/* ============================================================
   Tiltquell — общие стили
   Цвета, шрифты и скругления меняются в переменных ниже.
   ============================================================ */

:root {
  --bg: #07060f;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-solid: #12101f;
  --surface-2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.24);
  --fg: #f4f2ff;
  --muted: #b1adcc;
  --faint: #8f8bae;
  --accent: #a48bff;
  --accent-2: #22d3ee;
  --accent-3: #ff5fa8;
  --accent-soft: rgba(139, 108, 255, 0.18);
  --grad: linear-gradient(100deg, #8b6cff 0%, #22d3ee 100%);
  --grad-hot: linear-gradient(100deg, #ff5fa8 0%, #8b6cff 50%, #22d3ee 100%);
  --btn-fg: #0b0a14;
  --profit: #2be39a;
  --profit-soft: rgba(43, 227, 154, 0.14);
  --loss: #ff5470;
  --loss-soft: rgba(255, 84, 112, 0.14);
  --warn: #ffc857;
  --warn-soft: rgba(255, 200, 87, 0.14);
  --header-bg: rgba(7, 6, 15, 0.7);
  --glow-1: rgba(139, 108, 255, 0.34);
  --glow-2: rgba(34, 211, 238, 0.2);
  --glow-3: rgba(255, 95, 168, 0.16);
  --grid-line: rgba(255, 255, 255, 0.035);
  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 60px -30px rgba(0, 0, 0, 0.8);
  --radius: 22px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f4ff;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-2: rgba(91, 61, 245, 0.07);
  --border: rgba(30, 20, 80, 0.12);
  --border-strong: rgba(30, 20, 80, 0.3);
  --fg: #14102b;
  --muted: #564f78;
  --faint: #6a638c;
  --accent: #5b3df5;
  --accent-2: #0891b2;
  --accent-3: #d6267a;
  --accent-soft: rgba(91, 61, 245, 0.1);
  --profit: #0f8a5c;
  --profit-soft: rgba(15, 138, 92, 0.12);
  --loss: #d7263d;
  --loss-soft: rgba(215, 38, 61, 0.1);
  --warn: #946200;
  --warn-soft: rgba(148, 98, 0, 0.12);
  --header-bg: rgba(246, 244, 255, 0.78);
  --glow-1: rgba(139, 108, 255, 0.3);
  --glow-2: rgba(34, 211, 238, 0.24);
  --glow-3: rgba(255, 95, 168, 0.18);
  --grid-line: rgba(30, 20, 80, 0.045);
  --shadow-card: 0 1px 2px rgba(30, 20, 80, 0.05), 0 24px 50px -30px rgba(60, 40, 160, 0.35);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: clip; /* clip, а не hidden: иначе не прилипают шапка и меню */
}

main {
  flex: 1;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

img,
svg {
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

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

.faint {
  color: var(--faint);
}

.up {
  color: var(--profit);
}

.down {
  color: var(--loss);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 24px;
}

.container.narrow {
  max-width: 860px;
}

.section {
  padding-block: 40px; /* только сверху и снизу: боковые отступы задаёт .container */
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--border-strong);
}

.btn-sm {
  min-height: 38px;
  padding: 6px 14px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}

.icon-btn:hover {
  border-color: var(--border-strong);
}

.link {
  color: var(--accent);
}

.link:hover {
  text-decoration: underline;
}

/* Ссылка-стрелка: увеличенная зона нажатия */
.more-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

/* ---------- Карточки ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--border-strong);
}

.chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12px;
  font-weight: 600;
}

.badge.blue {
  background: var(--accent-soft);
  color: var(--accent);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
}

.dot.high {
  background: var(--loss);
}

.dot.medium {
  background: var(--warn);
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 66px;
  padding: 0 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  flex: none;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}

.main-nav {
  display: flex;
  gap: 4px;
  margin-left: 12px;
}

.main-nav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--fg);
  background: var(--surface-2);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.lang-switch button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--surface-2);
  color: var(--fg);
}

.flag {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  flex: none;
}

.burger {
  display: none;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px 20px;
  border-top: 1px solid var(--border);
}

.mobile-menu a:not(.btn) {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 10px;
  font-weight: 600;
}

.mobile-menu a:not(.btn):hover,
.mobile-menu a[aria-current="page"] {
  background: var(--surface-2);
}

.mobile-menu .menu-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.mobile-menu .menu-row .btn {
  flex: 1;
}

@media (max-width: 860px) {
  .main-nav,
  .header-actions .desktop-only {
    display: none;
  }

  .burger {
    display: inline-flex;
  }

  .site-header.open .mobile-menu {
    display: flex;
  }

  .header-inner {
    padding: 0 16px;
    gap: 10px;
  }
}

/* ---------- Подвал ---------- */

.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  padding: 28px 0 36px;
  color: var(--muted);
  font-size: 14px;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

.footer-links a:hover {
  color: var(--fg);
}

.disclaimer {
  margin-top: 14px;
  font-size: 13px;
  color: var(--faint);
  max-width: 820px;
}

/* ---------- Главная: герой ---------- */

.home-top {
  display: flex;
  flex-direction: column;
}

.hero {
  padding: 56px 0 40px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(32px, 5.2vw, 50px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero .lead {
  max-width: 680px;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.hero-note {
  margin-top: 14px;
  font-size: 14px;
  color: var(--faint);
}

/* ---------- Главная: тикер ---------- */

.ticker-wrap {
  padding-top: 28px;
}

.ticker-head {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--faint);
}

.ticker {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  overflow-x: auto;
  scrollbar-width: thin;
}

.ticker-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border-left: 1px solid var(--border);
  min-width: 0;
}

.ticker-item:first-child {
  border-left: 0;
}

.ticker-item .pair {
  font-size: 13px;
  font-weight: 600;
}

.ticker-item .price {
  font-size: 15px;
  font-weight: 700;
}

.ticker-item svg {
  display: block;
  width: 100%;
  height: 40px;
}

.ticker-item .chg {
  font-size: 12.5px;
}

/* На телефоне сначала оффер, потом котировки */
@media (max-width: 860px) {
  .home-top .hero {
    order: 1;
    padding-top: 36px;
  }

  .home-top .ticker-wrap {
    order: 2;
    padding-top: 0;
  }
}

/* ---------- Блоки с заголовком ---------- */

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

.block-head h2 {
  font-size: 20px;
}

.section-title {
  text-align: center;
  margin-bottom: 28px;
}

.section-title h2 {
  font-size: clamp(24px, 3.4vw, 32px);
  letter-spacing: -0.01em;
  margin-top: 6px;
}

/* ---------- Новости ---------- */

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.news-list {
  display: grid;
  gap: 12px;
}

.news-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  transition: border-color 0.15s;
}

.news-card:hover {
  border-color: var(--border-strong);
}

.news-card .meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--faint);
}

.news-card h3 {
  font-size: 16px;
  line-height: 1.35;
}

.news-card p {
  font-size: 14px;
  color: var(--muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-top: 40px;
}

.page-head h1 {
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -0.01em;
}

.page-head p {
  margin-top: 6px;
  color: var(--muted);
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 860px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Календарь ---------- */

.two-col {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
}

.panel {
  padding: 18px;
}

.day-label {
  margin: 14px 0 8px;
}

.day-label:first-child {
  margin-top: 0;
}

.event {
  display: grid;
  grid-template-columns: 64px 52px 12px 1fr;
  align-items: start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 8px;
  font-size: 14px;
}

.event .time {
  color: var(--muted);
}

.event .cur {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
}

.event .dot {
  margin-top: 7px;
}

/* Название события переносится, а не обрезается */
.event .name {
  overflow-wrap: anywhere;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  font-weight: 700;
}

@media (max-width: 860px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .event {
    grid-template-columns: 56px 48px 12px 1fr;
    gap: 8px;
  }
}

/* ---------- Сигнал дня ---------- */

.signal .sym {
  font-size: 22px;
  font-weight: 700;
  margin-top: 6px;
}

.signal .row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.signal .note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--faint);
}

/* ---------- Как это работает ---------- */

.how-block {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  padding: 22px;
  margin-bottom: 16px;
}

.how-stat {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: 10px;
  background: var(--surface-2);
}

.how-stat .num {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
}

.how-stat .lbl {
  font-size: 13px;
  color: var(--muted);
}

.how-body h3 {
  font-size: 22px;
  margin: 4px 0 14px;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.feature p {
  font-size: 14px;
  color: var(--muted);
}

.exchanges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 14px;
}

.exchanges span.x {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .how-block {
    grid-template-columns: 1fr;
  }

  .how-stat {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
  }

  .features {
    grid-template-columns: 1fr;
  }
}

/* ---------- Тарифы ---------- */

.plan {
  max-width: 440px;
  margin: 0 auto;
  padding: 28px;
  text-align: center;
}

.plan .amount {
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  margin: 14px 0 6px;
}

.plan .amount small {
  font-size: 28px;
  color: var(--muted);
  font-weight: 500;
  margin-right: 4px;
}

.plan ul {
  list-style: none;
  padding: 0;
  margin: 18px 0;
  text-align: left;
}

.plan li,
.incl li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  font-size: 15px;
}

.check {
  color: var(--profit);
  flex: none;
  font-weight: 700;
}

.plan .stack {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.plan .fine {
  margin-top: 12px;
  font-size: 13px;
  color: var(--faint);
}

.incl {
  margin-top: 28px;
  overflow: hidden;
}

.incl h3 {
  padding: 12px 20px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.incl .incl-head {
  padding: 16px 20px;
  font-size: 18px;
  font-weight: 700;
}

.incl ul {
  list-style: none;
  margin: 0;
  padding: 4px 20px;
}

.incl li {
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.incl li:last-child {
  border-bottom: 0;
}

.incl li .val {
  color: var(--accent);
  font-size: 13px;
  white-space: nowrap;
}

.faq {
  margin-top: 36px;
}

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-size: 22px;
  color: var(--faint);
}

.faq details[open] summary::after {
  content: "–";
}

.faq details p {
  padding: 0 0 18px;
  color: var(--muted);
}

/* ---------- Вход и регистрация ---------- */

.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 26px;
  margin-top: 24px;
}

.auth-card h1 {
  font-size: 24px;
}

.auth-card .sub {
  margin: 4px 0 20px;
  color: var(--muted);
  font-size: 15px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 14px;
  font-weight: 600;
}

.field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.field input::placeholder {
  color: var(--faint);
}

.field input:focus {
  border-color: var(--accent);
  outline: none;
}

.field .pw {
  position: relative;
}

.field .pw input {
  padding-right: 52px;
}

.field .pw button {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 38px;
  height: 38px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
}

.rules {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--faint);
}

.rules li::before {
  content: "○ ";
}

.rules li.ok {
  color: var(--profit);
}

.rules li.ok::before {
  content: "✓ ";
}

.form-msg {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 14px;
}

.form-msg[hidden] {
  display: none;
}

.auth-alt {
  margin-top: 18px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

/* Поле-ловушка для ботов */
.hp {
  position: absolute;
  left: -9999px;
}

/* ---------- Текстовые страницы и 404 ---------- */

.prose {
  padding-top: 40px;
}

.prose h1 {
  font-size: clamp(26px, 4vw, 34px);
  margin-bottom: 8px;
}

.prose h2 {
  font-size: 20px;
  margin: 28px 0 8px;
}

.prose p,
.prose li {
  color: var(--muted);
  margin-bottom: 10px;
}

.notice {
  padding: 12px 14px;
  margin: 16px 0;
  border-radius: 10px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 14px;
}

.notfound {
  padding: 96px 0;
  text-align: center;
}

.notfound .code {
  font-size: 88px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.notfound p {
  margin: 12px 0 24px;
  color: var(--muted);
}

/* ---------- Всплывающее сообщение ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-card);
  font-size: 14px;
  z-index: 100;
}

@media (max-width: 520px) {
  .container {
    padding: 0 16px;
  }

  .hero-actions .btn {
    width: 100%;
  }

  /* Узкий экран: в переключателе языка остаются только буквы */
  .lang-switch .flag {
    display: none;
  }

  .header-actions {
    gap: 8px;
  }

  .page-head {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}

/* ============================================================
   Яркий стиль: фон со свечением, градиенты, крупная типографика
   ============================================================ */

/* Фон: три пятна света и тонкая сетка */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(620px 420px at 12% -6%, var(--glow-1), transparent 70%),
    radial-gradient(560px 420px at 92% 8%, var(--glow-2), transparent 70%),
    radial-gradient(700px 520px at 50% 110%, var(--glow-3), transparent 70%),
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 56px 56px;
}

h1,
h2,
.how-body h3,
.logo,
.plan .amount,
.notfound .code {
  font-family: var(--display);
  letter-spacing: -0.02em;
}

h1,
h2 {
  overflow-wrap: break-word;
}

.grad-text,
.hero h1 .accent {
  background: var(--grad-hot);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Кнопки-пилюли с градиентом и свечением */
.btn {
  border-radius: 999px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, background 0.15s;
}

.btn-primary,
.btn-primary:hover {
  background: var(--grad);
  color: var(--btn-fg);
  box-shadow: 0 10px 30px -10px rgba(139, 108, 255, 0.75);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -10px rgba(34, 211, 238, 0.7);
}

.btn-ghost {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.icon-btn,
.lang-switch {
  border-radius: 999px;
}

.lang-switch button {
  border-radius: 999px;
}

.logo-mark {
  background: var(--grad);
  color: var(--btn-fg);
  border-radius: 12px;
}

/* Стеклянные карточки */
.card {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.news-card,
.how-block,
.plan {
  transition: transform 0.2s, border-color 0.2s;
}

.news-card:hover,
.how-block:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.field input,
.event,
.mobile-menu {
  background: var(--surface-solid);
}

.site-header.open {
  background: var(--surface-solid);
}

.eyebrow {
  color: var(--accent);
}

.day-label {
  color: var(--faint);
}

.chip[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--fg);
}

/* Первый экран */
.home-top .hero {
  order: 1;
  padding: 64px 0 28px;
}

.home-top .ticker-wrap {
  order: 2;
  padding-top: 0;
}

.hero h1 {
  font-size: clamp(28px, 5.6vw, 60px);
  line-height: 1.1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
}

.hero-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--profit);
  box-shadow: 0 0 0 4px var(--profit-soft);
}

/* Пример кабинета под оффером */
.hero-visual {
  position: relative;
  max-width: 920px;
  margin: 44px auto 0;
  padding: 0 24px;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 12% 8% -6%;
  z-index: -1;
  background: var(--grad-hot);
  filter: blur(70px);
  opacity: 0.35;
}

.mock {
  padding: 22px;
  text-align: left;
}

.mock-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.mock-head .big {
  font-size: clamp(22px, 3.4vw, 32px);
  font-weight: 700;
}

.equity {
  display: block;
  width: 100%;
  height: auto;
  margin: 10px 0 16px;
}

.equity .line {
  fill: none;
  stroke: url(#eq-stroke);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: draw 2.2s 0.3s ease-out forwards;
}

.equity .area {
  fill: url(#eq-fill);
  opacity: 0;
  animation: fade 1.2s 1.4s ease-out forwards;
}

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

@keyframes fade {
  to {
    opacity: 1;
  }
}

.mock-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.mock-stats div {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-2);
}

.mock-stats .v {
  display: block;
  font-size: 20px;
  font-weight: 700;
}

.mock-stats .k {
  font-size: 13px;
  color: var(--muted);
}

/* Крупные цифры и заголовки блоков */
.section {
  padding-block: 56px;
}

.section-title h2 {
  font-size: clamp(22px, 3.6vw, 38px);
  line-height: 1.15;
}

.how-stat {
  border-radius: 16px;
}

.how-stat .num {
  font-size: 34px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.plan {
  position: relative;
  border-color: var(--border-strong);
}

.plan::before {
  content: "";
  position: absolute;
  inset: 10% 6% -8%;
  z-index: -1;
  background: var(--grad);
  filter: blur(60px);
  opacity: 0.28;
}

.notfound .code {
  background: var(--grad-hot);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Появление блоков при прокрутке (класс ставит app.js) */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (max-width: 860px) {
  .home-top .hero {
    padding-top: 40px;
  }

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

  .hero-visual {
    padding: 0 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .equity .line {
    animation: none;
    stroke-dashoffset: 0;
  }

  .equity .area {
    animation: none;
    opacity: 1;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ===== Версия 2: цвет по всей странице, живой фон, интерактивный пример, иконки ===== */

.sprite {
  position: absolute;
  width: 0;
  height: 0;
}

/* --- Кнопки --- */

.btn-lg {
  min-height: 54px;
  padding: 12px 30px;
  font-size: 17px;
}

.btn-primary {
  position: relative;
  overflow: hidden;
}

/* блик, пробегающий по главной кнопке при наведении */
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease-out;
}

.btn-primary:hover::after {
  left: 120%;
}

.btn-dark,
.btn-dark:hover {
  background: #0b0a14;
  color: #fff;
}

.btn-dark:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -14px rgba(11, 10, 20, 0.7);
}

.hero-actions {
  align-items: center;
  gap: 18px;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-color: var(--border-strong);
}

.hero-link:hover {
  color: var(--fg);
}

/* --- Заголовки разделов: слева, с градиентным акцентом --- */

.block-head {
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 22px;
}

.block-head h2 {
  font-size: clamp(22px, 3.3vw, 36px);
  line-height: 1.15;
}

/* --- Цветные пятна за блоками --- */

.section {
  position: relative;
}

.section.glow-l::before,
.section.glow-r::before {
  content: "";
  position: absolute;
  top: 8%;
  z-index: -1;
  width: min(560px, 70vw);
  height: 420px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  pointer-events: none;
}

.section.glow-l::before {
  left: -14%;
  background: var(--glow-3);
}

.section.glow-r::before {
  right: -14%;
  background: var(--glow-2);
}

/* --- Подсветка карточки под курсором --- */

.card:not(.ticker) {
  position: relative;
}

.card:not(.ticker)::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, -999px) var(--my, -999px), rgba(139, 108, 255, 0.16), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

.card:not(.ticker):hover::after {
  opacity: 1;
}

.panel,
.plan,
.mock {
  transition: transform 0.2s, border-color 0.2s;
}

.panel:hover {
  border-color: var(--border-strong);
}

/* --- Пример кабинета --- */

.mock-head {
  align-items: center;
}

.mock-tabs {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
}

.mock-tabs button {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.mock-tabs button:hover {
  color: var(--fg);
}

.mock-tabs button[aria-pressed="true"] {
  background: var(--grad);
  color: var(--btn-fg);
}

.mock-cap {
  margin-top: 10px;
  font-size: 13px;
  color: var(--faint);
}

.mock-chart {
  position: relative;
  cursor: crosshair;
  touch-action: pan-y;
}

.mock-dot,
.mock-tip {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, left 0.12s ease-out, top 0.12s ease-out;
}

.mock-dot {
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.mock-tip {
  transform: translate(-50%, -150%);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.mock-chart.is-hover .mock-dot,
.mock-chart.is-hover .mock-tip {
  opacity: 1;
}

/* --- Котировки: крупнее и с подсветкой при изменении цены --- */

.ticker-item {
  padding: 18px 18px 16px;
  gap: 8px;
}

.ticker-item .pair {
  font-size: 13px;
  color: var(--muted);
}

.ticker-item .price {
  font-size: 20px;
}

.ticker-item svg {
  height: 54px;
}

.ticker-item .chg {
  font-size: 13.5px;
  font-weight: 700;
}

.ticker-item.flash-up {
  animation: flash-up 0.9s ease-out;
}

.ticker-item.flash-down {
  animation: flash-down 0.9s ease-out;
}

@keyframes flash-up {
  from {
    background: var(--profit-soft);
  }
}

@keyframes flash-down {
  from {
    background: var(--loss-soft);
  }
}

/* --- Три вопроса: картинка, иконки, чередование сторон --- */

.how-block {
  grid-template-columns: 300px 1fr;
  gap: 28px;
  padding: 26px;
  align-items: center;
}

.how-block.rev .how-visual {
  order: 2;
}

.how-block.rev {
  grid-template-columns: 1fr 300px;
}

.how-visual {
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  background: var(--surface-2);
}

.how-visual figcaption {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--faint);
}

.how-visual svg {
  display: block;
  width: 100%;
  height: auto;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.how-visual .lvl {
  stroke: var(--faint);
  stroke-width: 1.5;
  stroke-dasharray: 5 6;
}

.how-visual .px {
  stroke: var(--muted);
  stroke-width: 2.5;
}

.how-visual .brk {
  stroke: var(--profit);
  stroke-width: 3.5;
}

.how-visual .pt {
  fill: var(--fg);
  stroke: none;
}

.pnl {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.pnl i {
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--border);
}

.pnl .g1 {
  background: color-mix(in srgb, var(--profit) 45%, transparent);
}

.pnl .g2 {
  background: var(--profit);
}

.pnl .r1 {
  background: color-mix(in srgb, var(--loss) 45%, transparent);
}

.pnl .r2 {
  background: var(--loss);
}

.gauge__track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: var(--border);
}

.gauge__fill {
  width: 70%;
  height: 100%;
  border-radius: 999px;
  background: var(--grad-hot);
}

.gauge__mark {
  position: absolute;
  left: 70%;
  top: -8px;
  bottom: -8px;
  width: 3px;
  border-radius: 2px;
  background: var(--fg);
}

.gauge__labels {
  display: grid;
  grid-template-columns: 1fr auto 30%;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--muted);
}

.gauge__labels span:last-child {
  text-align: right;
}

.ico {
  display: block;
  width: 24px;
  height: 24px;
  margin-bottom: 10px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.how-tabs {
  display: none;
  gap: 8px;
  margin-bottom: 14px;
}

/* --- Тариф и завершающий призыв --- */

.plan-row {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 40px;
  align-items: center;
}

.plan-copy h2 {
  font-size: clamp(24px, 3.6vw, 40px);
  line-height: 1.12;
}

.plan-copy p {
  max-width: 46ch;
  margin: 16px 0 6px;
  font-size: 17px;
}

.plan-row .plan {
  margin: 0;
  max-width: none;
}

.cta-band {
  padding: clamp(32px, 6vw, 64px);
  border-radius: 28px;
  background: var(--grad-hot);
  color: #0b0a14;
}

.cta-band h2 {
  max-width: 18ch;
  font-size: clamp(24px, 4.2vw, 46px);
  line-height: 1.08;
}

.cta-band p {
  max-width: 44ch;
  margin: 16px 0 26px;
  font-size: 17px;
  font-weight: 500;
}

/* --- Подвал --- */

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.4fr;
  gap: 28px;
}

.footer-brand p {
  max-width: 34ch;
  margin-top: 12px;
}

.footer-col {
  display: grid;
  align-content: start;
}

.footer-title {
  margin-bottom: 6px;
  color: var(--fg);
  font-weight: 700;
}

.footer-col a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

.footer-col a:hover {
  color: var(--fg);
}

.footer-copy {
  margin-top: 18px;
  color: var(--faint);
  font-size: 13px;
}

.site-footer .disclaimer {
  margin-top: 26px;
}

/* --- Живой фон: свечи BTC, ценовые уровни и линия текущей цены --- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.backdrop__chart {
  position: absolute;
  inset: 0;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 2.6s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
}

.backdrop.is-in .backdrop__chart {
  clip-path: inset(0);
}

.backdrop svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.backdrop .up {
  fill: var(--accent);
  stroke: var(--accent);
  opacity: 0.16;
}

.backdrop .down {
  fill: var(--fg);
  stroke: var(--fg);
  opacity: 0.06;
}

.backdrop__level {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--border);
}

.backdrop__level span {
  position: absolute;
  right: 8px;
  top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  color: var(--faint);
}

.backdrop__now {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-2));
  transition: top 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.backdrop__now span {
  position: absolute;
  right: 18px;
  top: -10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--grad);
  color: var(--btn-fg);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.backdrop__now::before,
.backdrop__now::after {
  content: "";
  position: absolute;
  right: 5px;
  top: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
}

.backdrop__now::after {
  animation: live 1.8s ease-out infinite;
}

@keyframes live {
  to {
    transform: scale(3.4);
    opacity: 0;
  }
}

/* --- Узкие экраны --- */

@media (max-width: 860px) {
  .hero h1 {
    font-size: clamp(25px, 7.4vw, 44px);
    text-wrap: balance;
  }

  .hero h1 span {
    display: block;
  }

  .hero-actions {
    flex-direction: column;
    gap: 6px;
  }

  .mock-head {
    flex-wrap: wrap;
  }

  .how-tabs {
    display: flex;
    flex-wrap: wrap;
  }

  .how-block,
  .how-block.rev {
    grid-template-columns: 1fr;
  }

  .how-block:not(.is-active) {
    display: none;
  }

  .how-block.rev .how-visual {
    order: 0;
  }

  .how-visual {
    max-width: 360px;
  }

  .plan-row {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .backdrop__level span {
    display: none;
  }

  /* на телефоне ценник перекрывал бы заголовок: остаются линия и точка */
  .backdrop__now span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .backdrop__chart {
    clip-path: none;
    transition: none;
  }

  .backdrop__now {
    transition: none;
  }

  .backdrop__now::after,
  .ticker-item.flash-up,
  .ticker-item.flash-down {
    animation: none;
  }

  .btn-primary::after {
    display: none;
  }
}

/* Цветные пятна выходят за край страницы: лишнюю ширину обрезаем */

html {
  overflow-x: clip;
}

/* --- Список бирж: отдельная заметная плашка --- */

.exchanges {
  display: block;
  margin-top: 16px;
  padding: 26px 28px 28px;
  font-size: 16px;
}

.exchanges__title {
  max-width: none;
  margin-bottom: 18px;
  font-family: var(--display);
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.exchanges__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.exchanges span.x {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--fg);
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.exchanges span.x:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 10px 24px -14px var(--accent);
}

/* ===== Демо-кабинет (demo.html) ===== */

.btn-outline-dark,
.btn-outline-dark:hover {
  background: none;
  border-color: rgba(11, 10, 20, 0.55);
  color: #0b0a14;
}

.btn-outline-dark:hover {
  background: rgba(11, 10, 20, 0.08);
}

.cta-band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.dash-body {
  display: block;
}

.demo-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-solid);
  font-size: 14px;
}

.demo-bar p {
  color: var(--muted);
}

.demo-bar strong {
  color: var(--warn);
}

.demo-bar__actions {
  display: flex;
  gap: 8px;
}

.dash {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: calc(100vh - 59px);
}

.dash-side {
  position: sticky;
  top: 59px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: calc(100vh - 59px);
  padding: 22px 16px;
  border-right: 1px solid var(--border);
}

.dash-nav {
  display: grid;
  gap: 4px;
}

.dash-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.dash-nav a:hover {
  background: var(--surface-2);
  color: var(--fg);
}

.dash-nav a[aria-current="page"] {
  background: var(--grad);
  color: var(--btn-fg);
}

/* язык и тема стоят сразу под разделами */
.dash-side__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
}

.dash-main {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 26px clamp(16px, 3vw, 36px) 56px;
}

.dash-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.dash-head h1 {
  font-size: clamp(24px, 3vw, 34px);
}

.dash-filters,
.dash-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.dash-filters select {
  min-height: 40px;
  padding: 0 34px 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-solid);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.dash-filters select:hover {
  border-color: var(--border-strong);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpis--6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.kpi {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-radius: 18px;
}

.kpi__label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.kpi__value {
  display: block;
  font-size: clamp(20px, 2vw, 27px);
  font-weight: 700;
  line-height: 1.1;
}

.kpi__sub {
  display: block;
  min-height: 1em;
  font-size: 13px;
  color: var(--muted);
}

.accent-text {
  color: var(--accent);
}

.dash-panel {
  padding: 20px;
  border-radius: 18px;
  min-width: 0;
}

.dash-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.dash-panel h2 {
  font-family: var(--font);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.chart {
  display: block;
  width: 100%;
  height: auto;
}

.chart .grid {
  stroke: var(--border);
  stroke-width: 1;
}

.chart .ax {
  fill: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
}

.chart .line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.chart .line.thin {
  stroke-width: 1;
  opacity: 0.6;
}

.chart .area,
.chart .band {
  fill: var(--accent);
  opacity: 0.14;
}

.chart.neg .line {
  stroke: var(--loss);
}

.chart.neg .area {
  fill: var(--loss);
}

.chart .bar.pos {
  fill: var(--profit);
}

.chart .bar.neg,
.chart .bar.neg-force {
  fill: var(--loss);
}

.dash-empty,
.dash-note {
  color: var(--muted);
  font-size: 14px;
}

.dash-empty {
  padding: 28px 0;
}

.dash-note {
  margin-top: 12px;
  max-width: 62ch;
}

.ls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ls > div {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 14px;
  background: var(--surface-2);
}

.stat-list {
  display: grid;
  margin: 0;
}

.stat-list > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.stat-list > div:last-child {
  border-bottom: 0;
}

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

.stat-list dd {
  margin: 0;
  font-weight: 700;
  white-space: nowrap;
}

.brk {
  display: grid;
  gap: 10px;
}

.brk__row {
  display: grid;
  grid-template-columns: minmax(90px, 1.1fr) 1.4fr auto auto;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.brk__bar {
  height: 10px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.brk__bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.brk__bar .pos {
  background: var(--profit);
}

.brk__bar .neg {
  background: var(--loss);
}

.brk__n {
  color: var(--faint);
  font-size: 12.5px;
  white-space: nowrap;
}

.brk__pnl {
  min-width: 76px;
  text-align: right;
  font-weight: 700;
}

.full {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 32px;
}

.full h3 {
  margin: 10px 0 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* календарь прибыли */

.cal-nav__title {
  min-width: 150px;
  text-align: center;
}

.kpis--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cal-scroll {
  overflow-x: auto;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(92px, 1fr)) minmax(84px, 0.7fr);
  gap: 6px;
  min-width: 760px;
}

.cal-grid--head {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--faint);
}

.cal-cell {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 78px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12.5px;
}

.cal-cell.is-other {
  opacity: 0.35;
}

.cal-cell.pos {
  background: var(--profit-soft);
  border-color: color-mix(in srgb, var(--profit) 40%, transparent);
}

.cal-cell.neg {
  background: var(--loss-soft);
  border-color: color-mix(in srgb, var(--loss) 40%, transparent);
}

.cal-cell__d,
.cal-cell__n {
  color: var(--faint);
}

.cal-cell__p {
  font-size: 14px;
  font-weight: 700;
}

.cal-cell.pos .cal-cell__p {
  color: var(--profit);
}

.cal-cell.neg .cal-cell__p {
  color: var(--loss);
}

.cal-cell--week {
  align-content: center;
  justify-items: center;
  background: var(--surface-2);
}

/* таблица сделок */

.tbl-scroll {
  overflow-x: auto;
}

.tbl {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}

.tbl th,
.tbl td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

.tbl th:first-child,
.tbl td:first-child,
.tbl th:nth-child(2),
.tbl td:nth-child(2) {
  text-align: left;
}

.tbl th button {
  min-height: 32px;
  border: 0;
  background: none;
  color: var(--faint);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.tbl th button:hover,
.tbl th button[aria-pressed="true"] {
  color: var(--fg);
}

.tbl tbody tr:hover {
  background: var(--surface-2);
}

.side {
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
}

.side.pos {
  background: var(--profit-soft);
  color: var(--profit);
}

.side.neg {
  background: var(--loss-soft);
  color: var(--loss);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 1100px) {
  .kpis,
  .kpis--6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-grid,
  .full {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .demo-bar {
    position: static;
    padding: 10px 16px;
  }

  .dash {
    grid-template-columns: 1fr;
  }

  .dash-side {
    position: sticky;
    top: 0;
    z-index: 30;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    height: auto;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface-solid);
    overflow-x: auto;
  }

  .dash-side .logo {
    display: none;
  }

  .dash-nav {
    display: flex;
  }

  .dash-nav a {
    white-space: nowrap;
  }

  .dash-side__foot {
    margin: 0 0 0 auto;
  }

  .kpis--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brk__row {
    grid-template-columns: 1fr auto auto;
  }

  .brk__bar {
    display: none;
  }

  .ls {
    grid-template-columns: 1fr;
  }
}

/* в половинных панелях график вдвое уже: подписи и линии крупнее */

/* графики строятся под ширину панели (useBox в demo.js), поэтому размер подписей одинаковый везде */

/* переключатель единиц прибыли в кабинете: доллары или проценты */

.unit-tabs button {
  min-width: 44px;
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 15px;
}

/* --- Котировки: семь инструментов --- */

.ticker {
  grid-template-columns: repeat(7, minmax(148px, 1fr));
}

.ticker-item .pair {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.ticker-item .pair .badge {
  padding: 1px 6px;
  font-size: 10.5px;
}

.ticker-foot {
  max-width: 92ch;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--faint);
}

/* --- Пожертвование: кнопка в боковой панели кабинета и окно --- */

.dash-donate {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: none;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.dash-donate svg {
  flex: none;
  color: var(--accent-3);
  transition: transform 0.25s;
}

.dash-donate:hover {
  color: var(--fg);
  border-color: var(--accent-3);
  background: color-mix(in srgb, var(--accent-3) 10%, transparent);
}

.dash-donate:hover svg {
  transform: scale(1.18);
}

.donate {
  width: min(460px, calc(100vw - 32px));
  padding: 26px;
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  background: var(--surface-solid);
  color: var(--fg);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}

.donate::backdrop {
  background: rgba(7, 6, 15, 0.66);
  backdrop-filter: blur(4px);
}

.donate__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.donate__head h2 {
  flex: 1;
  font-family: var(--font);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0;
}

.donate__icon {
  display: inline-flex;
  color: var(--accent-3);
}

.donate__text {
  margin: 10px 0 18px;
  color: var(--muted);
}

.donate__card {
  display: grid;
  gap: 14px;
  justify-items: center;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.donate__card[hidden],
.donate__empty[hidden],
.donate__qr[hidden] {
  display: none;
}

.donate__net {
  font-weight: 700;
}

.donate__qr {
  width: 200px;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
}

.donate__qr svg {
  display: block;
  width: 100%;
  height: auto;
}

.donate__addr {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.donate__addr code {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 13px;
  overflow-wrap: anywhere;
  user-select: all;
}

.donate__warn {
  font-size: 13px;
  color: var(--warn);
  text-align: center;
}

.donate__empty {
  padding: 16px;
  border-radius: 14px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 14px;
}

@media (max-width: 860px) {
  .dash-donate {
    margin: 0;
    padding: 0 12px;
  }

  .dash-donate span {
    display: none;
  }
}

/* обзор: семь плиток, четыре в первом ряду и три пошире во втором */

.kpis--7 {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.kpis--7 .kpi {
  grid-column: span 3;
}

.kpis--7 .kpi:nth-child(n + 5) {
  grid-column: span 4;
}

@media (max-width: 1100px) {
  .kpis--7 .kpi,
  .kpis--7 .kpi:nth-child(n + 5) {
    grid-column: span 6;
  }

  .kpis--7 .kpi:last-child {
    grid-column: span 12;
  }
}

/* --- Риск-менеджмент --- */

.risk-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end; /* поля стоят на одной линии, даже если подпись в две строки */
}

.risk-form--calc {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.risk-form .field {
  margin: 0;
}

.risk-form .field input {
  font-family: var(--mono);
  font-weight: 700;
}

.meters {
  display: grid;
  gap: 18px;
}

.meter {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.meter__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.meter__top strong {
  color: var(--fg);
  white-space: nowrap;
}

.meter__bar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: var(--border);
}

.meter__bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--profit);
  transition: width 0.4s ease-out;
}

/* отметка, с которой начинается предупреждение */
.meter__bar b {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  border-radius: 1px;
  background: var(--faint);
}

.meter__status {
  font-size: 13px;
  font-weight: 600;
  color: var(--profit);
}

.meter--warn .meter__bar i {
  background: var(--warn);
}

.meter--warn .meter__status {
  color: var(--warn);
}

.meter--bad .meter__bar i {
  background: var(--loss);
}

.meter--bad .meter__status {
  color: var(--loss);
}

.tbl--plain {
  min-width: 0;
}

.tbl--plain th {
  color: var(--faint);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tbl--plain td:nth-child(2),
.tbl--plain th:nth-child(2) {
  white-space: normal;
}

@media (max-width: 860px) {
  .risk-form,
  .risk-form--calc {
    grid-template-columns: 1fr;
  }
}

/* --- Журнал: свои сделки, подсказки, авторазбор --- */

.demo-bar strong.is-own {
  color: var(--profit);
}

.demo-bar__actions {
  flex-wrap: wrap;
}

/* подсказка у названия метрики */
.hint {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  margin-left: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: 1px;
  cursor: help;
}

.insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.insight {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 20px;
  border-radius: 18px;
  text-align: left;
}

.insight h2 {
  font-family: var(--font);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}

.insight p {
  max-width: none;
  color: var(--muted);
}

.insight__tag {
  justify-self: start;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.insight--bad .insight__tag {
  background: var(--loss-soft);
  color: var(--loss);
}

.insight--good .insight__tag {
  background: var(--profit-soft);
  color: var(--profit);
}

.insight__tip {
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.insight__tip strong {
  color: var(--fg);
}

.hero-insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.hero-insights__cap {
  grid-column: 1 / -1;
  max-width: none;
  font-size: 13px;
  color: var(--faint);
  text-align: left;
}

.hero-insights .insight {
  padding: 16px;
}

.hero-insights .insight p {
  color: var(--fg);
  font-size: 15px;
}

/* окно загрузки */

.import {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.drop {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 28px 20px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.drop:hover,
.drop:focus-within {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.drop strong {
  font-size: 17px;
}

.drop span {
  max-width: 44ch;
  font-size: 14px;
  color: var(--muted);
}

.map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.map .field {
  margin: 0;
}

.map select,
.map input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-solid);
}

/* флажок с подписью (галочка «✓» в списках тарифа — это .check, не путать) */
.checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 14px 0;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}

.checkbox input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: none;
  accent-color: var(--accent);
}

.import-count {
  margin-bottom: 10px;
  font-size: 15px;
}

.import-count.is-bad {
  color: var(--loss);
}

.import-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

@media (max-width: 860px) {
  .insights,
  .hero-insights,
  .map {
    grid-template-columns: 1fr;
  }
}

/* --- Кнопка «Наверх» --- */

.to-top {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--grad);
  color: var(--btn-fg);
  box-shadow: 0 12px 30px -10px rgba(139, 108, 255, 0.8);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s, box-shadow 0.2s;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top.is-visible:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px -10px rgba(34, 211, 238, 0.75);
}

@media (prefers-reduced-motion: reduce) {
  .to-top {
    transition: none;
  }
}

/* --- Выпадающий список в кабинете --- */

.dd {
  position: relative;
}

.dd__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-solid);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dd__btn:hover,
.dd.is-open .dd__btn {
  border-color: var(--accent);
}

.dd.is-open .dd__btn {
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.dd__chev {
  color: var(--muted);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.dd.is-open .dd__chev {
  transform: rotate(180deg);
}

.dd__list {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 35;
  display: grid;
  gap: 2px;
  min-width: max(100%, 200px);
  max-height: min(420px, 60vh);
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface-solid);
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.55);
  overflow-y: auto;
  scrollbar-width: thin;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transform-origin: top left;
  transition: opacity 0.2s ease-out, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.2s;
}

.dd.is-open .dd__list {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.dd__opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, padding 0.2s;
}

.dd__opt:hover,
.dd__opt:focus-visible {
  background: var(--accent-soft);
  padding-left: 16px;
  outline: none;
}

.dd__check {
  color: var(--accent);
  opacity: 0;
}

.dd__opt[aria-selected="true"] {
  font-weight: 700;
}

.dd__opt[aria-selected="true"] .dd__check {
  opacity: 1;
}

/* список не должен вылезать за правый край у последних фильтров */
.dash-filters .dd:nth-last-child(-n + 2) .dd__list {
  left: auto;
  right: 0;
  transform-origin: top right;
}

@media (max-width: 860px) {
  .dash-filters .dd .dd__list,
  .dash-filters .dd:nth-last-child(-n + 2) .dd__list {
    left: 0;
    right: auto;
    transform-origin: top left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dd__list,
  .dd__chev,
  .dd__opt {
    transition: none;
  }
}

/* --- Подсказка к метрике: одна на страницу, поверх всех карточек --- */

.hint:hover,
.hint:focus {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.hint-pop {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 80;
  width: min(280px, calc(100vw - 16px));
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--fg);
  color: var(--bg);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: 0 20px 44px -18px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.16s ease-out, transform 0.2s ease-out, visibility 0.16s;
}

.hint-pop.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .hint-pop {
    transition: none;
  }
}

/* --- Настроение, «Что если», письмо, итог дня, профиль --- */

.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mood {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: none;
  color: var(--faint);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.mood:hover {
  border-color: var(--border-strong);
  color: var(--fg);
}

.mood--calm {
  border-color: transparent;
  background: var(--profit-soft);
  color: var(--profit);
}

.mood--greed {
  border-color: transparent;
  background: var(--warn-soft);
  color: var(--warn);
}

.mood--fear {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
}

.mood--anger {
  border-color: transparent;
  background: var(--loss-soft);
  color: var(--loss);
}

.twin {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: center;
}

.twin h2 {
  margin-bottom: 8px;
}

.twin p {
  margin-bottom: 14px;
  color: var(--muted);
}

.twin__nums {
  display: grid;
  gap: 10px;
}

.twin__nums > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--surface-2);
}

.wi-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 28px;
}

.wi-form .toolbar {
  margin: 8px 0 0;
}

.wi-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.wi-cap {
  margin: 0;
  max-width: 340px;
}

.chart .line.base {
  stroke: var(--faint);
  stroke-width: 2;
  stroke-dasharray: 6 6;
}

.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  max-width: none;
  font-size: 13px;
  color: var(--muted);
}

.legend span {
  display: inline-block;
  width: 26px;
  height: 0;
  border-top: 3px solid var(--accent);
}

.legend .legend__b {
  margin-left: 16px;
  border-top: 2px dashed var(--faint);
}

.letter {
  display: grid;
  gap: 14px;
  align-content: start;
}

.letter textarea {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  font: inherit;
  color: inherit;
  line-height: 1.5;
  resize: vertical;
}

.letter textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.letter .btn {
  justify-self: start;
}

.letter blockquote {
  margin: 0;
  padding: 16px 18px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  line-height: 1.6;
}

.letter--sealed {
  max-width: 620px;
}

.lab-dialog {
  width: min(600px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.lab-dialog .donate__head h2 {
  flex: 1;
}

.card-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
}

.lab-dialog .field input {
  width: 100%;
}

.lab-dialog .donate__addr {
  margin-top: 6px;
}

.profile-page {
  padding-top: 40px;
}

.profile-card {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 4vw, 34px);
}

.profile-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.profile-head h1 {
  font-size: clamp(24px, 4vw, 38px);
  overflow-wrap: anywhere;
}

.profile-head .big {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
}

.profile-stats {
  grid-template-columns: repeat(3, 1fr);
}

.profile-note {
  max-width: none;
  font-size: 13px;
  color: var(--faint);
}

.profile-card .btn {
  justify-self: start;
}

@media (max-width: 860px) {
  .twin,
  .wi-form {
    grid-template-columns: 1fr;
  }

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

.twin__note {
  grid-column: 1 / -1;
  max-width: none;
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* --- Часовой пояс, раздел «Настроение», турнир --- */

.tz-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--faint);
}

.tz-row span {
  flex: 1;
  min-width: 220px;
}

.tz-row .dd__list {
  max-height: 280px;
}

.mood-list {
  display: grid;
}

.mood-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto auto;
  align-items: center;
  gap: 12px 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.mood-row:last-child {
  border-bottom: 0;
}

.mood-row__info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 14px;
}

.mood-row__pnl {
  font-weight: 700;
  white-space: nowrap;
}

.mood-row__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.mood-row .mood {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.letter textarea,
#tour-links {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  font: inherit;
  font-size: 13px;
  color: inherit;
  resize: vertical;
}

.dash-panel .field input[type="text"] {
  width: 100%;
}

.tour th,
.tour td {
  text-align: left;
}

.tour tr.is-me {
  background: var(--accent-soft);
}

.tour__place {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  font-weight: 700;
}

.tour__place--1 {
  background: var(--grad);
  color: var(--btn-fg);
}

@media (max-width: 860px) {
  .mood-row {
    grid-template-columns: 1fr auto;
  }

  .mood-row__btns {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* --- Вкладки внутри «Сделок», раздел «Подключения» --- */

.kpis--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-solid);
  justify-self: start;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.tabs a:hover {
  color: var(--fg);
}

.tabs a[aria-current="page"] {
  background: var(--grad);
  color: var(--btn-fg);
}

.connect-status {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 20px;
  align-items: center;
}

.connect-status h2 {
  margin-bottom: 6px;
}

.connect-status .field,
.connect-card .field {
  margin: 0 0 12px;
}

.connect-status .field {
  margin: 0;
}

.connect-card .field input,
.connect-status .field input {
  width: 100%;
  font-family: var(--mono);
}

.connect-warn {
  max-width: none;
  margin: 0;
}

.steps {
  margin: 0 0 14px;
  padding-left: 20px;
  font-size: 14px;
  color: var(--muted);
}

.steps li {
  margin-bottom: 6px;
}

.steps li::marker {
  color: var(--accent);
  font-weight: 700;
}

.connect-card .import-actions {
  margin-top: 6px;
}

.connect-card .form-msg {
  margin: 0 0 12px;
}

@media (max-width: 1100px) {
  .kpis--3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .connect-status {
    grid-template-columns: 1fr;
  }
}

/* --- Метки разметки в таблице сделок --- */

.tag {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--fg);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.tag:hover {
  border-color: var(--accent);
}

.tag--none {
  background: none;
  color: var(--faint);
}

.tag--ok {
  border-color: transparent;
  background: var(--profit-soft);
  color: var(--profit);
}

.tag--bad {
  border-color: transparent;
  background: var(--loss-soft);
  color: var(--loss);
}

/* таблица сделок стала шире: метки не должны сжиматься */
.tbl:not(.tbl--plain) {
  min-width: 980px;
  font-size: 12.5px;
}

.tbl:not(.tbl--plain) th,
.tbl:not(.tbl--plain) td {
  padding: 10px 4px;
}

.tbl:not(.tbl--plain) .tag,
.tbl:not(.tbl--plain) .mood {
  padding: 0 8px;
  font-size: 11.5px;
}

.tbl td:has(.tag),
.tbl td:has(.mood) {
  text-align: left;
}

/* --- Таблица сделок: ровные колонки разметки и список выбора метки --- */

.tbl th.th-left,
.tbl td:has(.tag),
.tbl td:has(.mood) {
  text-align: left;
}

/* заголовок стоит над текстом метки: отступ равен внутреннему отступу метки */
.tbl th.th-left button,
.tbl th .th-label {
  padding-left: 9px;
}

.tbl th .th-label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--faint);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tbl:not(.tbl--plain) .tag,
.tbl:not(.tbl--plain) .mood {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  line-height: 1;
}

.pop-menu {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 70;
  display: grid;
  gap: 2px;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface-solid);
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transform-origin: top left;
  transition: opacity 0.18s ease-out, transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.18s;
}

.pop-menu[data-up="1"] {
  transform: translateY(8px) scale(0.97);
  transform-origin: bottom left;
}

.pop-menu.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .pop-menu {
    transition: none;
  }
}

/* --- Настроение рынка: индексы страха и жадности на главной --- */

.mood-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mood-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.mood-card h3 {
  font-size: 16px;
}

.mood-gauge {
  position: relative;
  width: min(100%, 300px);
  margin: 0 auto;
}

.mood-gauge svg {
  display: block;
  width: 100%;
  overflow: visible;
}

.mood-arc {
  fill: none;
  stroke-width: 14;
  stroke-linecap: round;
}

.mood-needle {
  transform: rotate(-90deg);
  transform-origin: 100px 100px;
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.mood-needle line {
  stroke: var(--fg);
  stroke-width: 3;
  stroke-linecap: round;
}

.mood-needle circle {
  fill: var(--fg);
}

.mood-value {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin-top: 8px;
}

.mood-value .mono {
  font-size: 44px;
  font-weight: 600;
  line-height: 1;
}

.mood-label {
  font-weight: 600;
}

.mood-label.flat {
  color: var(--warn);
}

.mood-hist {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.mood-hist dt {
  font-size: 12.5px;
  color: var(--faint);
}

.mood-hist dd {
  margin: 2px 0 0;
  font-size: 18px;
}

.mood-src,
.mood-empty {
  margin: 0;
  font-size: 12.5px;
  color: var(--faint);
}

.mood-empty {
  min-height: 120px;
  font-size: 14px;
}

@media (max-width: 720px) {
  .mood-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mood-needle {
    transition: none;
  }
}

/* --- Свой вариант метки в списке таблицы сделок --- */

.dd__opt--add {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 10px 10px;
  color: var(--accent);
}

.pop-menu__form {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.pop-menu__form input {
  flex: 1;
  min-width: 0;
  width: 150px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 14px;
}

.pop-menu__form input::placeholder {
  color: var(--faint);
}

.pop-menu__form input:focus {
  border-color: var(--accent);
  outline: none;
}

.mood--custom {
  border-color: transparent;
  background: var(--surface-2);
  color: var(--fg);
}

/* ===== Версия 3: карточка сделки, стратегии, тильтметр, резервная копия ===== */

.nowrap {
  white-space: nowrap;
}

.side.unk {
  background: var(--surface-2);
  color: var(--faint);
}

/* таблица сделок: выравнивание по классу, закреплённая первая колонка */
.tbl th.l,
.tbl td.l {
  text-align: left;
}

.tbl--trades th:first-child,
.tbl--trades td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface-solid);
  box-shadow: 1px 0 0 var(--border);
}

.tbl--trades tbody tr {
  cursor: pointer;
}

.trade-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 4px;
  cursor: pointer;
}

.trade-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.limit-badge {
  display: inline-flex;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--loss-soft);
  color: var(--loss);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  vertical-align: 1px;
}

.trade-sum {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.trade-sum > div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-2);
}

.trade-sum strong {
  font-size: 18px;
}

.trade-unmarked {
  margin: 0 0 10px;
}

.insight__go {
  justify-self: start;
}

/* кнопка выбора файла: сама подпись, поле спрятано */
.file-btn {
  position: relative;
  cursor: pointer;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

.cal-cell.is-today {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.exchanges__note {
  margin-top: 16px;
  max-width: 70ch;
  font-size: 14px;
  color: var(--muted);
}

/* --- Тильтметр и чек-лист --- */

.tilt {
  display: grid;
  gap: 10px;
}

.tilt__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.tilt__score {
  font-size: 34px;
  line-height: 1;
}

.tilt__score small {
  font-size: 15px;
  color: var(--faint);
}

.tilt .meter__bar i {
  background: var(--profit);
}

.tilt--warn .meter__bar i {
  background: var(--warn);
}

.tilt--warn .tilt__verdict {
  color: var(--warn);
}

.tilt--bad .meter__bar i {
  background: var(--loss);
}

.tilt__verdict {
  font-weight: 700;
  color: var(--profit);
}

.tilt--bad .tilt__verdict {
  color: var(--loss);
}

.tilt__why {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  color: var(--muted);
}

.checklist {
  display: grid;
  gap: 2px;
  margin: 8px 0 4px;
}

.checklist .checkbox {
  margin: 6px 0;
  color: var(--fg);
}

.checklist__result {
  font-size: 14px;
  font-weight: 600;
}

/* --- Стратегии --- */

.pb-card textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  font: inherit;
  font-size: 14px;
  color: inherit;
  line-height: 1.5;
  resize: vertical;
}

.pb-card textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.pb-card--add h2 {
  margin-bottom: 8px;
}

/* --- Карточка сделки --- */

.trade-dialog {
  width: min(860px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}

.trade-dialog .donate__head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.trade-dialog .icon-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

.trade-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 700;
}

.trade-top__pnl {
  font-size: 30px;
}

.trade-chart {
  min-height: 120px;
  margin-bottom: 14px;
  padding: 10px;
  border-radius: 16px;
  background: var(--surface-2);
}

.trade-svg .c-up line,
.trade-svg .c-up rect {
  stroke: var(--profit);
  fill: var(--profit);
}

.trade-svg .c-down line,
.trade-svg .c-down rect {
  stroke: var(--loss);
  fill: var(--loss);
}

.trade-svg .c-up,
.trade-svg .c-down {
  opacity: 0.75;
}

.trade-svg .lvl {
  stroke-width: 1.5;
  stroke-dasharray: 6 5;
}

.trade-svg .mk {
  stroke-width: 1;
  opacity: 0.5;
}

.trade-svg .in {
  stroke: var(--accent-2);
  fill: var(--accent-2);
}

.trade-svg .win {
  stroke: var(--profit);
  fill: var(--profit);
}

.trade-svg .loss {
  stroke: var(--loss);
  fill: var(--loss);
}

.trade-svg .lvl-t {
  stroke: none;
  font-weight: 700;
}

.trade-svg .dot-m {
  stroke: var(--surface-solid);
  stroke-width: 2;
}

.trade-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
}

.trade-h {
  margin: 20px 0 10px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.trade-tags {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  gap: 8px 14px;
}

.trade-tags > button {
  justify-self: start;
}

.trade-tags__k {
  font-size: 14px;
  color: var(--muted);
}

.trade-dialog textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  font: inherit;
  color: inherit;
  line-height: 1.5;
  resize: vertical;
}

.trade-dialog textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.shot {
  position: relative;
}

.shot__img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2) center / cover no-repeat;
  cursor: zoom-in;
}

.shot__del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(7, 6, 15, 0.7);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.shots__actions {
  align-items: center;
  justify-content: space-between;
}

.shot-full {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 14px;
  border-radius: 14px;
}

/* --- Узкие экраны --- */

@media (max-width: 860px) {
  /* меню кабинета листается вбок: правый край подсвечивает, что пункты продолжаются */
  .dash-side {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
    padding-right: 40px;
  }

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

  .trade-grid {
    grid-template-columns: 1fr;
  }
}

/* таблица сделок на телефоне превращается в карточки */
@media (max-width: 720px) {
  .tbl--trades {
    min-width: 0 !important;
  }

  .tbl--trades thead {
    display: none;
  }

  .tbl--trades,
  .tbl--trades tbody {
    display: block;
  }

  .tbl--trades tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--border);
  }

  .tbl--trades td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 0 !important;
    border: 0;
    text-align: left;
    white-space: normal;
  }

  .tbl--trades td::before {
    content: attr(data-label);
    font-family: var(--font);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--faint);
  }

  .tbl--trades td:first-child {
    position: static;
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    background: none;
    box-shadow: none;
    font-size: 16px;
  }

  .tbl--trades td:first-child::before {
    display: none;
  }
}


/* ===== Версия 3.1: единые размеры, выравнивание, новые элементы ===== */

:root {
  --r-panel: 18px; /* панели и плитки кабинета */
  --r-tile: 14px; /* вложенные плитки внутри панели */
  --r-field: 12px; /* поля ввода */
}

.kpi,
.dash-panel,
.insight {
  border-radius: var(--r-panel);
}

.trade-sum > div,
.ls > div,
.mc-stats > div,
.twin__nums > div,
.mock-stats div {
  border-radius: var(--r-tile);
}

.field input,
.map select,
.map input,
.letter textarea,
.pb-card textarea,
.trade-dialog textarea,
#tour-links,
.search {
  border-radius: var(--r-field);
}

/* заголовок первого экрана: две строки, без висящих слов */
.hero h1 span {
  display: block;
  text-wrap: balance;
}

/* ценник текущей цены на фоне не наезжает на подписи уровней у правого края */
.backdrop__now span {
  right: 76px;
}

/* котировки: семь колонок делят ширину поровну, подпись не обрезается */
.ticker {
  grid-template-columns: repeat(7, minmax(128px, 1fr));
}

.ticker-item .pair {
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticker-head .badge {
  margin-left: 8px;
}

/* индекс настроения без данных — короткая карточка, а не пустой прямоугольник */
.mood-empty {
  min-height: 0;
}

/* карточки выводов: кнопка всегда внизу карточки */
.insight {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.insight h2 {
  font-size: 17px;
}

.insight__go {
  align-self: flex-start;
  margin-top: auto;
}

/* показатели: значения стоят на одной линии, даже если подпись в две строки */
.kpi {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi__value {
  margin-top: auto;
}

/* заголовок внутри панели */
.sub-h {
  margin: 22px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.sub-h--first {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* лонг и шорт: две колонки с мини-статистикой */
.ls > div {
  align-content: start;
}

.ls .stat-list {
  margin-top: 6px;
}

.ls .stat-list > div {
  padding: 7px 0;
  font-size: 13.5px;
}

/* срезы: название и вторая строка мелким шрифтом */
.brk__row {
  grid-template-columns: minmax(120px, 1.2fr) 1.3fr auto auto;
}

.brk__label small {
  display: block;
  font-size: 12px;
  color: var(--faint);
}

/* календарь: дни со сделками открываются кликом */
.cal-cell[data-day] {
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.cal-cell[data-day]:hover,
.cal-cell[data-day]:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
}

/* таблица сделок: прибыль и доход в одной ячейке, поиск над таблицей */
.tbl--trades {
  min-width: 880px !important;
}

.pnl-cell {
  display: inline-grid;
  justify-items: end;
  line-height: 1.25;
}

.pnl-cell small {
  font-size: 11px;
  opacity: 0.75;
}

.trade-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.search {
  flex: 1;
  min-width: 220px;
  max-width: 420px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  font-size: 14px;
}

.search:focus {
  border-color: var(--accent);
  outline: none;
}

.search::placeholder {
  color: var(--faint);
}

/* Монте-Карло: итоги плитками под графиком */
.mc-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.mc-stats > div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  background: var(--surface-2);
}

.mc-stats strong {
  font-size: 17px;
}

/* «Что если»: две колонки настроек */
.wi-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.wi-col {
  display: grid;
  gap: 18px;
  align-content: start;
}

.wi-cap .dash-note {
  margin-top: 0;
}

/* «Подключения»: один размер текста во всех карточках */
.connect-card .muted {
  font-size: 14px;
  margin-bottom: 10px;
}

@media (max-width: 1100px) {
  .mc-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .wi-form {
    grid-template-columns: 1fr;
  }

  .search {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .tbl--trades {
    min-width: 0 !important;
  }

  .pnl-cell {
    justify-items: start;
  }

  .hero-badge {
    font-size: 13px;
  }
}

/* ячейка в две строки: основное значение и мелкая подпись под ним */
.two-line {
  display: inline-grid;
  justify-items: start;
  gap: 3px;
  line-height: 1.2;
}

.two-line small {
  font-size: 11px;
  color: var(--faint);
}

.two-line .side {
  padding: 1px 8px;
  font-size: 11px;
}

.tbl--trades {
  min-width: 760px !important;
}

.tbl--trades .tag,
.tbl--trades .mood {
  padding: 0 9px !important;
}

@media (max-width: 720px) {
  .tbl--trades {
    min-width: 0 !important;
  }

  .tbl--trades td:first-child .two-line {
    grid-auto-flow: column;
    align-items: center;
    gap: 10px;
  }
}

.tbl--trades th button,
.tbl--trades th .th-label {
  font-size: 11px;
  letter-spacing: 0.02em;
}

.insight__tag {
  align-self: flex-start;
}

/* календарь на телефоне: все семь дней видны без прокрутки, суммы короче */
@media (max-width: 720px) {
  .cal-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(0, 1.1fr);
    gap: 3px;
    min-width: 0;
  }

  .cal-grid--head {
    font-size: 10px;
    letter-spacing: 0;
  }

  .cal-cell {
    min-height: 54px;
    padding: 5px 4px;
    border-radius: 8px;
    font-size: 10.5px;
    overflow: hidden;
  }

  .cal-cell__p {
    font-size: 10px;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
  }

  .cal-cell__n {
    display: none;
  }

  .cal-cell--week .cal-cell__n {
    display: none;
  }
}

.cal-cell__s {
  display: none;
  font-size: 10.5px;
  font-weight: 700;
}

.cal-cell.pos .cal-cell__s {
  color: var(--profit);
}

.cal-cell.neg .cal-cell__s {
  color: var(--loss);
}

@media (max-width: 720px) {
  .cal-cell .cal-cell__p {
    display: none;
  }

  .cal-cell__s {
    display: block;
  }
}

/* ---------- v3.2: турнир — шаги с иконкой и скрытыми ссылками ---------- */
.tstep {
  padding: 0;
  overflow: hidden;
}

.tstep__head {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px 22px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tstep__head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--r-panel);
}

.tstep__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
}

.tstep__text,
.tlink__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.tstep__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.tstep__sub,
.tlink__text small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.tstep__chev {
  flex: none;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.tstep.is-folded .tstep__chev {
  transform: rotate(-90deg);
}

.tstep__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 22px;
  padding: 20px 0 22px;
  border-top: 1px solid var(--border);
}

.tstep__body .field {
  margin: 0;
}

.tstep__body .field input,
.tstep__body .field textarea {
  min-height: 52px;
  border-radius: 14px;
  font-size: 15px;
}

.tstep__body .dash-note {
  margin: 0;
}

.tlink,
.trival {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tlink__icon {
  flex: none;
  color: var(--accent);
}

.tlink__text b {
  font-size: 16px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tlink__copy {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s ease;
}

.tlink__copy:hover {
  background: var(--accent-soft);
}

.tlink__copy:focus-visible,
.tstep__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tstep__btn {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tstep__btn:hover {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
}

.trivals {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trival {
  padding: 10px 10px 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-tile);
  background: var(--surface);
}

.trival__ava {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.tstep__empty {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-tile);
  color: var(--muted);
  text-align: center;
}

.tsteps {
  align-items: start;
}

.tstep--wide {
  margin-top: 18px;
}

@media (max-width: 560px) {
  .tstep__head {
    gap: 14px;
    padding: 18px 16px;
  }

  .tstep__content {
    margin: 0 16px;
  }

  .tstep__icon {
    width: 48px;
    height: 48px;
  }

  .tstep__title {
    font-size: 17px;
  }
}

.tstep__body .field textarea {
  display: block;
  width: 100%;
  min-height: 92px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: inherit;
  font-family: var(--font);
  line-height: 1.45;
  resize: vertical;
}

.tstep__body .field textarea::placeholder {
  color: var(--faint);
}

.tstep__body .field textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.tstep__warn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-tile);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 14px;
}

/* ---------- v3.2: меню кабинета на телефоне — гамбургер ---------- */
.dash-menu {
  display: contents;
}

.dash-current,
.dash-burger {
  display: none;
}

@media (max-width: 860px) {
  .dash-side {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .dash-side .logo {
    display: inline-flex;
    flex: none;
    font-size: 0;
    gap: 0;
  }

  .dash-current {
    display: block;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-weight: 700;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dash-burger {
    display: inline-grid;
    place-items: center;
    flex: none;
  }

  .dash-burger__close,
  .dash-side.menu-open .dash-burger__open {
    display: none;
  }

  .dash-side.menu-open .dash-burger__close {
    display: block;
  }

  .dash-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 14px;
    max-height: calc(100dvh - 64px);
    padding: 12px 16px 20px;
    overflow-y: auto;
    border-bottom: 1px solid var(--border);
    background: var(--surface-solid);
    box-shadow: 0 24px 40px -20px rgba(0, 0, 0, 0.55);
  }

  .dash-side.menu-open .dash-menu {
    display: flex;
    animation: dash-menu-in 0.18s ease-out;
  }

  .dash-menu .dash-nav {
    display: grid;
    gap: 2px;
  }

  .dash-menu .dash-nav a {
    min-height: 48px;
    white-space: normal;
  }

  .dash-menu .dash-side__foot {
    margin: 0;
    padding: 12px 6px 0;
    border-top: 1px solid var(--border);
  }

  .dash-menu .dash-donate {
    padding: 0 14px;
  }

  .dash-menu .dash-donate span {
    display: inline;
  }
}

@keyframes dash-menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dash-side.menu-open .dash-menu {
    animation: none;
  }
}

/* ---------- v3.2: телефон — заголовки разделов и призыв по центру ---------- */
@media (max-width: 720px) {
  .block-head {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
  }

  .block-head h2,
  .plan-copy h2,
  .cta-band h2 {
    text-wrap: balance;
  }

  .how-tabs {
    justify-content: center;
  }

  .plan-copy {
    text-align: center;
  }

  .plan-copy p {
    margin-inline: auto;
  }

  .cta-band {
    text-align: center;
  }

  .cta-band h2,
  .cta-band p {
    margin-inline: auto;
  }

  .cta-band__actions {
    flex-direction: column;
    align-items: center;
  }

  .cta-band__actions .btn {
    justify-content: center;
    width: 100%;
    max-width: 320px;
  }
}

/* ---------- v3.2: подвал на телефоне — компактно и по центру ---------- */
@media (max-width: 720px) {
  .site-footer {
    margin-top: 32px;
    padding: 28px 0 96px; /* снизу место под кнопку «наверх» */
    text-align: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 6px;
  }

  .footer-brand p {
    max-width: 32ch;
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.5;
  }

  /* группы ссылок — строки слов через точку, без отдельных заголовков */
  .footer-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .footer-col {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0 6px;
  }

  .footer-col a {
    min-height: 36px;
    padding: 0 4px;
    font-size: 14.5px;
  }

  .footer-col a + a::before {
    content: "·";
    margin-right: 10px;
    color: var(--faint);
  }

  .footer-col + .footer-col {
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .site-footer .disclaimer {
    max-width: 40ch;
    margin: 20px auto 0;
    color: var(--faint);
    font-size: 12.5px;
    line-height: 1.5;
  }

  .footer-copy {
    margin-top: 12px;
    font-size: 12.5px;
  }
}

.f-short {
  display: none;
}

@media (max-width: 720px) {
  .footer-col .f-full {
    display: none;
  }

  .footer-col .f-short {
    display: inline;
  }
}

@media (max-width: 720px) {
  .footer-col {
    gap: 0;
  }

  .footer-col a {
    padding: 0 3px;
    font-size: 14px;
  }

  .footer-col a + a::before {
    margin: 0 9px 0 3px;
  }
}

@media (max-width: 720px) {
  .footer-col {
    gap: 0 18px;
  }

  .footer-col a {
    padding: 0;
  }

  .footer-col a + a::before {
    content: none;
  }
}

/* ---------- v3.2: сворачиваемые панели обзора на телефоне ---------- */
.fold {
  padding: 0;
}

.fold__h {
  margin: 0;
  font-size: inherit;
}

.fold__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 16px 20px;
  border: 0;
  border-radius: inherit;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.fold__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.fold__btn .dd__chev {
  flex: none;
  transition: transform 0.25s ease;
}

.fold.is-open .fold__btn .dd__chev {
  transform: rotate(180deg);
}

.fold__pad {
  padding: 0 20px 20px;
}

/* свёрнутые панели идут плотной стопкой */
.dash-grid:has(> .fold) {
  gap: 10px;
}



/* ============================================================
   v3.3 Анимации интерфейса
   Только transform и opacity, короткие,
   без бесконечных циклов, кроме фона плашки-призыва, пока она видна.
   Всё выключается системной настройкой «уменьшить движение».
   ============================================================ */

:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 1. Появление раздела кабинета: карточки по очереди, графики «прорисовываются» --- */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* график проявляется чуть позже своей карточки: только прозрачность, без перерисовки */
@keyframes chart-in {
  from {
    opacity: 0;
  }
}

.is-entering > * {
  animation: rise-in 0.5s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 55ms);
}

/* вкладки «Сделок» и полоса плиток стоят на месте, плитки появляются по одной */
.is-entering > .tabs,
.is-entering > .kpis {
  animation: none;
}

.is-entering > .kpis > * {
  animation: rise-in 0.5s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 55ms + var(--k, 0) * 45ms);
}

.is-entering > .kpis > :nth-child(2) { --k: 1; }
.is-entering > .kpis > :nth-child(3) { --k: 2; }
.is-entering > .kpis > :nth-child(4) { --k: 3; }
.is-entering > .kpis > :nth-child(5) { --k: 4; }
.is-entering > .kpis > :nth-child(6) { --k: 5; }
.is-entering > .kpis > :nth-child(n + 7) { --k: 6; }

.is-entering .chart {
  animation: chart-in 0.6s var(--ease-soft) backwards;
  animation-delay: calc(var(--i, 0) * 55ms + 180ms);
}

/* после смены фильтра содержимое мягко проявляется, без сдвигов */
@keyframes refresh-in {
  from {
    opacity: 0.7;
  }
}

.is-refresh .dash-panel,
.is-refresh .kpi,
.is-refresh .tbl-scroll {
  animation: refresh-in 0.3s var(--ease-soft);
}

/* --- 3. Аккордеоны: плавная высота через grid-строки, стрелка поворачивается --- */

.acc {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition:
    grid-template-rows 0.32s var(--ease-out),
    opacity 0.22s var(--ease-soft),
    visibility 0s linear 0.32s;
}

.fold.is-open > .acc,
.tstep:not(.is-folded) > .acc {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition:
    grid-template-rows 0.36s var(--ease-out),
    opacity 0.28s var(--ease-soft) 0.04s,
    visibility 0s;
}

.acc__clip {
  min-height: 0;
  overflow: hidden;
}

.tstep__chev,
.fold__btn .dd__chev {
  transition: transform 0.3s var(--ease-out);
}

.tstep__head,
.fold__btn {
  transition: background-color 0.2s var(--ease-soft);
}

.tstep__head:hover,
.fold__btn:hover {
  background-color: color-mix(in srgb, var(--accent) 5%, transparent);
}

/* --- 4. Микроанимации кнопок --- */

.btn,
.icon-btn,
.chip,
.dash-donate,
.tstep__btn,
.tlink__copy,
.dd__btn,
.mock-tabs button,
.tabs a,
.lang-switch button {
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.18s var(--ease-out),
    box-shadow 0.3s var(--ease-soft),
    background-color 0.2s var(--ease-soft),
    border-color 0.2s var(--ease-soft),
    color 0.2s var(--ease-soft),
    outline-offset 0.15s var(--ease-out);
}

.btn:active,
.icon-btn:active,
.chip:active,
.dash-donate:active,
.tstep__btn:active,
.tlink__copy:active,
.dd__btn:active,
.mock-tabs button:active,
.tabs a:active {
  transform: scale(0.96);
  transition-duration: 0.08s;
}

.btn-primary:active,
.btn-dark:active {
  transform: translateY(0) scale(0.97);
}

/* кольцо фокуса «натягивается» к кнопке */
@keyframes focus-in {
  from {
    outline-offset: 6px;
    outline-color: transparent;
  }
}

:is(.btn, .icon-btn, .chip, .dd__btn, .mock-tabs button, .tabs a, .dash-nav a, .tstep__btn, .tlink__copy, .fold__btn, .tstep__head):focus-visible {
  animation: focus-in 0.2s var(--ease-out);
}

/* состояние успешного действия: короткий «щелчок» и зелёное кольцо */
@keyframes ok-pop {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.07);
  }
  100% {
    transform: scale(1);
  }
}

.is-ok {
  animation: ok-pop 0.45s var(--ease-out);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--profit) 40%, transparent) !important;
}

.is-ok:not(.btn-primary) {
  border-color: var(--profit);
  background-color: var(--profit-soft);
  color: var(--profit);
}

/* нажатый переключатель после перерисовки мягко встаёт на место */
@keyframes press-in {
  from {
    opacity: 0.6;
    transform: scale(0.92);
  }
}

.press-in {
  animation: press-in 0.3s var(--ease-out);
}

/* --- 5. Свечение главных кнопок при наведении --- */

.btn-primary {
  transition:
    transform 0.2s var(--ease-out),
    box-shadow 0.35s var(--ease-soft);
}

@media (hover: hover) {
  .btn-primary:hover {
    box-shadow:
      0 0 0 1px rgba(164, 139, 255, 0.35),
      0 14px 34px -10px rgba(139, 108, 255, 0.7),
      0 0 30px -6px rgba(34, 211, 238, 0.5);
  }

  .tstep__btn:hover {
    box-shadow: 0 8px 26px -12px rgba(139, 108, 255, 0.7);
  }
}

/* блик по кнопке двигается через transform, а не через left */
.btn-primary::after {
  left: 0;
  transform: translateX(-160%) skewX(-20deg);
  transition: transform 0.7s var(--ease-soft);
}

.btn-primary:hover::after {
  left: 0;
  transform: translateX(330%) skewX(-20deg);
}

/* --- 6. Фон плашки-призыва едва заметно переливается, только пока она на экране --- */

.cta-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.cta-band::before {
  content: "";
  position: absolute;
  inset: -40%;
  z-index: -1;
  background:
    radial-gradient(40% 50% at 30% 40%, rgba(255, 255, 255, 0.22), transparent 70%),
    radial-gradient(35% 45% at 70% 65%, rgba(34, 211, 238, 0.25), transparent 70%);
  opacity: 0.8;
  pointer-events: none;
  animation: band-drift 18s ease-in-out infinite alternate;
  animation-play-state: paused;
}

.cta-band.is-live::before {
  animation-play-state: running;
}

@keyframes band-drift {
  from {
    transform: translate3d(-6%, -4%, 0) rotate(0deg);
  }
  to {
    transform: translate3d(6%, 4%, 0) rotate(8deg);
  }
}

/* --- Всплывающее сообщение появляется плавно --- */

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
}

.toast {
  animation: toast-in 0.3s var(--ease-out);
}

/* --- Уменьшенное движение: без анимаций и переходов --- */

@media (prefers-reduced-motion: reduce) {
  .is-entering > *,
  .is-entering > .kpis > *,
  .is-entering .chart,
  .is-refresh .dash-panel,
  .is-refresh .kpi,
  .is-refresh .tbl-scroll,
  .is-ok,
  .press-in,
  .toast,
  .cta-band::before,
  :focus-visible {
    animation: none !important;
  }

  .acc {
    transition: none !important;
  }
}

/* ---------- Смена темы кругом от кнопки (см. toggleTheme в app.js) ---------- */

:root[data-theme-vt="active"]::view-transition-old(root),
:root[data-theme-vt="active"]::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

:root[data-theme-vt="active"]::view-transition-new(root) {
  clip-path: var(--theme-vt-clip-from);
}

/* ---------- v3.4: экран загрузки страницы — волна колец ----------
   Внутренний слой проявляется только через 0,3 с: на быстрой загрузке экран не мелькает.
   Внешний слой плавно гаснет, когда страница готова (класс is-done из app.js),
   а если скрипт не сработал — сам прячется через 4 с. */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-soft, ease);
  animation: loader-hide 0.35s 4s forwards;
}

.page-loader.is-done {
  opacity: 0;
}

.page-loader__in {
  display: grid;
  place-items: center;
  height: 100%;
  background: var(--bg);
  animation: loader-show 0.25s 0.3s both;
}

@keyframes loader-show {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes loader-hide {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.page-loader__wave {
  position: relative;
  width: 96px;
  height: 96px;
}

.page-loader__wave span {
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow:
    0 0 14px -2px rgba(139, 108, 255, 0.7),
    inset 0 0 12px -4px rgba(34, 211, 238, 0.6);
  opacity: 0;
  transform: scale(0.25);
  animation: loader-wave 1.8s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.page-loader__wave span:nth-child(2) {
  animation-delay: 0.6s;
}

.page-loader__wave span:nth-child(3) {
  animation-delay: 1.2s;
}

@keyframes loader-wave {
  0% {
    opacity: 0.9;
    transform: scale(0.25);
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

.page-loader__wave i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 24px 2px rgba(139, 108, 255, 0.65);
  animation: loader-core 1.8s ease-in-out infinite;
}

@keyframes loader-core {
  50% {
    transform: scale(1.2);
  }
}

/* ---------- v3.4: бургер — полоски превращаются в крестик с неоновым свечением ---------- */
.burger-lines {
  position: relative;
  display: block;
  width: 18px;
  height: 14px;
}

.burger-lines span {
  position: absolute;
  top: 6px;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease,
    box-shadow 0.3s ease;
}

.burger-lines span:nth-child(1) {
  transform: translateY(-6px);
}

.burger-lines span:nth-child(3) {
  transform: translateY(6px);
}

[aria-expanded="true"] > .burger-lines span {
  box-shadow: 0 0 8px rgba(164, 139, 255, 0.9);
}

[aria-expanded="true"] > .burger-lines span:nth-child(1) {
  transform: rotate(45deg);
}

[aria-expanded="true"] > .burger-lines span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0.2);
}

[aria-expanded="true"] > .burger-lines span:nth-child(3) {
  transform: rotate(-45deg);
}

.burger[aria-expanded="true"],
.dash-burger[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow:
    0 0 0 3px var(--accent-soft),
    0 0 22px -4px rgba(139, 108, 255, 0.7);
}

@media (prefers-reduced-motion: reduce) {
  .page-loader__wave span,
  .page-loader__wave i {
    animation: none;
  }

  .page-loader__wave span {
    display: none;
  }

  .burger-lines span {
    transition: none;
  }
}

/* ---------- v3.5: раздел «Новости» в кабинете, настроение рынка в обзоре ---------- */
.news-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 1100px) {
  .news-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.news-layout .toolbar {
  margin-bottom: 12px;
}

.dash-events .event {
  grid-template-columns: 52px 44px 12px 1fr;
}

/* карточки индексов внутри панели обзора — без второй рамки и тени */
.dash-panel .mood-card {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: none;
}

@media (max-width: 720px) {
  .dash-panel .mood-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* события на странице новостей */
.news-events {
  margin-top: 40px;
}

/* ---------- v3.5: аккаунт (временный, в этом браузере) ---------- */
.header-acct,
.dash-account,
.menu-acct {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-acct:empty,
.dash-account:empty {
  display: none;
}

.acct {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.acct__ava {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad);
  color: var(--btn-fg);
  font-size: 14px;
  font-weight: 700;
}

.acct__name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-account {
  justify-content: space-between;
  padding: 0 6px;
}

.dash-account .acct {
  flex: 1;
}

.menu-acct {
  justify-content: space-between;
}

.notice--ok {
  border-color: color-mix(in srgb, var(--profit) 40%, transparent);
  background: var(--profit-soft);
  color: var(--profit);
}

/* ---------- публичный профиль: ссылка скрыта, как в турнире друзей ---------- */
.lab-dialog .tlink {
  margin: 4px 0 14px;
}

.profile-actions {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.lab-dialog .tlink__text b {
  white-space: normal;
}

/* ---------- v3.7: выделенный текст переливается, как Aurora Text (Magic UI) ----------
   Градиент шире текста и медленно сдвигается; цвета берутся из темы.
   Анимируется только положение фона у нескольких слов, при «уменьшить движение» стоит. */
@keyframes aurora {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.grad-text,
.hero h1 .accent {
  background-image: linear-gradient(120deg, var(--accent-3), var(--accent), var(--accent-2), var(--accent), var(--accent-3));
  background-size: 250% 100%;
  animation: aurora 8s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .grad-text,
  .hero h1 .accent {
    animation: none;
    background-position: 30% 50%;
  }
}

/* ============================================================
   v3.6 — подсказки для новичков (guide.js)
   ============================================================ */
.guide-slot { display: grid; gap: 14px; margin-bottom: 18px; }

.guide-card {
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: var(--r-panel);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface-solid)), color-mix(in srgb, var(--accent-2) 7%, var(--surface-solid)));
}
.guide-card__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.guide-card h2 { font-family: "Unbounded", sans-serif; font-size: 18px; margin: 0 0 4px; }
.guide-card__head .muted { font-size: 14px; max-width: 52ch; }
.guide-card__tools { display: flex; align-items: center; gap: 8px; }
.guide-bar { height: 6px; margin: 16px 0 6px; border-radius: 99px; background: var(--border); overflow: hidden; }
.guide-bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); transition: width 0.6s var(--ease-out); }
.guide-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.guide-step { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 12px; padding: 10px 8px; border-radius: var(--r-tile); transition: background 0.2s; }
.guide-step.is-next { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.guide-step__mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--border); font: 600 13px "JetBrains Mono", monospace; color: var(--muted); }
.guide-step.is-next .guide-step__mark { border-color: var(--accent); color: var(--accent); }
.guide-step.is-done .guide-step__mark { border-color: transparent; background: var(--grad); color: #fff; }
.guide-step__body { display: grid; gap: 2px; min-width: 0; }
.guide-step__body b { font-size: 15px; }
.guide-step__body span { font-size: 13.5px; color: var(--muted); }
.guide-step.is-done .guide-step__body b { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); color: var(--muted); }
.guide-step__ok { font-size: 13px; color: var(--accent-2); font-weight: 600; }

.guide-tip { display: grid; grid-template-columns: 28px 1fr auto; align-items: start; gap: 12px; padding: 12px 12px 12px 14px; border: 1px solid var(--border); border-left: 3px solid var(--accent-2); border-radius: var(--r-tile); background: var(--surface-solid); transition: opacity 0.24s, transform 0.24s var(--ease-out); }
.guide-tip.is-out { opacity: 0; transform: translateY(-6px); }
.guide-tip p { margin: 3px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.guide-tip__icon { display: grid; place-items: center; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; background: color-mix(in srgb, var(--accent-2) 18%, transparent); color: var(--accent-2); font: italic 700 14px Georgia, serif; }

.dash-help { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; background: none; color: var(--muted); font: inherit; font-size: 14.5px; font-weight: 600; text-align: left; white-space: nowrap; cursor: pointer; text-decoration: none; transition: color 0.2s, border-color 0.2s, background 0.2s; }
.dash-help:hover { color: var(--fg); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.dash-help__q { display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--grad); color: #fff; font: 700 12px "JetBrains Mono", monospace; }

/* Тур: затемнение даёт тень вокруг подсвеченной области */
.tour { position: fixed; inset: 0; z-index: 400; pointer-events: none; }
.tour.no-spot { background: rgba(5, 4, 14, 0.72); pointer-events: auto; }
.tour__spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(5, 4, 14, 0.72), 0 0 0 2px var(--accent); pointer-events: none; opacity: 0; transition: left 0.35s var(--ease-out), top 0.35s var(--ease-out), width 0.35s var(--ease-out), height 0.35s var(--ease-out), opacity 0.25s; }
.tour__pop { position: fixed; pointer-events: auto; padding: 18px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: var(--r-panel); background: var(--surface-solid); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); opacity: 0; transform: translateY(8px) scale(0.98); transition: opacity 0.25s, transform 0.3s var(--ease-out), left 0.35s var(--ease-out), top 0.35s var(--ease-out); outline: none; }
.tour.is-on .tour__pop { opacity: 1; transform: none; }
.tour__x { position: absolute; top: 8px; right: 8px; }
.tour__count { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.tour__pop h3 { font-family: "Unbounded", sans-serif; font-size: 16px; margin: 0 28px 8px 0; }
.tour__text { margin: 0 0 14px; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.tour__dots { display: flex; gap: 5px; margin-bottom: 14px; }
.tour__dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--border); transition: width 0.25s var(--ease-out), background 0.25s; }
.tour__dots i.on { width: 18px; background: var(--accent); }
.tour__nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour__nav span { display: flex; gap: 8px; }
body:has(.tour) { overflow: hidden; }

/* Страница «Как пользоваться» */
.howto-steps { list-style: none; margin: 0 0 40px; padding: 0; display: grid; gap: 14px; counter-reset: h; }
.howto-steps li { position: relative; padding: 18px 18px 18px 64px; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--surface-solid); counter-increment: h; }
.howto-steps li::before { content: counter(h); position: absolute; left: 18px; top: 18px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff; font: 700 14px "JetBrains Mono", monospace; }
.howto-steps h3 { margin: 0 0 4px; font-size: 17px; }
.howto-steps p { margin: 0 0 10px; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.howto-steps .btn { margin-top: 2px; }
.howto-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 40px; }

@media (max-width: 860px) {
  .guide-card { padding: 16px; }
  .guide-card__head { flex-direction: column; }
  .guide-step { grid-template-columns: 28px 1fr; }
  .guide-step > .btn, .guide-step__ok { grid-column: 2; justify-self: start; }
  .howto-steps li { padding: 16px 14px 16px 56px; }
  .howto-steps li::before { left: 14px; top: 16px; }
  .tour__nav { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .tour__spot, .tour__pop, .guide-bar i, .guide-tip { transition: none; }
}

/* v3.7 Первый экран занимает всю высоту, «Три вопроса» начинаются ниже */
.home-top .hero {
  min-height: calc(100vh - 78px);
  min-height: calc(100svh - 78px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 0 72px;
}
@media (max-width: 860px) {
  .home-top .hero { min-height: calc(100svh - 64px); padding: 36px 0 56px; }
}

/* v3.7 Сообщение об успехе в форме входа (письмо отправлено) */
.form-msg.ok {
  background: var(--profit-soft);
  color: var(--profit);
}
