/* Рамка смартфона на компьютере (не в Telegram): лендинг и кабинет показываются внутри «телефона»,
   как в макете из папки «визуал». На телефоне и в Mini App рамки нет — элементы рамки не создают блоков. */

.device,
.device-screen {
  display: contents;
}

.device-status,
.home-indicator {
  display: none;
}

html.is-framed,
html.is-framed body {
  height: 100%;
  overflow: hidden;
}

html.is-framed body {
  background:
    radial-gradient(ellipse at 50% 45%, rgba(15, 41, 55, .55), transparent 64%),
    radial-gradient(rgba(255, 255, 255, .03) .6px, transparent .6px) 0 0 / 18px 18px,
    #050c15;
}

html.is-framed .layout-wide {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: transparent;
}

html.is-framed .device {
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
  width: 404px;
  height: min(860px, calc(100dvh - 48px));
  min-height: 560px;
  border-radius: 40px;
  border: 7px solid #15212d;
  background: var(--bg);
  box-shadow: 0 0 0 1px #304253, 0 28px 90px rgba(0, 0, 0, .55);
  overflow: hidden;
}

html.is-framed .device-status {
  display: flex;
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
  height: 36px;
  padding: 0 24px;
  font-size: 10px;
  position: relative;
  z-index: 5;
  background: var(--bg);
  color: var(--text);
}

html.is-framed .device-status > span {
  font-size: 9px;
  letter-spacing: 1px;
}

html.is-framed .dynamic-island {
  position: absolute;
  left: 50%;
  top: 0;
  width: 82px;
  height: 21px;
  transform: translateX(-50%);
  border-radius: 0 0 15px 15px;
  background: #03080d;
}

/* Экран телефона. transform делает его опорным блоком для position: fixed —
   нижняя навигация и окна остаются внутри рамки; прокручивается #app внутри. */
html.is-framed .device-screen {
  display: block;
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

html.is-framed .device-screen > .layout-cabinet {
  height: 100%;
  min-height: 0;
  max-width: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

html.is-framed .device-screen > .layout-cabinet::-webkit-scrollbar {
  display: none;
}

html.is-framed .app-page {
  min-height: 100%;
}

html.is-framed .layout-cabinet .navbar {
  max-width: none;
}

html.is-framed .home-indicator {
  display: block;
  position: absolute;
  bottom: 6px;
  left: calc(50% - 52px);
  width: 104px;
  height: 4px;
  border-radius: 10px;
  background: rgba(240, 245, 251, .53);
  z-index: 30;
  pointer-events: none;
}

html.is-framed .modal {
  padding: 16px;
}

/* Keep the application viewport fixed while allowing normal scrolling. */
html, body {
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Prevent iOS focus zoom on form controls, including dialogs and admin forms. */
input, select, textarea, [contenteditable="true"] {
  font-size: 16px !important;
}

/* Preserve the larger amount controls. */
.amount-field input {
  font-size: 24px !important;
}
