/* Analyst Desk · v3 · тёмный терминал, современный стиль
 * сигнатура: пятиступенчатая шкала решения (Sell … Buy) и лента этапов анализа
 * motion: одно появление на экран, живые значения; только transform/opacity */
@import url("./tokens.css");
@import url("./base.css");

:root {
  --font-display: "Onest", "Golos Text", ui-sans-serif, system-ui, sans-serif;
  --font-body: var(--font-display);
  --font-outlier: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;
  --color-paper: #080B11; --color-paper-2: #0E131C; --color-paper-3: #151B27;
  --color-ink: #EEF1F6; --color-ink-2: #BCC4D2; --color-muted: #8793A7;
  --color-rule: #1C2432; --color-rule-2: #2A3445;
  --color-accent: #7C97FF; --color-accent-ink: #091034; --color-accent-soft: #1A2447; --color-focus: #A9BAFF;
  --color-cool: #7C97FF; --color-live: #F2B84B;
  --color-ok: #3DD598; --color-ok-soft: #0F2A22; --color-bad: #FF6B73; --color-bad-soft: #2E1519; --color-error: #FF8A90;
  --color-hold: #9AA6B8;
  --radius-card: 16px; --radius-pill: 10px; --radius-chip: 999px;
  --control-h: 40px; --label-w: 172px; --side-w: 380px;
  --container: 1560px; --gutter: 32px; --gap-columns: 20px;
  --tracking-display: -0.02em; --display-weight: 600;
  --text-3xl: 2.6rem;
}
body { font-size: 0.9375rem; background:
  radial-gradient(1100px 520px at 12% -8%, color-mix(in oklab, var(--color-accent) 9%, transparent), transparent 70%),
  var(--color-paper); background-attachment: fixed; }
h1 { font-size: 2.1rem; max-width: none; line-height: 1.1; }
h2 { font-size: 1.05rem; max-width: none; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 0.9rem; max-width: none; font-weight: 600; color: var(--color-ink-2); }
.mono { font-family: var(--font-outlier); font-variant-numeric: tabular-nums slashed-zero; }
.muted { color: var(--color-muted); }
.small { font-size: 0.8125rem; }
.label { font-size: 0.78rem; color: var(--color-muted); font-weight: 500; letter-spacing: 0.01em; }

/* motion */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes flash { from { background-color: var(--color-accent-soft); } to { background-color: transparent; } }
@keyframes drift { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.rise { animation: rise 480ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }
[data-enter="1"] > * { animation: rise 480ms var(--ease-out) both; }
[data-enter="1"] > *:nth-child(2) { animation-delay: 50ms; } [data-enter="1"] > *:nth-child(3) { animation-delay: 100ms; }
[data-enter="1"] > *:nth-child(4) { animation-delay: 150ms; } [data-enter="1"] > *:nth-child(5) { animation-delay: 200ms; }
[data-enter="1"] > *:nth-child(n+6) { animation-delay: 250ms; }
[data-enter="1"] .bar-seg { transform-origin: left center; animation: grow 800ms var(--ease-out) both; animation-delay: 260ms; }
[data-enter="1"] .tl-row.sub .bar-seg { animation-delay: 380ms; }
[data-enter="1"] .pin { animation: rise 500ms var(--ease-out) both; animation-delay: 900ms; }
.strip.enter .spark polyline { animation: reveal 900ms var(--ease-out) both; animation-delay: 200ms; }
.strip.enter .cell { animation: rise 480ms var(--ease-out) both; }
.strip.enter .cell:nth-child(2) { animation-delay: 60ms; } .strip.enter .cell:nth-child(3) { animation-delay: 120ms; } .strip.enter .cell:nth-child(4) { animation-delay: 180ms; }
.feed tr.new td { animation: flash 1600ms var(--ease-out) both; }

/* top bar */
.bar { background: color-mix(in oklab, var(--color-paper) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--color-rule); position: sticky; top: 0; z-index: var(--z-sticky-nav); }
.bar .container { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-lg); min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.02rem; letter-spacing: -0.01em; text-decoration: none; color: var(--color-ink); }
.brand .mark { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(160deg, var(--color-accent), color-mix(in oklab, var(--color-accent) 55%, #000)); display: grid; place-items: end center; padding-bottom: 4px; }
.brand .mark i { display: block; width: 12px; height: 10px; background: linear-gradient(to top, var(--color-accent-ink) 0 3px, transparent 3px) 0 100%/3px 100% no-repeat, linear-gradient(to top, var(--color-accent-ink) 0 6px, transparent 6px) 4.5px 100%/3px 100% no-repeat, linear-gradient(to top, var(--color-accent-ink) 0 9px, transparent 9px) 9px 100%/3px 100% no-repeat; }
.brand small { font-weight: 500; color: var(--color-muted); font-size: 0.78rem; }
.hstat { font-size: 0.8125rem; color: var(--color-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hstat:not(:empty)::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--color-live); margin-right: 8px; animation: pulse 1.6s ease-in-out infinite; vertical-align: 1px; }
.hstat b { color: var(--color-ink); font-weight: 600; }
.prog { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--color-accent); transform-origin: left center; transform: scaleX(0); transition: transform 1s linear; }
.who { display: flex; align-items: center; gap: 10px; font-size: 0.8125rem; color: var(--color-ink-2); min-width: 0; }
.who .ava { width: 28px; height: 28px; border-radius: 50%; background: var(--color-paper-3); border: 1px solid var(--color-rule-2); display: grid; place-items: center; font-weight: 600; font-size: 0.75rem; flex: none; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28ch; }
.who em { font-style: normal; font-size: 0.7rem; color: var(--color-accent); border: 1px solid color-mix(in oklab, var(--color-accent) 40%, transparent); border-radius: var(--radius-chip); padding: 1px 8px; margin-left: 8px; }

/* controls */
.btn { min-height: var(--control-h); padding: 0 16px; border: 1px solid var(--color-rule-2); background: var(--color-paper-3); color: var(--color-ink); font-weight: 500; cursor: pointer; border-radius: var(--radius-pill); transition: background-color 140ms var(--ease-out), border-color 140ms var(--ease-out), transform 140ms var(--ease-out), opacity 140ms; }
.btn:hover { border-color: var(--color-muted); background: color-mix(in oklab, var(--color-paper-3) 70%, var(--color-ink) 6%); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--color-accent); color: var(--color-accent-ink); border-color: transparent; font-weight: 600; box-shadow: 0 6px 24px -10px var(--color-accent); }
.btn.primary:hover { background: color-mix(in oklab, var(--color-accent) 88%, #fff); }
.btn.sm { min-height: 30px; padding: 0 12px; font-size: 0.8125rem; border-radius: 8px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
input[type="text"], input[type="password"], input[type="date"], select { width: 100%; min-height: var(--control-h); padding: 0 12px; background: var(--color-paper); color: var(--color-ink); border: 1px solid var(--color-rule-2); border-radius: var(--radius-pill); transition: border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out); }
input:hover, select:hover { border-color: var(--color-muted); }
input:focus-visible, select:focus-visible { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-accent) 28%, transparent); }
input.mono { font-family: var(--font-outlier); }
#f-ticker { font-size: 1.15rem; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; min-height: 48px; }
.field { display: grid; gap: 6px; margin-top: var(--space-sm); }
.help { min-height: 1lh; font-size: 0.8125rem; color: var(--color-muted); }
.help.err { color: var(--color-error); }
.help button { background: none; border: 0; padding: 0; color: var(--color-accent); font: inherit; text-decoration: underline; text-underline-offset: 0.16em; cursor: pointer; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.checks label { position: relative; display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border: 1px solid var(--color-rule-2); border-radius: var(--radius-chip); font-size: 0.8125rem; cursor: pointer; color: var(--color-ink-2); background: var(--color-paper); transition: background-color 140ms var(--ease-out), border-color 140ms var(--ease-out), color 140ms; }
.checks label:hover { border-color: var(--color-muted); }
.checks input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.checks label:has(input:checked) { background: var(--color-accent-soft); border-color: color-mix(in oklab, var(--color-accent) 60%, transparent); color: var(--color-ink); }
.checks label:has(input:checked)::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--color-accent); margin-right: 8px; }
.checks label:has(input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 2px; }
@media (pointer: coarse) { .btn, input[type="text"], input[type="password"], input[type="date"], select { min-height: 46px; } .btn.sm { min-height: 40px; } }

/* layout */
.app { padding-block: var(--space-lg) var(--space-2xl); display: grid; gap: var(--space-lg); }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); gap: var(--gap-columns); align-items: start; }
@media (max-width: 70rem) { .grid { grid-template-columns: minmax(0, 1fr); } }
.panel { color: var(--color-ink); background: linear-gradient(180deg, color-mix(in oklab, var(--color-paper-2) 92%, var(--color-ink) 3%), var(--color-paper-2)); border: 1px solid var(--color-rule); border-radius: var(--radius-card); padding: 22px; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-md); align-content: start; min-width: 0; }
.panel > header { display: flex; justify-content: space-between; align-items: center; gap: var(--space-md); flex-wrap: wrap; }
.side { display: grid; gap: var(--gap-columns); min-width: 0; }
.main { display: grid; gap: var(--gap-columns); min-width: 0; }
@media (min-width: 70.01rem) { #newrun { position: sticky; top: 76px; } }
@media (max-width: 40rem) { .panel { padding: 16px; border-radius: 14px; } }
.crow .st .mono { white-space: nowrap; }

/* node status: compact bento */
#strip { display: grid; gap: 0; }
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.cell { background: var(--color-paper-2); border: 1px solid var(--color-rule); border-radius: 14px; padding: 14px 18px 12px; display: grid; gap: 2px; align-content: start; min-width: 0; }
.fig { font-family: var(--font-outlier); font-size: 1.7rem; letter-spacing: -0.04em; line-height: 1.15; font-variant-numeric: tabular-nums slashed-zero; white-space: nowrap; font-weight: 400; }
.fig .u { font-size: 0.78rem; color: var(--color-muted); letter-spacing: 0; margin-left: 8px; }
.fig.text { font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; letter-spacing: -0.01em; white-space: normal; overflow-wrap: anywhere; }
.fig.text .state-ok::before, .fig.text .state-bad::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 8px; vertical-align: 1px; box-shadow: 0 0 0 4px color-mix(in oklab, currentColor 18%, transparent); }
.spark { width: 100%; height: 26px; margin-top: 6px; }
.spark polyline { fill: none; stroke: var(--color-cool); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.spark line { stroke: var(--color-rule-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.state-ok { color: var(--color-ok); } .state-bad { color: var(--color-bad); } .state-live { color: var(--color-live); }
.more { margin-top: 8px; }
.more > summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; color: var(--color-muted); font-weight: 500; font-size: 0.8125rem; list-style: none; transition: color 180ms; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after { content: "+"; margin-left: 8px; font-family: var(--font-outlier); }
.more[open] > summary::after { content: "–"; }
.more > summary:hover, .more[open] > summary { color: var(--color-ink); }
.stripmore > .strip { margin-top: 8px; }

/* session */
.head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.head .ttl { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; }
.head .ticker { font-family: var(--font-outlier); font-size: var(--text-3xl); font-weight: 500; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: slashed-zero; }
.verdict { font-weight: 600; font-size: 1.5rem; letter-spacing: -0.02em; line-height: 1; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.facts div { background: var(--color-paper); border: 1px solid var(--color-rule); border-radius: 12px; padding: 10px 14px; display: grid; gap: 0; }
.facts b { font-family: var(--font-outlier); font-weight: 400; font-size: 1.35rem; letter-spacing: -0.04em; font-variant-numeric: tabular-nums slashed-zero; }

/* the scale: five-tier verdict */
.scale { display: grid; gap: 10px; background: var(--color-paper); border: 1px solid var(--color-rule); border-radius: 14px; padding: 16px 18px 14px; }
.scale .row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.scale .seg { height: 10px; border-radius: 3px; background: var(--color-rule-2); opacity: 0.55; position: relative; transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out); }
.scale .seg.on { opacity: 1; transform: scaleY(1.9); }
.scale .seg[data-t="0"].on { background: var(--color-bad); } .scale .seg[data-t="1"].on { background: color-mix(in oklab, var(--color-bad) 55%, var(--color-hold)); }
.scale .seg[data-t="2"].on { background: var(--color-hold); }
.scale .seg[data-t="3"].on { background: color-mix(in oklab, var(--color-ok) 55%, var(--color-hold)); } .scale .seg[data-t="4"].on { background: var(--color-ok); }
.scale .names { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; font-size: 0.72rem; color: var(--color-muted); text-align: center; }
.scale .names span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scale .names span.on { color: var(--color-ink); font-weight: 600; }
.scale .gloss { font-size: 0.8125rem; color: var(--color-ink-2); }
.scale .gloss b { color: var(--color-ink); font-weight: 600; }
.scale.wait .gloss { color: var(--color-muted); }

/* timeline */
.tl { display: grid; gap: 0; border-top: 1px solid var(--color-rule); }
.tl-row { display: grid; grid-template-columns: var(--label-w) minmax(0, 1fr); align-items: center; border-bottom: 1px solid var(--color-rule); min-height: 36px; }
.tl-row .name { font-size: 0.8125rem; padding-right: var(--space-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-row.sub .name { color: var(--color-muted); padding-left: var(--space-md); }
.track { position: relative; height: 36px; }
.bar-seg { position: absolute; top: 12px; height: 12px; background: var(--color-cool); border-radius: 4px; overflow: hidden; }
.bar-seg.active { background: var(--color-live); }
.bar-seg.active::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in oklab, #fff 45%, transparent), transparent); animation: drift 2.2s linear infinite; animation-delay: var(--ph, 0s); }
.bar-seg.stopped { background: var(--color-rule-2); }
.bar-seg.approx { background-image: repeating-linear-gradient(90deg, transparent 0 5px, var(--color-paper-2) 5px 6px); }
.pin { position: absolute; top: 10px; width: 2px; height: 16px; background: var(--color-muted); border-radius: 1px; }
.pin.agent { background: var(--color-live); top: 6px; height: 24px; }
.axis { display: grid; grid-template-columns: var(--label-w) minmax(0, 1fr); margin-top: 4px; }
.ticks { position: relative; height: 22px; }
.tick { position: absolute; top: 0; font-size: 0.7rem; color: var(--color-muted); font-family: var(--font-outlier); padding-left: 4px; border-left: 1px solid var(--color-rule-2); height: 100%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tick.end { transform: translateX(-100%); border-left: 0; border-right: 1px solid var(--color-rule-2); padding-left: 0; padding-right: 4px; }
.legend { display: flex; gap: var(--space-lg); flex-wrap: wrap; font-size: 0.78rem; color: var(--color-muted); }
.legend i { display: inline-block; width: 18px; height: 8px; margin-right: 8px; vertical-align: baseline; border-radius: 3px; }
.legend .a { background: var(--color-cool); } .legend .b { background: var(--color-live); } .legend .c { width: 2px; height: 14px; background: var(--color-muted); vertical-align: middle; }
.well { background: var(--color-paper); border: 1px solid var(--color-rule); border-radius: 14px; padding: 6px 16px 10px; }
.well .tl { border-top: 0; }
.well .tl-row:last-child { border-bottom: 0; }

/* tables and log */
.table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.table th { text-align: left; font-weight: 500; color: var(--color-muted); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--color-rule-2); white-space: nowrap; font-size: 0.75rem; }
.table td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--color-rule); vertical-align: middle; transition: background-color 180ms var(--ease-out); }
.table tr.pick td { background: color-mix(in oklab, var(--color-accent) 7%, transparent); }
.table tr.pick td:first-child { box-shadow: inset 2px 0 var(--color-accent); padding-left: 12px; }
.table tr.row { cursor: pointer; }
.table tr.row:hover td { background: var(--color-paper-3); }
.table td.t { white-space: nowrap; color: var(--color-muted); font-family: var(--font-outlier); font-variant-numeric: tabular-nums; }
.table td b { font-family: var(--font-outlier); font-weight: 500; font-size: 0.9rem; letter-spacing: -0.01em; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 10px; border-radius: var(--radius-chip); font-size: 0.75rem; font-weight: 500; border: 1px solid var(--color-rule-2); color: var(--color-ink-2); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.up { color: var(--color-ok); background: var(--color-ok-soft); border-color: color-mix(in oklab, var(--color-ok) 30%, transparent); }
.pill.down { color: var(--color-bad); background: var(--color-bad-soft); border-color: color-mix(in oklab, var(--color-bad) 30%, transparent); }
.pill.live { color: var(--color-live); border-color: color-mix(in oklab, var(--color-live) 35%, transparent); }
.pill.live::before { animation: pulse 1.4s ease-in-out infinite; }
.feed { max-height: 360px; overflow: auto; background: var(--color-paper); border: 1px solid var(--color-rule); border-radius: 12px; padding-inline: 12px; }
.feed .table { table-layout: fixed; }
.feed .table col.c1 { width: 84px; } .feed .table col.c2 { width: 80px; }
.feed .table td { padding-block: 8px; }
.feed td.x { overflow-wrap: anywhere; }
.k-agent { color: var(--color-live); } .k-data { color: var(--color-cool); } .k-sys { color: var(--color-muted); }
@media (max-width: 40rem) {
  .table.stack thead { display: none; }
  .table.stack tr { display: grid; grid-template-columns: 1fr 1fr; padding: 8px 0; border-bottom: 1px solid var(--color-rule); }
  .table.stack td { border: 0; padding: 2px 0; }
  .table.stack td::before { content: attr(data-l); display: block; color: var(--color-muted); font-size: 0.7rem; }
  .tl-row, .axis { grid-template-columns: 96px minmax(0, 1fr); }
  .bar .container { grid-template-columns: auto minmax(0, 1fr); }
  .bar .hstat { display: none; }
  .who { justify-content: flex-end; }
  .who span, .who em { display: none; }
  .head .ticker { font-size: 2.1rem; }
}

/* connections */
.rows { display: grid; }
.crow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; padding: 12px 0; border-bottom: 1px solid var(--color-rule); align-items: center; }
.crow .nm { font-weight: 500; } .crow .st { font-size: 0.8125rem; color: var(--color-muted); }
.crow .acts { display: flex; gap: 8px; }
.crow .edit { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
.group { font-weight: 600; font-size: 0.8125rem; color: var(--color-ink-2); padding-bottom: 6px; border-bottom: 1px solid var(--color-rule-2); }

/* states */
.skel { display: block; height: 1em; background: var(--color-rule); border-radius: 6px; margin-block: 8px; position: relative; overflow: hidden; }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--color-ink) 10%, transparent), transparent); animation: drift 1.4s linear infinite; }
.empty, .error { padding: var(--space-lg) 0; display: grid; gap: var(--space-sm); justify-items: start; }
.error { color: var(--color-error); }
.pre { white-space: pre-wrap; font-family: var(--font-outlier); font-size: 0.75rem; color: var(--color-ink-2); max-height: 160px; overflow: auto; background: var(--color-bad-soft); border: 1px solid color-mix(in oklab, var(--color-bad) 25%, transparent); padding: 12px; border-radius: 12px; }

.tgbox { min-height: 48px; display: grid; justify-items: start; }
.facts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.facts.three div { padding: 8px 12px; }
.facts.three b { font-size: 1.1rem; }
.acts2 { white-space: nowrap; text-align: right; }
.acts2 .btn { margin-left: 4px; }
.panel p { overflow-wrap: anywhere; }
.table td:last-child, .table th:last-child { padding-right: 0; }

/* sign-in: split screen */
.gate { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); padding: 0; place-items: stretch; }
.gate .hero { padding: clamp(32px, 6vw, 96px); display: grid; align-content: space-between; gap: 48px; border-right: 1px solid var(--color-rule); position: relative; overflow: hidden; }
.gate .hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(var(--color-rule) 1px, transparent 1px) 0 0/100% 56px, linear-gradient(90deg, var(--color-rule) 1px, transparent 1px) 0 0/56px 100%; opacity: 0.35; mask-image: radial-gradient(70% 70% at 30% 30%, #000, transparent); -webkit-mask-image: radial-gradient(70% 70% at 30% 30%, #000, transparent); pointer-events: none; }
.gate .hero > * { position: relative; }
.gate .hero h1 { font-size: clamp(2rem, 3.6vw, 3.2rem); line-height: 1.05; max-width: 20ch; letter-spacing: -0.035em; text-wrap: balance; }
.gate .hero .lead { margin-top: 18px; color: var(--color-ink-2); max-width: 46ch; font-size: 1.02rem; }
.gate .points { display: grid; gap: 14px; max-width: 46ch; }
.gate .points div { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 4px 12px; color: var(--color-ink-2); font-size: 0.9rem; }
.gate .points b { color: var(--color-ink); font-weight: 600; display: block; }
.gate .points i { width: 28px; height: 28px; border-radius: 8px; background: var(--color-paper-3); border: 1px solid var(--color-rule-2); display: grid; place-items: center; font-style: normal; font-size: 0.8rem; color: var(--color-accent); font-family: var(--font-outlier); }
.gate .box { align-self: center; justify-self: center; width: min(100%, 26rem); display: grid; gap: var(--space-md); padding: var(--space-xl) var(--space-lg); animation: rise 520ms var(--ease-out) both; }
.gate .box h2 { font-size: 1.5rem; letter-spacing: -0.02em; }
.gate .box.solo { border: 1px solid var(--color-rule); background: var(--color-paper-2); border-radius: var(--radius-card); }
.gate .hero .scale { max-width: 460px; }
@media (max-width: 60rem) {
  .gate { grid-template-columns: minmax(0, 1fr); }
  .gate .hero { border-right: 0; border-bottom: 1px solid var(--color-rule); padding: 28px 20px; gap: 28px; }
  .gate .hero .points { display: none; }
  .gate .hero h1 { font-size: 1.9rem; }
  .gate .box { padding: 28px 20px 40px; }
}
.gate .box.solo { grid-column: 1 / -1; }

/* mobile order: form first, then session */
@media (max-width: 70rem) {
  .grid { display: flex; flex-direction: column; gap: var(--gap-columns); }
  .main, .side { display: contents; }
  #newrun { order: 1; } #session { order: 2; } #history { order: 3; } #people, #conns, #acct { order: 4; }
}
@media (max-width: 40rem) {
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cell { padding: 12px 14px 10px; }
  .fig { font-size: 1.35rem; } .fig.text { font-size: 1rem; }
  .scale { padding: 14px 12px 12px; } .scale .names { font-size: 0.62rem; }
}

/* ===== v4: teal terminal shell ===== */
:root { --color-paper: #0A0E18; --color-paper-2: #151A2A; --color-accent: #1FC8A0; --accent: #1FC8A0; --ok: #1FC8A0; --bad: #FF6B73; --muted: #8A93AD; --line: #232A3F; --raised: #1D2336; --side: #111625; --color-rule: #232A3F; }
body { background: #0A0E18; }
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.snav { position: sticky; top: 0; height: 100vh; background: var(--side); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 22px; }
.snav .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: #fff; text-decoration: none; padding: 0 8px; }
.snav nav { display: flex; flex-direction: column; gap: 4px; }
.ni { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 500; transition: background .15s, color .15s; }
.ni:hover { background: var(--raised); color: #fff; }
.ni.on { background: color-mix(in oklab, var(--accent) 16%, transparent); color: var(--accent); }
.ico { width: 20px; height: 20px; flex: none; }
.stage { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 18px; padding: 16px 28px; background: color-mix(in oklab, #0A0E18 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .tt { flex: 1; min-width: 0; } .topbar h1 { font-size: 20px; margin: 0; } .topbar p { margin: 2px 0 0; font-size: 13px; }
.topbar .who { display: flex; align-items: center; gap: 10px; } .topbar .wn { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .prog { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); opacity: 0; }
.topbar .prog.on { opacity: 1; }
.view { padding: 24px 28px 48px; display: grid; gap: 20px; align-content: start; max-width: 1280px; width: 100%; box-sizing: border-box; }
.narrow { max-width: 760px; }
.panel { background: var(--color-paper-2); border-radius: 18px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--color-paper-2); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; gap: 6px; }
.kpi b { font-size: 26px; font-weight: 600; } .kpi b.up { color: var(--ok); } .kpi b.down { color: var(--bad); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } .two.wide { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.donutw { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; } .donut { width: 150px; height: 150px; } .donut .dn { fill: #fff; font-size: 26px; font-weight: 600; } .donut .dl { fill: var(--muted); font-size: 10px; }
.dleg { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; flex: 1; min-width: 150px; } .dleg li { display: flex; align-items: center; gap: 8px; } .dleg li b { margin-left: auto; } .dleg i { width: 10px; height: 10px; border-radius: 3px; }
.cal { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 4px; } .cal .d { aspect-ratio: 1; border-radius: 4px; background: var(--raised); display: block; }
.cal .l1 { background: color-mix(in oklab, var(--accent) 35%, var(--raised)); } .cal .l2 { background: color-mix(in oklab, var(--accent) 65%, var(--raised)); } .cal .l3 { background: var(--accent); } .cal .fut { opacity: .25; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.rcard { background: var(--color-paper-2); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; gap: 8px; text-decoration: none; color: inherit; transition: transform .15s, border-color .15s; }
.rcard:hover { transform: translateY(-2px); border-color: var(--accent); } .rcard .rtop { display: flex; justify-content: space-between; align-items: center; gap: 8px; } .rcard .rt { font-size: 20px; }
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; } .back:hover { color: var(--accent); }
.pchart { width: 100%; height: auto; } .pchart .gl { stroke: var(--line); } .pchart .gt { fill: var(--muted); font-size: 10px; } .pchart .mk { stroke: var(--accent); stroke-dasharray: 3 3; }
.args { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } .arg h3 { margin: 0; } .arg.bull { border-top: 3px solid var(--ok); } .arg.bear { border-top: 3px solid var(--bad); } .arg.risk { border-top: 3px solid #F2B84B; }
.arg .md, .acc .md { max-height: 420px; overflow: auto; }
.md { line-height: 1.6; } .md h1, .md h2, .md h3, .md h4 { font-size: 15px; margin: 14px 0 6px; } .md p { margin: 0 0 10px; } .md ul, .md ol { padding-left: 20px; } .md table { border-collapse: collapse; font-size: 13px; } .md td, .md th { border: 1px solid var(--line); padding: 4px 8px; }
.acc { border-top: 1px solid var(--line); padding: 10px 0; } .acc summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
@media (max-width: 62rem) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .args, .two, .two.wide { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 48rem) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .snav { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 20; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); }
  .snav .brand { display: none; } .snav nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .ni { flex-direction: column; gap: 3px; font-size: 11px; padding: 6px 8px; } .ni.on { background: none; }
  .topbar { padding: 12px 16px; } .topbar .wn, .topbar .who em { display: none; }
  .view { padding: 16px 16px 96px; }
}
#report { display: grid; gap: 20px; min-width: 0; } .rhead .ticker { font-size: 38px; font-weight: 600; font-family: "Geist Mono", monospace; }
.arg { align-content: start; } .arg .md { max-height: 360px; }
.spark polyline { stroke: var(--accent); } .brand .mark { background: linear-gradient(135deg, #1FC8A0, #0E8F73); }
.btn.sm { min-height: 36px; } .snav .brand { min-height: 36px; }
.ni:focus-visible, .rcard:focus-visible, .btn:focus-visible, .back:focus-visible, .acc summary:focus-visible, tr.row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* v4.1 mobile header fix */
.topbar h1 { white-space: nowrap; }
input[type="date"], input[type="text"], select { max-width: 100%; min-width: 0; box-sizing: border-box; }
input[type="date"] { width: 100%; text-align: left; -webkit-appearance: none; appearance: none; min-height: 44px; }
.hstat:empty { display: none; }
@media (max-width: 48rem) {
  .topbar { flex-wrap: wrap; gap: 8px 12px; }
  .topbar .tt { flex: 1 1 60%; min-width: 0; }
  .topbar .tt p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .who { flex: 0 0 auto; margin-left: auto; }
  .topbar .hstat { order: 3; flex: 1 0 100%; font-size: 13px; padding: 6px 10px; background: var(--raised); border-radius: 10px; }
}
/* v4.2: календарь и карточки истории на всю ширину телефона */
.cal { display: grid; width: 100%; grid-template-columns: repeat(14, minmax(0, 1fr)); grid-template-rows: repeat(7, auto); grid-auto-flow: column; gap: 4px; }
.cal .d { width: 100%; aspect-ratio: 1; }
@media (max-width: 48rem) {
  .view.v-runs .two { grid-template-columns: minmax(0, 1fr); }
  .view.v-runs .panel { width: 100%; box-sizing: border-box; }
  .cal { gap: 3px; }
  .donutw { justify-content: center; }
  .dleg { min-width: 0; width: 100%; }
}
/* v4.3 login button */
a.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.tgbox { display: grid; gap: 12px; justify-items: stretch; }
.tgbox .tgbtn { width: 100%; min-height: 52px; font-size: 16px; font-weight: 600; border-radius: 14px; }
.tgbox .help { margin: 0; text-align: center; }
