/* Тёмная техно-эстетика: void-black + один акцент (emerald). Системные шрифты, без внешних ресурсов. */
:root {
  --bg: #06080a; --surface: #0c1014; --surface-2: #121820; --line: #1d2630; --line-2: #2a3644;
  --text: #e8eef4; --muted: #93a1af; --accent: #10b981; --accent-ink: #03150e; --accent-soft: rgba(16, 185, 129, .12);
  --warn: #e8bb6a; --bad: #f09a9a; --radius: 14px; --shadow: 0 8px 28px rgba(0, 0, 0, .45);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--text); background: var(--bg); min-height: 100vh; }
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.2; margin: 0 0 .6rem; font-weight: 600; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
p { margin: 0 0 .7rem; }
a { color: var(--accent); text-underline-offset: 3px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 20; }
.skip:focus { left: 8px; }

.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { font-weight: 650; letter-spacing: -.02em; }
.brand span { color: var(--accent); }
.nav { padding: 16px 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 10px; transition: background .15s, color .15s; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
main { padding: 24px clamp(14px, 3vw, 36px) 56px; max-width: 1280px; width: 100%; outline: none; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-bottom: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.grid .card { margin-bottom: 0; }
.stat { font-size: 1.7rem; font-weight: 600; letter-spacing: -.03em; }
.kv { display: grid; grid-template-columns: fit-content(50%) 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }

.btn { font: inherit; cursor: pointer; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 14px; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn-ghost { background: transparent; }
label { display: block; color: var(--muted); font-size: .85rem; margin-bottom: 4px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 12px; width: 100%; transition: border-color .15s; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; border: 1px solid var(--line-2); background: var(--surface-2); }
.badge-ok { border-color: var(--accent); color: var(--accent); }
.badge-neutral { color: var(--muted); }
.badge-warn { border-color: var(--warn); color: var(--warn); }
.badge-bad { border-color: var(--bad); color: var(--bad); }
.disclaimer { border: 1px solid var(--line-2); border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.notice { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line-2); }
.notice-error { border-color: var(--bad); color: var(--bad); } .notice-ok { border-color: var(--accent); color: var(--accent); } .notice-warn { border-color: var(--warn); color: var(--warn); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
tbody tr:hover { background: var(--surface); } tr:last-child td { border-bottom: 0; }
.mono { font-family: var(--mono); font-size: .85rem; }
.pager { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
progress, meter { width: 100%; height: 8px; accent-color: var(--accent); }

.state { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 24px; text-align: center; margin-bottom: 16px; }
.state-title { font-weight: 600; } .state-error { border-color: var(--bad); border-style: solid; }
.skeleton-row { height: 18px; border-radius: 8px; margin-bottom: 12px; background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.untrusted { border-left: 2px solid var(--warn); padding-left: 10px; }
.dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); max-width: min(520px, calc(100vw - 24px)); padding: 22px; }
.dialog::backdrop { background: rgba(0, 0, 0, .7); }
.login { max-width: 420px; margin: 12vh auto; padding: 0 16px; }
.noscript { padding: 24px; }
.page-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }

@media (max-width: 899px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .nav a { white-space: nowrap; }
}
/* Сворачиваемые секции (<details>): заголовок и краткая подсказка всегда видны */
.card.fold { padding: 0; }
.fold > summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 12px 18px; min-height: 44px; cursor: pointer; list-style: none; border-radius: var(--radius); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: "▸"; color: var(--accent); flex: none; transition: transform .15s; }
.fold[open] > summary::before { transform: rotate(90deg); }
.fold-title { font-weight: 600; letter-spacing: -.01em; }
.fold-hint { color: var(--muted); font-size: .85rem; }
.fold-body { padding: 4px 18px 16px; }
.fold-body > .table-wrap:last-child, .fold-body > .state:last-child { margin-bottom: 0; }
.bullets { margin: 0; padding-left: 1.2em; } .bullets-tight { padding-left: 1em; }
td, .kv dd { overflow-wrap: anywhere; }
.table-wrap:focus-visible { outline-offset: -2px; }

/* Узкие экраны: строка таблицы превращается в карточку «подпись: значение» (подписи из data-label) */
@media (max-width: 640px) {
  .table-wrap { overflow: visible; border: 0; border-radius: 0; }
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tbody tr { display: block; margin-bottom: 10px; padding: 6px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  tbody tr:hover { background: var(--surface); }
  td { display: grid; grid-template-columns: minmax(84px, 36%) minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 5px 12px; border-bottom: 0; }
  td::before { content: attr(data-label); color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
  .table-compact tbody tr { padding: 4px 0; margin-bottom: 6px; }
  .table-compact td { padding: 2px 12px; }
  .table-compact td.is-empty { display: none; }
  .fold > summary, .fold-body { padding-left: 14px; padding-right: 14px; }
  .card:not(.fold) { padding: 14px; }
  .dialog { padding: 16px; }
}
@media (max-width: 520px) {
  .kv { grid-template-columns: 1fr; gap: 0; } .kv dd { margin-bottom: 8px; }
  th, td { padding: 8px 10px; } h1 { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
ul.plain { list-style: none; margin: 0; padding: 0; }
.chip { display: inline-block; margin: 0 6px 4px 0; padding: 1px 8px; border: 1px solid var(--line-2); border-radius: 8px; font-size: .82rem; }

/* ===== Терминал: шапка, поиск, статус ===== */
.topbar { flex-wrap: wrap; }
.search-wrap { flex: 1 1 240px; max-width: 420px; }
.search { padding: 7px 12px; border-radius: 10px; }
.sysstat { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8rem; }
.dot { font-size: .7rem; } .dot-ok { color: var(--accent); } .dot-warn { color: var(--warn); } .dot-bad { color: var(--bad); }
.btn-sm { padding: 4px 10px; font-size: .85rem; min-height: 32px; }
.small { font-size: .82rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.topbar { gap: 10px 16px; }

/* ===== Сводка и карточки ===== */
.statbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.statbar-tight { margin: 14px 0 0; } .statbar-tight .stat-tile { background: var(--bg); }
.stat-label { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; }
.stat-value { font-size: 1.35rem; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: .8rem; overflow-wrap: anywhere; }
.market-today > h2, .dash h2 { margin-top: 8px; }
.class-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.class-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; transition: border-color .15s; }
.class-card:hover { border-color: var(--line-2); } .class-card h3 { margin: 0; }
.breadth { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .85rem; font-variant-numeric: tabular-nums; }
.breadth meter { flex: 1 1 100%; }
.breadth-up { color: var(--accent); } .breadth-down { color: var(--bad); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.trend { font-variant-numeric: tabular-nums; white-space: nowrap; } .trend-up { color: var(--accent); } .trend-down { color: var(--bad); } .trend-flat { color: var(--muted); }

/* ===== Тепловая плитка ===== */
.heatmap { position: relative; height: 340px; border-radius: 12px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); margin-bottom: 8px; }
.tile { position: absolute; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1px; padding: 2px; overflow: hidden; text-decoration: none; color: var(--text);
  border: 2px solid var(--bg); border-radius: 6px; transition: filter .15s, transform .15s; text-align: center; }
.tile:hover, .tile:focus-visible { filter: brightness(1.25); z-index: 2; }
.tile-name { font-weight: 600; font-size: .78rem; letter-spacing: -.01em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-pct { font-size: .74rem; font-variant-numeric: tabular-nums; }
.tile-sm .tile-name { font-size: .64rem; } .tile-sm .tile-pct { display: none; }
.tile-up.tier-0, .tile-flat { background: #17212a; } .tile-up.tier-1 { background: #0f3b2f; } .tile-up.tier-2 { background: #0d5e47; } .tile-up.tier-3 { background: #0b7f5e; }
.tile-down.tier-1 { background: #3d2230; } .tile-down.tier-2 { background: #5e2a3d; } .tile-down.tier-3 { background: #7d3048; }

/* ===== Воронка ===== */
.funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.funnel-row { display: grid; grid-template-columns: 34px minmax(80px, 1fr) auto; gap: 2px 12px; align-items: center; }
.funnel-lv { color: var(--muted); } .funnel-num { font-size: .8rem; text-align: right; }
.funnel-why { grid-column: 2 / -1; font-size: .78rem; overflow-wrap: anywhere; }
meter { height: 10px; } meter::-webkit-meter-bar { background: var(--surface-2); border-radius: 6px; border: 0; }
meter::-webkit-meter-optimum-value, meter::-webkit-meter-suboptimum-value, meter::-webkit-meter-even-less-good-value { background: var(--accent); border-radius: 6px; }
meter::-moz-meter-bar { background: var(--accent); }

/* ===== Лента возможностей ===== */
.opp-feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 8px; }
.opp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, transform .15s; }
.opp-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.opp-card p { margin: 0; } .opp-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ilink { font-weight: 600; text-decoration: none; letter-spacing: -.01em; } .ilink:hover { text-decoration: underline; }
.opp-link { font-size: .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* ===== Скринер ===== */
.filter-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.seg-group { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.seg { font: inherit; font-size: .85rem; cursor: pointer; color: var(--muted); background: transparent; border: 0; border-radius: 9px; padding: 5px 12px; min-height: 30px; transition: background .15s, color .15s; }
.seg:hover { color: var(--text); background: var(--surface-2); }
.seg[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent); }
.sort-bar { display: flex; gap: 8px; align-items: center; } .sort-bar select { width: auto; padding: 5px 10px; }
.th-btn { font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; background: transparent; border: 0; cursor: pointer; padding: 2px 0; }
.th-btn:hover { color: var(--text); } th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--accent); }
th.num .th-btn { text-align: right; }
.screener tbody tr.row-link { cursor: pointer; } .screener tbody tr.row-link:hover { background: var(--surface-2); }
.screener td { vertical-align: middle; }

/* ===== График ===== */
.chart-card { padding: 14px; } .chart-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.chart-stage { position: relative; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; touch-action: pan-y; }
.chart-stage canvas { display: block; cursor: crosshair; touch-action: none; }
.chart-legend { position: absolute; top: 6px; left: 8px; right: 70px; font-size: .72rem; color: var(--muted); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 16px; text-align: center; }
.chart-overlay-ready { display: none; } .chart-overlay-loading .state-title { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.chart-overlay-error .state-title { color: var(--bad); }
.chart-caption { margin: 8px 2px 0; font-size: .78rem; } .notice-warn-text { color: var(--warn); }
.equity-stage { width: 100%; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); } .equity-stage canvas { display: block; }
.instr-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 16px; align-items: start; margin-bottom: 16px; }
.instr-side { display: grid; gap: 12px; } .instr-side .card { margin: 0; }
.verdict-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (max-width: 1099px) { .instr-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .heatmap { height: 300px; } .search-wrap { flex-basis: 100%; max-width: none; order: 5; }
  .chart-card { padding: 10px; } .chart-legend { right: 8px; font-size: .66rem; }
  .filter-bar { flex-direction: column; align-items: stretch; } .seg-group { width: 100%; } .seg { flex: 1 1 auto; }
  td.num { text-align: left; }
  .screener tbody tr.row-link:hover { background: var(--surface); }
}
.table-compact td.num { font-variant-numeric: tabular-nums; }
.dash > .grid, .dash > section { margin-bottom: 8px; }

@media (min-width: 900px) {
  table.screener td, table.screener th { white-space: nowrap; }
  table.screener td:first-child { white-space: normal; word-break: break-all; min-width: 190px; }
}

/* ---- личный кабинет: вход, меню пользователя, профиль, избранное ---- */
.login-wide { max-width: 520px; margin: 9vh auto 6vh; padding: 0 20px; }
.login-wide h1 { font-size: 2rem; letter-spacing: -.02em; margin: 6px 0 12px; }
.eyebrow { margin: 0; color: var(--accent); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; }
.lead { color: var(--muted); font-size: 1.02rem; margin: 0 0 24px; }
.login-actions { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.btn-xl { display: block; text-align: center; text-decoration: none; padding: 14px 20px; font-size: 1.05rem; border-radius: 12px; box-shadow: 0 0 0 1px var(--accent), 0 8px 28px rgba(16, 185, 129, .18); }
a.btn-xl { color: var(--accent-ink); }
.btn-xl:disabled { opacity: .6; cursor: progress; }
.wait { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--text); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.fold-lite { margin: 22px 0 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.fold-lite summary { cursor: pointer; color: var(--muted); }
.fold-lite summary:hover { color: var(--text); }
.small { font-size: .85rem; }
.user-wrap { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; font: inherit; color: var(--text); background: transparent; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 12px 3px 4px; cursor: pointer; transition: border-color .15s; }
.user-btn:hover, .user-btn[aria-expanded="true"] { border-color: var(--accent); }
.user-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); font-size: .75rem; font-weight: 700; letter-spacing: .04em; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; z-index: 30; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 6px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.menu[hidden] { display: none; }
.menu a, .menu button { font: inherit; text-align: left; color: var(--text); text-decoration: none; background: transparent; border: 0; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.menu a:hover, .menu button:hover, .menu a:focus-visible, .menu button:focus-visible { background: var(--accent-soft); color: var(--accent); }
.menu-danger { border-top: 1px solid var(--line); border-radius: 0 0 8px 8px !important; margin-top: 4px; }
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.profile-name { margin: 0; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.title-row h1 { margin: 0; }
.btn-star { display: inline-flex; align-items: center; gap: 8px; }
.btn-star .star { font-size: 1.1rem; line-height: 1; }
.btn-star.is-on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn-star:disabled { opacity: .6; cursor: not-allowed; }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
@media (max-width: 640px) { .user-name { display: none; } .user-btn { padding: 3px; } .login-wide { margin-top: 5vh; } .login-wide h1 { font-size: 1.6rem; } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; border-top-color: var(--line-2); border-right-color: var(--accent); } }

.login-code { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 18px; border: 1px solid var(--accent); border-radius: 14px; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.login-code-label { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.login-code-digits { font-size: 2.2rem; letter-spacing: .18em; line-height: 1.1; color: var(--text); }

@media (min-width: 900px) {
  .table-compact td:nth-child(2), .table-compact td:last-child { white-space: nowrap; }
}

/* ===== ИИ-команда: светофор, комната агентов, спор, план ===== */
[hidden] { display: none !important; }
.lead { color: var(--text); font-size: 1.05rem; }
.market-line { margin-bottom: 18px; }
.nav-sep { margin: 14px 12px 4px; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.steps { margin: 0; padding-left: 1.4em; display: grid; gap: 6px; } .start { border-left: 3px solid var(--accent); }
.tabs { margin-bottom: 16px; }
.lamp { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); font-weight: 600; }
.lamp-bulbs { display: inline-flex; flex-direction: column; gap: 3px; padding: 4px; background: var(--bg); border-radius: 8px; }
.bulb { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.bulb-green.on { background: var(--accent); box-shadow: 0 0 8px var(--accent); } .bulb-yellow.on { background: var(--warn); } .bulb-red.on { background: var(--bad); }
.lamp-green { border-color: var(--accent); } .lamp-yellow { border-color: var(--warn); } .lamp-red { border-color: var(--bad); } .lamp-split { border-style: dashed; }
.lamp-ico { font-size: 1.15rem; } .lamp-green .lamp-ico { color: var(--accent); } .lamp-yellow .lamp-ico { color: var(--warn); } .lamp-red .lamp-ico { color: var(--bad); }
.lamp-text { font-size: 1.05rem; letter-spacing: -.01em; }
.ai-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; display: grid; gap: 14px; }
.ai-box > h2 { margin: 0; } .ai-box .state { margin: 0; } .ai-box .card { margin: 0; box-shadow: none; background: var(--bg); }
.result-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 8px; }
.conf { margin: 6px 0; } .conf-segs { display: inline-flex; gap: 4px; vertical-align: middle; }
.seg-dot { width: 18px; height: 6px; border-radius: 3px; background: var(--line-2); } .seg-dot.on { background: var(--accent); }
.why summary, .role-more summary { cursor: pointer; color: var(--accent); min-height: 32px; display: inline-flex; align-items: center; }
.ask { display: grid; gap: 8px; justify-items: start; } .ask .notice, .ask p { margin: 0; }
.progress-box { width: 100%; display: grid; gap: 8px; } .progress-box progress { max-width: 520px; }
.room { display: grid; gap: 10px; } .room h3, .room p { margin: 0; }
.room-group-title { margin: 8px 0; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.role-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.role-card.st-working { border-color: var(--accent); background: var(--accent-soft); }
.role-card.st-waiting, .role-card.st-absent { border-style: dashed; }
.role-card.st-failed { border-color: var(--bad); } .role-card.st-skipped { border-color: var(--warn); }
.role-head { display: flex; gap: 12px; align-items: center; }
.role-ico { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--accent); }
.role-title { margin: 0; font-size: .95rem; font-weight: 600; }
.role-status { font-size: .8rem; color: var(--muted); } .st-working .role-status { color: var(--accent); } .st-failed .role-status { color: var(--bad); } .st-done .role-status { color: var(--accent); }
.role-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.5s ease-in-out infinite; }
.role-src { margin-top: -4px; } .role-opinion.reveal, .role-src.reveal, .role-dir.reveal { animation: reveal .6s ease-out both; }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.room-progress { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); }
.room-progress progress { max-width: 100%; } .room-now { color: var(--accent); font-weight: 600; }
.role-card.st-waiting .role-title { color: var(--muted); }
.role-card p { margin: 0; } .role-opinion { font-size: .92rem; }
.role-dir { font-size: .85rem; font-weight: 600; } .dir-up { color: var(--accent); } .dir-down { color: var(--bad); } .dir-wait { color: var(--warn); } .dir-none { color: var(--muted); }
.role-full { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .85rem; max-height: 22em; overflow: auto; border-left: 2px solid var(--warn); padding-left: 10px; }
.debate-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.debate-side { padding: 10px 14px; border-radius: 12px; background: var(--surface); border-left: 3px solid var(--line-2); } .debate-side h4 { margin: 0 0 6px; }
.debate-side.bull { border-left-color: var(--accent); } .debate-side.bear { border-left-color: var(--bad); } .debate-side p { margin: 0; font-size: .92rem; }
.debate-judge { margin: 12px 0 0; }
.think-list { display: grid; gap: 6px; } .think-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 12px; background: var(--surface); border-radius: 10px; }
.think-row.dir-up, .think-row.dir-down, .think-row.dir-wait, .think-row.dir-none { color: var(--text); } .think-val { font-weight: 600; }
.plan-kv { margin-bottom: 8px; } .plan-det, .plan-llm { margin-bottom: 12px; } .plan h4 { margin: 0 0 8px; }
.plan-llm { border-left: 2px solid var(--warn); padding-left: 12px; }
/* подсказки-термины */
.term-wrap { position: relative; display: inline; }
.term { font: inherit; color: inherit; background: transparent; border: 0; border-bottom: 1px dashed var(--accent); padding: 0; cursor: help; }
.term-tip { position: absolute; z-index: 25; left: 0; top: calc(100% + 6px); width: min(300px, 80vw); padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); font-size: .85rem; font-weight: 400; text-transform: none; letter-spacing: 0; line-height: 1.45; color: var(--text); }
.term-ex { display: block; margin-top: 4px; color: var(--muted); }
@media (max-width: 899px) {
  .nav-sep { margin: 0 4px 0 10px; align-self: center; white-space: nowrap; }
  .nav a { min-height: 44px; display: inline-flex; align-items: center; }
}
@media (max-width: 640px) {
  .ai-box { padding: 14px; } .room-grid { grid-template-columns: minmax(0, 1fr); } .lamp-text { font-size: .98rem; }
  .btn-xl { width: 100%; }
}

/* Как читать итог, рецепты, подписи платформы */
.read-guide { margin: 10px 0; padding: 12px 14px; border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: 10px; background: var(--surface-2); }
.read-guide h3 { margin: 0 0 6px; font-size: .95rem; letter-spacing: -.01em; } .read-guide li { margin: 4px 0; line-height: 1.5; }
.rating-line { margin: 2px 0 6px; } .platform-cap { display: block; margin-top: 4px; }
.recipes { margin: 0 0 12px; } .recipes .seg-group { flex-wrap: wrap; gap: 6px; } .recipe-what { margin: 10px 0 0; line-height: 1.5; }
@media (max-width: 640px) { .recipes .seg { flex: 1 1 45%; } }

/* обучение */
.learn .lead { max-width: 62ch; } .learn-actions { margin: 6px 0 14px; align-items: center; gap: 12px; flex-wrap: wrap; }
.lessons { display: grid; gap: 10px; } .lessons .card.fold { margin: 0; padding: 0; }
.lesson > summary { align-items: center; } .lesson > summary::before { display: none; }
.lesson-num { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 8px; border: 1px solid var(--accent); color: var(--accent); font-weight: 600; font-size: .85rem; }
.lesson[open] > summary .lesson-num { background: var(--accent); color: var(--accent-ink); }
.lesson-body { display: grid; gap: 10px; padding: 4px 18px 18px; max-width: 72ch; } .lesson-body p, .lesson-body ul { margin: 0; }
.lesson-example { border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; padding: 8px 12px; }
.lesson-fig { margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); } .plan-diagram { width: 100%; max-width: 420px; height: auto; display: block; }
.pd-line { stroke-width: 1.2; stroke-dasharray: 5 4; } .pd-price { stroke: var(--text); stroke-width: 2; stroke-linejoin: round; }
line.pd-target, line.pd-entry { stroke: var(--accent); } line.pd-stop { stroke: var(--bad); } line.pd-entry { stroke-dasharray: none; }
.pd-label { font: 600 11px var(--font); } text.pd-target, text.pd-entry { fill: var(--accent); } text.pd-stop { fill: var(--bad); } .pd-note { font: 10px var(--font); fill: var(--muted); }
.gloss { display: grid; gap: 8px; } .gloss-list { display: grid; gap: 10px; margin: 0; max-height: 420px; overflow: auto; padding-right: 6px; }
.gloss-list dt { font-weight: 600; } .gloss-list dd { margin: 2px 0 0; } .gloss-ex { display: block; font-size: .85rem; }
/* онбординг-тур */
.tour-backdrop { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; padding: 16px; background: rgba(3, 6, 8, .68); }
.tour-dialog { width: min(460px, 100%); display: grid; gap: 10px; padding: 20px; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); }
.tour-dialog p, .tour-title { margin: 0; } .tour-title { font-size: 1.15rem; letter-spacing: -.01em; } .tour-text { line-height: 1.55; }
.tour-dots { display: flex; gap: 6px; } .tour-dot { width: 22px; height: 4px; border-radius: 2px; background: var(--line-2); } .tour-dot.on { background: var(--accent); }
.tour-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .tour-spacer { flex: 1; }
@media (min-width: 900px) { .tour-backdrop { align-items: center; } }

/* тур: подсветка цели (контур + затемнение вокруг, цель не перекрыта), позиция карточки рядом с целью */
.tour-ring { position: fixed; z-index: 1; border-radius: 12px; border: 2px solid var(--accent); box-shadow: 0 0 0 100vmax rgba(3, 6, 8, .68), 0 0 22px rgba(16, 185, 129, .35); pointer-events: none; }
.tour-backdrop.has-target { background: transparent; }
.tour-dialog { position: relative; z-index: 2; }
.tour-dialog[data-place="near"] { position: fixed; width: min(460px, calc(100vw - 28px)); }
.tour-dialog[data-place="top"] { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); width: min(460px, calc(100vw - 32px)); }
.tour-dialog[data-place="bottom"] { position: relative; }

/* нижняя панель навигации: только узкие экраны (<= 600 px) */
.bottombar, .more-sheet, .more-scrim { display: none; }
@media (max-width: 600px) {
  .nav { display: none; }
  main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .bottombar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 4px; }
  .bottombar a, .bar-more { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 48px; padding: 4px 2px; font: inherit; font-size: .78rem; line-height: 1.15; color: var(--muted); text-decoration: none; background: transparent; border: 0; border-radius: 10px; cursor: pointer; transition: background .15s, color .15s; }
  .bottombar a[aria-current="page"], .bar-more.has-current, .bar-more[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .more-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 41; background: rgba(3, 6, 8, .6); }
  .more-sheet:not([hidden]) { display: grid; gap: 2px; position: fixed; left: 0; right: 0; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 42; max-height: 70vh; overflow-y: auto; padding: 10px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius) var(--radius) 0 0; box-shadow: var(--shadow); }
  .more-sheet a { display: flex; align-items: center; min-height: 48px; padding: 8px 14px; color: var(--text); text-decoration: none; border-radius: 10px; }
  .more-sheet a:hover { background: var(--surface); }
  .more-sheet a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .more-sheet .nav-sep { margin: 10px 14px 2px; }
}
main:focus-visible { outline: none; }
