/* Runstate Connect: tokens and pieces from docs/design.html (Claude Design). Dark first. */
@font-face { font-family: 'Geist'; src: url(/assets/fonts/geist.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url(/assets/fonts/geist-mono.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg:#0B0B0C; --panel:#121214; --raised:#18181B; --hover:#1A1A1D; --line:#232326; --line2:#2E2E33;
  --tx:#EDEDEF; --tx2:#A1A1AA; --tx3:#8B8B94;
  --green:#22C55E; --green-hover:#16A34A; --on-green:#052E16; --green-tx:#4ADE80;
  --red:#F87171; --amber:#FBBF24; --amber-bar:#F59E0B; --on-amber:#1C1206;
  --skel:#1C1C20; --scrim:rgba(0,0,0,.6); --glow:rgba(255,255,255,.05);
  --r-sm:5px; --r:6px; --r-lg:8px; --r-xl:12px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:#FAFAFA; --panel:#FFFFFF; --raised:#F4F4F5; --hover:#F4F4F5; --line:#E4E4E7; --line2:#D4D4D8;
    --tx:#18181B; --tx2:#52525B; --tx3:#6B6B74; --green-tx:#166534; --red:#B91C1C; --amber:#92400E;
    --skel:#EDEDF0; --scrim:rgba(24,24,27,.35); --glow:rgba(0,0,0,.05); color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg:#FAFAFA; --panel:#FFFFFF; --raised:#F4F4F5; --hover:#F4F4F5; --line:#E4E4E7; --line2:#D4D4D8;
  --tx:#18181B; --tx2:#52525B; --tx3:#6B6B74; --green-tx:#166534; --red:#B91C1C; --amber:#92400E;
  --skel:#EDEDF0; --scrim:rgba(24,24,27,.35); --glow:rgba(0,0,0,.05); color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--tx); }
body { font: 13px/1.45 'Geist', system-ui, -apple-system, sans-serif; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 14px; line-height: 20px; font-weight: 600; }
h3 { font-size: 13px; line-height: 18px; font-weight: 600; }
a { color: var(--tx); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--tx3); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.mono { font-family: 'Geist Mono', ui-monospace, Menlo, monospace; font-size: 12px; }
.muted { color: var(--tx2); } .faint { color: var(--tx3); } .small { font-size: 12px; }
.stack { display: flex; flex-direction: column; gap: 16px; } .stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; } .grow { flex: 1; min-width: 0; } .wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* buttons: 32px look, 44px tap area on phones */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r);
  border: 1px solid var(--line2); background: var(--panel); color: var(--tx); font: inherit; font-weight: 500; line-height: 1; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, opacity .15s; }
.btn:hover { background: var(--hover); }
.btn::after { content: ''; position: absolute; inset: -6px 0; }
.btn-primary { background: var(--green); border-color: var(--green); color: var(--on-green); }
.btn-primary:hover { background: var(--green-hover); border-color: var(--green-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--tx2); }
.btn-ghost:hover { color: var(--tx); background: var(--hover); }
.btn-danger { color: var(--red); }
.btn-lg { height: 36px; padding: 0 14px; }
.btn-block { width: 100%; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.busy { color: transparent !important; pointer-events: none; }
.btn.busy::before { content: ''; position: absolute; width: 14px; height: 14px; border: 2px solid var(--tx3); border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-primary.busy::before { border-color: var(--on-green); border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* forms */
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
legend { padding: 0; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--tx2); text-transform: uppercase; letter-spacing: .04em; }
.label { display: block; font-size: 12px; font-weight: 500; color: var(--tx2); margin-bottom: 6px; }
.input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--tx); font: inherit; font-size: 14px; }
.input:focus { outline: 0; border-color: var(--tx3); }
.input[aria-invalid="true"] { border-color: var(--red); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--tx3) 50%), linear-gradient(135deg, var(--tx3) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
textarea.input { height: auto; min-height: 80px; padding: 8px 10px; resize: vertical; }
.pw { position: relative; } .pw .input { padding-right: 56px; }
.pw-eye { position: absolute; right: 4px; top: 4px; height: 28px; padding: 0 8px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--tx2); font: inherit; font-size: 12px; cursor: pointer; }
.pw-eye:hover { color: var(--tx); background: var(--hover); }
.hint { font-size: 12px; color: var(--tx3); margin-top: 6px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--tx2); cursor: pointer; }
.check input { margin: 2px 0 0; accent-color: var(--green); width: 16px; height: 16px; }
.alert { padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line2); background: var(--raised); font-size: 13px; }
.alert-error { border-color: color-mix(in srgb, var(--red) 40%, transparent); color: var(--red); background: color-mix(in srgb, var(--red) 8%, transparent); }
.alert-ok { border-color: color-mix(in srgb, var(--green) 40%, transparent); color: var(--green-tx); background: color-mix(in srgb, var(--green) 8%, transparent); }
.meter { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 8px; }
.meter > i { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s, background .2s; }
.code-inputs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code-inputs input { height: 48px; text-align: center; font: 600 20px 'Geist Mono', monospace; padding: 0; }

/* pieces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--r-sm); border: 1px solid var(--line2); background: var(--raised); font-size: 11px; font-weight: 500; color: var(--tx2); white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; color: var(--tx); }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--dot, var(--tx3)); }
.p-green { --dot: var(--green); } .p-red { --dot: var(--red); } .p-amber { --dot: var(--amber); }
.kbd { font: 10.5px/16px 'Geist Mono', monospace; padding: 0 5px; border: 1px solid var(--line2); border-radius: 4px; color: var(--tx3); }
.skel { display: block; height: 14px; background: var(--skel); border-radius: 4px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.empty { padding: 40px 20px; text-align: center; color: var(--tx2); display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* lists: name + one line, status, ONE button */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); min-height: 56px; }
.list > li:last-child { border-bottom: 0; }
.list .who { flex: 1; min-width: 0; }
.list .who b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .who span { display: block; font-size: 12px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .st { text-align: right; font-size: 12px; color: var(--tx3); }
.list .st .pill { justify-content: flex-end; }
.list.wrap-text .who span { white-space: normal; }
.list > li.click { cursor: pointer; } .list > li.click:hover { background: var(--hover); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 10px; margin-bottom: -1px; color: var(--tx2); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--tx); }
.tabs a[aria-current="page"] { color: var(--tx); border-bottom-color: var(--tx); }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tile { padding: 16px; }
dialog .tiles { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
dialog .tile { padding: 12px; } dialog .tile .v { font-size: 18px; }
.tile .k { font-size: 12px; color: var(--tx2); }
.tile .v { font-size: 22px; font-weight: 600; margin-top: 6px; letter-spacing: -.01em; }
.tile .d { font-size: 12px; color: var(--tx3); margin-top: 2px; }

/* dialog */
dialog { padding: 0; border: 1px solid var(--line2); border-radius: var(--r-xl); background: var(--panel); color: var(--tx); width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: var(--scrim); }
dialog[open] { animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.dlg-head { display: flex; align-items: center; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dlg-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }

/* toast */
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--raised); border: 1px solid var(--line2); padding: 10px 14px; border-radius: var(--r-lg); box-shadow: 0 8px 24px rgba(0,0,0,.3); animation: pop .16s ease-out; }

/* account pages: centered card, max 400px */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; background: radial-gradient(600px 300px at 50% 0, var(--glow), transparent); }
.auth-card { width: 100%; max-width: 400px; padding: 28px; }
.auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.auth-foot { margin-top: 16px; text-align: center; color: var(--tx2); font-size: 13px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--tx); text-decoration: none; }
.logo i { width: 18px; height: 18px; border-radius: 5px; background: var(--green); display: inline-block; box-shadow: inset 0 0 0 4px var(--on-green); }
.auth > .logo { margin-bottom: 24px; }

/* app shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.aside { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 12px; border-right: 1px solid var(--line); background: var(--panel); overflow-y: auto; }
.aside .ws { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--tx); font: inherit; cursor: pointer; text-align: left; margin-bottom: 8px; }
.aside .ws .av { width: 24px; height: 24px; border-radius: 6px; background: var(--raised); display: grid; place-items: center; font-weight: 600; font-size: 11px; flex: none; }
.aside .ws b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.nav-h { font-size: 11px; color: var(--tx3); padding: 10px 8px 2px; text-transform: uppercase; letter-spacing: .05em; }
.nav a, .nav span { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px; border-radius: var(--r); color: var(--tx2); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--hover); color: var(--tx); }
.nav a[aria-current="page"] { background: var(--raised); color: var(--tx); }
.nav span { color: var(--tx3); cursor: default; }
.nav .soon { margin-left: auto; font-size: 10px; color: var(--tx3); border: 1px solid var(--line2); border-radius: 4px; padding: 0 4px; line-height: 16px; }
.aside .foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.main { min-width: 0; }
.page { max-width: 1040px; margin: 0 auto; padding: 32px 32px 64px; display: flex; flex-direction: column; gap: 20px; }
.ph { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ph .grow { flex: 1 1 220px; }
.topbar { display: none; align-items: center; gap: 10px; height: 52px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.bar { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; min-height: 32px; padding: 6px 16px; font-size: 12.5px; font-weight: 500; text-align: center; }
.bar-amber { background: var(--amber-bar); color: var(--on-amber); }
.bar-amber a { color: inherit; text-decoration-color: currentColor; font-weight: 600; }
.bar-note { background: var(--raised); border-bottom: 1px solid var(--line); color: var(--tx2); }
.scrim { display: none; }

/* product choice cards */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); cursor: pointer; text-align: left; color: var(--tx); font: inherit; transition: border-color .15s; }
.choice:hover { border-color: var(--line2); }
.choice[aria-pressed="true"] { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.choice b { display: block; font-weight: 600; margin-bottom: 2px; }
.choice span { color: var(--tx2); font-size: 12.5px; }
.steps { display: flex; gap: 6px; } .steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); } .steps i.on { background: var(--green); }

/* charts */
.chart { width: 100%; height: 140px; display: block; }
.chart rect { fill: var(--green); }
.chart rect.zero { fill: var(--line2); }
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel .f { display: grid; grid-template-columns: 150px 1fr 48px; gap: 12px; align-items: center; font-size: 12.5px; }
.funnel .f div { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; } .funnel .f div i { display: block; height: 100%; background: var(--green); }

.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; padding: 14px 16px; border: 1px dashed var(--line2); border-radius: var(--r); }
.qr { width: 168px; height: 168px; padding: 8px; background: #fff; border-radius: var(--r); }
.qr svg { width: 100%; height: 100%; display: block; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .aside { position: fixed; z-index: 20; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .2s; }
  .shell.menu .aside { transform: none; }
  .shell.menu .scrim { display: block; position: fixed; inset: 0; z-index: 15; background: var(--scrim); }
  .topbar { display: flex; }
  .page { padding: 16px 16px 48px; }
  .btn { min-height: 36px; }
  .list > li { padding: 12px 16px; }
  .card-pad { padding: 16px; } .card-head { padding: 14px 16px; }
  .auth-card { padding: 20px; }
  .hide-sm { display: none; }
  .head-actions { flex-basis: 100%; }
  .head-actions .btn { flex: 1; }
  .funnel .f { grid-template-columns: 110px 1fr 40px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
