/* AI Dev Assistant dashboard. One column, what needs the owner first; light and dark themes. */
:root {
  --bg: #f4f6f9; --surface: #ffffff; --surface-2: #f7f9fb; --raised: #eef2f6; --text: #14181d; --muted: #5d6773; --faint: #66707c;
  --line: #e3e8ee; --line-2: #d3dae3;
  --accent: #2f62e6; --accent-soft: #e8efff; --on-accent: #ffffff;
  --ok: #0e6f37; --ok-soft: #e4f6eb; --warn: #9a5b00; --warn-soft: #fff2db; --bad: #c62832; --bad-soft: #fde8ea;
  --claude: #9c4c14; --claude-soft: #fbeee4; --codex: #0d7a6f; --codex-soft: #e1f4f1; --on-bad: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
  --top: rgba(244, 246, 249, .9); --scrim: rgba(15, 20, 28, .35);
  --radius: 14px; --radius-sm: 10px;
  color-scheme: light;
}
/* Dark: when the system is dark unless Your account chose Light (data-theme="light"), and always with Dark
   (data-theme="dark", set by theme.js before the page is drawn). The two blocks carry the same colours. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1014; --surface: #151a20; --surface-2: #1a2027; --raised: #212832; --text: #e8ebef; --muted: #a6b0bc; --faint: #8a94a0;
    --line: #262d36; --line-2: #333c48;
    --accent: #7aa2ff; --accent-soft: rgba(122, 162, 255, .14); --on-accent: #0b1220;
    --ok: #4fd17f; --ok-soft: rgba(79, 209, 127, .13); --warn: #f2b84b; --warn-soft: rgba(242, 184, 75, .13); --bad: #ff7a7f; --bad-soft: rgba(255, 122, 127, .12);
    --claude: #f0a46a; --claude-soft: rgba(240, 164, 106, .14); --codex: #4fd1c1; --codex-soft: rgba(79, 209, 193, .13); --on-bad: #2a0b0d;
    --shadow: 0 1px 0 rgba(255, 255, 255, .02), 0 10px 28px rgba(0, 0, 0, .35);
    --top: rgba(13, 16, 20, .88); --scrim: rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1014; --surface: #151a20; --surface-2: #1a2027; --raised: #212832; --text: #e8ebef; --muted: #a6b0bc; --faint: #8a94a0;
  --line: #262d36; --line-2: #333c48;
  --accent: #7aa2ff; --accent-soft: rgba(122, 162, 255, .14); --on-accent: #0b1220;
  --ok: #4fd17f; --ok-soft: rgba(79, 209, 127, .13); --warn: #f2b84b; --warn-soft: rgba(242, 184, 75, .13); --bad: #ff7a7f; --bad-soft: rgba(255, 122, 127, .12);
  --claude: #f0a46a; --claude-soft: rgba(240, 164, 106, .14); --codex: #4fd1c1; --codex-soft: rgba(79, 209, 193, .13); --on-bad: #2a0b0d;
  --shadow: 0 1px 0 rgba(255, 255, 255, .02), 0 10px 28px rgba(0, 0, 0, .35);
  --top: rgba(13, 16, 20, .88); --scrim: rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
/* The page never shifts sideways when a panel locks its scrolling. */
html { scrollbar-gutter: stable; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; }
code { font: 12px/1.4 Consolas, ui-monospace, monospace; background: var(--raised); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font: 13px/1.5 "Segoe UI", system-ui, sans-serif; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.bad { color: var(--bad); }
.hint { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }

/* ---- top bar ---- */
.top { position: sticky; top: 0; z-index: 20; background: var(--top); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 960px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.brand { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.offline { background: var(--bad-soft); color: var(--bad); text-align: center; font-size: 13px; font-weight: 600; padding: 6px 16px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; background: var(--raised); color: var(--muted); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.icon-btn { position: relative; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.icon-btn.ghost { border-color: transparent; background: transparent; }
.badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; border-radius: 999px; background: var(--bad); color: var(--on-bad); font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
#open-account.has-requests::after { content: ""; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
/* The chat's button: a question still under way (pulsing, steady with reduced motion) or an answer not seen yet. */
.chat-dot { position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.chat-dot.busy { animation: chat-pulse 1.4s ease-in-out infinite; }
@keyframes chat-pulse { 50% { opacity: .35; transform: scale(.8); } }

/* ---- layout ---- */
main { max-width: 960px; margin: 0 auto; padding: 16px 16px 110px; display: grid; gap: 14px; }
main > *, .list > *, .task .head > * { min-width: 0; }
.version-line { margin: 8px 0 0; color: var(--faint); font-size: 11.5px; text-align: center; overflow-wrap: anywhere; }
.fact { max-width: 100%; overflow-wrap: anywhere; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }

/* ---- buttons, switches, segmented control ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); border-radius: 9px; padding: 6px 13px; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--faint); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: var(--on-bad); }
.btn.small { padding: 3px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.big { padding: 10px 20px; font-size: 14.5px; border-radius: 11px; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 2px 4px; }
.btn:disabled, .icon-btn:disabled { opacity: .5; cursor: default; }
.switch { position: relative; width: 44px; height: 26px; border-radius: 999px; border: 0; background: var(--line-2); cursor: pointer; flex: none; transition: background .15s; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: left .15s; }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"]::after { left: 21px; }
.switch.big { width: 58px; height: 32px; }
.switch.big::after { width: 26px; height: 26px; }
.switch.big[aria-checked="true"]::after { left: 29px; }
.switch.sm { width: 36px; height: 21px; }
.switch.sm::after { width: 15px; height: 15px; }
.switch.sm[aria-checked="true"]::after { left: 18px; }
.switch:disabled { opacity: .5; cursor: default; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.form-switch { display: grid; gap: 5px; }
.form-switch .toggle { justify-content: space-between; color: var(--text); }
.form-switch small { color: var(--muted); }
.seg { display: inline-flex; background: var(--raised); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; border-radius: 8px; padding: 6px 16px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--on-accent); }
.seg button:disabled { cursor: default; }

/* ---- the status card ---- */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: center; }
.hero-title { display: flex; align-items: center; gap: 14px; }
.hero h1 { font-size: 22px; letter-spacing: -.01em; }
.hero h1 .state { color: var(--ok); }
.hero.off h1 .state { color: var(--bad); }
.hero.off { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); background: linear-gradient(0deg, var(--bad-soft), var(--bad-soft)), var(--surface); }
.hero-sub { margin: 6px 0 12px; color: var(--muted); font-size: 13px; }
.hero-usage { display: grid; gap: 14px; }
.engine .row { display: flex; align-items: center; gap: 8px; }
.engine b { font-size: 13.5px; }
.engine .state { font-size: 12px; color: var(--muted); }
.engine .switch { margin-left: auto; }
.bar { height: 7px; border-radius: 999px; background: var(--raised); overflow: hidden; margin: 7px 0 4px; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.bar.warn i { background: var(--warn); }
.bar.bad i { background: var(--bad); }
.engine .meta { font-size: 12px; color: var(--muted); }

/* ---- projects row ---- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 1px; }
.chips::-webkit-scrollbar { display: none; }
.pchip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 13px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.pchip:hover { color: var(--text); }
.pchip.sel { background: var(--text); border-color: var(--text); color: var(--bg); }
.pchip .n { background: var(--bad); color: var(--on-bad); border-radius: 999px; font-size: 11px; padding: 0 6px; }
.pchip .sub { font-weight: 500; opacity: .75; }
.pchip.add { border-style: dashed; color: var(--accent); background: transparent; }

/* ---- a project's facts (the selected project) ---- */
.facts-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.facts-head h2 { font-size: 18px; }
.facts-head .repo { font-size: 12.5px; color: var(--muted); }
.facts-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fact-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.fact { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font-size: 12.5px; color: var(--muted); }
.fact b { color: var(--text); font-weight: 600; }
.fact .d { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.fact .d.ok { background: var(--ok); } .fact .d.bad { background: var(--bad); } .fact .d.warn { background: var(--warn); }
.facts details { margin-top: 10px; }
.facts summary, .panel summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
.facts .about { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.warnline { margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-size: 13px; font-weight: 600; }

/* ---- all projects ---- */
.overview { display: grid; gap: 8px; }
.prow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.prow:hover { border-color: var(--line-2); }
.prow > b { font-size: 14.5px; }
.prow .nums { margin-left: auto; display: flex; gap: 14px; color: var(--muted); font-size: 12.5px; }
.prow .nums b { color: var(--text); font-size: 13.5px; margin-right: 3px; }
.prow .nums .hot b { color: var(--bad); }
.prow .go { color: var(--faint); font-size: 18px; line-height: 1; }

/* ---- the next step, while a project is getting started ---- */
.guide { display: flex; align-items: center; gap: 14px; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.guide .ico { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.guide .txt { flex: 1; min-width: 0; }
.guide b { display: block; font-size: 14.5px; }
.guide p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* ---- where the work is ---- */
.stages { display: grid; grid-template-columns: repeat(var(--tiles, 5), minmax(0, 1fr)); gap: 10px; }
.stage { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; cursor: pointer; }
.stage:hover { border-color: var(--line-2); }
.stage b { display: block; font-size: 22px; line-height: 1.2; }
.stage span { font-size: 12.5px; color: var(--muted); }
.stage.hot { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: linear-gradient(0deg, var(--bad-soft), var(--bad-soft)), var(--surface); }
.stage.hot b { color: var(--bad); }
.stage.good b { color: var(--ok); }

/* ---- sections and task cards ---- */
.sec { scroll-margin-top: 64px; }
.sec > h2 { display: flex; align-items: center; gap: 8px; margin: 4px 2px 10px; font-size: 12.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.sec-actions { margin-left: auto; text-transform: none; letter-spacing: 0; }
.count { background: var(--raised); color: var(--text); border-radius: 999px; padding: 0 8px; font-size: 12px; letter-spacing: 0; }
.count.bad { background: var(--bad-soft); color: var(--bad); }
.count:empty { display: none; }
.list { display: grid; gap: 10px; }
.task { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; }
.task.attn { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.task.paused { background: var(--surface-2); }
.task .head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task .title { font-weight: 600; color: var(--text); overflow-wrap: anywhere; min-width: 0; }
.task .title:hover { color: var(--accent); }
.task .title.plain:hover { color: var(--text); }
/* A task's name: the plan's label first ("Step 2 · task 3"), the issue number as its small link to GitHub. */
.plan-label { font-weight: 700; color: var(--text); white-space: nowrap; }
.issue-no { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.issue-no:hover { color: var(--accent); }
/* What runs now: a pulse only while a process is seen to run; with "reduce motion", a steady "live" label instead. */
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 50% { opacity: .55; box-shadow: 0 0 0 5px transparent; } }
.live-tag { display: none; border-radius: 6px; padding: 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .03em; background: var(--ok-soft); color: var(--ok); }
@media (prefers-reduced-motion: reduce) { .live-tag { display: inline-block; } }
.task .nowline { color: var(--text); font-weight: 600; }
.task .waits { color: var(--warn); font-weight: 600; }
/* The history: one line per event, the newest marked "now". */
.hist { display: grid; gap: 2px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.hist div { display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; gap: 8px; overflow-wrap: anywhere; }
.hist .t { color: var(--faint); font-variant-numeric: tabular-nums; }
.hist .cur { color: var(--text); font-weight: 600; }
.task .end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.task .meta { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.done-group { display: grid; gap: 10px; }
.done-group + .done-group { margin-top: 4px; }
.done-group h3 { margin: 3px 2px -2px; font-size: 13px; color: var(--text); }
.done-group h3 span { margin-left: 4px; color: var(--muted); font-weight: 500; }
.done-task { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 12px; }
.done-task .head { align-items: flex-start; }
.done-task .title { flex: 1 1 240px; }
.done-time { width: 120px; text-align: right; white-space: nowrap; color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.task .text { margin-top: 8px; max-height: 300px; overflow: auto; }
.task .err { color: var(--bad); font-size: 12.5px; margin-top: 6px; overflow-wrap: anywhere; }
.task .foot { display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; }
.task .foot details { flex: 1; min-width: 0; }
.task details summary { font-size: 12.5px; color: var(--faint); cursor: pointer; }
.task details pre { margin-top: 6px; font-size: 12px; color: var(--muted); }
.answer { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.answer textarea { flex: 1; min-width: 0; min-height: 40px; }
.compact .task { padding: 10px 15px; }
.compact .task .meta { margin-top: 2px; }
.more { justify-self: start; }
.group-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 2px 0; font-size: 13px; color: var(--muted); }
.group-row b { color: var(--text); }
.group-row .btn { margin-left: auto; }
.empty { color: var(--muted); font-style: italic; margin: 2px 2px 0; }
.chip { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; border-radius: 6px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; background: var(--raised); color: var(--muted); white-space: nowrap; }
.chip.claude { background: var(--claude-soft); color: var(--claude); }
.chip.codex { background: var(--codex-soft); color: var(--codex); }
.chip.phase { background: var(--accent-soft); color: var(--accent); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.proj { background: transparent; border: 1px solid var(--line); }
/* Where a task is: work, check, review, merge. */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 10px; }
.steps span { text-align: center; font-size: 11.5px; font-weight: 600; padding: 4px 2px; border-radius: 6px; background: var(--raised); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps span.done { background: var(--ok-soft); color: var(--ok); }
.steps span.now { background: var(--accent); color: var(--on-accent); }
.steps small { font-size: inherit; }
.task.paused .steps span.now { background: var(--warn-soft); color: var(--warn); }
.steps span.wait { background: var(--warn-soft); color: var(--warn); }

/* ---- onboarding and welcome ---- */
.onboarding { display: flex; align-items: center; gap: 10px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.onboarding.failed { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); flex-wrap: wrap; }
.onboarding.failed b { color: var(--bad); }
.grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
/* A pressed button while it works (a spinner and its verb), its ✓ for a second, or the reason it failed. */
.btn .spin, .seg .spin, .act-note .spin { width: 12px; height: 12px; border-color: currentColor; border-right-color: transparent; display: inline-block; }
.btn[data-state="working"], .seg button[data-state="working"] { opacity: .75; cursor: progress; }
.btn[data-state="done"] { opacity: 1; }
.okmark { color: var(--ok); font-weight: 700; }
.btn.primary .okmark, .btn.danger.solid .okmark { color: inherit; }
.act-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.act-fail { color: var(--bad); font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.act-pair { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.act-slot:empty { display: none; }
.answer { flex-wrap: wrap; }
.answer .act-fail { flex-basis: 100%; }
.engine .row > :is(.act-note, .act-ok, .act-fail) { margin-left: auto; }
.engine .row > :is(.act-note, .act-ok, .act-fail) + .switch { margin-left: 0; }
/* A switch while it works: the spinner on its knob. */
.switch[data-state="working"] { opacity: .75; cursor: progress; }
.switch[data-state="working"]::after { box-sizing: border-box; border: 2px solid var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; }
.switch[data-state="done"] { opacity: 1; }
.welcome { text-align: center; padding: 30px 20px; }
.welcome-title { font-size: 19px; margin-bottom: 18px; letter-spacing: -.01em; }

/* ---- setup: one step at a time ---- */
.setup { display: grid; gap: 14px; }
.setup h2 { font-size: 18px; letter-spacing: -.01em; margin: 0; }
.setup .why { margin: 0; color: var(--muted); }
.setup-trust { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--ok-soft); }
.setup-trust svg { flex: none; color: var(--ok); margin-top: 1px; }
.setup-trust b { display: block; font-size: 13.5px; }
.setup-trust p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.setup-lines { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.setup-line { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.setup-line:first-child { border-top: 0; }
.setup-line .mark { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--raised); color: var(--muted); }
.setup-line.ok .mark { background: var(--ok-soft); color: var(--ok); }
.setup-line.warn .mark { background: var(--warn-soft); color: var(--warn); }
.setup-line.busy .mark { background: var(--accent-soft); color: var(--accent); }
.setup-line .txt { flex: 1; min-width: 0; }
.setup-line b { font-size: 14px; }
.setup-line p { margin: 2px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.setup-line .go { flex: none; align-self: center; }
.setup-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.setup-foot .hint { margin: 0; }
.setup-progress { display: flex; gap: 6px; }
.setup-progress span { flex: 1; height: 5px; border-radius: 99px; background: var(--raised); }
.setup-progress span.done { background: var(--ok); }
.setup-progress span.on { background: var(--accent); }
.setup-step { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.ai-tiles { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.ai-tile { border: 1px solid var(--line); border-radius: 12px; display: grid; align-content: start; background: var(--surface); overflow: hidden; }
.ai-tile.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.ai-tile .setup-line { border: 0; }
.account-group > h4 { margin: 8px 0 0; font-size: 14px; }
@media (max-width: 720px) {
  .setup-line { flex-wrap: wrap; }
  .setup-line .go, .setup-line .go .btn { width: 100%; }
  .ai-tiles { grid-template-columns: minmax(0, 1fr); }
}
.how { list-style: none; counter-reset: how; padding: 0; margin: 0 auto 22px; max-width: 760px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; text-align: left; }
.how li { counter-increment: how; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.how li::before { content: counter(how); display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 12.5px; margin-bottom: 8px; }
.how b { display: block; font-size: 14px; }
.how span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }

/* ---- the assistant bar, toasts ---- */
.askbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 22px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--bg) 45%); pointer-events: none; }
.askbar-in { pointer-events: auto; max-width: 928px; margin: 0 auto; display: flex; gap: 4px; align-items: center; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 5px; box-shadow: var(--shadow); }
.askbar-in:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.askbar-in input[type="text"] { flex: 1; min-width: 0; border: 0; background: transparent; padding: 8px 4px; font-size: 14px; }
.askbar-in input[type="text"]:focus { box-shadow: none; }
.askbar-in .btn { padding: 8px 18px; border-radius: 10px; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 70; max-width: min(640px, calc(100% - 32px)); background: var(--text); color: var(--bg); border-radius: 12px; padding: 10px 16px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }
.toast.bad { background: var(--bad); color: var(--on-bad); }

/* ---- forms ---- */
input:not([type]), input[type="text"], input[type="email"], input[type="password"], textarea { width: 100%; background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 11px; font: 13.5px/1.4 "Segoe UI", system-ui, sans-serif; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.form .lbl { color: var(--text); font-size: 13px; }
.form .lbl em { font-style: normal; font-weight: 500; color: var(--faint); margin-left: 4px; }
.form label small { font-weight: 400; color: var(--faint); font-size: 12px; }
.modal-title + .hint { margin-top: 4px; }
.form .check { display: flex; gap: 9px; align-items: flex-start; font-weight: 500; color: var(--text); line-height: 1.45; }
.form .check input { flex: none; margin: 3px 0 0; }
.form details summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.form-error { margin: 0; color: var(--bad); font-size: 13px; font-weight: 600; }

/* ---- panels (right side; full screen on a phone) and the dialog ---- */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); }
.panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(440px, 100%); background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; box-shadow: -12px 0 32px rgba(0, 0, 0, .25); }
/* The chat takes 40% of a large screen (at least 440 px), 70% of a tablet's, a phone's whole width (below). */
#chat-panel { width: max(440px, 40%); }
@media (max-width: 1024px) { #chat-panel { width: 70%; } }
.panel > header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.panel > header b { font-size: 15px; }
.panel-body { flex: 1; overflow: auto; padding: 14px; display: grid; gap: 14px; align-content: start; }
.panel h3 { font-size: 12.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 4px 0 8px; }
.ptabs { display: flex; border-bottom: 1px solid var(--line); }
.ptabs button { flex: 1; border: 0; background: none; padding: 10px 0; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.ptabs button.sel { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.alert { border-bottom: 1px solid var(--line); padding: 10px 2px; }
.alert:last-child { border-bottom: 0; }
.alert .when { font-size: 12px; color: var(--faint); }
.log { display: grid; gap: 1px; font-size: 12.5px; }
.logline { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 8px; padding: 4px 2px; color: var(--muted); overflow-wrap: anywhere; border-bottom: 1px solid var(--line); }
.logline .t { color: var(--faint); font-variant-numeric: tabular-nums; }
.logline.alert-line { color: var(--text); }
.logline.alert-line .x::before { content: "⚠ "; color: var(--warn); }
.chat-log { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 86%; padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.bubble.owner { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 4px; }
.bubble.assistant { align-self: flex-start; background: var(--raised); border-bottom-left-radius: 4px; }
.bubble.failed { background: var(--bad-soft); color: var(--bad); }
.bubble code { background: rgba(127, 127, 127, .18); }
.bubble-meta { font-size: 11px; opacity: .7; margin-top: 4px; }
.typing { color: var(--muted); font-style: italic; }
.chat-note { margin: 0 0 4px; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; font-weight: 600; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.quick-btn { border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text); }
.quick-btn:hover { border-color: var(--accent); color: var(--accent); }
.chat-in { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.chat-compose { flex: 1; min-width: 0; display: grid; gap: 8px; }
.chat-in textarea { width: 100%; min-height: 44px; max-height: 50vh; }
/* Under the text field: "+" to attach, which AI answers (and its model and effort), Send on the right. */
/* It wraps rather than scroll sideways on a narrow phone; the menu opens over the whole row, never off the screen. */
.chat-tools { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.chat-tools .send { margin-left: auto; flex: none; }
.plus { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; padding: 0; font: inherit; font-size: 22px; line-height: 1; border: 1px solid var(--line-2); color: var(--text); background: var(--surface); cursor: pointer; }
.plus:hover { border-color: var(--accent); color: var(--accent); }
.chat-who { display: inline-flex; min-width: 0; }
.chat-who .who { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--raised); }
.chat-who .who button { border: 0; background: none; padding: 4px 9px; border-radius: 7px; font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.chat-who .who button[aria-checked="true"] { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.chat-who .one { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.chat-model { min-width: 0; }
.chat-model-btn { border: 0; background: none; padding: 4px 2px; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.chat-model-btn::after { content: " ▾"; }
.chat-model-btn:hover { color: var(--text); }
.chat-model-menu { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 5; width: min(260px, 100%); box-sizing: border-box; display: grid; gap: 10px; padding: 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); font-size: 12.5px; }
.chat-model-menu[hidden] { display: none; }
.chat-model-group { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.chat-model-group b { grid-column: 1 / -1; font-size: 12px; }
.chat-model-group[hidden] { display: none; }
.chat-model-menu select, .chat-model-menu input { min-width: 0; width: 100%; font: inherit; font-size: 12.5px; padding: 4px 6px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface-2); color: var(--text); }
.bubble-by { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; white-space: normal; }
.toast .btn.link { color: inherit; text-decoration: underline; padding: 0 2px; font: inherit; }
.chat-files { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-files:empty { display: none; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--raised); color: var(--muted); font-size: 12px; }
.file-chip .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip button { border: 0; padding: 0; background: none; color: inherit; cursor: pointer; font: inherit; }
.bubble-files { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.bubble-file { color: inherit; font-size: 12px; }
.bubble-file img { display: block; width: 96px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.setting { display: flex; align-items: flex-start; gap: 12px; }
.setting > div { flex: 1; }
.setting b { display: block; font-size: 13.5px; }
.setting p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.seg.pc-limit { display: flex; max-width: 100%; }
.seg.pc-limit button { flex: 1 1 0; min-width: 0; padding: 6px 4px; white-space: nowrap; overflow-wrap: normal; }
.seg.pc-limit button[data-pc-limit="auto"] { flex: 0 0 auto; padding: 6px 12px; }
.modal { position: fixed; inset: 0; z-index: 60; background: var(--scrim); display: grid; place-items: center; padding: 16px; overflow: auto; }
.modal > .card { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.modal-title { font-size: 18px; }
.owner-dialog { width: min(440px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 14px; color: var(--text); background: var(--surface); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.owner-dialog::backdrop { background: var(--scrim); }
.owner-dialog .sheet { padding: 20px; }
.owner-dialog h2 { margin: 0 0 8px; font-size: 18px; }
.owner-dialog p { margin: 0 0 18px; color: var(--muted); white-space: pre-line; line-height: 1.5; }
.owner-dialog .grab { display: none; }
/* Settings in groups (Your account reuses them): a line between groups, a dashed line between the settings of a
   group; each setting says what it is in one line (group-help), then its state. */
.panel-body:has(> .group) { gap: 0; padding-top: 0; padding-bottom: 0; }
.group { padding: 16px 0; border-top: 1px solid var(--line); }
.group:first-child { border-top: 0; }
.group > h3 { margin: 0 0 10px; }
.group > h3.danger { color: var(--bad); }
.group-item + .group-item { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.group-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.group-head > b { font-size: 14px; }
.group-head .act-pair { margin-left: auto; }
.group-help { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.group-state { margin: 8px 0 0; font-size: 13px; }
.group-note { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; }
.group-kv { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 8px 10px; margin: 10px 0 0; font-size: 13px; }
.group > .group-kv:first-of-type { margin-top: 0; }
.group-kv dt { color: var(--muted); }
.group-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.group-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.group-kv .group-actions { margin-top: 6px; }
.group .seg.pc-limit { margin-top: 10px; }
.field-row { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.field-row input { flex: 1 1 140px; min-width: 0; }

/* ---- the mark, and signing in ---- */
.mark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 12px; letter-spacing: -.02em; flex: none; }
.brand { display: inline-flex; align-items: center; gap: 9px; }
.login-main { max-width: 400px; padding-top: 14vh; }
.login-card { display: grid; gap: 16px; padding: 24px; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .mark { width: 44px; height: 44px; border-radius: 12px; font-size: 16px; }
.login-brand h1 { font-size: 19px; letter-spacing: -.01em; }
.login-brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.login-card label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.login-card .bad { margin: 0; font-size: 13px; font-weight: 600; }
.login-card .bad:empty { display: none; }
/* Hidden from sight, there for the browser (it outranks the input styles above). */
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }

/* ---- phones ---- */
@media (max-width: 720px) {
  .top-in { padding: 9px 12px; }
  main { padding: 12px 12px 104px; gap: 12px; }
  .hero { grid-template-columns: 1fr; gap: 14px; padding: 14px; }
  .hero h1 { font-size: 20px; }
  .hero-sub { margin-bottom: 10px; }
  /* Both AIs side by side: the status card stays short. */
  .hero-usage { grid-template-columns: 1fr 1fr; gap: 12px; }
  .engine .meta { font-size: 11.5px; }
  .engine .row { flex-wrap: wrap; row-gap: 2px; }
  .engine .state { order: 3; width: 100%; font-size: 11px; }
  .seg { display: flex; }
  .seg button { flex: 1; padding: 7px 0; }
  .chips { flex-wrap: wrap; overflow: visible; }
  .stages { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stages[data-tiles="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage { padding: 8px 10px; }
  .stage b { font-size: 18px; }
  .btn.small { min-height: 36px; padding: 6px 12px; }
  .switch.sm { width: 44px; height: 26px; }
  .switch.sm::after { width: 20px; height: 20px; }
  .switch.sm[aria-checked="true"]::after { left: 21px; }
  .task details summary, .facts summary { padding: 8px 0; }
  .meta a, .fact a, .facts-head .repo { display: inline-block; padding: 6px 0; }
  .facts-actions { margin-left: 0; width: 100%; }
  .fact.minor { display: none; }
  .prow .go { display: none; }
  .prow .nums { margin-left: 0; width: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; text-align: center; font-size: 11px; line-height: 1.25; }
  .prow .nums b { display: block; margin: 0 0 2px; font-size: 16px; }
  .steps small { display: none; }
  .how { grid-template-columns: 1fr; }
  .guide { flex-wrap: wrap; }
  .guide .btn { width: 100%; }
  .task .end { margin-left: 0; }
  .done-task { grid-template-columns: minmax(0, 1fr) 90px; gap: 8px; }
  .done-time { width: 90px; font-size: 11.5px; }
  .steps small { display: none; } /* the reviewer's name is on the line under the bar */
  .panel, #chat-panel { width: 100%; border-left: 0; }
  .askbar { padding-left: 12px; padding-right: 12px; }
  .toast { bottom: 80px; }
  .owner-dialog { width: 100%; max-width: none; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .owner-dialog .sheet { padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); }
  .owner-dialog .grab { display: block; width: 38px; height: 4px; margin: 0 auto 16px; border-radius: 99px; background: var(--line-2); }
  .owner-dialog .actions { flex-direction: column-reverse; }
  .owner-dialog .actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  /* The spinner stands still: a full, faded ring. */
  .spin, .switch[data-state="working"]::after { border-right-color: var(--accent); opacity: .6; }
  :is(.btn, .seg, .act-note) .spin { border-right-color: currentColor; }
}

/* ---- the signed-out home page (home.html) ---- */
.home-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; letter-spacing: -.01em; }
.home-brand img { border-radius: 12px; }
.home-intro h1 { font-size: clamp(24px, 3.4vw, 34px); line-height: 1.15; letter-spacing: -.02em; margin: 22px 0 10px; text-wrap: balance; }
.home-intro .lead { color: var(--muted); font-size: 15.5px; max-width: 60ch; margin: 0 0 8px; }
.home-intro h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 26px 0 10px; }
.home-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.home-flow li { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; text-align: center; }
.home-flow li b { display: block; font-size: 14px; }
.home-flow li span { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: 2px; }
.home-flow li:not(:last-child)::after { content: "→"; position: absolute; right: -15px; top: 50%; transform: translateY(-50%); color: var(--faint); font-weight: 700; }
.home-flow li.other { border-color: color-mix(in srgb, var(--codex) 45%, var(--line)); }
@media (max-width: 820px) {
  .home-flow { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .home-flow li:not(:last-child)::after { content: "↓"; right: auto; left: 50%; top: auto; bottom: -17px; transform: translateX(-50%); }
}
.home-shot { margin-top: 20px; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; background: var(--bg); box-shadow: var(--shadow); }
.home-shot .shot-top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--top); font-weight: 700; font-size: 13px; }
.home-qs { display: grid; gap: 6px; }
.home-qs details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.home-qs summary { cursor: pointer; font-weight: 600; }
.home-qs p { margin: 6px 0 0; color: var(--muted); }
.home-icons { position: absolute; }
.home-cards { display: grid; gap: 12px; }
.home-cards.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home-cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 8px; align-content: start; }
.home-tile b { font-size: 14px; }
.home-tile p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.home-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.home-ico svg { width: 18px; height: 18px; }
.home-ico.need { background: var(--accent-soft); color: var(--accent); }
.home-ico.safe { background: var(--ok-soft); color: var(--ok); }
@media (max-width: 900px) { .home-cards.four, .home-cards.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.home-card { display: grid; gap: 12px; padding: 24px; min-width: 0; overflow-wrap: anywhere; }
.home-card h2 { font-size: 18px; margin: 0; }
.home-card .switches { margin: 0; font-size: 13px; color: var(--muted); }
.home-card .good { color: var(--ok); }
.home-card p:empty { display: none; }
/* Get started: the whole journey in six steps, the request form as step 1 (the approved picture, step 3). */
.gs { margin-top: 28px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.home-intro .gs h2 { margin: 0 0 16px; }
.gs-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.gs-steps > li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; }
.gs-steps > li > div { min-width: 0; }
.gs-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.gs-steps b { display: block; margin-top: 4px; }
.gs-steps p { margin: 2px 0 0; }
.gs-form { margin-top: 10px; gap: 8px; max-width: 420px; }
.gs-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gs-form input { width: 100%; box-sizing: border-box; }
.gs-steps p.bad, .gs-steps p.thanks { margin-top: 10px; max-width: 420px; }
.gs-steps p.bad { color: var(--bad); font-weight: 600; }
.thanks { padding: 10px 12px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); }
.gs-steps p:empty { display: none; }
.cmd { margin-top: 8px; display: flex; gap: 8px; align-items: stretch; max-width: 520px; }
.cmd code { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; overflow-x: auto; white-space: nowrap;
  background: color-mix(in srgb, var(--text) 7%, transparent); border: 1px solid var(--line); }
@media (max-width: 560px) { .gs-form .row { grid-template-columns: minmax(0, 1fr); } .gs { padding: 16px; } }

/* The signed-out home page, full width: the sign-in form waits behind the person icon in the top bar. */
.home-top .top-in { max-width: 1040px; position: relative; }
.home-top .brand-name { display: inline; }
main.home-wide { max-width: 1040px; display: block; padding-block: 34px 60px; }
.home-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; }
.home-hero h1 { margin-top: 0; }
.home-hero .lead { max-width: none; }
.home-hero .home-shot { margin-top: 0; }
.home-hero .hero-go { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.home-wide .cmd { max-width: 640px; }
.signin-pop { position: absolute; top: calc(100% + 6px); right: 16px; width: 360px; max-width: calc(100vw - 24px);
  padding: 22px; box-shadow: var(--shadow); z-index: 30; }
.icon-btn[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
.pop-sep { border: 0; border-top: 1px solid var(--line); margin: 6px 0 2px; }
.pop-look { display: grid; gap: 6px; }
.pop-look > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.home-foot { border-top: 1px solid var(--line); }
.home-foot-in { max-width: 1040px; margin: 0 auto; padding: 22px 16px 34px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 40px; align-items: start; }
.home-foot p { margin: 0; }
.home-foot h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 6px; }
.home-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.home-foot .fine { grid-column: 1 / -1; color: var(--faint); font-size: 12.5px; }

/* The demo: the first minutes after signing in, played with the dashboard's own pieces (its script in home.js). */
.demo-stage { position: relative; height: 540px; padding: 12px; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 9px; }
.demo [data-off] { opacity: 0; transform: translateY(6px); pointer-events: none; }
.demo [data-gone] { display: none; }
.demo-stage > *, .demo-t, .demo-q, .demo .bubble { transition: opacity .35s ease, transform .35s ease; }
.demo-line { color: var(--muted); font-size: 12.5px; margin: 0 2px; min-height: 18px; }
.demo-row { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.demo-hint { color: var(--muted); font-size: 12.5px; }
.demo-project { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.demo-project .end { margin-left: auto; display: flex; gap: 6px; }
.demo-facts { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.demo-facts b { color: var(--text); font-weight: 600; }
.demo-spin { display: inline-block; width: 10px; height: 10px; border-width: 2px; margin-right: 5px; vertical-align: -1px; }
.demo-h { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 2px 2px 0; }
.demo-list { display: grid; gap: 6px; }
.demo .task { padding: 7px 11px; }
.demo .task .steps { margin-top: 6px; display: none; }
.demo .task .steps.on { display: grid; }
.demo .task.new { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.demo-tfoot { display: none; justify-content: flex-end; margin-top: 6px; }
.demo-tfoot.on { display: flex; }
.demo-q-text { margin-top: 5px; font-size: 13px; }
.demo-answer { display: flex; gap: 8px; margin-top: 7px; align-items: stretch; }
.demo-answer .demo-input { flex: 1; min-width: 0; }
.demo-input { min-height: 32px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 6px 10px; font-size: 12.5px; color: var(--faint); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.demo-input.typing-in { color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.demo-input.typing-in::after { content: ""; display: inline-block; width: 1px; height: 1.1em; background: var(--text); margin-left: 1px; vertical-align: -3px; animation: demo-blink 1s steps(1) infinite; }
.demo-input.filled { color: var(--text); }
@keyframes demo-blink { 50% { opacity: 0; } }
.demo-dialog { position: absolute; left: 50%; top: 52px; width: min(300px, 86%); transform: translateX(-50%); padding: 14px; display: grid; gap: 8px; box-shadow: var(--shadow); z-index: 2; }
.demo-dialog[data-off] { transform: translate(-50%, 8px); }
.demo-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.demo-side { position: absolute; top: 0; right: 0; bottom: 0; width: 40%; background: var(--surface); border-left: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 10px; transition: transform .45s ease; z-index: 3; }
.demo-side[data-off] { opacity: 1; transform: translateX(105%); }
.demo-side-h { font-size: 13px; }
.demo-chat-log { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
.demo .bubble { font-size: 12.5px; }
.demo .bubble:empty { display: none; }
.demo-sw { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.demo-small { color: var(--muted); font-size: 12px; margin: 0; }
.demo .pressed { box-shadow: 0 0 0 4px var(--accent-soft); transform: scale(.96); }
.demo-steps { list-style: none; margin: 0; padding: 8px 12px 10px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; border-top: 1px solid var(--line); background: var(--top); }
.demo-steps li { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--faint); padding: 3px 2px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .3s, color .3s; }
.demo-steps li.on { background: var(--accent-soft); color: var(--accent); }

@media (max-width: 820px) {
  main.home-wide { padding-block: 18px 40px; }
  .demo-side { width: 70%; }
  .demo-stage { height: 600px; }
}
@media (max-width: 560px) {
  .home-cards.four, .home-cards.three { grid-template-columns: minmax(0, 1fr); }
  .signin-pop { left: 12px; right: 12px; width: auto; }
  .home-foot-in { grid-template-columns: minmax(0, 1fr); }
  .demo-side { width: 100%; border-left: 0; }
  .demo-stage { height: 650px; }
  .demo-steps { padding: 7px 6px 9px; gap: 2px; }
  .demo-steps li { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) { .demo *, .demo *::after { transition: none !important; animation: none !important; } }

/* Privacy and terms: one readable column, using the same colours as the signed-out home page. */
.doc-main { max-width: 760px; margin: 0 auto; padding: 36px 16px; display: grid; gap: 16px; }
.doc-main .home-brand { margin-bottom: 4px; color: var(--text); }
.doc-main h1 { font-size: clamp(24px, 3.4vw, 30px); letter-spacing: -.02em; margin: 14px 0 4px; }
.doc-main .lead { color: var(--muted); margin: 0; }
.doc-sec { display: grid; gap: 6px; }
.doc-sec h2 { font-size: 16px; margin: 0; }
.doc-sec p { margin: 0; }
.doc-sec ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.doc-foot { color: var(--muted); font-size: 13px; }

/* ---- the logo, Your account, projects from a previous PC ---- */
.logo { display: block; flex: none; border-radius: 7px; }
/* Your account: groups drawn in two places around the static password form, laid out as one list of groups. */
.account-groups { display: contents; }
#account-admin > .group:first-child { border-top: 1px solid var(--line); }
.account-group { display: grid; gap: 8px; }
.account-group > h3 { margin: 0 0 2px; }
.account-group p { margin: 0; }
.account-group .setting { flex-wrap: wrap; }
.account-group .setting > div { min-width: 0; flex-basis: 160px; overflow-wrap: anywhere; }
.theme-seg { justify-self: start; }
/* The strength meter under a new password: four bars, filled up to its score, and its words. */
.pw-meter { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.pw-bar { display: inline-grid; grid-template-columns: repeat(4, 22px); gap: 3px; flex: none; }
.pw-bar i { height: 5px; border-radius: 3px; background: var(--line-2); }
.pw-meter[data-score="1"] i:nth-child(-n+1) { background: var(--bad); }
.pw-meter[data-score="2"] i:nth-child(-n+2) { background: var(--warn); }
.pw-meter[data-score="3"] i:nth-child(-n+3) { background: var(--ok); }
.pw-meter[data-score="4"] i { background: var(--ok); }
.form > p.muted, .form > p.group-help { margin: 0; font-size: 12.5px; }
.linkbox { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.linkbox input { width: 100%; }
.remembered { display: grid; gap: 10px; }
.remembered h2, .remembered p { margin: 0; }
.remembered h2 { font-size: 16px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; overflow-wrap: anywhere; }

/* a long PC name wraps or shrinks instead of widening the header on a phone */
@media (max-width: 720px) {
  .top-in { flex-wrap: wrap; }
  #online { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
}

@media (max-width: 420px) {
  .brand-name { display: none; }
  .top-in { flex-wrap: nowrap; }
  #online { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
}

/* the update icon (a newer version is ready) and Your account's Update now */
.icon-btn.update { color: var(--accent); }
.update-dot { position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.update-box { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: var(--radius-sm); background: var(--accent-soft); scroll-margin: 16px; }
.update-box > b { font-size: 14px; }
.update-box p { margin: 0; }
.update-box ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 13px; }
.update-box .btn { justify-self: start; }
/* its step and its result are whole sentences: they wrap instead of being cut */
.update-box .chip { justify-self: start; white-space: normal; display: inline-flex; align-items: center; gap: 6px; }
.update-box .chip .spin { width: 11px; height: 11px; border-width: 2px; }
