/* AW Trade — дизайн-система.
   Палитра снята с аватарки канала: графит, морская бирюза, туман.
   Пиксельность дозирована: уголки-скобки у карточек, ступенчатые края
   кнопок, пиксельный шрифт в заголовках и дизеринг фона. Цифры — моношрифт. */

:root {
  --bg: #0c1014;
  --bg-2: #10161b;
  --panel: #141c23;
  --panel-2: #18232c;
  --panel-3: #1d2b36;
  --line: #22313c;
  --line-2: #2d4150;
  --ink: #e2ecea;
  --ink-2: #a8bcba;
  --ink-3: #6e8889;
  --ink-4: #4b6163;
  --teal-900: #1a313a;
  --teal-700: #295159;
  --teal-500: #3a686e;
  --teal-400: #48777b;
  --teal-300: #588486;
  --mist: #7b9b98;
  --accent: #86d7cd;
  --accent-2: #5fb8ad;
  --accent-ink: #081a1b;
  --long: #4fd1a1;
  --long-bg: rgba(79, 209, 161, .12);
  --short: #ff6b7a;
  --short-bg: rgba(255, 107, 122, .12);
  --warn: #f2c46d;
  --warn-bg: rgba(242, 196, 109, .12);
  --pro: #e9c77b;
  --radius: 2px;
  --px: 3px;
  --f-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-px: "Press Start 2P", "Inter", monospace;
  --f-8bit: "Press Start 2P", monospace;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --sidebar: 236px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--f-ui);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  /* туман и дизеринг: едва заметная клетка 2×2, гаснущая к низу */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 75% -10%, rgba(88, 132, 134, .18), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(41, 81, 89, .22), transparent 60%),
    repeating-conic-gradient(rgba(255, 255, 255, .018) 0 25%, transparent 0 50%) 0 0 / 4px 4px;
  -webkit-mask: linear-gradient(#000 0, #000 55%, rgba(0,0,0,.35) 100%);
          mask: linear-gradient(#000 0, #000 55%, rgba(0,0,0,.35) 100%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--teal-500); color: #fff; }
button, input, select, textarea { font: inherit; color: inherit; }
img.px, .pixelated { image-rendering: pixelated; }
.mono, .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-2); }
.up, .pos { color: var(--long); }
.down, .neg { color: var(--short); }
.warn { color: var(--warn); }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 8px; }
.gap-4 { gap: 4px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.sm { font-size: 12px; } .xs { font-size: 11px; } .lg { font-size: 16px; }

h1, h2 { font-family: var(--f-px); font-weight: 400; letter-spacing: 0; margin: 0; line-height: 1.35; }
h3, h4 { font-family: var(--f-ui); font-weight: 700; margin: 0; line-height: 1.3; letter-spacing: -.005em; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
.h-8bit { font-family: var(--f-8bit); font-weight: 400; letter-spacing: 0; }

/* ------------------------------ кнопки ------------------------------ */
.btn {
  --b-bg: var(--panel-3); --b-fg: var(--ink); --b-hi: rgba(255,255,255,.06); --b-lo: rgba(0,0,0,.3);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border: 0; cursor: pointer; user-select: none;
  background: var(--b-bg); color: var(--b-fg); font-weight: 600; font-size: 13px; white-space: nowrap;
  box-shadow: inset 0 2px 0 var(--b-hi), inset 0 -3px 0 var(--b-lo);
  clip-path: polygon(0 var(--px), var(--px) var(--px), var(--px) 0, calc(100% - var(--px)) 0,
    calc(100% - var(--px)) var(--px), 100% var(--px), 100% calc(100% - var(--px)),
    calc(100% - var(--px)) calc(100% - var(--px)), calc(100% - var(--px)) 100%, var(--px) 100%,
    var(--px) calc(100% - var(--px)), 0 calc(100% - var(--px)));
  transition: filter .12s, transform .06s;
}
.btn:hover { filter: brightness(1.12); text-decoration: none; }
.btn:active { transform: translateY(1px); box-shadow: inset 0 3px 0 var(--b-lo); }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.btn.primary { --b-bg: var(--accent); --b-fg: var(--accent-ink); --b-hi: rgba(255,255,255,.35); --b-lo: rgba(0,0,0,.22); }
.btn.teal { --b-bg: var(--teal-500); --b-fg: #fff; }
.btn.ghost { --b-bg: transparent; --b-hi: transparent; --b-lo: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); clip-path: none; }
.btn.ghost:hover { color: var(--ink); background: var(--panel-2); }
.btn.long { --b-bg: #2f9e78; --b-fg: #fff; }
.btn.short { --b-bg: #c9485a; --b-fg: #fff; }
.btn.danger { --b-bg: #7a2b36; --b-fg: #ffd9de; }
.btn.pro { --b-bg: var(--pro); --b-fg: #231a05; --b-hi: rgba(255,255,255,.4); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; --px: 2px; }
.btn.xs { height: 22px; padding: 0 8px; font-size: 11px; --px: 2px; gap: 4px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; --px: 4px; }
.btn.icon { width: 32px; padding: 0; }
.btn.block { width: 100%; }
.btn.pay { height: auto; min-height: 62px; padding: 10px 18px; white-space: normal; text-align: center; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }

/* ------------------------------ поля ------------------------------ */
.input, .select, textarea.input {
  height: 36px; padding: 0 10px; background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: var(--radius); color: var(--ink); outline: none; min-width: 0; width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; padding: 8px 10px; resize: vertical; min-height: 70px; }
.input:focus, .select:focus { border-color: var(--teal-300); box-shadow: 0 0 0 3px rgba(88,132,134,.25); }
.input.mono { font-family: var(--f-mono); }
.input.sm, .select.sm { height: 28px; font-size: 12px; }
.select { appearance: none; padding-right: 26px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 13px) 50%, calc(100% - 8px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--ink-3); }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 0; }
.input-group .addon { display: flex; align-items: center; padding: 0 10px; background: var(--panel-2); border: 1px solid var(--line-2); border-left: 0; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.input-group .addon:first-child { border-left: 1px solid var(--line-2); border-right: 0; }

/* сегментированный переключатель */
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-2); padding: 2px; gap: 2px; border-radius: var(--radius); }
.seg button { border: 0; background: transparent; color: var(--ink-3); padding: 0 10px; height: 26px; cursor: pointer; font-weight: 600; font-size: 12px; border-radius: 1px; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--panel-3); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent-2); }
.seg.sm button { height: 22px; padding: 0 8px; font-size: 11px; }
.seg.block { display: flex; }
.seg.block button { flex: 1; height: 30px; font-size: 13px; }

/* тумблер */
.switch { position: relative; width: 38px; height: 20px; flex: none; cursor: pointer; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--panel-3); box-shadow: inset 0 0 0 1px var(--line-2); transition: background .15s; }
.switch span::after { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: var(--ink-3); transition: transform .15s, background .15s; }
.switch input:checked + span { background: var(--teal-500); }
.switch input:checked + span::after { transform: translateX(18px); background: #fff; }

/* пиксельная галочка — как ✅/▫️ в ботах */
.pcheck { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.pcheck i { width: 16px; height: 16px; flex: none; background: var(--bg-2); box-shadow: inset 0 0 0 2px var(--line-2); position: relative; }
.pcheck.on i { background: var(--accent-2); box-shadow: inset 0 0 0 2px var(--accent); }
.pcheck.on i::after { content: ""; position: absolute; left: 3px; top: 7px; width: 2px; height: 2px; background: var(--accent-ink);
  box-shadow: 2px 2px 0 var(--accent-ink), 4px 0 0 var(--accent-ink), 6px -2px 0 var(--accent-ink), 8px -4px 0 var(--accent-ink); }
.pcheck.disabled { opacity: .45; cursor: not-allowed; }

/* ------------------------------ карточки ------------------------------ */
.card {
  --c: var(--line-2);
  position: relative; background:
    linear-gradient(var(--c) 0 0) 0 0 / 10px 2px, linear-gradient(var(--c) 0 0) 0 0 / 2px 10px,
    linear-gradient(var(--c) 0 0) 100% 0 / 10px 2px, linear-gradient(var(--c) 0 0) 100% 0 / 2px 10px,
    linear-gradient(var(--c) 0 0) 0 100% / 10px 2px, linear-gradient(var(--c) 0 0) 0 100% / 2px 10px,
    linear-gradient(var(--c) 0 0) 100% 100% / 10px 2px, linear-gradient(var(--c) 0 0) 100% 100% / 2px 10px,
    var(--panel);
  background-repeat: no-repeat;
  border: 1px solid var(--line); padding: 16px; min-width: 0;
}
.card.hover:hover, .card.active { --c: var(--accent-2); }
.card.flat { background: var(--panel); }
.card.tight { padding: 12px; }
.card.pad0 { padding: 0; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-height: 28px; }
.card-h h3 { font-size: 15px; }
.card-h .sub { color: var(--ink-3); font-size: 12px; }
.card-h .tools { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.px-divider { height: 8px; margin: 28px 0; background:
  repeating-linear-gradient(90deg, var(--teal-700) 0 8px, transparent 8px 16px) 0 0 / 100% 4px no-repeat,
  repeating-linear-gradient(90deg, transparent 0 8px, var(--teal-900) 8px 16px) 0 4px / 100% 4px no-repeat; opacity: .8; }

/* ------------------------------ бейджи ------------------------------ */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; font-size: 11px; font-weight: 700;
  background: var(--panel-3); color: var(--ink-2); letter-spacing: .02em; white-space: nowrap; }
.badge.long { background: var(--long-bg); color: var(--long); }
.badge.short { background: var(--short-bg); color: var(--short); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.pro { background: rgba(233,199,123,.14); color: var(--pro); font-family: var(--f-px); font-size: 8px; letter-spacing: .06em; }
.badge.accent { background: rgba(134,215,205,.12); color: var(--accent); }
.badge.live::before { content: ""; width: 6px; height: 6px; background: var(--long); box-shadow: 0 0 8px var(--long); animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.dot { width: 8px; height: 8px; display: inline-block; background: var(--ink-4); flex: none; }
.dot.ok { background: var(--long); } .dot.err { background: var(--short); } .dot.warn { background: var(--warn); } .dot.off { background: var(--ink-4); }
.exlogo { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.exlogo i { width: 16px; height: 16px; flex: none; display: inline-grid; place-items: center; font-style: normal; font-size: 9px; font-weight: 800; color: #0b1215; font-family: var(--f-mono); }

/* ------------------------------ таблицы ------------------------------ */
.tbl-wrap { overflow: auto; max-width: 100%; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th { position: sticky; top: 0; z-index: 1; background: var(--panel-2); color: var(--ink-3); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; user-select: none; }
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--ink); }
.tbl th.sorted { color: var(--accent); }
.tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.tbl tr:hover td { background: rgba(88,132,134,.07); }
.tbl tr.click { cursor: pointer; }
.tbl td.num, .tbl th.num { text-align: right; font-family: var(--f-mono); }
.tbl.big th { font-size: 14px; padding: 12px 14px; }
.tbl.big th .badge { font-size: 13px; padding: 3px 10px; }
.tbl.big td { font-size: 15px; padding: 12px 14px; white-space: normal; }
.tbl.big td.center { font-size: 16px; font-weight: 600; }
.tbl .sticky-col { position: sticky; left: 0; background: var(--panel); z-index: 1; }
.tbl th.sticky-col { z-index: 2; background: var(--panel-2); }
.heat { border-radius: 1px; padding: 2px 5px; display: inline-block; min-width: 64px; text-align: right; }

/* ------------------------------ оболочка ------------------------------ */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); background: rgba(12,16,20,.8);
  backdrop-filter: blur(8px); display: flex; flex-direction: column; padding: 14px 10px; gap: 4px; overflow-y: auto; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; text-decoration: none !important; color: var(--ink); }
.brand img { width: 34px; height: 34px; image-rendering: pixelated; box-shadow: 0 0 0 2px var(--teal-700); }
.brand .t1 { font-family: var(--f-8bit); font-size: 12px; line-height: 1.1; color: var(--ink); }
.brand .t2 { font-family: var(--f-px); font-size: 8px; color: var(--mist); letter-spacing: .2em; margin-top: 4px; }
.nav-sec { font-size: 10px; color: var(--ink-4); text-transform: uppercase; letter-spacing: .12em; padding: 12px 10px 4px; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: var(--ink-2); font-weight: 500; border-radius: 1px; position: relative; }
.nav a:hover { background: var(--panel); color: var(--ink); text-decoration: none; }
.nav a.on { background: var(--panel-2); color: var(--ink); }
.nav a.on::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; background: var(--accent); }
.nav a svg { flex: none; }
.nav a .lock { margin-left: auto; color: var(--pro); opacity: .8; }
.nav a .cnt { margin-left: auto; background: var(--short); color: #fff; font-size: 10px; font-weight: 700; padding: 0 5px; min-width: 16px; text-align: center; }
.side-foot { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; }
.user-chip .av { width: 30px; height: 30px; display: grid; place-items: center; background: var(--teal-700); font-family: var(--f-8bit); font-size: 10px; color: #fff; flex: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0;
  background: rgba(12,16,20,.85); backdrop-filter: blur(8px); z-index: 15; }
.topbar h1 { font-size: 13px; display: flex; align-items: center; gap: 10px; line-height: 1.4; }
.topbar .tb-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.page { padding: 20px 24px 60px; max-width: 1600px; width: 100%; }
.page.wide { max-width: none; }
.burger { display: none; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.split.l { grid-template-columns: 340px minmax(0, 1fr); }
.split.half { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
.split.half > .col > .card:first-child { flex: 1; }
.split.half > .col > div:empty { display: none; }
/* подписка: карточка покупки во всю высоту колонки, подпись про бота — внизу */
.split.half > .col > .card:first-child { display: flex; flex-direction: column; }
.buy-body { flex: 1; }
.buy-note { margin-top: auto; }
.periods.lg button { padding: 9px 16px; font-size: 14px; }
.price-card .amt.big { font-size: 52px; }
.btn.pay { min-height: 74px; }

/* плитки-цифры */
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .k { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.kpi .v { font-family: var(--f-mono); font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.kpi .s { font-size: 12px; color: var(--ink-3); }

/* полоса до ликвидации */
.liqbar { position: relative; height: 8px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-2); min-width: 90px; }
.liqbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--long); }
.liqbar.warn i { background: var(--warn); } .liqbar.bad i { background: var(--short); }
.liqbar .thr { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .7; }

/* вкладки */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; }
.tabs button { background: none; border: 0; color: var(--ink-3); padding: 10px 14px; cursor: pointer; font-weight: 600; white-space: nowrap; position: relative; display: flex; gap: 8px; align-items: center; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); }
.tabs button.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 3px; background: var(--accent); }

/* модалка и тосты */
.modal-bg { position: fixed; inset: 0; background: rgba(4,8,10,.72); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow); animation: pop .16s ease-out; }
.modal.wide { width: min(880px, 100%); }
.modal .card-h { margin-bottom: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); padding: 10px 14px; box-shadow: var(--shadow); animation: pop .18s ease-out; font-size: 13px; }
.toast.err { border-left-color: var(--short); } .toast.ok { border-left-color: var(--long); } .toast.warn { border-left-color: var(--warn); }

/* пустые состояния, загрузка */
.empty { padding: 36px 16px; text-align: center; color: var(--ink-3); }
.empty .ico { margin-bottom: 10px; opacity: .8; }
.skel { background: linear-gradient(90deg, var(--panel-2), var(--panel-3), var(--panel-2)); background-size: 200% 100%; animation: sk 1.2s infinite linear; height: 14px; }
@keyframes sk { to { background-position: -200% 0; } }
.spinner { width: 14px; height: 14px; display: inline-block; background: var(--accent); animation: spin 1s steps(8) infinite; clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); }
@keyframes spin { to { transform: rotate(360deg); } }
.note { padding: 10px 12px; background: var(--panel-2); border-left: 3px solid var(--teal-300); color: var(--ink-2); font-size: 13px; }
.note.warn { border-left-color: var(--warn); background: rgba(242,196,109,.06); }
.note.err { border-left-color: var(--short); background: rgba(255,107,122,.06); }
.note.ok { border-left-color: var(--long); background: rgba(79,209,161,.06); }
.kbd { font-family: var(--f-mono); font-size: 11px; padding: 1px 5px; background: var(--panel-3); box-shadow: inset 0 -2px 0 rgba(0,0,0,.35); }

/* замок Pro */
.pro-lock { position: relative; }
.pro-wall { display: grid; place-items: center; text-align: center; padding: 56px 20px; gap: 12px; }
.pro-wall .big { font-family: var(--f-px); font-size: 16px; line-height: 1.5; }

/* график */
.chart-box { position: relative; height: 520px; background: var(--bg-2); border: 1px solid var(--line); }
.chart-box.sm { height: 300px; }
.chart-box .ov { position: absolute; left: 10px; top: 8px; z-index: 5; display: flex; gap: 12px; align-items: center; font-size: 12px; pointer-events: none; }
.chart-box .ov .t { font-family: var(--f-ui); font-weight: 700; font-size: 15px; color: var(--ink); }
.chart-box .err { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); z-index: 4; text-align: center; padding: 20px; }
.chart-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.alert-tag { position: absolute; right: 70px; z-index: 6; transform: translateY(-50%); display: flex; align-items: center; gap: 4px; pointer-events: auto; }
.alert-tag .lbl { background: var(--warn); color: #221903; font-size: 11px; font-weight: 700; padding: 2px 6px; font-family: var(--f-mono); cursor: ns-resize; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.alert-tag .x { background: #3a2f16; color: var(--warn); border: 0; width: 18px; height: 18px; cursor: pointer; font-size: 12px; line-height: 18px; padding: 0; }
.alert-tag.fired .lbl { background: var(--ink-4); color: var(--ink); }
.alert-tag.draft .lbl { background: var(--accent); color: var(--accent-ink); }
/* настройки: свёрнутая подсказка «что включить на бирже» у карточки ключа */
.key-guide { font-size: 12px; border: 1px solid var(--line); background: var(--panel); padding: 6px 10px; }
.key-guide summary { cursor: pointer; color: var(--accent); font-weight: 600; list-style: none; user-select: none; }
.key-guide summary::-webkit-details-marker { display: none; }
.key-guide summary::before { content: "▸ "; }
.key-guide[open] summary::before { content: "▾ "; }
.key-guide ol { margin: 8px 0 6px 18px; padding: 0; display: flex; flex-direction: column; gap: 5px; color: var(--ink-2); line-height: 1.45; }
.key-guide code { background: var(--panel-3); padding: 0 4px; color: var(--ink); }
.key-guide .btn.xs { padding: 0 4px; height: 18px; vertical-align: middle; }
/* терминал CrossEx: позиция с PnL слева, ордера и стопы справа (их тянут) */
.alert-tag.pos { right: auto; left: 8px; }
.alert-tag.pos .lbl { cursor: default; background: #1d2a31; color: var(--ink); border-left: 3px solid var(--ink-3); }
.alert-tag.locked .lbl { cursor: default; }
.alert-tag.pos.up .lbl { border-left-color: var(--long); color: var(--long); }
.alert-tag.pos.down .lbl { border-left-color: var(--short); color: var(--short); }
.alert-tag.order .lbl, .alert-tag.sl .lbl, .alert-tag.tp .lbl { background: #1d2a31; color: var(--ink); }
.alert-tag.order.buy .lbl { box-shadow: inset 3px 0 0 var(--long); }
.alert-tag.order.sell .lbl { box-shadow: inset 3px 0 0 var(--short); }
.alert-tag.sl .lbl { background: var(--short); color: #2a0b10; }
.alert-tag.tp .lbl { background: var(--long); color: #062118; }
.alert-tag.order .x, .alert-tag.sl .x, .alert-tag.tp .x { background: #1d2a31; color: var(--ink-2); }
.cx-chart-tools { position: absolute; left: 8px; top: 8px; z-index: 7; display: flex; gap: 6px; }

/* поиск монеты */
.picker { position: relative; }
.picker .list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; max-height: 340px; overflow: auto; background: var(--panel-2); border: 1px solid var(--line-2); z-index: 50; box-shadow: var(--shadow); min-width: 240px; }
.picker .list div { padding: 7px 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.picker .list div:hover, .picker .list div.hl { background: var(--panel-3); }

/* стакан */
.book { font-family: var(--f-mono); font-size: 12px; }
.book .lv { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 2px 8px; position: relative; cursor: pointer; }
.book .lv:hover { outline: 1px solid var(--line-2); }
.book .lv span { position: relative; z-index: 1; text-align: right; }
.book .lv span:first-child { text-align: left; }
.book .lv i { position: absolute; right: 0; top: 0; bottom: 0; }
.book .ask i { background: rgba(255,107,122,.12); } .book .bid i { background: rgba(79,209,161,.12); }
.book .ask span:first-child { color: var(--short); } .book .bid span:first-child { color: var(--long); }
.book .mid { padding: 6px 8px; font-size: 15px; font-weight: 600; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }

/* ------------------------------ лендинг ------------------------------ */
.land { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.land-nav { display: flex; align-items: center; gap: 18px; height: 70px; }
.land-nav .links { display: flex; gap: 18px; margin-left: 24px; }
.land-nav .links a { color: var(--ink-2); font-weight: 500; }
.land-nav .links a:hover { color: var(--ink); text-decoration: none; }
.land-nav .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 40px 0 30px; min-height: 560px; }
.hero h1 { font-size: 34px; line-height: 1.38; }
.hero h1 .acc { color: var(--accent); }
.hero .lead { font-size: 17px; color: var(--ink-2); max-width: 560px; margin: 18px 0 26px; }
.hero .tag { display: inline-flex; gap: 10px; align-items: center; font-family: var(--f-px); color: var(--mist); font-size: 9px; letter-spacing: .08em; margin-bottom: 22px; }
.hero .tag::before { content: ""; width: 24px; height: 4px; background: var(--accent-2); }
.hero-art { position: relative; aspect-ratio: 1; max-width: 520px; justify-self: center; width: 100%; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; display: block;
  clip-path: polygon(0 12px, 12px 12px, 12px 0, calc(100% - 12px) 0, calc(100% - 12px) 12px, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 12px calc(100% - 12px), 0 calc(100% - 12px)); }
.hero-art .fog { position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  clip-path: inherit; }
.hero-art .fog::before, .hero-art .fog::after { content: ""; position: absolute; left: -50%; right: -50%; height: 45%; bottom: -8%;
  background: radial-gradient(closest-side, rgba(170,205,200,.28), transparent); filter: blur(10px); animation: drift 14s ease-in-out infinite alternate; }
.hero-art .fog::after { bottom: 20%; height: 30%; opacity: .6; animation-duration: 19s; animation-direction: alternate-reverse; }
@keyframes drift { from { transform: translateX(-12%); } to { transform: translateX(12%); } }
.hero-art .frame { position: absolute; inset: -10px; pointer-events: none; --c: var(--teal-300);
  background: linear-gradient(var(--c) 0 0) 0 0 / 34px 4px, linear-gradient(var(--c) 0 0) 0 0 / 4px 34px,
    linear-gradient(var(--c) 0 0) 100% 0 / 34px 4px, linear-gradient(var(--c) 0 0) 100% 0 / 4px 34px,
    linear-gradient(var(--c) 0 0) 0 100% / 34px 4px, linear-gradient(var(--c) 0 0) 0 100% / 4px 34px,
    linear-gradient(var(--c) 0 0) 100% 100% / 34px 4px, linear-gradient(var(--c) 0 0) 100% 100% / 4px 34px; background-repeat: no-repeat; }
.hero-art .scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 1px, transparent 1px 4px); mix-blend-mode: multiply; }
.hero-stats { display: flex; gap: 28px; margin-top: 30px; flex-wrap: wrap; }
.hero-stats .kpi .v { font-size: 24px; }
.ticker-tape { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(16,22,27,.7); white-space: nowrap; }
.ticker-tape .inner { display: inline-flex; gap: 28px; padding: 10px 0; animation: tape 60s linear infinite; font-family: var(--f-mono); font-size: 12px; }
@keyframes tape { to { transform: translateX(-50%); } }
.sec { padding: 64px 0 20px; }
.sec-h { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; }
.sec-h .kick { font-family: var(--f-px); color: var(--accent); letter-spacing: .08em; font-size: 9px; }
.sec-h h2 { font-size: 24px; line-height: 1.4; }
.sec-h p { color: var(--ink-2); max-width: 680px; margin: 0; }
.feat { display: flex; flex-direction: column; gap: 10px; min-height: 210px; }
.feat .ic { width: 44px; height: 44px; display: grid; place-items: center; background: var(--teal-900); box-shadow: inset 0 0 0 2px var(--teal-700); }
.feat h3 { font-size: 18px; }
.feat p { color: var(--ink-2); margin: 0; font-size: 13.5px; }
.feat ul { margin: 0; padding-left: 16px; color: var(--ink-2); font-size: 13px; }
.feat .foot { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; }

/* плашки инструментов: значок, заголовок, описание и пиксельная сценка (art.js) —
   полосой во всю ширину низа плашки, под текстом не лежит; кверху гаснет в фон. */
.tool-card { display: flex; flex-direction: column; }
/* .card.… — чтобы мобильный `.card { padding }` не съел место под сценку */
.card.tool-card, .card.feat { padding-bottom: 84px; }
.tool-card, .feat { overflow: hidden; }
.tool-card > :not(.art), .feat > :not(.art) { position: relative; z-index: 1; }
.tool-ic { width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  background: var(--teal-900); box-shadow: inset 0 0 0 2px var(--teal-700); }
.art { position: absolute; left: 1px; right: 1px; bottom: 1px; height: 76px; z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 45%); mask-image: linear-gradient(to bottom, transparent, #000 45%); }
.art svg { display: block; width: 100%; height: 100%; opacity: .5; transition: opacity .25s; }
.card.hover:hover .art svg { opacity: .9; }
.art .l { fill: var(--long); }
.art .s { fill: var(--short); }
.art .a { fill: var(--accent-2); }
.art .m { fill: var(--teal-500); }
.art .w { fill: var(--warn); }
.art .t { fill: var(--teal-900); }
.price-card { display: flex; flex-direction: column; gap: 14px; }
.price-card .amt { font-family: var(--f-mono); font-size: 40px; font-weight: 600; }
.price-card .amt small { font-size: 14px; color: var(--ink-3); font-weight: 400; }
.price-card ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.price-card li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); }
.price-card li::before { content: ""; width: 8px; height: 8px; margin-top: 7px; background: var(--accent-2); flex: none; }
.price-card.pro { --c: var(--pro); }
.price-card.pro li::before { background: var(--pro); }
.periods { display: flex; gap: 6px; flex-wrap: wrap; }
.periods button { border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink-2); padding: 6px 10px; cursor: pointer; font-weight: 600; font-size: 12px; }
.periods button.on { border-color: var(--pro); color: var(--pro); background: rgba(233,199,123,.08); }
.periods button .off { color: var(--long); margin-left: 4px; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; gap: 10px; align-items: center; }
.faq summary::before { content: "+"; font-family: var(--f-8bit); font-size: 11px; color: var(--accent); width: 14px; }
.faq details[open] summary::before { content: "−"; }
.faq details p { color: var(--ink-2); margin: 10px 0 0 24px; }
.footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 28px 0 40px; color: var(--ink-3); font-size: 13px; }

/* вход */
.login-box { max-width: 440px; margin: 8vh auto; }
.code-box { font-family: var(--f-mono); font-size: 12px; background: var(--bg-2); padding: 10px; border: 1px dashed var(--line-2); word-break: break-all; }
.steps { counter-reset: s; display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-2); }
.steps li::before { counter-increment: s; content: counter(s); font-family: var(--f-8bit); font-size: 10px; width: 24px; height: 24px; display: grid; place-items: center; background: var(--teal-700); color: #fff; flex: none; }

/* лента событий */
.feed { display: flex; flex-direction: column; }
.feed .ev { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); align-items: start; }
.feed .ev .t { font-weight: 600; }
.feed .ev .b { color: var(--ink-2); font-size: 12.5px; white-space: pre-line; margin-top: 2px; }
.feed .ev .tm { color: var(--ink-4); font-size: 11px; font-family: var(--f-mono); }
.feed .ev.new { background: rgba(134,215,205,.04); }

/* ------------------------------ адаптив ------------------------------ */
@media (max-width: 1200px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split.l { grid-template-columns: minmax(0, 1fr); }
  .split.half { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); background: var(--bg); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 19; }
  .burger { display: inline-flex; }
  .topbar { padding: 0 12px; }
  .page { padding: 14px 12px 60px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 10px; }
  .hero h1 { font-size: 24px; }
  .hero-art { max-width: 360px; order: -1; }
  .land-nav .links { display: none; }
  .chart-box { height: 420px; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: minmax(0, 1fr); }
  .topbar h1 { font-size: 11px; }
  .sec-h h2 { font-size: 18px; }
  .hero h1 { font-size: 20px; }
  .card { padding: 12px; }
  .chart-box { height: 360px; }
  .tb-right .hide-sm { display: none; }
}
.tbl tr.sel td { background: rgba(134,215,205,.08); }
.kpis-sm .kpi .v { font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
.kpis-sm .kpi .s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.range { width: 100%; accent-color: var(--accent-2); cursor: pointer; }
.range-marks { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); font-family: var(--f-mono); }
.range-marks span { cursor: pointer; }
.range-marks span:hover { color: var(--ink); }
.tbl tr.grp td { background: var(--panel-2); color: var(--ink-2); font-size: 12px; padding: 6px 10px; }
.tbl.lev-tiers tr.on td { background: var(--panel-3); color: var(--ink); }
.cx-grip { height: 12px; margin: 2px 0 -4px; cursor: ns-resize; touch-action: none; position: relative; }
.cx-grip::after { content: ""; position: absolute; left: 50%; top: 4px; width: 48px; height: 4px; margin-left: -24px; background: var(--line-2); }
.cx-grip:hover::after { background: var(--accent-2); }
@media (max-width: 1280px) { .cx-grid { grid-template-columns: minmax(0,1fr) 300px !important; } .cx-grid > :first-child { grid-column: 1 / -1; } }
@media (max-width: 720px) { .cx-grid { grid-template-columns: minmax(0,1fr) !important; grid-auto-rows: auto !important; } .cx-grid > .chart-box { height: 420px !important; } .cx-grid > .card:nth-child(2) { height: 440px; } .cx-grip { display: none; } }
/* ------------------------------ автотрейд ------------------------------ */
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mode-card { text-align: left; background: var(--bg-2); border: 1px solid var(--line-2); padding: 10px 12px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; color: var(--ink-3); transition: border-color .12s, background .12s; }
.mode-card b { color: var(--ink-2); }
.mode-card:hover { border-color: var(--teal-300); color: var(--ink-2); }
.mode-card.on { background: var(--panel-2); color: var(--ink-2); }
.mode-card.on b { color: var(--ink); }
.mode-card.m-all.on { border-color: var(--long); box-shadow: inset 0 -3px 0 var(--long); }
.mode-card.m-exits.on { border-color: var(--warn); box-shadow: inset 0 -3px 0 var(--warn); }
.mode-card.m-stop.on { border-color: var(--short); box-shadow: inset 0 -3px 0 var(--short); }
.mode-card.m-all svg { color: var(--long); } .mode-card.m-exits svg { color: var(--warn); } .mode-card.m-stop svg { color: var(--short); }
.save-bar { position: sticky; bottom: 12px; z-index: 10; display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); color: var(--ink-3); }
.save-bar.on { border-color: var(--accent-2); color: var(--ink); }
.pnl-bars { display: flex; align-items: stretch; gap: 3px; height: 120px; position: relative; }
.pnl-bars::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line-2); }
.pnl-bars .b { flex: 1 1 0; position: relative; min-width: 3px; }
.pnl-bars .b:hover { background: rgba(88,132,134,.12); }
.pnl-bars .b i { position: absolute; left: 0; right: 0; }
.pnl-bars .b i.p { bottom: 50%; background: var(--long); }
.pnl-bars .b i.n { top: 50%; background: var(--short); }
@media (max-width: 720px) { .modes { grid-template-columns: minmax(0, 1fr); } }
/* мост: шаги перевода в пути */
.track { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.track > div { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: var(--ink-4); }
.track > div i { height: 6px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.track > div.done { color: var(--ink-3); } .track > div.done i { background: var(--long); box-shadow: none; }
.track > div.cur { color: var(--ink); font-weight: 600; } .track > div.cur i { background: var(--accent); box-shadow: none; animation: blink 1.2s steps(2) infinite; }
@media (max-width: 560px) { .track { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
