/* Infra Cost Advisor. One stylesheet, no framework. Light and dark themes share every rule;
   only the tokens below differ. The theme follows the system unless the visitor picked one. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/static/fonts/inter-cyrillic-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/static/fonts/inter-latin-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("/static/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }

:root {
  --bg: #f5f6f8;
  --bg-side: #fbfbfc;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --line: #e3e5ea;
  --line-strong: #cfd3da;
  --ink: #0b0c0f;
  --ink-2: #30343c;
  --muted: #646b77;
  --accent: #0a8558;
  --accent-hover: #087a50;
  --accent-ink: #ffffff;
  --accent-text: #08774e;
  --accent-soft: #e1f5ea;
  --act: #0a8558;
  --act-soft: #e1f5ea;
  --question: #a15c07;
  --question-soft: #fcf1d8;
  --check: #3b5bdb;
  --check-soft: #e8edff;
  --error: #c0362c;
  --error-soft: #fdecea;
  --code: #f1f2f5;
  --term: #0d0f12;
  --term-ink: #e6e8eb;
  --shadow-sm: 0 1px 2px rgba(15, 18, 25, 0.05);
  --shadow: 0 1px 2px rgba(15, 18, 25, 0.04), 0 10px 30px -12px rgba(15, 18, 25, 0.12);
  --shadow-lg: 0 2px 4px rgba(15, 18, 25, 0.04), 0 40px 80px -30px rgba(15, 18, 25, 0.28);
  --glow-1: rgba(16, 178, 116, 0.18);
  --glow-2: rgba(34, 184, 207, 0.14);
  --grid: rgba(15, 18, 25, 0.045);
  --nav-bg: rgba(245, 246, 248, 0.78);
  --radius: 14px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090a0c; --bg-side: #0c0d10; --surface: #111317; --surface-2: #171a1f; --line: #22252c; --line-strong: #30343d;
    --ink: #eef0f3; --ink-2: #c8ccd3; --muted: #8a909b;
    --accent: #3ecf8e; --accent-hover: #55dba0; --accent-ink: #04140d; --accent-text: #4fdc9d; --accent-soft: rgba(62, 207, 142, 0.12);
    --act: #3ecf8e; --act-soft: rgba(62, 207, 142, 0.12); --question: #f3b44a; --question-soft: rgba(243, 180, 74, 0.12);
    --check: #8aa4ff; --check-soft: rgba(138, 164, 255, 0.13); --error: #ff8375; --error-soft: rgba(255, 131, 117, 0.12);
    --code: #1a1d23; --term: #07080a; --term-ink: #e6e8eb;
    --shadow-sm: none; --shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset; --shadow-lg: 0 60px 120px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    --glow-1: rgba(62, 207, 142, 0.2); --glow-2: rgba(34, 184, 207, 0.14); --grid: rgba(255, 255, 255, 0.04); --nav-bg: rgba(9, 10, 12, 0.72);
  }
}
:root[data-theme="dark"] {
  --bg: #090a0c; --bg-side: #0c0d10; --surface: #111317; --surface-2: #171a1f; --line: #22252c; --line-strong: #30343d;
  --ink: #eef0f3; --ink-2: #c8ccd3; --muted: #8a909b;
  --accent: #3ecf8e; --accent-hover: #55dba0; --accent-ink: #04140d; --accent-text: #4fdc9d; --accent-soft: rgba(62, 207, 142, 0.12);
  --act: #3ecf8e; --act-soft: rgba(62, 207, 142, 0.12); --question: #f3b44a; --question-soft: rgba(243, 180, 74, 0.12);
  --check: #8aa4ff; --check-soft: rgba(138, 164, 255, 0.13); --error: #ff8375; --error-soft: rgba(255, 131, 117, 0.12);
  --code: #1a1d23; --term: #07080a; --term-ink: #e6e8eb;
  --shadow-sm: none; --shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset; --shadow-lg: 0 60px 120px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  --glow-1: rgba(62, 207, 142, 0.2); --glow-2: rgba(34, 184, 207, 0.14); --grid: rgba(255, 255, 255, 0.04); --nav-bg: rgba(9, 10, 12, 0.72);
}
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
:root { color-scheme: light dark; }

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.6 var(--sans); font-feature-settings: "cv11", "ss03", "calt"; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -0.025em; }
h2 { font-size: 17px; line-height: 1.35; }
h3 { font-size: 15px; line-height: 1.4; letter-spacing: -0.01em; }
p { margin: 0 0 12px; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
b, strong { font-weight: 620; }
small { font-size: 0.62em; font-weight: 500; color: var(--muted); letter-spacing: 0; }
code { font-family: var(--mono); font-size: 0.86em; background: var(--code); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
pre { margin: 0; overflow-x: auto; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.quiet { color: var(--muted); font-size: 13px; }
code.quiet { background: transparent; padding: 0; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.5; }
.lead { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 44em; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.icon { width: 16px; height: 16px; flex: none; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.kicker { font-size: 12px; font-weight: 650; letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 12px; }

/* ---------- brand ---------- */

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; letter-spacing: -0.015em; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.logo { width: 28px; height: 28px; flex: none; border-radius: 8px; box-shadow: 0 4px 14px -4px var(--glow-1); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px;
  font: 600 14px/1 var(--sans); letter-spacing: -0.005em; color: var(--ink); white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: background 0.15s, border-color 0.15s, transform 0.05s, box-shadow 0.15s;
}
.btn:hover { text-decoration: none; border-color: var(--line-strong); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 6px 18px -8px var(--glow-1); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--error); }
.btn.danger:hover { background: var(--error-soft); border-color: transparent; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.large { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.65; cursor: progress; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.when-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .when-dark { display: block; } :root:not([data-theme="light"]) .when-light { display: none; } }
:root[data-theme="dark"] .when-dark { display: block; }
:root[data-theme="dark"] .when-light { display: none; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.actions.center { justify-content: center; }

/* ---------- forms ---------- */

.form { display: grid; gap: 16px; max-width: 420px; }
.form.wide { max-width: 620px; }
.form.inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 18px; max-width: none; }
.form.inline.tight { gap: 8px; flex-wrap: nowrap; }
.form label { display: grid; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.form label.check, label.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 400; color: var(--ink-2); line-height: 1.5; }
.form.inline label.check { align-items: center; height: 40px; }
.form .hint { font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%; height: 40px; padding: 0 12px; font: 400 14px/1.4 var(--sans); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { height: auto; padding: 10px 12px; font: 400 13px/1.55 var(--mono); resize: vertical; }
select { width: auto; min-width: 180px; padding-right: 30px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.7; }
input:hover, textarea:hover, select:hover { border-color: var(--line-strong); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"] { flex: none; width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); }

/* ---------- surfaces ---------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); margin: 0 0 16px; }
.card > :last-child { margin-bottom: 0; }
.card > h2 { margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head h2 { margin: 0; }
.card-head p { margin: 4px 0 0; max-width: 60ch; }
.card-head:last-child { margin-bottom: 0; }
.section-title { margin: 32px 0 12px; }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.meta span + span::before { content: "·"; margin-right: 12px; color: var(--line-strong); }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin: 0 0 16px; font-size: 14px; line-height: 1.5; border: 1px solid transparent; }
.banner .icon { width: 18px; height: 18px; margin-top: 1px; }
.banner.info { background: var(--check-soft); color: var(--check); }
.banner.ok { background: var(--act-soft); color: var(--act); }
.banner.warn { background: var(--question-soft); color: var(--question); }
.banner.error { background: var(--error-soft); color: var(--error); }
.banner > div { color: var(--ink); min-width: 0; }
.banner a { font-weight: 600; }
.banner code { background: transparent; padding: 0; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; font-size: 12px; font-weight: 600; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--act-soft); color: var(--act); }
.badge.warn { background: var(--question-soft); color: var(--question); }
.badge.error { background: var(--error-soft); color: var(--error); }
.badge.info { background: var(--check-soft); color: var(--check); }
.badge.info::before { animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

.hint-box { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 14px; }
.hint-box .icon { width: 18px; height: 18px; margin-top: 2px; }
.hint-box p { margin: 0; color: var(--ink-2); }

/* Terminal block */
.term { background: var(--term); color: var(--term-ink); border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.08); overflow: hidden; margin: 0 0 12px; box-shadow: var(--shadow); }
.term-bar { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 8px 0 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.term-dots { display: inline-flex; gap: 6px; }
.term-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.term-title { flex: 1; font-size: 12px; color: rgba(255, 255, 255, 0.45); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term-copy { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; font: 600 12px/1 var(--sans); color: rgba(255, 255, 255, 0.85); background: rgba(255, 255, 255, 0.08); border: 0; border-radius: 7px; cursor: pointer; }
.term-copy:hover { background: rgba(255, 255, 255, 0.16); }
.term-copy .icon { width: 13px; height: 13px; }
.term pre { max-height: 300px; overflow: auto; }
.term pre code { display: block; padding: 14px 16px; background: transparent; color: var(--term-ink); font-size: 13px; line-height: 1.65; white-space: pre; overflow-wrap: normal; border-radius: 0; }
.snippet { background: var(--term); border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.08); }
.snippet code { display: block; padding: 12px 14px; background: transparent; color: var(--term-ink); font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Tiles */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 0 0 14px; }
.tile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 15px; box-shadow: var(--shadow-sm); overflow: hidden; }
.tile-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 550; color: var(--muted); }
.tile-label .icon { width: 26px; height: 26px; padding: 5px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); }
.tile-value { font-size: 30px; font-weight: 680; letter-spacing: -0.035em; line-height: 1.15; margin-top: 12px; font-variant-numeric: tabular-nums; }
.tile-note { font-size: 13px; color: var(--muted); margin-top: 3px; }
.tile.act .tile-label .icon, .tile.accent .tile-label .icon { background: var(--act-soft); color: var(--act); }
.tile.act .tile-value, .tile.accent .tile-value { color: var(--act); }
.tile.act { background: linear-gradient(160deg, var(--act-soft), transparent 70%), var(--surface); border-color: color-mix(in srgb, var(--act) 28%, var(--line)); }
.tile.question .tile-label .icon { background: var(--question-soft); color: var(--question); }
.tile.check .tile-label .icon { background: var(--check-soft); color: var(--check); }

.splitbar { margin: 0 0 20px; }
.splitbar svg { display: block; width: 100%; height: 10px; }
.seg-act { fill: var(--act); background: var(--act); }
.seg-question { fill: var(--question); background: var(--question); }
.seg-check { fill: var(--check); background: var(--check); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend b { color: var(--ink); font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 14px; }
.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; margin: 0 0 16px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table th.num, .table td.num { text-align: right; }
.table td.up { color: var(--question); font-weight: 600; }
.table td.down { color: var(--act); font-weight: 600; }
.card .table th:first-child, .card .table td:first-child { padding-left: 0; }
.card .table th:last-child, .card .table td:last-child { padding-right: 0; }
.card .table tbody tr:hover { background: transparent; }
.row-link { font-weight: 600; color: var(--ink); }
.bar-col { width: 26%; min-width: 90px; }
meter { display: block; width: 100%; height: 6px; border: 0; border-radius: 999px; background: var(--surface-2); appearance: none; -webkit-appearance: none; }
meter::-webkit-meter-bar { height: 6px; background: var(--surface-2); border: 0; border-radius: 999px; }
meter::-webkit-meter-optimum-value, meter::-webkit-meter-suboptimum-value, meter::-webkit-meter-even-less-good-value { background: var(--accent); border-radius: 999px; }
meter::-moz-meter-bar { background: var(--accent); border-radius: 999px; }

/* ---------- cabinet layout ---------- */

body.cabinet { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 18px 12px 12px; background: var(--bg-side); border-right: 1px solid var(--line); }
.side-top { padding: 2px 8px 18px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-link { display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: 9px; font-size: 14px; font-weight: 520; color: var(--ink-2); }
.side-link .icon { width: 17px; height: 17px; color: var(--muted); }
.side-link:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.side-link[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 620; box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.side-link[aria-current="page"] .icon { color: var(--accent-text); }
.side-link.subtle { color: var(--muted); font-size: 13px; }
.side-foot { display: flex; flex-direction: column; gap: 8px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px 6px 4px 8px; border-top: 1px solid var(--line); margin-top: 4px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; border-radius: 9px; font-weight: 650; font-size: 13px; color: var(--accent-ink); background: linear-gradient(135deg, #3ecf8e, #22b8cf); }
.side-user-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.side-user-text b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-text span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user form { display: flex; }
.content { width: 100%; max-width: 1100px; margin: 0 auto; padding: 36px 40px 96px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 24px; flex-wrap: wrap; margin: 0 0 24px; }
.page-sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; max-width: 70ch; }
.page-actions, .run-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; margin: -8px 0 14px; font-size: 13px; font-weight: 550; color: var(--muted); }
.back:hover { color: var(--ink); text-decoration: none; }
.flip { transform: rotate(180deg); }

/* Overview */
.conn-title { display: flex; align-items: center; gap: 14px; }
.conn-title h2 a { color: var(--ink); }
.conn-icon, .empty-icon, .group-icon, .feature-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); }
.conn-icon .icon, .group-icon .icon, .feature-icon .icon { width: 20px; height: 20px; }
.conn-last { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.conn-last a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.conn .splitbar { margin-bottom: 4px; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 680px; margin: 6vh auto 0; }
.empty h1 { font-size: 30px; margin: 20px 0 12px; }
.empty .lead { margin-bottom: 28px; }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; box-shadow: 0 12px 30px -10px var(--glow-1); }
.empty-icon .icon { width: 28px; height: 28px; }
.empty-steps { list-style: none; padding: 0; margin: 0 0 28px; width: 100%; display: grid; gap: 10px; text-align: left; }
.empty-steps li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
.empty-steps div { display: flex; flex-direction: column; }
.empty-steps span:not(.step-n) { color: var(--muted); font-size: 14px; }
.empty.small { margin-top: 24px; padding: 40px 24px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); max-width: none; }
.empty.small h2 { margin: 14px 0 4px; }
.empty.small .btn { margin-top: 12px; }
.step-n { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; border-radius: 9px; font-size: 13px; font-weight: 680; background: var(--accent-soft); color: var(--accent-text); }

/* Connection wizard */
.connect { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.sticky { position: sticky; top: 24px; }
.wizard { list-style: none; counter-reset: step; padding: 0; margin: 0 0 16px; }
.wizard > li { counter-increment: step; position: relative; padding: 0 0 28px 56px; }
.wizard > li::before { content: counter(step); position: absolute; left: 0; top: 0; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 11px; font-weight: 680; font-size: 14px; color: var(--accent-ink); background: var(--accent); box-shadow: 0 8px 20px -8px var(--glow-1); }
.wizard > li::after { content: ""; position: absolute; left: 16.5px; top: 42px; bottom: 6px; width: 1px; background: var(--line); }
.wizard > li:last-child::after { display: none; }
.wizard > li:last-child { padding-bottom: 8px; }
.wizard h2 { font-size: 18px; margin: 5px 0 10px; }
.wizard p { color: var(--ink-2); }
.choice { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; }
.choice a { padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.choice a:hover { text-decoration: none; color: var(--ink); }
.choice a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.disclosure > summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 8px; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.75px solid var(--muted); border-bottom: 1.75px solid var(--muted); transform: rotate(-45deg); transition: transform 0.15s; margin: 0 4px 0 2px; }
.disclosure[open] > summary::before { transform: rotate(45deg); }
.disclosure[open] > summary { margin-bottom: 14px; }
.perms h3 { margin-bottom: 14px; }
.perms ul { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 12px; }
.perms li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--muted); }
.perms li b { color: var(--ink); display: block; }
.perms li .icon { width: 20px; height: 20px; padding: 4px; border-radius: 50%; margin-top: 1px; stroke-width: 2.5; }
.perms li.yes .icon { background: var(--act-soft); color: var(--act); }
.perms li.no .icon { background: var(--surface-2); color: var(--muted); }
ol.plain, ul.plain { margin: 0 0 14px; padding-left: 20px; }
ol.plain li, ul.plain li { margin-bottom: 7px; }
.danger-zone { border-color: color-mix(in srgb, var(--error) 30%, var(--line)); }

/* Run progress */
.progress { max-width: 560px; margin: 8vh auto 0; padding: 36px; text-align: center; }
.progress h1 { margin: 18px 0 8px; }
.pulse { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-text); animation: pulse 2s ease-in-out infinite; }
.pulse .icon { width: 26px; height: 26px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--glow-1); } 50% { box-shadow: 0 0 0 14px transparent; } }
.bar { height: 4px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 22px 0; }
.bar i { display: block; width: 40%; height: 100%; border-radius: 999px; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: slide 1.6s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.stages { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 12px; text-align: left; }
.stages li { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.stage-dot { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.stage-dot .icon { width: 12px; height: 12px; stroke-width: 3; opacity: 0; }
.stages li.done { color: var(--ink); }
.stages li.done .stage-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stages li.done .stage-dot .icon { opacity: 1; }
.stages li.now { color: var(--ink); font-weight: 600; }
.stages li.now .stage-dot { border-color: var(--accent); border-top-color: transparent; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.detail { min-height: 22px; font-size: 13px; color: var(--muted); margin: 0; }

/* Report */
.group { margin: 36px 0 0; }
.group-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.group-title { flex: 1; min-width: 0; }
.group-title h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.group-title p { margin: 2px 0 0; color: var(--muted); font-size: 14px; max-width: 72ch; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--muted); letter-spacing: 0; }
.group-total { font-size: 24px; font-weight: 680; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tone-act .group-icon { background: var(--act-soft); color: var(--act); }
.tone-act .group-total { color: var(--act); }
.tone-question .group-icon { background: var(--question-soft); color: var(--question); }
.tone-check .group-icon { background: var(--check-soft); color: var(--check); }
.tone-keep .group-icon, .tone-plain .group-icon { background: var(--surface-2); color: var(--muted); }
.finding { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; box-shadow: var(--shadow-sm); transition: border-color 0.15s, box-shadow 0.15s; }
.finding:hover { border-color: var(--line-strong); }
.finding[open] { box-shadow: var(--shadow); border-color: var(--line-strong); }
.finding > summary, .mock-row { list-style: none; display: flex; align-items: center; gap: 12px; padding: 13px 16px; cursor: pointer; }
.finding > summary::-webkit-details-marker { display: none; }
.caret, .mock-row > .icon { color: var(--muted); transition: transform 0.15s; }
.finding[open] .caret { transform: rotate(90deg); }
.f-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.res { background: transparent; padding: 0; font-weight: 600; font-size: 13.5px; color: var(--ink); }
.f-title { color: var(--muted); font-size: 13.5px; }
.f-money { font-size: 16px; font-weight: 680; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.f-body { margin: 0; padding: 16px 18px 18px 44px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px 18px; font-size: 14px; }
.f-body dt { color: var(--muted); font-size: 13px; padding-top: 1px; }
.f-body dd { margin: 0; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 500 12px/1.4 var(--mono); background: var(--code); border-radius: 7px; padding: 3px 8px; overflow-wrap: anywhere; color: var(--ink-2); }
.deltas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 14px; }
.deltas div { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; }
.deltas b { font-size: 22px; font-weight: 680; letter-spacing: -0.03em; }
.deltas span { font-size: 13px; color: var(--muted); }

/* Usage and plans */
.usage-grid { display: grid; gap: 18px 32px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-bottom: 16px; }
.usage-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.usage-row b { color: var(--ink); }
.plans { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.plan { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.plan.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 22px; }
.plan-price { font-size: 26px; font-weight: 680; letter-spacing: -0.03em; margin: 10px 0 14px; }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 13px; color: var(--ink-2); }
.plan li { display: flex; gap: 8px; align-items: flex-start; }
.plan li .icon { color: var(--accent-text); margin-top: 3px; width: 14px; height: 14px; stroke-width: 2.5; }

/* ---------- public site ---------- */

body.site { position: relative; overflow-x: hidden; display: flex; flex-direction: column; min-height: 100vh; font-size: 16px; }
.glow { position: absolute; inset: 0 0 auto 0; height: 900px; pointer-events: none; z-index: 0;
  background:
    radial-gradient(600px 380px at 50% -60px, var(--glow-1), transparent 70%),
    radial-gradient(520px 340px at 78% 60px, var(--glow-2), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 56px 56px;
  -webkit-mask-image: linear-gradient(#000 30%, transparent 92%); mask-image: linear-gradient(#000 30%, transparent 92%); }
.site-nav { position: sticky; top: 0; z-index: 10; background: var(--nav-bg); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--line); }
.site-nav-row { display: flex; align-items: center; gap: 28px; height: 64px; }
.site-links { display: flex; gap: 4px; flex: 1; }
.site-links a { padding: 7px 12px; border-radius: 8px; font-size: 14px; font-weight: 520; color: var(--muted); }
.site-links a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.site-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.site-main { position: relative; z-index: 1; flex: 1; padding-bottom: 96px; }
.site-foot { position: relative; z-index: 1; border-top: 1px solid var(--line); padding: 36px 0 44px; color: var(--muted); font-size: 14px; }
.site-foot-row { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.site-foot p { margin: 12px 0 0; max-width: 34em; }
.site-foot nav { display: flex; flex-direction: column; gap: 8px; }
.site-foot nav a { color: var(--muted); }
.site-foot nav a:hover { color: var(--ink); }

.hero { text-align: center; padding: 84px 0 44px; display: flex; flex-direction: column; align-items: center; }
.hero h1 { font-size: clamp(38px, 6.6vw, 72px); line-height: 1.03; letter-spacing: -0.045em; font-weight: 680; max-width: 15em; margin: 26px 0 22px; }
.grad { background: linear-gradient(100deg, #2fbf82 5%, #22b8cf 95%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: clamp(17px, 2vw, 20px); max-width: 38em; margin: 0 auto 10px; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 550; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.pill:hover { text-decoration: none; border-color: var(--line-strong); }
.pill .icon:first-child { color: var(--accent-text); }
.pill .icon:last-child { width: 14px; height: 14px; color: var(--muted); }
.trust { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; padding: 0; margin: 28px 0 0; font-size: 14px; color: var(--muted); }
.trust li { display: inline-flex; align-items: center; gap: 8px; }
.trust .icon { color: var(--accent-text); }

.mock { margin: 20px 0 0; }
.window { border-radius: 18px; border: 1px solid var(--line); background: var(--bg); box-shadow: var(--shadow-lg); overflow: hidden; }
.window-bar { display: flex; align-items: center; gap: 14px; height: 42px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.window-bar .term-dots i { background: var(--line-strong); }
.window-title { font-size: 12.5px; color: var(--muted); }
.window-body { padding: 22px; text-align: left; }
.mock-rows { display: grid; gap: 8px; }
.mock-row { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: default; box-shadow: var(--shadow-sm); }

section.block { padding: 96px 0 0; }
section.block > h2, .split h2, .cta h2 { font-size: clamp(26px, 3.6vw, 38px); line-height: 1.12; letter-spacing: -0.035em; max-width: 20em; margin-bottom: 14px; }
section.block > .lead { margin-bottom: 8px; }
.how, .bento, .modes { display: grid; gap: 16px; margin-top: 32px; }
.how { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.bento { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.modes { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.how .card, .bento .card, .modes .card { margin: 0; padding: 24px; }
.step h3, .feature h3 { font-size: 17px; margin: 16px 0 8px; }
.step p, .feature p, .mode p { color: var(--muted); font-size: 15px; margin: 0 0 14px; }
.feature p:last-child, .mode p:last-child, .step > :last-child { margin-bottom: 0; }
.feature { transition: transform 0.2s, border-color 0.2s; }
.feature:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.mini { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.mini li { display: flex; align-items: center; gap: 10px; }
.mini .icon { color: var(--accent-text); stroke-width: 2.5; width: 14px; height: 14px; }
.mode-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mode-head h3 { flex: 1; font-size: 17px; }
.mode-head > .icon { width: 20px; height: 20px; color: var(--accent-text); }
.mode.featured { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: linear-gradient(160deg, var(--accent-soft), transparent 60%), var(--surface); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.split .lead { margin-bottom: 22px; }
.split .card { margin: 0; padding: 26px; }
.cta { margin-top: 96px; padding: 56px 24px; text-align: center; border-radius: 22px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); background: radial-gradient(520px 240px at 50% 0, var(--glow-1), transparent 70%), var(--surface); }
.cta h2 { margin: 0 auto 10px; }
.cta p { color: var(--muted); margin: 0 auto 24px; max-width: 34em; }
.prose { max-width: 740px; margin: 0 auto; padding-top: 64px; font-size: 16px; line-height: 1.7; }
.prose h1 { font-size: clamp(30px, 4.4vw, 44px); letter-spacing: -0.04em; margin-bottom: 16px; }
.prose h2 { font-size: 21px; margin: 40px 0 10px; }
.prose ul { padding-left: 22px; margin: 0 0 14px; }
.prose li { margin-bottom: 7px; }
.prose p, .prose li { color: var(--ink-2); }

/* Sign-in */
body.auth .site-links, body.auth .site-foot { display: none; }
.auth-main { position: relative; z-index: 1; flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 9vh 20px 80px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card > .muted { margin-bottom: 22px; }
.auth-card .form { max-width: none; }
.auth-foot { margin: 20px 0 0; text-align: center; font-size: 14px; color: var(--muted); }

/* ---------- small screens ---------- */

@media (max-width: 920px) {
  body.cabinet { display: block; }
  .side { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-top { padding: 0; flex: 1; }
  .side-nav { order: 3; flex: 0 0 100%; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 2px; }
  .side-link { white-space: nowrap; }
  .side-foot { flex-direction: row; align-items: center; }
  .side-foot .subtle, .side-user-text, .avatar { display: none; }
  .side-user { border: 0; padding: 0; margin: 0; gap: 2px; }
  .content { padding: 24px 18px 72px; }
  .connect { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .site-links { display: none; }
  .site-nav-row { justify-content: space-between; }
}
@media (max-width: 640px) {
  h1 { font-size: 23px; }
  .hero { padding-top: 52px; }
  section.block { padding-top: 68px; }
  .window-body { padding: 14px; }
  .f-body { grid-template-columns: minmax(0, 1fr); gap: 2px 0; padding-left: 18px; }
  .f-body dd { margin-bottom: 12px; }
  .wizard > li { padding-left: 0; padding-top: 46px; }
  .wizard > li::after { display: none; }
  .tile-value { font-size: 26px; }
  .group-head { flex-wrap: wrap; }
  .group-total { width: 100%; padding-left: 54px; }
  .site-actions .ghost { display: none; }
  .progress { padding: 26px 20px; }
  .card { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* Late adjustments for narrow screens */
.side-nav { scrollbar-width: none; }
.side-nav::-webkit-scrollbar { display: none; }
@media (max-width: 520px) {
  .site-nav .brand span { display: none; }
  .site-nav-row { gap: 12px; }
  .run-buttons, .run-buttons .btn, .page-actions .btn { width: 100%; }
  .hero .actions .btn { width: 100%; }
}
