/* ---------- Fonts (self-hosted, OFL — лицензии в assets/fonts) ---------- */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("assets/fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("assets/fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("assets/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("assets/fonts/unbounded-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */

:root {
  --bg: #05090f;
  --panel: #0a111b;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-deep: rgba(0, 0, 0, 0.28);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, 0.06);

  --text: #eef3f8;
  --text-2: #b9c4d0;
  --muted: #7f8d9e;

  --green: #2fd08c;
  --green-2: #1fae77;
  --green-soft: rgba(47, 208, 140, 0.12);
  --green-line: rgba(47, 208, 140, 0.4);
  --red: #f0506a;
  --red-soft: rgba(240, 80, 106, 0.12);
  --amber: #f2b451;
  --gold: #e6c27a;
  --blue: #7cc4ea;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.5);

  --font-body: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Arial, sans-serif;
  --font-display: "Unbounded", "Manrope", ui-sans-serif, system-ui, sans-serif;

  font-family: var(--font-body);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(47, 208, 140, 0.08), transparent 60%),
    radial-gradient(80% 50% at 100% 100%, rgba(124, 196, 234, 0.05), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select {
  font: inherit;
}

h2,
p {
  margin-top: 0;
}

.screen[hidden],
[hidden] {
  display: none !important;
}

.icon {
  flex-shrink: 0;
  width: 1em;
  height: 1em;
}

/* Без видимых полос прокрутки — на сайте и в Mini App; листать можно как обычно. */
* {
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* ---------- Shell ---------- */

.app-shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: 14px;
  isolation: isolate;
}

.app-shell::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0%, rgba(0, 0, 0, 0.9), transparent 70%);
}

.phone-frame {
  position: relative;
  width: min(100%, 430px);
  min-height: min(860px, calc(100vh - 28px));
  min-height: min(860px, calc(100dvh - 28px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, #0c1420 0%, #080d16 45%, #060a11 100%);
  box-shadow: var(--shadow);
}

.phone-frame::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.topbar,
.screen {
  position: relative;
  z-index: 1;
}

.screen {
  padding: 8px 16px 20px;
}

.screen-terminal {
  padding-top: 6px;
}

/* Плавная смена экранов: новый выезжает снизу, старый тает. */
.screen {
  animation: screen-in 460ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.screen.is-leaving {
  animation: screen-out 220ms ease forwards;
  pointer-events: none;
}

/* Блоки, которые появляются по ходу, — мягко проявляются. */
.topbar-balance,
.copy-analysis,
.form-error,
.credentials-card,
.field-error {
  animation: fade-up 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}


/* ---------- Topbar ---------- */

.topbar {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 20px 18px 12px;
  text-align: center;
}

.topbar h1 {
  margin: 0;
}

.brand {
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(17px, 5.2vw, 22px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-accent {
  color: var(--green);
}

.topbar-balance {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--highlight);
  font-size: 12px;
}

.topbar-balance span {
  color: var(--muted);
  font-weight: 600;
}

.topbar-balance strong {
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.demo-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  margin: 0;
  padding: 3px 9px;
  border: 1px solid var(--green-line);
  border-radius: 999px;
  color: #c9f5e1;
  background: var(--green-soft);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Typography blocks ---------- */

.section-head {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  margin: 16px 0 14px;
}

.step-badge {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  color: var(--text-2);
  background: var(--surface);
  font-size: 14px;
  font-weight: 800;
}

.section-head h2,
.unlock-card h2,
.signal-card h2,
.popup-card h2 {
  margin-bottom: 6px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.section-head p,
.unlock-card p,
.popup-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- DEMO warning ---------- */

.demo-warning {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(242, 180, 81, 0.32);
  border-radius: var(--radius);
  color: #f3dcb4;
  background: linear-gradient(180deg, rgba(242, 180, 81, 0.1), rgba(242, 180, 81, 0.04));
}

.demo-warning p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.demo-warning strong {
  color: #fff0d4;
}

.demo-warning-icon {
  display: grid;
  place-items: center;
  padding-top: 1px;
  color: var(--amber);
  font-size: 19px;
}

/* ---------- Deposit screen ---------- */

.screen-deposit .section-head {
  margin-top: 4px;
}

.deposit-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  box-shadow: var(--highlight);
}

.amount-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.amount-head label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.currency-picker {
  position: relative;
}

.currency-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 10px 4px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.currency-switch:hover:not(:disabled),
.currency-switch[aria-expanded="true"] {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.09);
}

.currency-switch:focus-visible,
.currency-option:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.currency-switch:disabled {
  opacity: 0.55;
  cursor: default;
}

.currency-chevron {
  color: var(--text-2);
  font-size: 13px;
  transition: transform 200ms ease;
}

.currency-switch[aria-expanded="true"] .currency-chevron {
  transform: rotate(180deg);
}

.currency-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  width: 176px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: rgba(14, 21, 32, 0.96);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.55),
    var(--highlight);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition:
    opacity 160ms ease,
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.currency-popover.is-open {
  opacity: 1;
  transform: none;
}

/* Мягкие затемнения сверху/снизу подсказывают, что список листается. */
.currency-popover::before,
.currency-popover::after {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 1;
  height: 22px;
  pointer-events: none;
  content: "";
  opacity: 0;
  transition: opacity 200ms ease;
}

.currency-popover::before {
  top: 0;
  background: linear-gradient(180deg, rgba(14, 21, 32, 0.95), transparent);
}

.currency-popover::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(14, 21, 32, 0.95), transparent);
}

.currency-popover.has-more-above::before,
.currency-popover.has-more-below::after {
  opacity: 1;
}

.currency-menu {
  display: grid;
  gap: 2px;
  max-height: 292px;
  margin: 0;
  padding: 6px 22px 6px 6px;
  overflow-y: auto;
  list-style: none;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.currency-menu::-webkit-scrollbar {
  display: none;
}

/* Своя шкала прокрутки: тонкая линия и «свеча», которая ездит вверх-вниз. */
.currency-scroll {
  position: absolute;
  top: 14px;
  right: 9px;
  bottom: 14px;
  width: 6px;
  pointer-events: none;
}

.currency-scroll::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  content: "";
  background: rgba(255, 255, 255, 0.08);
}

.currency-scroll-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 26px;
  border-radius: 2px;
  background: var(--green);
  box-shadow: 0 0 8px rgba(47, 208, 140, 0.35);
  transition:
    background 200ms ease,
    box-shadow 200ms ease;
}

/* «Фитиль» свечи сверху и снизу. */
.currency-scroll-thumb::before {
  position: absolute;
  top: -5px;
  bottom: -5px;
  left: 50%;
  width: 1px;
  content: "";
  background: inherit;
  transform: translateX(-50%);
}

.currency-scroll-thumb.is-down {
  background: var(--red);
  box-shadow: 0 0 8px rgba(240, 80, 106, 0.35);
}

.currency-option {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 120ms ease,
    color 120ms ease;
}

.currency-option:hover,
.currency-option:focus {
  outline: none;
  color: var(--text);
  background: var(--surface-2);
}

.currency-option[aria-selected="true"] {
  color: #d4f8e7;
  background: var(--green-soft);
}

.currency-option[aria-selected="true"]::after {
  width: 6px;
  height: 6px;
  content: "";
  border-radius: 50%;
  background: var(--green);
}

.currency-symbol {
  color: var(--muted);
}

.currency-option[aria-selected="true"] .currency-symbol {
  color: var(--green);
}

.amount-field {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface-deep);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.amount-field:focus-within {
  border-color: var(--green-line);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.amount-field.is-invalid {
  border-color: rgba(240, 80, 106, 0.6);
  box-shadow: 0 0 0 4px var(--red-soft);
}

.amount-input {
  width: 100%;
  min-width: 0;
  padding: 16px 12px 16px 16px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.amount-input::placeholder {
  color: rgba(127, 141, 158, 0.45);
}

.amount-currency {
  flex-shrink: 0;
  padding-right: 16px;
  color: var(--text-2);
  font-size: 18px;
  font-weight: 700;
}

.amount-field.is-loading {
  border-color: var(--line);
  background: linear-gradient(90deg, #0a111b 0%, #131e2d 50%, #0a111b 100%);
  background-size: 200% 100%;
  animation: skeleton 1.2s ease-in-out infinite;
}

.amount-field.is-loading .amount-input,
.amount-field.is-loading .amount-currency {
  visibility: hidden;
}

.amount-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.amount-chip,
.chip-skeleton {
  min-height: 38px;
  border-radius: var(--radius-sm);
}

.amount-chip {
  min-width: 0;
  padding: 6px 4px;
  border: 1px solid var(--line);
  color: var(--text-2);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.amount-chip:hover:not(:disabled) {
  border-color: var(--line-2);
  color: var(--text);
}

.amount-chip.is-active {
  border-color: var(--green-line);
  color: #d4f8e7;
  background: var(--green-soft);
}

.amount-chip:disabled {
  opacity: 0.5;
  cursor: default;
}

.chip-skeleton {
  display: block;
  background: linear-gradient(90deg, #0a111b 0%, #141f2e 50%, #0a111b 100%);
  background-size: 200% 100%;
  animation: skeleton 1.2s ease-in-out infinite;
}

.amount-range {
  min-height: 16px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.field-error {
  margin: 6px 0 0;
  color: #ff8fa0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.deposit-done {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(230, 194, 122, 0.3);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(230, 194, 122, 0.09), rgba(230, 194, 122, 0.03));
  animation: session-pop 420ms ease;
}

.deposit-done span {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.deposit-done strong {
  color: var(--gold);
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ---------- Buttons ---------- */

.connect-button,
.telegram-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  margin-top: 14px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 140ms ease,
    filter 160ms ease,
    opacity 160ms ease;
}

.connect-button {
  color: #03140c;
  background: linear-gradient(180deg, #3bdc9b 0%, var(--green-2) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 12px 28px -12px rgba(31, 174, 119, 0.7);
}

.telegram-button {
  color: #fff;
  background: linear-gradient(180deg, #3aa8f2 0%, #2182d6 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 12px 28px -12px rgba(33, 130, 214, 0.75);
}

.connect-button .icon,
.telegram-button .icon {
  font-size: 18px;
}

.connect-button:hover:not(:disabled),
.telegram-button:hover {
  filter: brightness(1.06);
}

.connect-button:active:not(:disabled),
.telegram-button:active {
  transform: translateY(1px);
}

.connect-button:disabled {
  color: var(--muted);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: default;
}

.connect-button.is-loading {
  color: #03140c;
  background: linear-gradient(180deg, #3bdc9b 0%, var(--green-2) 100%);
  opacity: 0.85;
}

.connect-button.is-loading::before {
  width: 18px;
  height: 18px;
  content: "";
  border: 2.5px solid rgba(3, 20, 12, 0.25);
  border-top-color: #03140c;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease;
}

.ghost-button:hover {
  border-color: rgba(255, 255, 255, 0.24);
}

.ghost-button .icon {
  font-size: 16px;
  color: var(--text-2);
}

/* Состояние «Скопировано». */
.ghost-button {
  transition:
    border-color 220ms ease,
    background 220ms ease,
    color 220ms ease,
    box-shadow 220ms ease;
}

.ghost-button .icon-check {
  display: none;
}

.ghost-button.is-copied {
  border-color: var(--green-line);
  color: #d4f8e7;
  background: var(--green-soft);
  box-shadow: 0 0 0 4px rgba(47, 208, 140, 0.08);
  animation: copied-pop 420ms cubic-bezier(0.34, 1.4, 0.64, 1);
}

.ghost-button.is-copied .icon-copy {
  display: none;
}

.ghost-button.is-copied .icon-check {
  display: block;
  color: var(--green);
}

.ghost-button.is-copied .icon-check path {
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1.01;
  animation: check-draw 420ms cubic-bezier(0.65, 0, 0.35, 1) 80ms forwards;
}

.credentials-list code {
  transition:
    border-color 300ms ease,
    box-shadow 300ms ease,
    background 300ms ease;
}

.credentials-list code.is-copied {
  border-color: var(--green-line);
  background: rgba(47, 208, 140, 0.12);
  box-shadow: 0 0 18px rgba(47, 208, 140, 0.35);
}

@keyframes copied-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes check-draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---------- Mode screen ---------- */

.mode-hero {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(90% 80% at 90% 0%, rgba(47, 208, 140, 0.1), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  box-shadow: var(--highlight);
}

.mode-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 0;
}

.mode-hero-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mode-hero-balance {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.mode-hero-pair {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-2);
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(47, 208, 140, 0.6);
  animation: live-pulse 1.8s ease-out infinite;
}

.mode-hero-chart {
  display: block;
  width: 100%;
  height: 96px;
  margin-top: 8px;
}

.mode-grid {
  display: grid;
  gap: 8px;
}

.mode-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 64px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-align: left;
  background: var(--surface);
  box-shadow: var(--highlight);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.mode-card strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.mode-icon,
.unlock-icon {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  color: var(--text-2);
  background:
    radial-gradient(80% 80% at 30% 20%, rgba(255, 255, 255, 0.08), transparent 70%),
    #0c131d;
  font-size: 20px;
}

.mode-icon.is-signals {
  border-color: var(--green-line);
  background:
    radial-gradient(80% 80% at 50% 40%, rgba(47, 208, 140, 0.18), transparent 70%),
    #0b1714;
  font-size: 24px;
}

.mode-icon .c-green {
  fill: var(--green);
  stroke: var(--green);
  stroke-width: 1.2;
}

.mode-icon .c-red {
  fill: var(--red);
  stroke: var(--red);
  stroke-width: 1.2;
}

.mode-lock {
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  color: var(--amber);
  background: #111a26;
  font-size: 11px;
}

.mode-card.is-unlocked .mode-icon {
  border-color: var(--green-line);
  color: var(--green);
}

.mode-card.is-unlocked .mode-lock {
  display: none;
}

.mode-card.is-active {
  border-color: var(--green-line);
  background: linear-gradient(90deg, rgba(47, 208, 140, 0.14), rgba(47, 208, 140, 0.03));
}

.mode-card.is-locked {
  color: var(--text-2);
  opacity: 0.72;
}

.mode-card.is-unlocked {
  border-color: var(--green-line);
  opacity: 1;
}

.mode-card:active {
  transform: scale(0.985);
}

.risk-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  line-height: 1.45;
}

/* ---------- Terminal ---------- */

.trade-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.trade-meta span {
  min-width: 0;
  padding: 8px 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface);
  box-shadow: var(--highlight);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.trade-meta strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.trade-meta [data-hero-balance] {
  color: var(--green);
}

.chart-stage {
  position: relative;
  min-height: 392px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #0a1522 0%, #060d16 60%, #04080e 100%);
  box-shadow: var(--highlight);
}

.chart-stage::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(5, 9, 15, 0.5), transparent 16%, transparent 82%, rgba(5, 9, 15, 0.6)),
    linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.25));
}

.live-chart {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.signal-card {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 14px;
  left: 0;
  width: min(316px, calc(100% - 28px));
  margin: 0 auto;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: rgba(7, 12, 20, 0.78);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: float-card 4s ease-in-out infinite;
}

.signal-kicker {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.signal-card h2 {
  margin-top: 6px;
  margin-bottom: 8px;
  font-size: 17px;
}

.signal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

[data-signal-direction] {
  display: inline-flex;
  min-width: 84px;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 10px;
  color: #03140c;
  background: var(--green);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

[data-signal-direction][data-direction="down"] {
  color: #fff;
  background: var(--red);
}

.countdown {
  position: relative;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.countdown-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.countdown-ring circle {
  fill: none;
  stroke-width: 3;
}

.countdown-track {
  stroke: rgba(255, 255, 255, 0.1);
}

/* Длина окружности r=21: 2π·21 ≈ 131.95 */
.countdown-progress {
  stroke: var(--green);
  stroke-linecap: round;
  stroke-dasharray: 131.95;
  stroke-dashoffset: 0;
  transition: stroke 240ms ease;
}

.countdown.is-running .countdown-progress {
  animation: countdown-drain var(--countdown-duration, 3s) linear forwards;
}

.countdown.is-paused .countdown-progress {
  animation-play-state: paused;
}

.countdown.is-urgent {
  color: var(--red);
}

.countdown.is-urgent .countdown-progress {
  stroke: var(--red);
}

[data-result] {
  min-height: 22px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

[data-result="win"] {
  color: var(--green);
}

[data-result="loss"] {
  color: var(--red);
}

[data-result="missed"] {
  color: var(--amber);
}

.is-flashing {
  animation: result-flash 520ms ease;
}

.float-amount {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 3;
  padding: 6px 16px;
  border-radius: 999px;
  color: #03140c;
  background: var(--green);
  box-shadow: 0 12px 28px -10px rgba(47, 208, 140, 0.7);
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 12px) scale(0.7);
  pointer-events: none;
}

.float-amount.is-down {
  color: #fff;
  background: var(--red);
  box-shadow: 0 12px 28px -10px rgba(240, 80, 106, 0.7);
}

.float-amount.is-flash {
  animation: float-amount 1300ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.trade-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.trade-button {
  min-width: 0;
  min-height: 76px;
  padding: 10px 8px;
  border: 0;
  border-radius: 16px;
  color: #03140c;
  cursor: pointer;
  transition:
    transform 140ms ease,
    filter 160ms ease,
    opacity 160ms ease;
}

.trade-button span,
.trade-button small {
  display: block;
}

.trade-button span {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.trade-button small {
  margin-top: 5px;
  color: rgba(3, 20, 12, 0.65);
  font-size: 11px;
  font-weight: 700;
}

.trade-button.up {
  background: linear-gradient(180deg, #3bdc9b 0%, var(--green-2) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 14px 30px -14px rgba(31, 174, 119, 0.8);
}

.trade-button.down {
  color: #fff;
  background: linear-gradient(180deg, #f66a80 0%, #d53b56 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 14px 30px -14px rgba(213, 59, 86, 0.8);
}

.trade-button.down small {
  color: rgba(255, 255, 255, 0.72);
}

.trade-button:active {
  transform: translateY(1px) scale(0.99);
}

.trade-button:disabled {
  opacity: 0.45;
  cursor: default;
  filter: saturate(0.7);
}

.trade-button.hint:not(:disabled) {
  animation: hint-pulse 1.1s ease-in-out infinite;
}

.trade-button.up.hint:not(:disabled) {
  outline: 2px solid rgba(47, 208, 140, 0.85);
  outline-offset: 3px;
}

.trade-button.down.hint:not(:disabled) {
  outline: 2px solid rgba(240, 80, 106, 0.85);
  outline-offset: 3px;
}

.progress-line {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.progress-line span {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

/* Заливка плавно «растекается» слева направо. */
.progress-line span::after {
  position: absolute;
  inset: 0;
  content: "";
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-2), var(--green));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1100ms cubic-bezier(0.45, 0, 0.2, 1);
}

.progress-line span.is-complete::after {
  transform: scaleX(1);
}

/* ---------- Copy trading ---------- */

.screen-copy {
  display: grid;
  gap: 12px;
}

/* Три шага сессий: пустые кружки заполняются по мере прохождения. */
.copy-checks {
  display: flex;
  align-items: center;
  width: min(240px, 80%);
  margin: 6px auto 2px;
}

.copy-check {
  position: relative;
  display: grid;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1.5px solid var(--line-2);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface);
  isolation: isolate;
  transition:
    border-color 400ms ease,
    color 300ms ease;
}

.copy-check > * {
  grid-area: 1 / 1;
}

/* Заливка — отдельный слой, растёт из центра; сам кружок с рамкой не масштабируется. */
.copy-check::before {
  position: absolute;
  inset: -1.5px;
  z-index: -1;
  content: "";
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #4be6a8, var(--green-2));
  transform: scale(0);
  will-change: transform;
  transition: transform 520ms cubic-bezier(0.34, 1.12, 0.64, 1);
}

/* Вспышка-кольцо при завершении шага. */
.copy-check::after {
  position: absolute;
  inset: -1.5px;
  z-index: -2;
  content: "";
  border: 2px solid var(--green);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.copy-step-num {
  font-size: 14px;
  font-weight: 800;
  transition:
    opacity 200ms ease,
    transform 260ms ease;
}

.copy-check svg {
  width: 18px;
  height: 18px;
  color: #03140c;
  overflow: visible;
}

/* Галочка прорисовывается линией после заливки; зазор в штрихе прячет «точку» от скруглённого конца. */
.copy-check svg path {
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1.01;
  transition: stroke-dashoffset 380ms cubic-bezier(0.65, 0, 0.35, 1) 260ms;
}

.copy-check.is-current {
  border-color: rgba(124, 196, 234, 0.6);
  color: var(--blue);
}

.copy-check.is-current::after {
  border-color: rgba(124, 196, 234, 0.55);
  animation: step-ring 1.8s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
}

.copy-check.is-done {
  border-color: transparent;
}

.copy-check.is-done::before {
  transform: scale(1);
}

.copy-check.is-done::after {
  animation: step-burst 900ms cubic-bezier(0.2, 0.6, 0.3, 1) 180ms both;
}

.copy-check.is-done .copy-step-num {
  opacity: 0;
  transform: scale(0.6);
}

.copy-check.is-done svg path {
  stroke-dashoffset: 0;
}

.copy-link {
  position: relative;
  flex: 1;
  height: 2px;
  margin: 0 6px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line-2);
}

.copy-link::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, var(--green-2), var(--green));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 700ms cubic-bezier(0.45, 0, 0.2, 1);
}

.copy-link.is-done::after {
  transform: scaleX(1);
}

.unlock-card {
  position: relative;
  padding: 16px;
  border: 1px solid var(--green-line);
  border-radius: 18px;
  background:
    radial-gradient(90% 90% at 0% 0%, rgba(47, 208, 140, 0.12), transparent 60%),
    rgba(8, 14, 22, 0.9);
  box-shadow: var(--highlight);
}

.unlock-card .unlock-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  border-color: var(--green-line);
  color: var(--green);
  background:
    radial-gradient(80% 80% at 50% 40%, rgba(47, 208, 140, 0.2), transparent 70%),
    #0b1714;
}

.unlock-card h2 {
  margin-top: 14px;
  transition: margin 400ms ease;
}

/* После подключения описание и кнопка плавно сворачиваются. */
.unlock-body {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition:
    grid-template-rows 450ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 250ms ease;
}

.unlock-body > div {
  min-height: 0;
  overflow: hidden;
}

.unlock-card.is-connected .unlock-body {
  grid-template-rows: 0fr;
  opacity: 0;
}

.unlock-card.is-connected h2 {
  margin-bottom: 0;
  font-size: 17px;
}

.unlock-live {
  margin-top: 14px;
  animation: session-pop 420ms ease;
}

.unlock-live-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--green-line);
  border-radius: var(--radius);
  background: var(--green-soft);
}

.unlock-live span {
  color: #bfeed8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.unlock-live strong {
  color: var(--green);
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.bot-sessions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.bot-session {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  text-align: center;
  transition:
    border-color 200ms ease,
    background 200ms ease;
}

.bot-session span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bot-session strong {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.bot-session.is-analyzing {
  border-color: rgba(124, 196, 234, 0.4);
  background: rgba(124, 196, 234, 0.07);
}

.bot-session.is-analyzing strong {
  color: var(--blue);
  animation: analysis-pulse 1.2s ease-in-out infinite;
}

.bot-session.is-active {
  border-color: var(--green-line);
  background: var(--green-soft);
  animation: session-pop 420ms ease;
}

.bot-session.is-active strong {
  color: var(--green);
}

[data-session-result].is-win {
  color: var(--green);
  animation: amount-pop 620ms ease;
}

.copy-analysis {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  box-shadow: var(--highlight);
}

.analysis-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.analysis-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: analysis-pulse 1.2s ease-in-out infinite;
}

.analysis-head strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

/* Лог фиксированной высоты: новые строки снизу, старые уходят вверх и тают. */
.analysis-log {
  display: grid;
  align-content: start;
  gap: 7px;
  height: 128px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 30px);
  mask-image: linear-gradient(180deg, transparent 0, #000 30px);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.analysis-log::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.analysis-line {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 280ms ease,
    transform 280ms ease;
}

.analysis-line.is-in {
  opacity: 1;
  transform: none;
}

.analysis-line::before {
  position: absolute;
  left: 4px;
  content: "›";
  color: var(--blue);
}

.analysis-line.is-win {
  color: var(--green);
  font-weight: 700;
}

.analysis-line.is-win::before {
  content: "✓";
  color: var(--green);
}

.analysis-line.is-head {
  color: var(--text-2);
  font-weight: 700;
}

.analysis-line.is-head::before {
  content: "▸";
  color: var(--text-2);
}

.analysis-line.is-entry {
  color: var(--amber);
  font-weight: 700;
}

.analysis-line.is-entry::before {
  content: "→";
  color: var(--amber);
}

/* ---------- Popup ---------- */

.popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 5, 9, 0.72);
  opacity: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 240ms ease;
}

.popup-backdrop.is-open {
  opacity: 1;
}

.popup-card {
  position: relative;
  width: min(100%, 380px);
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px;
  border: 1px solid var(--line-2);
  border-radius: 22px;
  background: linear-gradient(180deg, #0f1824 0%, #080d15 100%);
  box-shadow:
    var(--shadow),
    var(--highlight);
  transform: translateY(16px) scale(0.97);
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.popup-backdrop.is-open .popup-card {
  transform: translateY(0) scale(1);
}

.popup-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.popup-head-info {
  display: grid;
  gap: 8px;
}

.popup-card .popup-head img {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border: 2px solid rgba(230, 194, 122, 0.55);
  border-radius: 50%;
  object-fit: cover;
}

.popup-name {
  font-size: 16px;
  font-weight: 800;
}

.popup-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.popup-stats div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--highlight);
  text-align: center;
}

.popup-stats span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.popup-stats strong {
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.popup-stats .is-profit {
  color: var(--green);
}

.popup-stats .is-total {
  color: var(--gold);
}

/* Финальное предупреждение — мягкое «дыхание» свечения, чтобы его заметили. */
.popup-card .demo-warning {
  border-color: rgba(242, 180, 81, 0.5);
  box-shadow:
    0 0 0 1px rgba(242, 180, 81, 0.12),
    0 0 22px -6px rgba(242, 180, 81, 0.45);
  animation: warning-glow 3.2s ease-in-out infinite;
}

.popup-card .demo-warning p {
  color: #f3dcb4;
}

.popup-card h2 {
  margin-top: 4px;
  font-size: 17px;
}

.popup-card small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
  text-align: center;
}

/* ---------- Registration ---------- */

.register-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

/* Версия под канал: заголовок и одна кнопка в Telegram-канал. */
.channel-block {
  display: grid;
  gap: 12px;
}

.channel-block .telegram-button {
  margin-top: 4px;
}

.register-form .field-error {
  margin-top: -2px;
}

.text-input {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  outline: 0;
  color: var(--text);
  background: var(--surface-deep);
  font-size: 16px;
  font-weight: 500;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.text-input::placeholder {
  color: var(--muted);
}

/* Автозаполнение браузера не должно красить поле в системный цвет. */
.text-input:-webkit-autofill,
.text-input:-webkit-autofill:hover,
.text-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 100px #0b121c inset;
  transition: background-color 99999s;
}

.text-input:focus {
  border-color: var(--green-line);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.text-input.is-invalid {
  border-color: rgba(240, 80, 106, 0.6);
}

.agree-check {
  display: grid;
  grid-template-columns: 1fr 50px;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-2);
  background: var(--surface);
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
  transition:
    border-color 200ms ease,
    background 200ms ease;
}

.agree-check:has(input:checked) {
  border-color: var(--green-line);
  background: rgba(47, 208, 140, 0.06);
}

.agree-check.is-invalid {
  border-color: rgba(240, 80, 106, 0.55);
}

.agree-check span {
  grid-row: 1;
  grid-column: 1;
}

.agree-check a {
  color: var(--blue);
  text-underline-offset: 2px;
}

/* Тумблер вместо чекбокса: нативный input, поэтому клавиатура и скринридеры работают как обычно. */
.agree-check input {
  position: relative;
  grid-row: 1;
  grid-column: 2;
  width: 50px;
  height: 30px;
  margin: 0;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition:
    background 220ms ease,
    border-color 220ms ease;
}

.agree-check input::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  content: "";
  border-radius: 50%;
  background: #f4f8fc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 240ms cubic-bezier(0.3, 0.7, 0.4, 1.2);
}

.agree-check input:checked {
  border-color: transparent;
  background: linear-gradient(180deg, #3bdc9b, var(--green-2));
}

.agree-check input:checked::before {
  transform: translateX(20px);
}

.agree-check input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.agree-check.is-invalid input {
  border-color: var(--red);
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.register-form .connect-button {
  margin-top: 4px;
}

.form-error {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(240, 80, 106, 0.4);
  border-radius: var(--radius);
  background: var(--red-soft);
}

.form-error p {
  margin: 0;
  color: #ffc2cc;
  font-size: 14px;
  font-weight: 700;
}

.credentials-card {
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding: 16px;
  border: 1px solid var(--green-line);
  border-radius: 18px;
  background:
    radial-gradient(90% 90% at 0% 0%, rgba(47, 208, 140, 0.1), transparent 60%),
    var(--surface);
}

.credentials-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  margin: 0;
  font-size: 14px;
}

.credentials-list dt {
  color: var(--muted);
}

.credentials-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.credentials-list code {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  background: var(--surface-deep);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  letter-spacing: 0.06em;
  user-select: all;
}

.credentials-note {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

/* Регистрация по ссылке: «Последний шаг». */
.demo-pill.is-amber {
  border-color: rgba(242, 180, 81, 0.45);
  color: #f6d9a2;
  background: rgba(242, 180, 81, 0.1);
}

.reg-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}




.popup-card .returning-text {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

.popup-card .returning-warning {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  margin: 0;
  color: #f6d9a2;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.returning-warning .icon {
  margin-top: 2px;
  color: var(--amber);
  font-size: 17px;
}

.returning-card .telegram-button {
  margin-top: 4px;
}

.credentials-card .connect-button {
  margin-top: 2px;
}

.telegram-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.telegram-link .icon {
  font-size: 16px;
}

.telegram-link:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}







/* ---------- Telegram Mini App ---------- */

.tma-main-button [data-tma-hide] {
  display: none !important;
}

.is-tma .app-shell {
  padding: 0;
}

/* Без «телефонной» рамки: фон от края до края, в цвет панелей Telegram. */
.is-tma .phone-frame {
  width: 100%;
  min-height: 100vh;
  min-height: var(--tg-viewport-stable-height, 100dvh);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.is-tma .phone-frame::after {
  display: none;
}

/* В полноэкранном режиме сверху — статус-бар телефона и кнопки Telegram (safe area). */
.is-tma .topbar {
  padding-top: calc(
    var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px) + 12px
  );
}

.is-tma .screen {
  padding-bottom: calc(
    var(--tg-safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, 0px) + 28px
  );
}

/* Попап тоже не должен заезжать под кнопки Telegram и home-индикатор. */
.is-tma .popup-backdrop {
  padding-top: calc(
    var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px) + 10px
  );
  padding-bottom: calc(
    var(--tg-safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, 0px) + 14px
  );
}

.is-tma .popup-card {
  max-height: calc(
    100dvh - var(--tg-safe-area-inset-top, 0px) - var(--tg-content-safe-area-inset-top, 0px) -
      var(--tg-safe-area-inset-bottom, 0px) - var(--tg-content-safe-area-inset-bottom, 0px) - 24px
  );
}


/* ---------- Клавиатура: планка «Готово» и окно на время ввода ---------- */

/* Планка стоит над клавиатурой: низ видимой части экрана даёт script.js (--vv-top, --vv-height). */
.kb-bar {
  position: fixed;
  top: calc(var(--vv-top, 0px) + var(--vv-height, 100vh) - 52px);
  right: 0;
  left: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 52px;
  padding: 0 12px;
  border-top: 1px solid var(--line-2);
  background: var(--panel);
  /* Спрятана: уехала вниз на свою высоту. Появляется и уходит плавно, как окно (.popup-card). */
  visibility: hidden;
  opacity: 0;
  transform: translateY(100%);
  transition:
    transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 280ms ease,
    visibility 0s linear 280ms;
}

.kb-bar[hidden] {
  display: none;
}

.is-typing .kb-bar {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition-delay: 0s;
}

.kb-done {
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  color: var(--green);
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* Страница: низ закрыт клавиатурой и планкой — добавляем столько же прокрутки. */
.is-typing body {
  padding-bottom: calc(var(--kb-cover, 0px) + 52px);
}

/* Окно регистрации: занимает только видимую часть, место под планку — снизу. */
.is-typing .popup-backdrop {
  top: var(--vv-top, 0px);
  bottom: auto;
  height: var(--vv-height, 100dvh);
  padding-bottom: 60px;
  align-items: start;
}

.is-typing .popup-card {
  max-height: calc(var(--vv-height, 100dvh) - 18px - 60px);
}

.is-typing.is-tma .popup-card {
  max-height: calc(
    var(--vv-height, 100dvh) - var(--tg-safe-area-inset-top, 0px) -
      var(--tg-content-safe-area-inset-top, 0px) - 10px - 60px
  );
}

/* ---------- Motion ---------- */

.shake {
  animation: shake 420ms ease;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes screen-out {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes step-ring {
  0% {
    opacity: 0.8;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.55);
  }
}

@keyframes step-burst {
  0% {
    opacity: 0.9;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}

@keyframes warning-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(242, 180, 81, 0.12),
      0 0 18px -8px rgba(242, 180, 81, 0.35);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(242, 180, 81, 0.22),
      0 0 30px -4px rgba(242, 180, 81, 0.55);
  }
}

@keyframes countdown-drain {
  to {
    stroke-dashoffset: 131.95;
  }
}

@keyframes live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 208, 140, 0.55);
  }
  70%,
  100% {
    box-shadow: 0 0 0 7px rgba(47, 208, 140, 0);
  }
}

@keyframes float-card {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes float-amount {
  0% {
    opacity: 0;
    transform: translate(-50%, 14px) scale(0.7);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.08);
  }
  34% {
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -54px) scale(1);
  }
}

@keyframes result-flash {
  0% {
    transform: translateY(6px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes session-pop {
  0% {
    transform: scale(0.97);
  }
  70% {
    transform: scale(1.015);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes amount-pop {
  0% {
    transform: scale(0.7);
    opacity: 0.4;
  }
  60% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes analysis-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.8);
  }
}

@keyframes hint-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(5px);
  }
  75% {
    transform: translateX(-3px);
  }
}

@keyframes skeleton {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Responsive ---------- */

/* Phones: edge-to-edge app, no card chrome, respect notch/home-indicator. */
@media (max-width: 480px) {
  .app-shell {
    padding: 0;
  }

  .phone-frame {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .topbar {
    padding-top: max(20px, env(safe-area-inset-top));
  }

  .progress-line,
  .bot-sessions,
  .risk-note {
    margin-bottom: env(safe-area-inset-bottom);
  }
}

/* Compact phones: tighten typography and chart height. */
@media (max-width: 360px) {
  .screen {
    padding-right: 12px;
    padding-left: 12px;
  }

  .trade-meta {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-head h2,
  .unlock-card h2,
  .signal-card h2 {
    font-size: 17px;
  }

  .chart-stage {
    min-height: 342px;
  }

  .trade-button span {
    font-size: 18px;
  }

  .amount-input {
    font-size: 20px;
  }

  .amount-chip {
    font-size: 12px;
  }
}

/* Short phones (iPhone SE и т.п.): терминал целиком в экран. */
@media (max-height: 700px) {
  .chart-stage {
    min-height: 330px;
  }

  .trade-button {
    min-height: 66px;
  }
}

/* Tablet & desktop: single centered app frame with breathing room. */
@media (min-width: 768px) {
  .app-shell {
    padding: 32px;
  }

  .phone-frame {
    min-height: min(860px, calc(100dvh - 64px));
  }
}

/* Финал по кнопке из напоминания бота (?go=reg): статистики DEMO в этом заходе нет — прячем её. */
.popup-backdrop.is-direct .popup-stats,
.popup-backdrop.is-direct .demo-warning {
  display: none;
}

/* ---------- Окно с данными после регистрации: поднимается снизу ----------
   Фон, рамка, радиус 22px, отступ 20px и затемнение — от .popup-backdrop/.popup-card;
   список, копирование и кнопка — общие .credentials-list, .ghost-button, .telegram-button. */

.demo-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(2, 5, 9, 0.72);
  opacity: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 320ms ease;
}

.demo-sheet-backdrop.is-open {
  opacity: 1;
}

.demo-sheet {
  display: grid;
  gap: 12px;
  width: min(100%, 440px);
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--line-2);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, #0f1824 0%, #080d15 100%);
  box-shadow:
    0 -24px 80px rgba(0, 0, 0, 0.55),
    var(--highlight);
  transform: translateY(100%);
  transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.demo-sheet-backdrop.is-open .demo-sheet {
  transform: translateY(0);
}

/* Содержимое догоняет окно — короткая лесенка вместо одновременного появления. */
.demo-sheet > * {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 360ms ease,
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.demo-sheet-backdrop.is-open .demo-sheet > * {
  opacity: 1;
  transform: translateY(0);
}

.demo-sheet-backdrop.is-open .demo-sheet > :nth-child(3) { transition-delay: 100ms; }
.demo-sheet-backdrop.is-open .demo-sheet > :nth-child(4) { transition-delay: 140ms; }
.demo-sheet-backdrop.is-open .demo-sheet > :nth-child(5) { transition-delay: 200ms; }
.demo-sheet-backdrop.is-open .demo-sheet > :nth-child(6) { transition-delay: 250ms; }
.demo-sheet-backdrop.is-open .demo-sheet > :nth-child(7) { transition-delay: 300ms; }
.demo-sheet-backdrop.is-open .demo-sheet > :nth-child(8) { transition-delay: 350ms; }
.demo-sheet-backdrop.is-open .demo-sheet > :nth-child(9) { transition-delay: 390ms; }

.demo-sheet-grip {
  justify-self: center;
  width: 42px;
  height: 4px;
  border-radius: 4px;
  background: var(--line-2);
}

.demo-sheet-mark {
  display: grid;
  justify-self: center;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid var(--green-line);
  border-radius: 50%;
  color: var(--green);
  background: var(--green-soft);
  font-size: 26px;
  box-shadow: 0 0 28px rgba(47, 208, 140, 0.25);
}

.demo-sheet .reg-title,
.demo-sheet > .credentials-note {
  text-align: center;
}

.demo-sheet .credentials-list {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.demo-sheet-next {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 14px;
  text-align: center;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
}

.demo-sheet-next strong {
  font-size: 15px;
}

.demo-sheet-next p {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.45;
}

/* Значения .popup-card .returning-warning — окно живёт вне .popup-card. */
/* По центру, как весь блок: значок идёт в строке с текстом и центрируется вместе с ним. */
.demo-sheet-next .returning-warning {
  display: block;
  color: #f6d9a2;
  font-weight: 700;
}

.demo-sheet-next .returning-warning .icon {
  display: inline-block;
  margin: 0 6px 0 0;
  vertical-align: -3px;
}

.demo-sheet .connect-button {
  margin-top: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* Кольцо таймера несёт смысл (сколько осталось времени), поэтому его не отключаем. */
  .countdown.is-running .countdown-progress {
    animation-duration: var(--countdown-duration, 3s) !important;
  }
}

/* ---------- Письмо справа налево (арабский) ---------- */
/* Направление задаёт script.js (applyLocale): <html dir="rtl">. Ряды и сетки зеркалятся сами;
   здесь — только то, что само не зеркалится. Русская версия (?lang=ru) эти правила не видит. */

/* Разрядка рвёт арабские буквы: они пишутся слитно. Логотип — латиницей, ему разрядку оставляем. */
[dir="rtl"] *:not(.brand):not(.brand *) {
  letter-spacing: 0 !important;
}

/* Острова «слева направо»: ввод суммы со знаком валюты, выбор валюты, почта и пароль. */
[dir="rtl"] .amount-field,
[dir="rtl"] .currency-switch,
[dir="rtl"] .currency-menu,
[dir="rtl"] .credentials-list dd {
  direction: ltr;
}

/* Почта и пароль пишутся слева направо, но прижаты к своим подписям, а не к дальнему краю. */
[dir="rtl"] .credentials-list dd {
  text-align: right;
}

/* Почта печатается слева направо, но стоит у правого края, как остальная форма. */
[dir="rtl"] .text-input[type="email"] {
  direction: ltr;
  text-align: right;
}

/* Привязки к краю — на другую сторону. */
[dir="rtl"] .currency-popover {
  right: auto;
  left: 0;
}

[dir="rtl"] .mode-card {
  padding: 10px 10px 10px 14px;
  text-align: right;
}

[dir="rtl"] .mode-lock {
  right: auto;
  left: -5px;
}

[dir="rtl"] .unlock-card .unlock-icon {
  right: auto;
  left: 16px;
}

[dir="rtl"] .analysis-line {
  padding-right: 18px;
  padding-left: 0;
}

[dir="rtl"] .analysis-line::before {
  right: 4px;
  left: auto;
  /* Стрелка-маркер смотрит по ходу чтения. */
  transform: scaleX(-1);
}

/* Полосы прогресса растут от начала строки — при письме справа налево это правый край. */
[dir="rtl"] .progress-line span::after,
[dir="rtl"] .copy-link::after {
  transform-origin: right center;
}

[dir="rtl"] .demo-sheet-next .returning-warning .icon {
  margin: 0 0 0 6px;
}

/* Ловушка для ботов уведена за экран: при письме справа налево — за правый край, иначе слева
   появляется прокрутка. */
[dir="rtl"] .hp-field {
  right: -9999px;
  left: auto;
}
