* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #141415;
  --surface: #19191b;
  --surface-2: #232325;
  --surface-soft: #1f1f22;
  --text: #ededed;
  --text-secondary: #a1a1a6;
  --text-muted: #85858b;
  --border: rgba(237, 237, 237, .08);
  --border-strong: rgba(237, 237, 237, .14);
  --red: #c02a2b;
  --red-bright: #f74d4d;
  --red-dark: #941a19;
  --green-bg: #10251a;
  --green-text: #4cc38a;
  --red-bg: #2a1214;
  --red-text: #ff8a80;
  --yellow-bg: #2a2412;
  --yellow-text: #fbbf24;
  --radius: 16px;
  --radius-sm: 10px;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

html, body { height: 100%; }

body {
  font-family: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: var(--app-height, 100vh);
  padding: 0 calc(20px + env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) calc(20px + env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

.screen { display: none; }
.screen.active {
  display: block;
  /* Новый экран появляется мягко: show() меняет всю разметку разом, без этого
     нажатие выглядело как резкая подмена. */
  animation: screen-in .2s var(--ease) both;
}
@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .screen.active { animation: none; }
}

/* Нижние вкладки: главные разделы всегда под большим пальцем. */
body.has-nav #app {
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
}

.app-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  background: rgba(20, 20, 21, .94);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(14px);
  z-index: 30;
}

.app-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  background: none;
  border: 0;
  border-radius: 10px;
  color: var(--text-muted);
  font: inherit;
  font-size: 10.5px;
  letter-spacing: .01em;
  cursor: pointer;
  transition: color .15s var(--ease), background .15s var(--ease);
}

.app-nav-item svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-nav-icon { display: inline-flex; }

/* Замок рядом с подписью «Сигналы», пока UID не подтверждён. */
.app-nav-item .nav-lock {
  width: 11px;
  height: 11px;
  margin-left: 4px;
  vertical-align: -1px;
  stroke: var(--text-secondary);
  stroke-width: 2.4;
}

.app-nav-item.is-active { color: var(--text); }
.app-nav-item:hover { color: var(--text-secondary); }
.app-nav-item.is-active:hover { color: var(--text); }
.app-nav-item:active { background: var(--surface); }
.app-nav-item:focus-visible {
  outline: 2px solid var(--border-strong);
  outline-offset: 1px;
}
/* Пока восстанавливаем доступ, вместо пустого #app — логотип и спиннер. */
.boot {
  min-height: var(--app-height, 100vh);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px;
}
.boot .logo { width: 64px; height: 64px; border-radius: 18px; }

/* Header */
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 0 20px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lang-toggle {
  flex: none;
  min-height: 32px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: .02em;
  cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.lang-toggle:hover { border-color: var(--border-strong); color: var(--text); }
.lang-caret { font-size: 10px; opacity: .7; }

/* Видимый размер мелких контролов остаётся 32 px, зона нажатия — 44 px. */
.lang-toggle, .back-link, .promo-copy, .pair-modal-close { position: relative; }
.lang-toggle::after, .back-link::after, .promo-copy::after, .pair-modal-close::after {
  content: "";
  position: absolute;
  inset: -6px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Language picker */
.lang-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(4px);
}
.lang-sheet {
  width: 100%;
  max-width: 440px;
  margin-bottom: 8px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
}
.lang-sheet-title { font-size: 18px; font-weight: 600; margin-bottom: 14px; }
.lang-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--surface-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
.lang-option:hover { border-color: var(--red); }
.lang-option.active {
  border-color: var(--red);
  background: rgba(192, 42, 43, .14);
  color: var(--red-bright);
}
.lang-check { font-weight: 700; }

.logo {
  width: 36px; height: 36px; flex: none;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
}
.logo-img { display: block; width: 100%; height: 100%; }
.app-title {
  font-size: 17px; font-weight: 500; letter-spacing: 0;
  color: var(--text);
}
.app-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 0; }

/* Typography */
.hero-title { font-size: 32px; line-height: 1.12; font-weight: 500; letter-spacing: -.02em; margin-bottom: 10px; }
.hero-text { font-size: 15px; color: var(--text-secondary); }
.screen-title { font-size: 22px; font-weight: 500; letter-spacing: -.01em; margin: 4px 0 18px; }

/* Home */
.home-hero { padding: 0 0 20px; }

/* Главный экран: на широких окнах главное и карточка сигнала стоят рядом,
   на телефоне — одной колонкой. */
.home-layout { display: block; }
.home-main, .home-side { min-width: 0; }
.home-main { display: flex; flex-direction: column; }

@media (min-width: 820px) {
  #app.wide { max-width: 900px; }
  .home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    margin-bottom: 24px;
  }
  .home-side .signal-ticket { margin-bottom: 0; }
}
.home-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
}
.home-status .status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-text); flex: none; }
.home-cta-note { text-align: left; margin: 0 2px 24px; }

/* Sample signal ticket */
.signal-ticket {
  background: linear-gradient(165deg, rgba(35, 35, 38, .92), rgba(22, 22, 24, .96));
  border: 1px solid rgba(237, 237, 237, .09);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  margin-bottom: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 24px 48px rgba(0, 0, 0, .34);
}
.ticket-head, .ticket-foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.ticket-head { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.ticket-foot { padding-top: 12px; border-top: 1px solid var(--border); }
.ticket-pair { font-family: var(--mono); font-size: 13px; color: var(--text); letter-spacing: .01em; }
.ticket-quote {
  font-family: var(--mono); font-size: 13px; color: var(--text);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ticket-change { font-size: 10.5px; color: var(--green-text); margin-inline-start: 4px; }
.ticket-direction {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--green-text); letter-spacing: .08em;
}
/* График как в терминале: сетка, свечи, объёмы, метка последней цены.
   Высота по пропорции viewBox — иначе на широких экранах рисунок центрируется
   с пустыми полями. */
.ticket-chart {
  display: block; width: 100%; height: auto; max-height: 280px;
  margin: 12px 0 2px; direction: ltr; overflow: visible;
}
.ticket-chart .grid { stroke: rgba(237, 237, 237, .06); stroke-width: 1; }
.ticket-chart .axis-line { stroke: rgba(237, 237, 237, .1); stroke-width: 1; }
.ticket-chart .axis { fill: var(--text-muted); font-family: var(--mono); font-size: 8px; }
.ticket-chart .wick { stroke-width: 1; }
.ticket-chart .wick.up { stroke: var(--green-text); }
.ticket-chart .wick.down { stroke: var(--red-bright); }
.ticket-chart .body.up { fill: var(--green-text); }
.ticket-chart .body.down { fill: var(--red-bright); }
.ticket-chart .vol { opacity: .26; }
.ticket-chart .vol.up { fill: var(--green-text); }
.ticket-chart .vol.down { fill: var(--red-bright); }
.ticket-chart .price-line { stroke: rgba(76, 195, 138, .55); stroke-width: 1; stroke-dasharray: 3 3; }
.ticket-chart .price-tag { fill: rgba(76, 195, 138, .18); }
.ticket-chart .price-text {
  fill: #7ddcae; font-family: var(--mono); font-size: 8.5px; direction: ltr;
}
.ticket-chart .now-line { stroke: rgba(237, 237, 237, .2); stroke-width: 1; stroke-dasharray: 2 3; }
.ticket-chart .time-tag { fill: rgba(237, 237, 237, .1); }
.ticket-chart .axis.is-now { fill: var(--text-secondary); }

/* Steps */
.steps {
  display: flex; flex-direction: column;
  background: linear-gradient(165deg, rgba(35, 35, 38, .9), rgba(24, 24, 26, .94));
  border: 1px solid rgba(237, 237, 237, .08);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 18px 40px rgba(0, 0, 0, .26);
}
.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border-top: 1px solid var(--border);
}
.step:first-child { border-top: none; }
.step-num {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  display: grid; place-items: center;
  flex: none;
}
.step-body { min-width: 0; }
.step-title { font-size: 16px; font-weight: 500; margin-bottom: 3px; }
.step-text { font-size: 15px; color: var(--text-muted); line-height: 1.45; }

/* Шаги свёрнуты в аккордеон: страница короче, а при желании всё раскрывается. */
.steps-accordion {
  background: linear-gradient(165deg, rgba(35, 35, 38, .9), rgba(24, 24, 26, .94));
  border: 1px solid rgba(237, 237, 237, .08);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 18px 40px rgba(0, 0, 0, .26);
}
.steps-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.steps-accordion summary::-webkit-details-marker { display: none; }
.steps-accordion summary:hover { color: var(--text); }
.steps-chev {
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  transition: transform .2s var(--ease);
}
.steps-accordion[open] .steps-chev { transform: rotate(90deg); }
/* Пока содержимое доезжает до нуля, шеврон уже смотрит обратно. */
html[dir="rtl"] .steps-chev { transform: scaleX(-1); }
html[dir="rtl"] .steps-accordion[open] .steps-chev { transform: scaleX(-1) rotate(90deg); }

.steps-accordion .steps {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* Back link — маленькая ghost-кнопка, место и габариты прежние */
.back-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 0 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.back-link:hover { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.verify-text { margin-bottom: 20px; }
.section-label {
  font-size: 15px; font-weight: 500; color: var(--text-secondary);
  letter-spacing: 0;
  margin: 0 2px 10px;
}

/* Warning */
.warning-card {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(192, 42, 43, .07); color: #e9b4b1;
  border: 1px solid rgba(192, 42, 43, .2);
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-size: 13px; line-height: 1.45; margin-bottom: 20px;
}
.warning-icon {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid rgba(192, 42, 43, .55); color: #e9b4b1;
  font-size: 11px; font-weight: 500;
  display: grid; place-items: center; flex: none; margin-top: 1px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}

/* Согласие на сигналы: текст длинный, поэтому абзацы идут с воздухом. */
.consent-card p { margin: 0 0 10px; }
.consent-card p:last-child { margin-bottom: 0; }
.consent-text { color: var(--text-secondary); font-size: 13.5px; line-height: 1.55; }
.consent-version { margin: 14px 0 0 !important; }
.consent-accepted { margin-top: 4px; }

/* Form */
.field-group { margin-bottom: 16px; }
.field-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 8px; padding-left: 4px; }

.text-input {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.text-input::placeholder { color: #6f6f79; }
.text-input:focus {
  background: var(--surface-2);
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(192, 42, 43, .22);
}
.text-input.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(192, 42, 43, .22);
}
.uid-hint { margin: 8px 4px 0; }

.checkbox-row {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13px; color: var(--text-muted);
  margin: 4px 4px 20px; cursor: pointer;
}
.checkbox-row input {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 1px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.checkbox-row input::after {
  content: "";
  width: 10px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px) scale(0);
  transition: transform .12s var(--ease);
}
.checkbox-row input:checked {
  background: var(--red);
  border-color: var(--red);
}
.checkbox-row input:checked::after { transform: rotate(-45deg) translateY(-1px) scale(1); }
.checkbox-row input:focus-visible { outline: 2px solid var(--red-bright); outline-offset: 2px; }

/* Подсказка под кнопкой: чего не хватает для отправки. */
.uid-ready {
  min-height: 17px;
  margin: -6px 2px 10px;
  color: var(--text-muted);
}
.uid-ready:empty { min-height: 0; margin-bottom: 4px; }

/* Buttons: шкала размеров 32 / 44 / 52 — высота, отступы 16 / 24 / 32,
   подпись 14 / 16 / 16 */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 32px;
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 12px;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .12s var(--ease);
}
.btn:active { transform: scale(.985); }
.btn-primary {
  background: linear-gradient(160deg, #dd393a, #b32426);
  color: #fff;
  box-shadow: 0 12px 28px rgba(192, 42, 43, .26), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.btn-primary:hover { background: linear-gradient(160deg, #ef4b4b, #c72c2d); }
.btn-primary:disabled {
  opacity: 1;
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-sm { min-height: 44px; font-size: 15px; padding: 0 20px; }
/* Второе действие на экране UID: та же ширина и высота, что у Verify, но
   нейтральная заливка. Пока UID пустой — мягко пульсирует рамкой и фоном. */
.btn-register { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn-register:hover { background: var(--surface-soft); border-color: var(--red); }
.btn-register.is-nudge { animation: register-nudge 2.4s var(--ease) infinite; }
@keyframes register-nudge {
  0%, 100% { border-color: var(--border-strong); background: var(--surface-2); }
  50% { border-color: var(--red-bright); background: var(--red-bg); }
}
@media (prefers-reduced-motion: reduce) {
  .btn-register.is-nudge { animation: none; border-color: var(--red-bright); background: var(--red-bg); }
}
/* Главный призыв пульсирует тем же ритмом, но на красной заливке: меняется
   только свечение, чтобы кнопка «горела», а не перекрашивалась в серую. */
.btn-primary.is-nudge { animation: primary-nudge 2.4s var(--ease) infinite; }
@keyframes primary-nudge {
  0%, 100% { box-shadow: 0 12px 28px rgba(192, 42, 43, .26), inset 0 1px 0 rgba(255, 255, 255, .16); }
  50% { box-shadow: 0 12px 34px rgba(239, 75, 75, .55), inset 0 1px 0 rgba(255, 255, 255, .2); }
}
@media (prefers-reduced-motion: reduce) {
  .btn-primary.is-nudge { animation: none; }
}

/* Третичное действие — текстом: смена UID, удаление данных. */
.btn-link {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: none;
  border: 0;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(237, 237, 237, .22);
}
.btn-link:hover { color: var(--text); text-decoration-color: var(--red-bright); }

/* Готовый сигнал, который не успели показать: одна строка на главной. */
.pending-signal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.pending-signal:hover { border-color: var(--border-strong); background: var(--surface-2); }
.pending-signal-label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.pending-signal-value { display: block; font-size: 15px; font-weight: 500; }


/* Пояснение перед первым действием — не сноска, а подсказка. */
.home-cta-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}
.home-cta-note::before {
  content: "→";
  color: var(--red-bright);
  flex: none;
}

.fine-print { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin: 4px 4px 14px; }

/* Юридическая строка в подвале экранов: 18+ и «не финансовый совет».
   Намеренно мельче обычных fine-print и по центру — заметна, но не мешает. */
.legal-notice { font-size: 11px; text-align: center; margin: 10px 4px 4px; }

/* Info rows */
.row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--surface-soft);
}
.row:last-of-type { border-bottom: none; }
.row-label { font-size: 14px; color: var(--text-muted); }
.row-value { font-size: 15px; font-weight: 500; }

/* Chips */
.chip { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.chip-success { background: var(--green-bg); color: var(--green-text); }
.chip-warning { background: var(--yellow-bg); color: var(--yellow-text); }
.chip-muted { background: var(--surface-soft); color: var(--text-muted); }

/* Access categories */
.home-status { flex-wrap: wrap; }
.access-state { text-align: center; padding: 20px 4px 4px; margin-bottom: 4px; }
.access-granted { padding-top: 2px; }
.access-state .screen-title { margin-bottom: 10px; }
.access-state .verify-text { margin-bottom: 18px; }
.access-details { margin-top: 2px; }
.progress-card { padding: 16px 18px; }
.progress-track {
  height: 8px; margin-top: 6px; border-radius: 999px;
  background: var(--surface-soft); overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 999px;
  background: var(--red);
}

/* Карточка уровня: название по центру, номер уровня под ним */
.level-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.level-head .screen-title { margin-bottom: 0; }
.level-rank {
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.level-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.level-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
}
.level-stat-value {
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.level-stat-label { color: var(--text-muted); font-size: 12px; margin-top: 3px; }
.level-next { padding: 16px 18px; margin-bottom: 18px; }
.level-next .row { border-bottom: none; padding-bottom: 0; }
.level-next-note { margin: 8px 0 0; }
.level-next-cta { margin: 12px 0 0; }

/* Чек-лист условий активации под шкалой */
.check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}
.check-mark {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
}
.check-row.is-done { color: var(--text); }
.check-row.is-done .check-mark {
  background: var(--green-bg);
  border-color: #2f7a4e;
  color: var(--green-text);
}
.check-row.is-done .check-mark::before { content: "✓"; }
.check-row.is-todo .check-mark { border-color: rgba(192, 42, 43, .34); color: #c07a76; }
.check-row.is-todo .check-mark::before { content: "✕"; }
.promo-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px; margin-bottom: 16px;
  border-radius: var(--radius);
  background: rgba(192, 42, 43, .1);
  border: 1px dashed rgba(192, 42, 43, .45);
}
.promo-label {
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
}
.promo-row { display: flex; align-items: center; gap: 10px; }
.promo-code {
  flex: 1; padding: 10px 14px; border-radius: 10px;
  background: rgba(0, 0, 0, .35); color: #fff;
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px; font-weight: 600; letter-spacing: .08em; text-align: center;
}
.promo-copy {
  flex: none; min-height: 32px; padding: 0 16px; border-radius: 999px;
  border: 1px solid rgba(192, 42, 43, .5); background: transparent;
  color: var(--red-bright); font-family: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background .2s, color .2s;
}
.promo-copy:hover, .promo-copy.is-copied { background: var(--red); color: #fff; }
.access-demo-note { text-align: center; margin: 4px 8px 0; }
.promo-note { margin: 8px 2px 0; }
/* Ссылка длиннее карточки: переносим её и ставим кнопку ниже, внутри рамки. */
.promo-card-link .promo-row {
  flex-direction: column;
  align-items: stretch;
}
.promo-card-link .promo-code {
  min-width: 0;
  text-align: left;
  letter-spacing: 0;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.promo-card-link .promo-copy {
  width: 100%;
  min-height: 36px;
}
@media (max-width: 380px) {
  .promo-row { flex-direction: column; align-items: stretch; }
  .promo-copy { width: 100%; }
}

/* Pair & timeframe selection */
.pair-select {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 15px 16px;
  margin-bottom: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  text-align: start;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease);
}
@media (hover: hover) {
  .pair-select:hover {
    border-color: var(--border-strong);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
  }
}
.pair-select:active { background: var(--surface-2); }
.pair-select:focus-visible { outline: 2px solid rgba(192, 42, 43, .55); outline-offset: 2px; }
.pair-select-label { flex: none; font-size: 13px; color: var(--text-muted); }
.pair-select-value {
  margin-inline-start: auto;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.pair-select-chevron { width: 14px; height: 14px; flex: none; color: var(--text-muted); }

/* Timeframe grid: весь выбор виден сразу, без прокрутки */
.tf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}
.tf-chip {
  min-height: 44px;
  padding: 0 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
  font-family: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), color .15s var(--ease), background-color .15s var(--ease);
}
@media (hover: hover) {
  .tf-chip:hover {
    border-color: var(--border-strong);
    color: var(--text);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
  }
}
.tf-chip.is-selected {
  background: rgba(192, 42, 43, .12);
  border-color: var(--red);
  color: var(--red-bright);
  box-shadow: 0 0 0 1px rgba(192, 42, 43, .35);
}
/* Пробный доступ: секундные таймфреймы видны, но выбрать их нельзя */
.tf-chip.is-locked,
.tf-chip.is-locked:hover {
  opacity: .35;
  cursor: not-allowed;
  border-color: var(--border);
  color: var(--text-muted);
  box-shadow: none;
}

/* Пробный доступ: карточка с живым отсчётом */
.trial-card { border-inline-start: 3px solid var(--red); border-radius: 18px; }
.trial-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.trial-note { margin: 6px 0 0; }
.trial-tf-note { margin: -8px 4px 14px; }

/* Pair modal: категории + сетка вместо длинного списка */
body.modal-open { overflow: hidden; }
.pair-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(6px);
  animation: modal-fade .16s var(--ease);
}
.pair-modal-sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 440px;
  max-height: min(90vh, 640px);
  padding: 16px;
  background: #232326;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: 0 32px 64px -16px rgba(0, 0, 0, .8);
  animation: modal-rise .2s var(--ease);
}
.pair-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.pair-modal-title {
  margin: 0;
  font-family: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
}
.pair-modal-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
@media (hover: hover) {
  .pair-modal-close:hover { color: var(--text); border-color: var(--border-strong); }
}
.pair-modal-search {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color .15s var(--ease);
}
.pair-modal-search::placeholder { color: #6f6f79; }
.pair-modal-search:focus { border-color: var(--border-strong); }
.pair-modal-search::-webkit-search-cancel-button { filter: invert(.6); }

.seg-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.seg-tab {
  flex: 1;
  min-height: 44px;
  padding: 8px 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-family: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s var(--ease), border-color .15s var(--ease), background-color .15s var(--ease);
}
.seg-tab.is-active {
  background: rgba(192, 42, 43, .12);
  border-color: var(--red);
  color: var(--red-bright);
}

/* Guide & FAQ */
.text-link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 10px 2px;
  background: none; border: none;
  color: var(--text-muted); font-family: inherit; font-size: 13.5px;
  cursor: pointer; margin: 0 2px 18px;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s var(--ease);
}
.text-link:hover { color: var(--red-bright); }
.text-link-chev { font-size: 15px; line-height: 1; }
html[dir="rtl"] .text-link-chev { transform: scaleX(-1); }

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  transition: border-color .18s var(--ease);
}
.faq-item[open] { border-color: var(--border-strong); }
.faq-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 16px; margin: 0;
  color: var(--text); font-size: 14.5px; font-weight: 500;
  cursor: pointer; list-style: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.faq-head::-webkit-details-marker { display: none; }
.faq-head::after {
  content: "+"; flex: none;
  color: var(--text-muted); font-size: 18px; font-weight: 400; line-height: 1;
}
.faq-item[open] .faq-head::after { content: "−"; color: var(--red-bright); }
.faq-item[open] .faq-head { padding-bottom: 4px; }
.faq-body { padding: 8px 16px 16px; }
.faq-list { margin: 0; padding-left: 18px; }
.faq-list li {
  color: var(--text-secondary); font-size: 13.5px; line-height: 1.55;
  margin-bottom: 8px;
}
.faq-list li:last-child { margin-bottom: 0; }
.faq-text { color: var(--text-secondary); font-size: 13.5px; line-height: 1.55; margin: 0; }
.faq-note {
  margin: 12px 0 0; padding: 10px 12px;
  background: rgba(192, 42, 43, .07); border: 1px solid rgba(192, 42, 43, .2);
  border-radius: var(--radius-sm);
  color: #e9b4b1; font-size: 12.5px; line-height: 1.45;
}
html[dir="rtl"] .faq-list { padding-left: 0; padding-right: 18px; }

.pair-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.pair-chip {
  min-height: 44px;
  padding: 0 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease), color .15s var(--ease);
}
@media (hover: hover) {
  .pair-chip:hover {
    border-color: var(--border-strong);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
  }
}
.pair-chip.is-selected {
  background: rgba(192, 42, 43, .14);
  border-color: var(--red);
  color: var(--red-bright);
  box-shadow: 0 0 0 1px rgba(192, 42, 43, .35);
}
/* Пара выше уровня: видна, но выбор ведёт на апгрейд, а не на сигнал. */
.pair-chip.is-locked {
  color: var(--text-muted);
  border-style: dashed;
}
.pair-chip-lock {
  display: inline-flex;
  margin-left: 3px;
  vertical-align: -1px;
}
.pair-chip-lock svg { width: 11px; height: 11px; }
.pair-modal-empty { padding: 14px 2px; margin: 0; font-size: 13px; color: var(--text-muted); }

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modal-rise {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes modal-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes modal-drop {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(10px) scale(.985); }
}
/* Закрытие зеркально открытию: оверлей гаснет, лист уезжает вниз. */
.pair-modal.is-closing { animation: modal-fade-out .18s var(--ease) both; }
.pair-modal.is-closing .pair-modal-sheet { animation: modal-drop .18s var(--ease) both; }
.lang-overlay { animation: modal-fade .16s var(--ease); }
.lang-sheet { animation: modal-rise .2s var(--ease); }
.lang-overlay.is-closing { animation: modal-fade-out .18s var(--ease) both; }
.lang-overlay.is-closing .lang-sheet { animation: modal-drop .18s var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  .pair-modal, .pair-modal-sheet,
  .lang-overlay, .lang-sheet { animation: none; }
}

/* Level status: карточка уровня над выбором биржи, пары и таймфрейма */
.level-card {
  padding: 16px 18px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--red);
  border-radius: 18px;
  animation: level-card-in .3s var(--ease) both;
}
/* Уровень аккордеоном: свёрнутая строка, по тапу — полная начинка карточки */
.level-accordion {
  padding: 0;
  margin-bottom: 16px;
  border-radius: 16px;
  animation: none;
}
.level-accordion-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 16px;
  padding-inline-start: 14px;
  cursor: pointer;
  list-style: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.level-accordion-summary::-webkit-details-marker { display: none; }
.level-accordion-summary:focus-visible {
  outline: 2px solid rgba(192, 42, 43, .55);
  outline-offset: 2px;
  border-radius: 14px;
}
.level-accordion[open] .level-name-chevron { transform: rotate(90deg); }
html[dir="rtl"] .level-accordion[open] .level-name-chevron {
  transform: scaleX(-1) rotate(-90deg);
}
.level-accordion-body { padding: 0 14px 14px; }
.level-accordion-cta { margin: 14px 0 0; }
.level-card-compact-name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14.5px;
  font-weight: 500;
}
.level-card-compact-meta {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.level-badge {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 9px;
  background: rgba(192, 42, 43, .14);
  border: 1px solid rgba(192, 42, 43, .4);
  color: var(--red-bright);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
}
.level-meter {
  height: 6px;
  margin-top: 12px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.level-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--red);
  transition: width .3s var(--ease);
}
.level-usage { margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.level-reset { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.level-perks {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.level-perks li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.level-perks li::before {
  content: "✓";
  font-size: 10px;
  font-weight: 700;
  color: var(--green-text);
}

/* Панель уровней: текущая ступень + расстояние до следующих.
   Пройденные ступени не рендерятся (см. levelLadder в app.js). */
.level-ladder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.level-ladder-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}
.level-ladder {
  list-style: none;
  margin-top: 2px;
  display: flex;
  flex-direction: column;
}
.level-rung {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 10px;
  align-items: center;
  padding: 6px 0;
}
.level-rung-body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 8px;
  row-gap: 1px;
  min-width: 0;
}
.level-rung-name { font-size: 12.5px; color: var(--text-secondary); }
.level-rung.is-current .level-rung-name { font-weight: 500; color: var(--text); }
.level-rung-meta { font-size: 12px; color: var(--text-muted); }
.level-rung-gap {
  align-self: center;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--red-bright);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.level-rung-state {
  align-self: center;
  padding: 3px 9px;
  font-size: 11px;
  white-space: nowrap;
}
.level-name-chevron {
  flex: none;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  transition: transform .2s var(--ease);
}
html[dir="rtl"] .level-name-chevron { transform: scaleX(-1); }

@keyframes level-card-in {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .level-card, .level-rung { animation: none; }
}

.level-modal-sheet { max-width: 420px; }
.upgrade-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.upgrade-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}
.upgrade-side.is-next {
  background: rgba(192, 42, 43, .07);
  border-color: rgba(192, 42, 43, .4);
}
.upgrade-side-label { font-size: 12px; color: var(--text-muted); }
.upgrade-side-name { font-size: 13.5px; font-weight: 500; margin-bottom: 4px; }
.upgrade-fact { font-size: 11.5px; line-height: 1.45; color: var(--text-secondary); }
.upgrade-fact.is-deposit { color: var(--red-bright); }
.upgrade-gap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.upgrade-gap strong {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.upgrade-promo { margin-bottom: 14px; }
.upgrade-promo-label { display: block; margin-bottom: 6px; font-size: 11.5px; color: var(--text-muted); }
.upgrade-how { text-align: center; margin: 2px 0 0; }

/* Exchange picker */
.exchange-list { display: grid; gap: 12px; margin-bottom: 8px; }

.exchange-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 18px 18px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color .2s, transform .1s, box-shadow .2s, background .2s;
}
.exchange-card:active { transform: scale(.99); }
.exchange-card.is-open:hover {
  border-color: var(--red);
  box-shadow: 0 0 0 1px rgba(192, 42, 43, .5), 0 10px 26px rgba(192, 42, 43, .14);
}
.exchange-card.is-closed { opacity: .72; }

.exchange-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.exchange-name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
}
.exchange-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge-open { color: var(--green-text); background: var(--green-bg); border-color: rgba(74, 222, 128, .3); }
.badge-closed { color: var(--red-text); background: var(--red-bg); border-color: rgba(255, 138, 128, .3); }
.badge-unknown { color: var(--text-muted); background: var(--surface-soft); }

.exchange-desc { font-size: 13px; color: var(--text-muted); line-height: 1.45; margin-bottom: 8px; }
.exchange-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.exchange-clock { text-align: center; }

/* Полоса биржи целиком — кнопка: нажимается по всей площади */
.exchange-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: inherit;
  font-family: inherit;
  text-align: start;
  cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease);
}
.exchange-strip:hover { background: var(--surface-2); border-color: var(--border-strong); }
.exchange-strip:active { transform: scale(.99); }
.exchange-strip:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 2px;
}
.exchange-strip-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .8px;
  color: var(--red-bright);
}
.exchange-strip-count { font-size: 11.5px; color: var(--text-muted); }
.exchange-strip-change {
  margin-inline-start: auto;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.exchange-strip:hover .exchange-strip-change { color: var(--red-bright); }

.limit-reset-row {
  margin-top: 8px;
  border-bottom: none;
  padding-bottom: 0;
}
.limit-reset-value {
  font-family: var(--mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.limit-window-track .progress-fill { background: rgba(237, 237, 237, .32); }

.hidden { display: none !important; }

/* Loading */
.loading-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 22px 0 16px; text-align: center; }
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid rgba(237, 237, 237, .14);
  border-top-color: rgba(237, 237, 237, .92);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 15px; color: var(--text-muted); margin-top: 12px; }
.data-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 0 12px;
}
.loading-progress {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
/* Пара и таймфрейм прямо над списком: то, что человек проверяет перед сигналом */
.loading-ticket {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.loading-pair { font-size: 17px; font-weight: 500; letter-spacing: .2px; }
.loading-chip,
.signal-chip {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px 7px;
}
/* Отмена: липнет к низу экрана и заливается, пока держишь 2 секунды */
.loading-cancel {
  position: sticky;
  bottom: calc(env(safe-area-inset-bottom) + 8px);
  z-index: 2;
  margin-top: 16px;
  overflow: hidden;
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
.loading-cancel-fill {
  position: absolute;
  inset: 0;
  background: rgba(192, 42, 43, .3);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}
html[dir="rtl"] .loading-cancel-fill { transform-origin: right center; }
.loading-cancel.is-holding .loading-cancel-fill { animation: cancel-fill 1s linear forwards; }
.loading-cancel.is-cancelled .loading-cancel-fill {
  transform: scaleX(1);
  animation: none;
  opacity: 0;
  transition: opacity .18s ease;
}
@keyframes cancel-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.loading-cancel-label { position: relative; }

/* Analysis checklist on the loading screen */
.analysis-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.analysis-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
  opacity: .45; transition: opacity .25s ease, border-color .25s ease;
}
.analysis-item.is-ready { opacity: 1; border-color: #2f7a4e; }
.analysis-check {
  flex: 0 0 16px; width: 16px; height: 16px; margin-top: 2px;
  border-radius: 50%; border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: var(--green-text);
}
.analysis-item.is-ready .analysis-check { background: var(--green-bg); border-color: #2f7a4e; }
.analysis-item.is-ready .analysis-check::before { content: "✓"; }
/* Условия сверх уровня: замок и подпись, с какого уровня откроется */
.analysis-item.is-locked { opacity: 1; }
.analysis-item.is-locked .analysis-title,
.analysis-item.is-locked .analysis-hint { color: var(--text-muted); }
.analysis-item.is-locked .analysis-check { border-color: var(--border); color: var(--text-muted); }
.analysis-check svg { width: 9px; height: 9px; display: block; }
/* Первый пункт: реальная проверка канала до бэкенда */
.engine-status { margin-bottom: 0; }
.analysis-item.is-failed { opacity: 1; border-color: rgba(192, 42, 43, .35); }
.analysis-item.is-failed .analysis-check { border-color: rgba(192, 42, 43, .34); color: #c07a76; }
.analysis-item.is-failed .analysis-check::before { content: "✕"; }
.analysis-body { display: flex; flex-direction: column; gap: 2px; }
.analysis-title { font-size: 14px; font-weight: 600; }
.analysis-hint { font-size: 12.5px; line-height: 1.4; color: var(--text-muted); }

/* Result */
.signal-panel {
  --glow: rgba(237, 237, 237, .07);
  background:
    radial-gradient(120% 90% at 50% 128%, var(--glow), transparent 64%),
    linear-gradient(165deg, rgba(237, 237, 237, .05), rgba(237, 237, 237, .012));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 18px 20px;
  margin-bottom: 22px;
}
.result-up {
  --glow: rgba(76, 195, 138, .22);
  border-color: rgba(76, 195, 138, .26);
}
.result-down {
  --glow: rgba(255, 138, 128, .18);
  border-color: rgba(255, 138, 128, .26);
}
/* Пропуск сделки: нейтральная карточка без зелёного и красного. */
.result-flat {
  --glow: rgba(237, 237, 237, .1);
  border-color: rgba(237, 237, 237, .18);
}
.result-flat .signal-direction-value {
  font-size: 34px;
  color: var(--text);
}
.signal-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.signal-ref {
  margin-inline-start: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.signal-trade {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.signal-trade-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.signal-trade-row > span:last-child {
  font-family: var(--mono);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.signal-timer {
  height: 4px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}
.signal-timer-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--green-text);
  transition: width .35s linear;
}
.result-down .signal-timer-fill { background: var(--red-text); }
.signal-timer-note {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
/* Две кнопки в ряд: компактные, поэтому отступы меньше шкалы */
.btn-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.btn-row .btn {
  flex: 1;
  width: auto;
  min-width: 0;
  padding: 0 10px;
  font-size: 15px;
  margin-bottom: 0;
}
.signal-pair { font-size: 15px; font-weight: 500; }
.signal-direction {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.signal-direction-value {
  font-family: var(--mono);
  font-size: 46px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .01em;
}
.signal-direction-arrow { font-family: var(--mono); font-size: 20px; }
.result-up .signal-direction-value,
.result-up .signal-direction-arrow {
  color: var(--green-text);
  text-shadow: 0 0 28px rgba(76, 195, 138, .45);
}
.result-down .signal-direction-value,
.result-down .signal-direction-arrow {
  color: var(--red-text);
  text-shadow: 0 0 28px rgba(255, 138, 128, .4);
}

.signal-data { margin-bottom: 24px; }
.signal-data .section-label { margin-bottom: 4px; }
.data-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 2px;
}
.data-row + .data-row { border-top: 1px solid var(--border); }
.data-label { font-size: 13px; color: var(--text-muted); }
.data-value {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.signal-note { margin-bottom: 22px; }
.signal-note .section-label { margin-bottom: 8px; }
.signal-note p {
  margin: 0 0 6px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.signal-note p:last-child { margin-bottom: 0; }
.signal-note .signal-skip-note { color: var(--text-muted); }
.signal-disclaimer { margin-bottom: 22px; }

@media (min-width: 480px) {
  #app { padding-left: 24px; padding-right: 24px; }
}

/* RTL (Arabic) */
html[dir="rtl"] .lang-option,
html[dir="rtl"] .row,
html[dir="rtl"] .app-header {
  flex-direction: row;
}
html[dir="rtl"] .warning-card { text-align: right; }
html[dir="rtl"] .home-cta-note { text-align: right; }
html[dir="rtl"] .home-cta-note::before { content: "←"; }

/* Глобальный видимый фокус для клавиатуры и скринридеров. */
:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 2px;
}

/* Ненавязчивые сообщения об ошибках/устаревших данных. */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 1000;
  width: min(92vw, 440px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

/* С нижними вкладками тост поднимается над панелью, а не ложится на неё. */
body.has-nav .toast-host {
  bottom: calc(76px + env(safe-area-inset-bottom));
}

.toast {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  transition: opacity .2s ease, transform .2s ease;
}

.toast-error {
  border-color: rgba(192, 42, 43, .55);
  color: var(--text);
}

.toast.is-hiding {
  opacity: 0;
  transform: translateY(6px);
}

@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}
