/* Open Net Worth Cloud portal. The design system is docs/DESIGN.md: every value below comes from
   the tokens in :root. Type roles: title 24/32, heading 16/24, body 14/20, secondary 13/20,
   caption 12/16. Spacing on a 4px grid. Radius 6 / 8 / 12 / 16. Controls 36 (44 signed-out). */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/static/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/static/fonts/inter-latin-600-normal.woff2') format('woff2'); }

/* ---------- tokens ---------- */
:root {
  --font: Inter, system-ui, -apple-system, sans-serif;
  color-scheme: dark;
  --side: #0a0a0a; --bg: #111111; --panel: #171717; --panel-2: #1e1e1e;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.13);
  --ink: #ececec; --muted: #b4b4b4; --faint: #8f8f8f;
  --good: #34b08a; --bad: #e2554f; --warn: #e0a032;
  --btn-bg: #ececec; --btn-ink: #0a0a0a; --hover: rgba(255,255,255,.05); --focus: rgba(255,255,255,.14);
  --shadow-pop: 0 16px 40px -12px rgba(0,0,0,.6);

  --t-title: 600 24px/32px var(--font);
  --t-heading: 600 16px/24px var(--font);
  --t-body: 400 14px/20px var(--font);
  --t-secondary: 400 13px/20px var(--font);
  --t-caption: 500 12px/16px var(--font);

  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --h-ctl: 36px; --h-ctl-lg: 44px; --h-seg: 28px;
  --side-w: 264px; --content-w: 880px; --measure: 68ch;
}
:root[data-theme="light"] {
  color-scheme: light;
  --side: #f9f9f9; --bg: #ffffff; --panel: #ffffff; --panel-2: #f7f7f7;
  --line: rgba(0,0,0,.08); --line-2: rgba(0,0,0,.14);
  --ink: #0d0d0d; --muted: #5d5d5d; --faint: #767676;
  --good: #177a5c; --bad: #bc3a34; --warn: #96690a;
  --btn-bg: #0d0d0d; --btn-ink: #ffffff; --hover: rgba(0,0,0,.04); --focus: rgba(0,0,0,.12);
  --shadow-pop: 0 16px 40px -12px rgba(0,0,0,.18);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --side: #f9f9f9; --bg: #ffffff; --panel: #ffffff; --panel-2: #f7f7f7;
    --line: rgba(0,0,0,.08); --line-2: rgba(0,0,0,.14);
    --ink: #0d0d0d; --muted: #5d5d5d; --faint: #767676;
    --good: #177a5c; --bad: #bc3a34; --warn: #96690a;
    --btn-bg: #0d0d0d; --btn-ink: #ffffff; --hover: rgba(0,0,0,.04); --focus: rgba(0,0,0,.12);
    --shadow-pop: 0 16px 40px -12px rgba(0,0,0,.18);
  }
}

/* ---------- base + type roles ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font: var(--t-body); letter-spacing: -.003em;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: inherit; }
b, strong { font-weight: 500; color: var(--ink); }
svg.i { width: 18px; height: 18px; flex: none; }
h1 { font: var(--t-title); letter-spacing: -.015em; }
h2 { font: var(--t-heading); letter-spacing: -.005em; }
.page-sub { color: var(--muted); margin-top: 4px; max-width: var(--measure); }
.muted, .sub, .hint { font: var(--t-secondary); color: var(--muted); }
p.muted { max-width: var(--measure); }
.caption, .label, .time { font: var(--t-caption); color: var(--faint); }
.link { color: var(--muted); text-decoration: none; }
.link:hover { color: var(--ink); }
.error { font: var(--t-secondary); color: var(--bad); margin-top: 12px; }
.inline { display: inline; margin: 0; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-20 { margin-top: 20px; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; position: relative; }
.app::before { content: ""; position: fixed; left: 0; top: 0; bottom: 0; width: var(--side-w); background: var(--side);
  border-right: 1px solid var(--line); z-index: 0; }
.side { z-index: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
.main { position: relative; z-index: 1; padding: 48px 40px 120px; }
.content { max-width: var(--content-w); margin: 0 auto; display: flex; flex-direction: column; gap: 32px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; }
.page-head .grow { flex: 1; min-width: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

.brand { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px; margin-bottom: 16px;
  font-weight: 600; white-space: nowrap; text-decoration: none; }
.brand svg.mark { width: 22px; height: 22px; color: var(--ink); flex: none; }
.tag { font: var(--t-caption); font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); border-radius: var(--r-xs); padding: 1px 6px; }
.nav-group { margin: 20px 0 4px; padding: 0 12px; font: var(--t-caption); color: var(--faint); }
.nav a { display: flex; align-items: center; gap: 12px; height: var(--h-ctl); padding: 0 12px; border-radius: var(--r-sm);
  text-decoration: none; color: var(--muted); }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.on { background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.side-foot form { margin: 0; }
.me { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 44px; padding: 0 12px;
  border-radius: var(--r-sm); color: var(--muted); }
.me:hover { background: var(--hover); }
.me .who { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.me .who .email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av { width: 28px; height: 28px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--ink);
  font: var(--t-caption); display: grid; place-items: center; flex: none; }

/* account menu */
.account { position: relative; }
.account summary { list-style: none; cursor: pointer; }
.account summary::-webkit-details-marker { display: none; }
.account .chev { width: 14px; height: 14px; color: var(--faint); flex: none; transition: transform .15s; }
.account[open] .chev { transform: rotate(180deg); }
.account[open] summary { background: var(--hover); }
.menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--r-md); padding: 6px; box-shadow: var(--shadow-pop); z-index: 20; }
.menu form { margin: 0; }
.menu-label { font: var(--t-caption); color: var(--faint); padding: 6px 8px; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 8px; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--ink); font: var(--t-body); cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--hover); }
.menu-item svg.i { width: 16px; height: 16px; color: var(--muted); }
.theme-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; margin: 0 4px 4px; border-radius: var(--r-sm);
  background: var(--side); border: 1px solid var(--line); }
.theme-seg button { height: var(--h-seg); border: 0; border-radius: var(--r-xs); background: none; color: var(--muted); font: var(--t-caption);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.theme-seg button svg { width: 12px; height: 12px; }
.theme-seg button.on { background: var(--panel-2); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2); }

/* ---------- surfaces ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); }
.card-head { display: flex; align-items: center; gap: 16px; padding: 20px; }
.card-body { padding: 20px; }
.card-body > h2 + .muted, .card-body > h2 + .page-sub { margin-top: 4px; }
.card-body > p + .grid-form, .card-body > p + .field, .card-body > p + .plan-list { margin-top: 16px; }
.card-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.card-foot .hint { margin-right: auto; }
.tile { width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--panel-2); border: 1px solid var(--line-2);
  display: grid; place-items: center; color: var(--ink); flex: none; }
.tile svg.mark { width: 20px; height: 20px; color: var(--ink); }
.ident { flex: 1; min-width: 0; }
.name { font-weight: 600; font-size: 15px; line-height: 22px; }
.addr { display: flex; align-items: center; gap: 6px; font: var(--t-secondary); color: var(--muted); margin-top: 2px; }
.icon-btn { width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--r-xs); border: 0; background: none;
  color: var(--faint); cursor: pointer; }
.icon-btn:hover { color: var(--ink); background: var(--hover); }
.icon-btn.copied { color: var(--good); }
.icon-btn svg { width: 14px; height: 14px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.fact { padding: 14px 20px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fact + .fact { border-left: 1px solid var(--line); }
.val { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rows { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); }
.row { display: flex; align-items: center; gap: 16px; padding: 14px 20px; }
.row + .row { border-top: 1px solid var(--line); }
.row .txt { flex: 1; min-width: 0; font-weight: 500; }
.row .txt .sub { display: block; font-weight: 400; margin-top: 2px; }
.row .ic { width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--panel-2); border: 1px solid var(--line-2);
  display: grid; place-items: center; color: var(--muted); flex: none; }
.row-actions { display: flex; gap: 8px; }
.crumb { display: inline-block; font: var(--t-secondary); margin-bottom: 8px; }

/* getting-started checklist */
.guide { list-style: none; display: grid; gap: 4px; }
.guide li { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.guide li + li { border-top: 1px solid var(--line); }
.guide .txt { flex: 1; min-width: 0; font-weight: 500; }
.guide .txt .sub { display: block; font-weight: 400; margin-top: 2px; }
.guide .tick { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: none; }
.guide li.done .tick { border-color: var(--good); background: radial-gradient(circle, var(--good) 0 4px, transparent 4.5px); }
.guide li.done .txt { color: var(--muted); }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.danger-zone .ic { color: var(--bad); }
.empty { padding: 32px 20px; text-align: center; font: var(--t-secondary); color: var(--muted); }

/* ---------- status ---------- */
.status { display: inline-flex; align-items: center; gap: 8px; height: 24px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line-2); font: var(--t-caption); color: var(--ink); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.status.good::before { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent); }
.status.warn::before { background: var(--warn); animation: pulse 1.4s ease-in-out infinite; }
.status.bad::before { background: var(--bad); }
.badge { font: var(--t-caption); padding: 2px 8px; border-radius: var(--r-xs); background: var(--panel-2); border: 1px solid var(--line-2); color: var(--muted); }
.badge.good { color: var(--good); } .badge.warn { color: var(--warn); } .badge.bad { color: var(--bad); }
@keyframes pulse { 50% { opacity: .35; } }

.alert { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-radius: var(--r-md); border: 1px solid; }
.alert .txt { flex: 1; font-weight: 500; }
.alert .txt .sub { display: block; font-weight: 400; margin-top: 2px; }
.alert.warn { background: color-mix(in srgb, var(--warn) 9%, var(--panel)); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.alert.bad { background: color-mix(in srgb, var(--bad) 8%, var(--panel)); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.alert.neutral { background: var(--panel); border-color: var(--line); }
.alert .ic { color: var(--warn); } .alert.bad .ic { color: var(--bad); } .alert.neutral .ic { color: var(--muted); }

/* ---------- controls ---------- */
.btn { height: var(--h-ctl); padding: 0 14px; border-radius: var(--r-sm); font: 500 14px/1 var(--font); display: inline-flex; align-items: center;
  justify-content: center; gap: 6px; border: 1px solid var(--line-2); background: transparent; color: var(--ink); cursor: pointer;
  text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.btn.primary { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }
.btn.primary:hover { opacity: .9; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn svg { width: 14px; height: 14px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--ink); font: var(--t-caption); cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 16px; }
.field label { font-weight: 500; }
.field .opt { font: var(--t-secondary); color: var(--faint); margin-left: 4px; }
input, textarea, select { width: 100%; height: var(--h-ctl); padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--bg); color: var(--ink); font: var(--t-body); outline: none; }
textarea { height: 88px; padding: 8px 12px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--muted); box-shadow: 0 0 0 3px var(--focus); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.check { display: flex; align-items: flex-start; gap: 10px; font: var(--t-secondary); color: var(--muted); cursor: pointer; }
.check input { width: 16px; height: 16px; margin-top: 2px; flex: none; accent-color: var(--ink); }
.readonly { display: flex; align-items: center; justify-content: space-between; height: var(--h-ctl); padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); }
.grid-form { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; align-items: end; }
.grid-form .field + .field { margin-top: 0; }

/* radio-card choice (plans, versions) */
.plan-list { display: grid; gap: 8px; }
.plan-opt { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line-2);
  border-radius: var(--r-sm); cursor: pointer; transition: border-color .12s, background .12s; }
.plan-opt:hover { border-color: var(--muted); }
.plan-opt input { position: absolute; opacity: 0; pointer-events: none; }
.plan-opt .radio { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: none; display: grid; place-items: center;
  transition: border-color .12s; }
.plan-opt .radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); transform: scale(0); transition: transform .12s; }
.plan-opt:has(input:checked) { border-color: var(--ink); background: var(--panel-2); }
.plan-opt:has(input:checked) .radio { border-color: var(--ink); }
.plan-opt:has(input:checked) .radio::after { transform: scale(1); }
.plan-opt:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--focus); }
.plan-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.plan-name { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.plan-sub { font: var(--t-secondary); color: var(--muted); }
.plan-price { font-weight: 600; white-space: nowrap; text-align: right; }
.plan-price small { font: var(--t-secondary); color: var(--muted); }
.plan-meta { font: var(--t-secondary); color: var(--muted); white-space: nowrap; }
.save { font: var(--t-caption); color: var(--good); }

/* ---------- lists ---------- */
.timeline { list-style: none; position: relative; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 12px; bottom: 12px; width: 1px; background: var(--line-2); }
.timeline li { position: relative; display: flex; align-items: center; gap: 14px; min-height: 40px; color: var(--muted); }
.timeline li::before { content: ""; width: 17px; height: 17px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line-2); flex: none; z-index: 1; }
.timeline li.ok::before { border-color: color-mix(in srgb, var(--good) 60%, transparent); background: radial-gradient(circle, var(--good) 0 3.5px, var(--bg) 4px); }
.timeline li.warn::before { border-color: color-mix(in srgb, var(--warn) 60%, transparent); background: radial-gradient(circle, var(--warn) 0 3.5px, var(--bg) 4px); }
.timeline li.bad::before { border-color: color-mix(in srgb, var(--bad) 60%, transparent); background: radial-gradient(circle, var(--bad) 0 3.5px, var(--bg) 4px); }
.timeline b { color: var(--ink); }
.time { margin-left: auto; font-weight: 400; }

.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.steps li { padding: 14px 20px; display: flex; flex-direction: column; gap: 10px; font: var(--t-secondary); color: var(--faint); }
.steps li + li { border-left: 1px solid var(--line); }
.steps .bar { height: 4px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.steps li.done { color: var(--ink); } .steps li.done .bar { background: var(--good); }
.steps li.now { color: var(--ink); font-weight: 500; }
.steps li.now .bar { background: linear-gradient(90deg, var(--warn) 45%, var(--line-2) 45%); }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font: var(--t-caption); color: var(--faint); padding: 10px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.tabs { display: flex; gap: 4px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.tabs a { height: 30px; padding: 0 12px; border-radius: var(--r-sm); display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--muted); }
.tabs a.on { background: var(--panel-2); color: var(--ink); }
.tabs a .n { font: var(--t-caption); color: var(--faint); }
.tabs .search { margin-left: auto; width: 240px; }
.bulk { display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.bulk .grow { flex: 1; font-weight: 500; }
.mail-body { white-space: pre-wrap; font: var(--t-secondary); color: var(--muted); margin-top: 8px; }

/* ---------- modal ---------- */
.modal-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--side); }
.scrim { position: fixed; inset: 0; background: rgba(5,6,8,.66); display: grid; place-items: center; z-index: 10; }
.modal { width: 460px; max-width: 100%; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 24px;
  box-shadow: var(--shadow-pop); }
.modal h2 { margin-bottom: 4px; }
.modal p { font: var(--t-secondary); color: var(--muted); margin-bottom: 20px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }

/* ---------- signed-out pages ---------- */
.auth { width: 100%; max-width: 380px; }
.auth.wide { max-width: 640px; }
.auth h1 { font: var(--t-title); letter-spacing: -.015em; }
.auth .page-sub { margin: 6px 0 24px; }
.auth .field + .field { margin-top: 14px; }
.auth input, .auth .readonly { height: var(--h-ctl-lg); background: transparent; }
.auth .btn.block { height: var(--h-ctl-lg); margin-top: 16px; }
.auth > .btn.block:not(.primary) { margin-top: 0; }
.auth .done-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 20px;
  background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.pill-note { display: inline-flex; gap: 6px; align-items: center; font: var(--t-caption); color: var(--ink); border: 1px solid var(--line-2);
  background: var(--panel-2); border-radius: 999px; padding: 4px 10px; margin-bottom: 14px; }
.below { color: var(--muted); }
.below a { color: var(--ink); text-decoration: none; font-weight: 500; }
.fine { font: var(--t-secondary); color: var(--faint); margin-top: 16px; }
.social { display: grid; gap: 8px; }
.social-btn { height: var(--h-ctl-lg); width: 100%; gap: 10px; }
.social-btn svg { width: 18px; height: 18px; }
.or { display: flex; align-items: center; gap: 12px; font: var(--t-caption); color: var(--faint); margin: 20px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.split { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.split-brand { position: relative; overflow: hidden; background: var(--side); border-right: 1px solid var(--line); padding: 40px 64px;
  display: flex; flex-direction: column; }
.split-brand::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--line-2) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 80% 60% at 60% 50%, #000 20%, transparent 75%); }
.split-brand > * { position: relative; }
.split-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.split-logo svg.mark { width: 24px; height: 24px; color: var(--ink); }
.split-copy { margin: auto 0; max-width: 460px; }
.split-copy h2 { font: var(--t-title); letter-spacing: -.015em; }
.split-facts { list-style: none; margin-top: 28px; display: grid; gap: 16px; font: var(--t-secondary); color: var(--muted); }
.split-facts li { display: flex; gap: 12px; align-items: flex-start; }
.split-facts svg.i { width: 18px; height: 18px; margin-top: 1px; color: var(--faint); }
.split-facts b { color: var(--ink); }
.split-foot { font: var(--t-caption); font-weight: 400; color: var(--faint); }
.split-form { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; gap: 20px; background: var(--bg); }
.split-form .below { width: 100%; max-width: 380px; }

/* the signed-out visual: what the agent did overnight */
.agent { margin-top: 28px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-md);
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 24px 48px -24px rgba(0,0,0,.35); overflow: hidden; }
.agent-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.agent-av { width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line-2); display: grid; place-items: center; flex: none; }
.agent-av svg.mark { width: 18px; height: 18px; color: var(--ink); }
.agent-name { display: flex; flex-direction: column; font-weight: 500; margin-right: auto; }
.agent-sub { font: var(--t-caption); font-weight: 400; color: var(--faint); }
.agent-live { display: inline-flex; align-items: center; gap: 6px; font: var(--t-caption); color: var(--good); }
.agent-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); position: relative; }
.agent-live i::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: var(--good); opacity: .35; animation: agent-pulse 2s ease-out infinite; }
@keyframes agent-pulse { from { transform: scale(.4); opacity: .5; } to { transform: scale(1.4); opacity: 0; } }
.agent-feed { list-style: none; padding: 4px 0; }
.agent-feed li { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: baseline; padding: 9px 16px; font: var(--t-secondary); color: var(--muted);
  opacity: 0; animation: agent-in .5s ease-out forwards; }
.agent-feed li:nth-child(2) { animation-delay: .25s; } .agent-feed li:nth-child(3) { animation-delay: .5s; } .agent-feed li:nth-child(4) { animation-delay: .75s; }
.agent-feed li + li { border-top: 1px solid var(--line); }
.agent-feed time { font: var(--t-caption); font-weight: 400; color: var(--faint); }
.agent-feed b.up { color: var(--good); }
.agent-feed em { font: var(--t-caption); font-style: normal; font-size: 11px; border-radius: var(--r-xs); padding: 1px 6px; border: 1px solid currentColor; }
.agent-feed em.warn { color: var(--warn); } .agent-feed em.good { color: var(--good); }
@keyframes agent-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- version page: own-build fields only when chosen ---------- */
.version-form .custom-only, .version-form .github-only, .version-form .own-build-only { display: none; }
.version-form:has(input[name="choice"][value="custom"]:checked) .custom-only,
.version-form:has(input[name="choice"][value="github"]:checked) .github-only { display: block; }
.version-form:has(input[name="choice"][value="custom"]:checked) .own-build-only,
.version-form:has(input[name="choice"][value="github"]:checked) .own-build-only { display: flex; }

/* ---------- local-mode strip ---------- */
.dev-strip { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 30; display: flex; gap: 14px; align-items: center;
  font: var(--t-caption); font-weight: 400; color: var(--muted); background: var(--panel); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 6px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.dev-strip, .dev-strip * { white-space: nowrap; }
.dev-strip a { color: var(--ink); text-decoration: none; font-weight: 500; }
.dev-strip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.view-as { display: inline-flex; align-items: center; gap: 6px; padding-left: 12px; border-left: 1px solid var(--line-2); }
.view-as .seg { border: 1px solid var(--line-2); background: none; color: var(--muted); font: var(--t-caption); height: 22px; padding: 0 8px;
  border-radius: var(--r-xs); cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; }
.view-as .seg.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- motion ---------- */
@view-transition { navigation: auto; }
.side { view-transition-name: sidebar; }
.app::before { view-transition-name: sidebar-bg; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 140ms; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none; }
  .agent-feed li { animation: none; opacity: 1; } .agent-live i::after, .status.warn::before { animation: none; }
}

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .app::before { display: none; }
  /* the sidebar becomes a compact top bar: brand + avatar, then a scrolling row of links */
  .side { position: sticky; top: 0; z-index: 5; height: auto; display: grid; grid-template-columns: 1fr auto; align-items: center;
    gap: 4px 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--side); }
  .brand { margin: 0; }
  .side-foot { grid-column: 2; grid-row: 1; margin: 0; }
  .me { height: 40px; padding: 0 6px; }
  .me .email, .me .chev { display: none; }
  .menu { left: auto; right: 0; bottom: auto; top: calc(100% + 6px); width: 240px; }
  .nav { grid-column: 1 / -1; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; height: 32px; padding: 0 10px; white-space: nowrap; }
  .nav a svg.i, .nav-group { display: none; }
  .main { padding: 32px 20px 120px; }
  .facts, .steps { grid-template-columns: 1fr 1fr; }
  .fact:nth-child(3), .steps li:nth-child(3) { border-left: 0; }
  .fact:nth-child(n+3), .steps li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .grid-form { grid-template-columns: 1fr; }
  .card-foot { flex-wrap: wrap; }
  .card-foot .hint { flex-basis: 100%; }
  /* a row's action drops below its text instead of squeezing it */
  .row { flex-wrap: wrap; }
  .row .txt { flex: 1 1 200px; }
  .row > .btn, .row > form, .row > .row-actions { margin-left: auto; }
  .split { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .split-brand { padding: 20px 24px; border-right: 0; border-bottom: 1px solid var(--line); }
  .split-copy, .split-foot { display: none; }
  .split-form { justify-content: flex-start; padding-top: 40px; }
  .dev-strip { display: none; }
}
