/* Agentix Notes: white cards on a grey ground, radius 24, no borders on cards; the menu is an island on the
   left and a dock on phones; buttons, tabs, filters and statuses are pills, the chosen one inverted (ink on paper). Colour
   lives only on data and statuses. System font: SF Pro on Apple devices, Segoe or Roboto elsewhere. Light or dark follows
   the system until the toggle in the menu picks one (theme_boot in _ui.html). */
:root {
  --bg: #f2f2f4;
  --side: #ffffff;
  --surface: #ffffff;
  --fill: #f3f3f5;
  --fill-hover: #e8e8ec;
  --sunken: #f3f3f5;
  --sel: #e8e8ec;
  --raised: #ffffff;
  --sand: #f3f3f5;
  --text: #121212;
  --muted: #6e6e73;
  --faint: #6e6e73;
  --control: #c7c7cc;
  --border: rgba(120, 120, 128, .16);
  --border-strong: rgba(120, 120, 128, .24);
  --logo: #190d6d;
  --accent: #2481ff;
  --accent-hover: #1a6fe0;
  --accent-text: #1a6fe0;
  --accent-soft: rgba(36, 129, 255, .12);
  --on-accent: #ffffff;
  --coral: #a85a00;
  --coral-soft: #fff0d9;
  --ok: #177a35;
  --ok-soft: #e1f3e6;
  --ok-ink: #135e2a;
  --on-ok: #ffffff;
  --err: #c9271d;
  --err-soft: #ffe5e3;
  --err-ink: #b3221a;
  --nt-bg: #ececf0;
  --nt-ink: #55555a;
  --code-bg: #f3f3f5;
  --code-text: #121212;
  --code-dim: #6e6e73;
  --shadow-xs: none;
  --shadow: none;
  --shadow-lg: 0 6px 24px rgba(0, 0, 0, .12), 0 0 0 1px var(--border);
  --r-lg: 24px;
  --r: 18px;
  --r-sm: 12px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --font: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme=dark] {
  --bg: #0f0f10;
  --side: #1c1c1e;
  --surface: #1c1c1e;
  --fill: #26262a;
  --fill-hover: #303035;
  --sunken: #26262a;
  --sel: #303035;
  --raised: #1c1c1e;
  --sand: #26262a;
  --text: #f5f5f7;
  --muted: #98989f;
  --faint: #98989f;
  --control: #48484d;
  --border: rgba(255, 255, 255, .1);
  --border-strong: rgba(255, 255, 255, .16);
  --logo: #ffffff;
  --accent: #3e88f7;
  --accent-hover: #5c9bf8;
  --accent-text: #6aa6ff;
  --accent-soft: rgba(62, 136, 247, .18);
  --coral: #ffb340;
  --coral-soft: #35270f;
  --ok: #4cd070;
  --ok-soft: #16301d;
  --ok-ink: #6fdd8b;
  --on-ok: #0f0f10;
  --err: #ff6961;
  --err-soft: #3a1917;
  --err-ink: #ff8a84;
  --nt-bg: #2a2a2e;
  --nt-ink: #c7c7cc;
  --code-bg: #26262a;
  --code-text: #f5f5f7;
  --code-dim: #98989f;
  --shadow-lg: 0 6px 24px rgba(0, 0, 0, .5), 0 0 0 1px var(--border);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/22px var(--font); -webkit-font-smoothing: antialiased; }
body { font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 18px; line-height: 24px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 15px; font-weight: 700; }
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
code, pre, .mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
[hidden] { display: none !important; }  /* class rules like label.field set display and would beat the attribute */
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.logo { display: inline-block; flex: none; background: var(--logo); -webkit-mask: url(mark.svg) center / contain no-repeat; mask: url(mark.svg) center / contain no-repeat; }
svg.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---- app shell: the menu is an island on the grey ground; on phones it gives way to a dock ---- */
.app { display: grid; grid-template-columns: 266px minmax(0, 1fr); min-height: 100vh; }
/* the island has a fixed height: its rows must not shrink (they did, to 22px, once the projects outgrew the screen); the projects scroll instead */
.side { position: sticky; top: 12px; height: calc(100vh - 24px); margin: 12px 0 12px 12px; display: flex; flex-direction: column; gap: 2px;
  padding: 14px 10px 12px; background: var(--side); border-radius: var(--r-lg); }
.side > * { flex: none; }
.side > .side-scroll { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; display: flex; flex-direction: column; gap: 2px;
  padding-bottom: 18px; -webkit-mask-image: linear-gradient(#000 calc(100% - 22px), transparent); mask-image: linear-gradient(#000 calc(100% - 22px), transparent); }  /* the fade says the list goes on */
.side-projects, .side-agents { display: flex; flex-direction: column; gap: 2px; }
.side-scroll .nav { flex: none; }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 0 2px 8px 10px; }
.side-head { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 700; font-size: 15px; }
/* the product switch: Projects (the tracker, at /projects on the same address) | Notes */
.switch { display: flex; gap: 2px; padding: 3px; margin: 0 0 10px; border-radius: 999px; background: var(--bg); }
.switch a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border-radius: 999px; color: var(--muted); font-weight: 700; }
.switch a:hover { color: var(--text); }
.switch a[aria-current] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
:root[data-theme=dark] .switch a[aria-current] { background: var(--fill-hover); box-shadow: none; }
.switch .icon { display: none; }
.side .side-search { background: var(--fill); margin-bottom: 6px; }
.count { margin-left: auto; display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--fill-hover);
  color: var(--text); font-size: 12px; font-weight: 700; }
.side .nav > .faint.small { margin-left: auto; font-weight: 500; }
.side-label a:hover { color: var(--text); }
.side-new > summary { list-style: none; cursor: pointer; } .side-new > summary::-webkit-details-marker { display: none; }
.side-form { display: flex; gap: 6px; padding: 6px 2px 8px; } .side-form input { height: 36px; padding: 0 14px; font-size: 14px; }
.side .agent-nav { height: 48px; }
.agent-nav .tile { display: none; }
.agent-nav .two { line-height: 18px; gap: 0; } .agent-nav small { font-size: 12px; font-weight: 500; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--control); flex: none; }
.dot.on { background: var(--ok); }
.side .tile-sm { width: 26px; height: 26px; margin: 0 -4px; border-radius: 8px; letter-spacing: .02em; }  /* projects are squares, agents and people are circles */
.side-user .tile-sm { margin: 0; border-radius: 50%; }
.side .nav { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 999px; color: var(--muted); font-weight: 600; width: 100%;
  transition: background .15s var(--ease), color .15s var(--ease); }
.side .nav:hover { background: var(--fill); color: var(--text); }
.side .nav[aria-current] { background: var(--sel); color: var(--text); }
.side .nav.quiet { height: 36px; font-weight: 500; }
.side-label { padding: 14px 12px 4px; min-height: 34px; font-size: 13px; line-height: 16px; font-weight: 600; color: var(--muted); }
.side-bottom { margin-top: auto; display: grid; gap: 2px; padding-top: 12px; }
.side-bottom .setup-card { margin-bottom: 6px; } .side-account { margin-top: 6px; }
.setup-card { display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--r); background: var(--fill); transition: background .15s var(--ease); }
.setup-card:hover { background: var(--fill-hover); }
.segments { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.segments span { height: 4px; border-radius: 4px; background: var(--fill-hover); }
.segments span.on { background: var(--accent); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 999px; min-width: 0; font-weight: 600; }
.theme-toggle .icon-moon, :root[data-theme=light] .theme-toggle .icon-sun { display: none; }
:root[data-theme=light] .theme-toggle .icon-moon { display: block; }
.main { min-width: 0; padding: 28px 32px 72px; }
.page { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
/* a narrow page keeps the left edge of the wide ones, so the heading does not jump between sections */
.page-narrow { max-width: 780px; margin-left: max(0px, calc((100% - 1080px) / 2)); }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.head p { margin-top: 6px; color: var(--muted); max-width: 600px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.crumbs a:hover { color: var(--text); }

/* ---- buttons: pills; the main action is inverted ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--surface); color: var(--text); font: 700 14px/1 var(--font); cursor: pointer; white-space: nowrap; user-select: none;
  -webkit-tap-highlight-color: transparent; transition: background .15s var(--ease), color .15s var(--ease), opacity .15s var(--ease); }
.btn:hover { background: var(--fill-hover); }
:is(.card, .side, .live-card, .fold, .insight-bar, .key-card, .prompt-card, .panel) .btn { background: var(--fill); }
:is(.card, .side, .live-card, .fold, .insight-bar, .key-card, .prompt-card, .panel) .btn:hover { background: var(--fill-hover); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.btn-primary { background: var(--text); color: var(--surface); }
.btn.btn-primary:hover { background: var(--text); opacity: .88; }
.btn.btn-ghost { background: transparent; color: var(--muted); }
.btn.btn-ghost:hover { background: var(--fill-hover); color: var(--text); }
.btn.btn-danger { background: var(--err-soft); color: var(--err-ink); }
.btn.btn-danger:hover { background: color-mix(in srgb, var(--err) 20%, var(--surface)); }
.btn-sm { height: 32px; padding: 0 12px; gap: 6px; font-size: 13px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15px; }
.btn-icon { width: 38px; padding: 0; } .btn-sm.btn-icon { width: 32px; }
.btn.copied { color: var(--ok); }

/* ---- fields: pills on the raised grey ---- */
input[type=text], input[type=search], input[type=password], input[type=email], input:not([type]), select { height: 42px; width: 100%; padding: 0 16px; border-radius: 999px;
  border: 0; background: var(--fill); color: var(--text); font: inherit; transition: background .15s var(--ease), box-shadow .15s var(--ease); }
input:focus, select:focus { outline: none; box-shadow: 0 0 0 2px var(--accent); }
input::placeholder { color: var(--muted); }
select { appearance: none; padding-right: 38px; font-weight: 600; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238b8389' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--text); }
label.field { display: grid; gap: 6px; font-weight: 700; font-size: 13px; color: var(--muted); }
.inline { display: flex; gap: 8px; } .inline input { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--surface);
  color: var(--muted); font: 700 13px var(--font); cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease); }
:is(.card, .panel, .pop-body) .chip { background: var(--fill); }
.chip:hover { color: var(--text); }
.chip.on, .card .chip.on { background: var(--text); color: var(--surface); }
.chip .icon { width: 14px; height: 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 999px; background: var(--surface);
  color: var(--muted); font-weight: 700; font-size: 14px; white-space: nowrap; transition: background .15s var(--ease), color .15s var(--ease); }
.tabs a:hover { color: var(--text); }
.tabs a.on { background: var(--text); color: var(--surface); }

/* ---- surfaces ---- */
.card { background: var(--surface); border-radius: var(--r-lg); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 10px; }
.card-body { padding: 4px 20px 20px; }
.card > .card-body:first-child { padding-top: 18px; }  /* no heading above: the table header must not sit 4px under the card edge */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.grid-side { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.grid-2 > *, .grid-4 > *, .grid-side > * { min-width: 0; }
.banner { padding: 12px 16px; border-radius: var(--r); background: var(--err-soft); color: var(--err-ink); max-width: 1080px; margin: 0 auto 16px; font-weight: 600; }
.banner.ok { background: var(--ok-soft); color: var(--ok-ink); }

/* ---- empty-state marks: a round icon ---- */
.spot { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--fill); color: var(--muted); }
.spot .icon { width: 20px; height: 20px; }
.spot-lg { width: 52px; height: 52px; } .spot-lg .icon { width: 22px; height: 22px; }
.spot-sm { width: 34px; height: 34px; }
.art { background: var(--surface); border-radius: var(--r-lg); display: grid; place-items: center; overflow: hidden; }

.searchbox { position: relative; width: 100%; max-width: 640px; margin-top: 4px; }
.searchbox input { height: 44px; padding: 0 52px 0 44px; border-radius: 999px; font-size: 15px; background: var(--surface); }
.searchbox > svg { position: absolute; left: 16px; top: 13px; color: var(--muted); }
.searchbox button { position: absolute; right: 3px; top: 3px; } .searchbox .btn-sm { right: 6px; top: 6px; }
.searchbox-sm { max-width: none; margin: 0; }
.setup-banner { padding: 18px 20px 20px; }
.setup-banner h2 { font-size: 15px; }
.checklist { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 14px; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 8px; list-style: none; color: var(--muted); font-size: 13.5px; }
.checklist li.done { color: var(--faint); text-decoration: line-through; }
.checklist li.now { color: var(--text); font-weight: 600; }
.check { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--border-strong); display: grid; place-items: center; flex: none; }
.done .check { background: var(--ok); box-shadow: none; color: var(--on-ok); }
.now .check { box-shadow: inset 0 0 0 1.5px var(--accent); }
.done .check svg { width: 11px; height: 11px; stroke-width: 3; }

/* ---- home: projects table ---- */

/* ---- lists, tables, pills ---- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  padding: 0 14px 10px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 14px 13px 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.link-row { cursor: pointer; } .table tr.link-row:hover td { background: var(--fill); }
.table td:first-child, .table th:first-child { padding-left: 6px; }
.table .right { text-align: right; }
@media (min-width: 721px) { .table td.right + td:not(.right), .table th.right + th:not(.right) { padding-left: 22px; } }
.cell-sub { display: block; }
.table td .row, .table td time, .table td code { white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--nt-bg);
  color: var(--nt-ink); font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill-ok { background: var(--ok-soft); color: var(--ok-ink); }
.pill-err { background: var(--err-soft); color: var(--err-ink); }
.pill-accent { background: var(--accent-soft); color: var(--accent-text); }
mark { background: rgba(255, 204, 0, .4); color: inherit; border-radius: 3px; padding: 0 1px; }
.ok-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: var(--ok); background: var(--ok-soft); }
.ok-mark .icon { width: 12px; height: 12px; stroke-width: 2.6; }
/* access editor: a segmented choice per project */
.access-list { display: grid; }
.access-row { display: grid; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.access-row:last-child { border-bottom: 0; }
.seg { display: inline-flex; justify-self: start; gap: 3px; padding: 3px; border-radius: 999px; background: var(--fill); flex-wrap: wrap; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg span:hover { color: var(--text); }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .14); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
/* "Full access to all" hides the per-project list; the server grants rwd everywhere when scope=all */
.grants:has(input[name=scope][value=all]:checked) :is(.access-list, .grants-each) { display: none; }
.grants:has(input[name=scope][value=each]:checked) .grants-all { display: none; }
.tile { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none; font-weight: 700; font-size: 11px;
  background: hsl(var(--h, 230) 46% 90%); color: hsl(var(--h, 230) 46% 28%); }
:root[data-theme=dark] .tile { background: hsl(var(--h, 230) 26% 24%); color: hsl(var(--h, 230) 50% 82%); }
.tile-sm { width: 22px; height: 22px; font-size: 10px; }
.tile-lg { width: 44px; height: 44px; font-size: 15px; }

/* ---- empty states (Miro / Laravel Cloud) ---- */
.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 36px 24px 40px; }
.empty .spot { margin-bottom: 10px; }
.empty h2 { font-size: 17px; }
.empty p { color: var(--muted); max-width: 420px; }
.empty .btn { margin-top: 10px; }

/* ---- wizard: one column on the grey ground ---- */
.wizard-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; background: var(--bg); }
.wizard-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper span { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 600; }
.stepper span b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--control); font-size: 11px; }
.stepper span b .icon { width: 11px; height: 11px; stroke-width: 3; }
.stepper span.done { color: var(--muted); } .stepper span.done b { background: var(--ok); box-shadow: none; color: var(--on-ok); }
.stepper span.now { color: var(--text); } .stepper span.now b { background: var(--text); box-shadow: none; color: var(--surface); }
.stepper i { width: 22px; height: 1.5px; background: var(--control); }
.wizard-main { width: 100%; max-width: 620px; margin: 0 auto; padding: 36px 20px 72px; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 20px; }
.wizard-hero { display: grid; gap: 10px; justify-items: start; }
.wizard-main h1 { font-size: 30px; }
.lead { color: var(--muted); font-size: 15px; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.choice-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 6px; border-radius: var(--r-lg); background: var(--surface); }
.choice { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 12px;
  border-radius: 14px; cursor: pointer; transition: background .15s var(--ease); }
.choice:hover { background: var(--fill); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { background: var(--fill-hover); }
.choice:has(input:checked) .tile { background: var(--text); color: var(--surface); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.choice b { display: block; font-size: 15px; font-weight: 700; } .choice small { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; }

/* ---- guides: steps as a vertical timeline ---- */
.guide { display: grid; counter-reset: step; }
.guide-step { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 14px; padding-bottom: 22px; }
.guide-step::before { counter-increment: step; content: counter(step); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--control); color: var(--muted); font-size: 12px; font-weight: 700; position: relative; z-index: 1; }
.guide-step::after { content: ""; position: absolute; left: 11.25px; top: 28px; bottom: 4px; width: 1.5px; background: var(--border-strong); }
.guide-step:last-child { padding-bottom: 0; } .guide-step:last-child::after { display: none; }
.guide-step.key::before { content: ""; counter-increment: none; background-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='15' r='4'/%3E%3Cpath d='m10.85 12.15 7.65-7.65M18 5l2 2M15 8l2 2'/%3E%3C/svg%3E");
  background-size: 13px; background-repeat: no-repeat; background-position: center; }
.guide-step > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; padding-top: 2px; }
.key-card, .secret, .code, .live-card > div { min-width: 0; }
.key-card .spread { flex-wrap: wrap; gap: 2px 12px; }
.guide-step .note { color: var(--muted); font-size: 13px; }
.key-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 16px; border-radius: var(--r); background: var(--fill); }
.code { border-radius: 14px; background: var(--code-bg); overflow: hidden; min-width: 0; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 36px; padding: 0 5px 0 14px;
  border-bottom: 1px solid var(--border); color: var(--code-dim); font: 600 12px var(--mono); }
.code-head .btn { height: 28px; padding: 0 10px; background: transparent; color: var(--code-dim); font-size: 12px; }
.code-head .btn:hover { background: var(--fill-hover); color: var(--text); }
.code-head .btn.copied { color: var(--ok); }
.code pre { margin: 0; padding: 12px 14px; color: var(--code-text); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; font-size: 12.5px; }
.secret { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 5px 0 16px; border-radius: 999px; background: var(--fill); }
.secret code { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.secret .btn { background: var(--surface); }
.secret.codes { height: auto; align-items: flex-start; padding: 12px 8px 12px 16px; border-radius: var(--r-sm); }
.secret.codes code { white-space: pre; overflow: visible; line-height: 1.7; }
.callout { display: grid; gap: 10px; padding: 16px 18px; border-radius: var(--r); background: var(--fill); grid-template-columns: minmax(0, 1fr); }
.callout.warn { background: var(--coral-soft); }
.prompt-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r);
  background: var(--fill); }
.prompt-card .badge { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--text); }
textarea.hidden-copy { position: absolute; left: -9999px; }
/* the prompt is the main way to connect: its first lines show under the heading, the rest scrolls inside */
.prompt-box { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); }
.card .prompt-box { padding: 0; }
.prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; }
.prompt-head > div { flex: 1 1 260px; display: grid; gap: 2px; } .prompt-head h3 { font-size: 17px; }
.prompt-peek { margin: 0; max-height: 196px; overflow-y: auto; padding: 14px 16px 26px; border-radius: 14px; background: var(--code-bg); color: var(--code-text);
  font: 12.5px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 44px), transparent); mask-image: linear-gradient(#000 calc(100% - 44px), transparent); }

/* ---- live connection: a dashed line with one moving dash while waiting ---- */
.live-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; padding: 18px 20px;
  border-radius: var(--r-lg); background: var(--surface); transition: box-shadow .22s var(--ease); }
.live-card h3 { font-size: 15px; }
.live-card .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.beam { position: relative; display: flex; align-items: center; width: 148px; height: 48px; }
.beam .end { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--fill); flex: none; }
.beam .end .tile { width: 28px; height: 28px; }
.beam .end img { width: 26px; height: 26px; }
.beam svg.wire { flex: 1; height: 12px; overflow: visible; }
.beam .wire line { stroke-width: 2; stroke-linecap: round; }
.beam .wire .base { stroke: var(--control); stroke-dasharray: 2 5; }
.beam .wire .flow { stroke: var(--accent); stroke-dasharray: 22 90; animation: beam-flow 1.6s linear infinite; }
@keyframes beam-flow { from { stroke-dashoffset: 112; } to { stroke-dashoffset: 0; } }
.beam .badge { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok); color: var(--on-ok); box-shadow: 0 0 0 3px var(--surface); opacity: 0; z-index: 2; }
.beam .badge .icon { width: 12px; height: 12px; stroke-width: 3; }
.is-live .live-card { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ok) 45%, transparent); }
.is-live .beam .flow { display: none; animation: none; }
.is-live .beam .base { stroke: var(--ok); stroke-dasharray: none; }
.is-live .beam .badge { opacity: 1; transition: opacity .18s var(--ease); }
.live { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--fill); font-size: 13px; font-weight: 700; }
.pulse { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); flex: none; }
.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--coral); opacity: 0; animation: ping 1.6s var(--ease) infinite; }
.live.ok { background: var(--ok-soft); color: var(--ok); } .live.ok .pulse { background: var(--ok); } .live.ok .pulse::after { display: none; }
@keyframes ping { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.8); opacity: 0; } }
.success { display: none; } .is-live .success { display: grid; } .is-live .success.row, .is-live .success.actions { display: flex; } .is-live .waiting-only { display: none; }

/* ---- v2 onboarding: one prompt, then the live tracker (signal -> first project -> done) ---- */
.stepper b .icon { display: none; } .stepper .done b .icon { display: block; } .stepper .done b span { display: none; }
.project-step, .all-done, .project-done { display: none; }
.tracker.is-live .project-step { display: grid; animation: reveal .45s var(--ease) both; }
.tracker.has-project .project-wait { display: none; }
.tracker.has-project .project-done { display: flex; animation: reveal .4s var(--ease) both; }
.tracker.is-live.has-project .all-done { display: flex; }
.tracker.is-live.has-project .until-done { display: none; }
.check-badge { width: 22px; height: 22px; border-radius: 50%; background: var(--ok); color: var(--on-ok); display: grid; place-items: center; flex: none; }
.check-badge .icon { width: 12px; height: 12px; stroke-width: 3; }

/* ---- folds: collapsible blocks that remember their state ---- */
.fold { border-radius: var(--r); background: var(--surface); min-width: 0; }
.fold > summary { display: flex; align-items: center; gap: 8px; padding: 13px 16px; cursor: pointer; font-weight: 700; list-style: none; user-select: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint);
  transform: rotate(-45deg); transition: transform .2s var(--ease); }
.fold[open] > summary::after { transform: rotate(45deg); }
.fold > summary em { font-style: normal; color: var(--faint); font-size: 12.5px; }
.fold-body { padding: 2px 16px 14px; display: grid; gap: 2px; min-width: 0; }
.manual .fold-body { padding-top: 10px; }

/* ---- project: header with tabs; the notes view is a filter rail beside the list ---- */
.page-wide { max-width: 1180px; }
.phead { display: grid; gap: 16px; }
.phead .crumbs { margin-bottom: -6px; }
.phead-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.phead-row p { margin-top: 4px; }
.ptabs { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.ptabs-more { display: flex; flex-wrap: wrap; gap: 2px; }
.ptabs-more a { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; }
.ptabs-more a:hover { color: var(--text); } .ptabs-more a[aria-current] { background: var(--surface); color: var(--text); }
/* segmented links: the project's sections, its folders */
.segs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: var(--r); background: var(--surface); max-width: 100%; }
.segs a { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 14px; color: var(--muted); font-weight: 700; font-size: 14px;
  white-space: nowrap; transition: background .15s var(--ease), color .15s var(--ease); }
.segs a:hover { color: var(--text); }
.segs a[aria-current] { background: var(--fill-hover); color: var(--text); }
.segs em { font-style: normal; font-weight: 500; color: var(--muted); }
.toolbar .pop { margin-left: auto; }
/* a dropdown without script: the filters of a project */
.pop { position: relative; }
.pop > summary { list-style: none; } .pop > summary::-webkit-details-marker { display: none; }
.pop-body { position: absolute; right: 0; top: calc(100% + 8px); z-index: 5; width: min(440px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; padding: 16px;
  border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-lg); gap: 8px; }
.pop-body .searchbox input { background: var(--fill); }
.pop-body .tree-label { padding: 8px 0 0; }

/* ---- master-detail: a list in aligned columns beside the picked item's card; on narrow screens the card goes below ---- */
.split { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.list-card, .list-col { flex: 3 1 480px; min-width: 0; }
.list-card { overflow: hidden; }
.list-col { display: grid; gap: 12px; }
.panel { flex: 2 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 18px; padding: 20px; border-radius: var(--r-lg); background: var(--surface); }
.panel.sticky { position: sticky; top: 12px; }
.panel h2 a:hover { color: var(--accent-text); }
.panel-where { font: 12px/18px var(--mono); color: var(--muted); } .panel-where a:hover { color: var(--text); }
.blk { display: grid; gap: 8px; min-width: 0; } .blk p { line-height: 1.5; overflow-wrap: anywhere; }
.lbl { font-size: 12px; font-weight: 700; color: var(--muted); }
.link-box { display: block; padding: 11px 14px; border-radius: var(--r-sm); background: var(--fill); } a.link-box:hover { background: var(--fill-hover); }
.lrow { display: grid; align-items: center; gap: 12px; min-height: 60px; padding: 9px 16px; border-top: 1px solid var(--border); transition: background .15s var(--ease); }
.list-card > .lrow:first-child, .sec + .lrow { border-top: 0; }
.lrow:hover { background: var(--fill); }
.lrow[aria-current] { background: var(--fill); box-shadow: inset 3px 0 0 var(--accent); }
.lrow:focus-visible { outline-offset: -2px; border-radius: 0; }
.cols-home { grid-template-columns: minmax(0, 1fr) 92px minmax(0, 160px); }
.cols-project { grid-template-columns: minmax(0, 1fr) minmax(0, 88px) 76px minmax(0, 170px); }
.cols-agents { grid-template-columns: 8px minmax(0, 1fr) auto minmax(0, 110px); }
.two { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.two .t, .two .s, .two > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.two .t { font-weight: 700; } .two .s { color: var(--muted); font-size: 13px; }
.lmeta { color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lfolder { color: var(--muted); font-size: 13px; }
.sec { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; font-size: 13px; font-weight: 700; }
.sec:not(:first-child) { border-top: 1px solid var(--border); }
.sec-more { justify-content: space-between; }
.call-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 6px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.call-row .row { flex: none; }
.tabs a em { font-style: normal; font-weight: 600; opacity: .6; }
.tabs a .icon { width: 16px; height: 16px; }
.ppanel { min-width: 0; }
.ppanel-narrow { max-width: 760px; }
.more > summary { cursor: pointer; list-style: none; padding: 4px 12px 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary:hover { color: var(--text); }
.card-body .more > summary { padding-left: 0; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.insight-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 18px;
  border-radius: var(--r-lg); background: var(--surface); }
.insight-mark { color: var(--accent-text); padding-top: 1px; }
.insight-bar .insight > p:first-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; }
.insight-bar .insight .pill { margin-right: 4px; vertical-align: 1px; }
.insight-bar .insight-refs { display: flex; gap: 4px 16px; flex-wrap: nowrap; overflow: hidden; }
.insight-bar .insight-refs > * { max-width: 45%; flex: none; }
.insight-nav { display: flex; align-items: center; gap: 2px; margin: -4px -6px 0 0; }
.tree-label { padding: 14px 12px 4px; font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.chip em { font-style: normal; }
.snap-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); }
.pill-warn { background: var(--coral-soft); color: var(--coral); }

/* ---- note: description, notices, links, history ---- */
.props-more { margin: -10px 0 22px; }
.props-more .props { margin: 0; padding: 2px 0 6px; border: 0; grid-template-columns: 140px minmax(0, 1fr); font-size: 13px; }
.props-more .props dt { min-height: 24px; } .props-more .props dd { min-height: 24px; overflow-wrap: anywhere; }
.access-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; min-width: 0; }
.access-row .row { min-width: 0; } .access-row .truncate { min-width: 0; }
.calls-n { color: var(--muted); font: 600 12px var(--mono); margin-left: 4px; }
.description { font-size: 15px; line-height: 1.6; color: var(--muted); margin: -8px 0 18px; max-width: 64ch; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--r);
  background: var(--accent-soft); margin-bottom: 14px; font-size: 14px; font-weight: 600; }
.notice.warn { background: var(--coral-soft); }
.notice > span:first-child { display: flex; align-items: center; gap: 8px; }
.extras { display: grid; gap: 10px; margin-top: 28px; }
.xref { display: flex; align-items: baseline; gap: 6px; min-width: 0; padding: 6px 0; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.xref:last-child { border-bottom: 0; }
.xref a { display: flex; gap: 8px; min-width: 0; }
.xref a:hover b, .xref a:hover { color: var(--accent-text); }
.xref a.on { color: var(--accent-text); font-weight: 600; }
.diff { margin: 0; font: 12.5px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.diff span { display: block; padding: 0 6px; border-radius: 4px; }
.diff .dadd { background: var(--ok-soft); color: var(--ok); }
.diff .ddel { background: var(--err-soft); color: var(--err); }
.diff .dgap { color: var(--faint); }

/* ---- databases: grid, console, history ---- */
.db-badge { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--text); flex: none; }
.db-badge .icon { width: 22px; height: 22px; }
.db-row { display: grid; grid-template-columns: minmax(140px, auto) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 10px;
  border-bottom: 1px solid var(--border); }
.db-row:last-child { border-bottom: 0; } .db-row:hover { background: var(--fill); }
.sql { width: 100%; min-height: 104px; padding: 12px 14px; border-radius: 14px; border: 0; background: var(--fill);
  color: var(--text); font: 13px/1.55 var(--mono); resize: vertical; }
.sql:focus { outline: none; box-shadow: 0 0 0 2px var(--accent); }
.data-wrap { overflow: auto; max-height: 68vh; border-radius: 14px; background: var(--surface); }
.data { border-collapse: separate; border-spacing: 0; font-size: 13px; width: max-content; min-width: 100%; }
.data th { position: sticky; top: 0; z-index: 1; background: var(--surface); text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data td { padding: 7px 12px; border-bottom: 1px solid var(--border); max-width: 320px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: top; }
.data tr:last-child td { border-bottom: 0; }
.data tbody tr:hover td { background: var(--fill); }
.data td.num, .data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data .type { font: 11px var(--mono); color: var(--faint); font-weight: 400; }
.data a.sort { color: inherit; } .data a.sort.on { color: var(--text); }
.cell-link { color: var(--accent-text); }
.change-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--border); }
.change-row:last-child { border-bottom: 0; }
.change-row form { margin-left: auto; }
.op { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--nt-bg); color: var(--nt-ink); }
.op-insert { background: var(--ok-soft); color: var(--ok-ink); } .op-delete, .op-drop_table { background: var(--err-soft); color: var(--err-ink); }
.op-update { background: var(--accent-soft); color: var(--accent-text); }

/* ---- page reveal: a 6px rise ---- */
[data-reveal] > * { animation: reveal .18s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } }

/* ---- auth: form beside a card with the three points ---- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-form { display: grid; align-content: center; justify-items: start; gap: 18px; padding: 48px clamp(24px, 8vw, 112px); max-width: 620px; }
.auth-form h1 { font-size: 30px; }
.auth-form form, .auth-form > .btn { width: 100%; max-width: 360px; }
.auth-form form { display: grid; gap: 12px; }
.auth-art { margin: 14px; display: grid; align-content: center; justify-items: start; gap: 26px; padding: 40px clamp(24px, 5vw, 64px); }
.points { display: grid; gap: 14px; max-width: 400px; color: var(--muted); padding: 0; margin: 0; }
.points li { list-style: none; display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 14px; }
.points li::before { content: ""; width: 6px; height: 6px; margin: 8px 0 0 6px; border-radius: 50%; background: var(--text); }
.error { color: var(--err); min-height: 1.4em; font-size: 13px; }
.project-wait .error:empty { display: none; }

/* ---- welcome by invite and the product tour: a dark stage for the picture, text that rises line by line ---- */
.stage { background: #faf9f7; border-radius: var(--r-lg); overflow: hidden; }
.stage img { display: block; width: 100%; height: 100%; object-fit: contain; animation: stage-in 1.4s var(--ease) both; }
.auth-art.stage { padding: clamp(24px, 6vw, 72px); align-content: stretch; }
/* sign-in and sign-up: one heading, one card with the form, quiet notes under it; three type sizes in all (heading, 15, 13) */
.auth-card { width: 100%; max-width: 380px; display: grid; gap: 14px; padding: 20px; }
.auth-form .auth-card form, .auth-form form.auth-card { display: grid; gap: 14px; max-width: none; }
.auth-card .error:empty { display: none; }
.consent { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.consent input { flex: none; margin: 0; }
.consent a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }
.auth-foot { display: grid; gap: 10px; max-width: 380px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.auth-foot summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px; } .auth-foot summary::-webkit-details-marker { display: none; }
.auth-foot summary:hover { color: var(--text); }
.auth-foot summary::after { content: ""; width: 6px; height: 6px; margin-top: -3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .15s var(--ease); }
.auth-foot details[open] summary::after { transform: rotate(-135deg); margin-top: 3px; } .auth-foot details[open] summary { margin-bottom: 10px; }
@keyframes stage-in { from { opacity: 0; transform: scale(1.08); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.hello { display: grid; gap: 12px; max-width: 440px; }
.hello > *, .hello h1 span, .hello-form, .tour-text > * { animation: rise .7s var(--ease) both; }
.hello-kicker { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.auth-form .hello h1 { font-size: clamp(34px, 3.6vw, 46px); line-height: 1.08; letter-spacing: -.03em; animation: none; }
.hello h1 span { display: block; animation-delay: .1s; } .hello h1 span + span { animation-delay: .3s; }
.hello > p { animation-delay: .45s; } .hello-form { animation-delay: .6s; }
.dots { display: flex; align-items: center; gap: 6px; }
.dots a { width: 6px; height: 6px; border-radius: 999px; background: var(--control); transition: width .2s var(--ease), background .2s var(--ease); }
.dots a.on { width: 24px; background: var(--text); }
.tour { width: 100%; max-width: 1040px; margin: 0 auto; padding: 24px 20px 64px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 44px; align-items: center; }
.tour .stage { aspect-ratio: 4 / 3; }
.tour-text { display: grid; gap: 14px; justify-items: start; }
.tour-text h1 { font-size: clamp(30px, 3.4vw, 42px); line-height: 1.1; animation-delay: .1s; }
.tour-text .lead { font-size: 17px; line-height: 1.55; max-width: 44ch; animation-delay: .2s; }
.tour-text .points { gap: 8px; max-width: 44ch; animation-delay: .25s; }
.tour-text .actions { margin-top: 10px; animation-delay: .3s; flex-wrap: nowrap; }
@media (max-width: 860px) {
  .tour { grid-template-columns: minmax(0, 1fr); gap: 22px; padding-top: 8px; align-content: start; }
  .auth:has(.auth-art.stage) { grid-template-rows: 34vh auto; } .auth .auth-art.stage { display: block; order: -1; margin: 8px 8px 0; }
}

/* ---- note page ---- */
.doc { max-width: 720px; margin: 0 auto; }
.doc h1 { font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 18px; }
.props { display: grid; grid-template-columns: 140px minmax(0, 1fr); row-gap: 4px; padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--border); }
.props dt { display: flex; align-items: center; gap: 8px; color: var(--muted); min-height: 28px; }
.props dd { margin: 0; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.props dd a { color: var(--accent-text); }
.prose { font-size: 16px; line-height: 1.7; }
.prose h1, .prose h2, .prose h3 { margin: 1.5em 0 .5em; font-weight: 700; }
.prose h1 { font-size: 25px; } .prose h2 { font-size: 20px; } .prose h3 { font-size: 17px; }
.prose p, .prose ul, .prose ol, .prose pre, .prose blockquote, .prose table { margin: 0 0 1em; }
.prose a { color: var(--accent-text); text-decoration: underline 1px color-mix(in srgb, var(--accent-text) 40%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent-text); }
.prose a strong, .prose strong a { font-weight: 600; }
.prose code { background: var(--fill); padding: 1px 6px; border-radius: 6px; }
.prose pre { background: var(--code-bg); color: var(--code-text); padding: 12px 14px; border-radius: 14px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { border-left: 3px solid var(--border-strong); padding-left: 14px; color: var(--muted); }
.prose img { max-width: 100%; }
.note-row { display: grid; gap: 3px; padding: 14px 10px; border-bottom: 1px solid var(--border); transition: background .15s; }
.note-row:hover { background: var(--fill); } .note-row:last-child { border-bottom: 0; }
.note-row b { font-size: 16px; font-weight: 700; }
.note-row .sum { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-row .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---- stats ---- */
.stat-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-value { font: 800 30px/36px var(--font); letter-spacing: -.025em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--faint); font-size: 12.5px; }
.bars { display: grid; grid-template-columns: repeat(14, 1fr); align-items: end; gap: 8px; height: 140px; padding-top: 16px; border-top: 1px solid var(--border); }
.bar { position: relative; background: var(--accent); border-radius: 6px 6px 2px 2px; min-height: 3px; transform-origin: bottom; animation: grow .6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 25ms); }
@keyframes grow { from { transform: scaleY(0); } }
.bar.zero { background: var(--border); }
.bar:hover::after { content: attr(data-label); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); font-size: 12px; padding: 3px 7px; border-radius: 6px; white-space: nowrap; }
.bars-axis { display: flex; justify-content: space-between; color: var(--faint); font-size: 12px; margin-top: 8px; }
.meter { height: 6px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* Insights: the cards share one grid cell and cross-fade; the bar under them is the 10-second clock (app.js) */
.insight-stack { display: grid; }
.insight { grid-area: 1 / 1; display: grid; align-content: start; gap: 8px; opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .5s var(--ease), transform .5s var(--ease), visibility 0s .5s; }
.insight.on { opacity: 1; visibility: visible; transform: none; transition: opacity .6s var(--ease) .2s, transform .6s var(--ease) .2s; }
.insight p { margin: 0; overflow-wrap: anywhere; }
.insight .pill { justify-self: start; }
.insight-refs { display: grid; gap: 2px; }
.insight-refs > * { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }  /* one line per source keeps the card short */
.insight-refs a { color: var(--accent-text); }
.pill-pattern { background: var(--accent-soft); color: var(--accent-text); }
.pill-contradiction { background: var(--err-soft); color: var(--err-ink); }
.pill-trend { background: var(--ok-soft); color: var(--ok-ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* ---- collapsed menu: a rail of icons; projects keep their two-letter squares ---- */
@media (min-width: 721px) {
  .app { transition: grid-template-columns .2s var(--ease); }
  [data-side=rail] .app { grid-template-columns: 76px minmax(0, 1fr); }
  [data-side=rail] .side { padding: 14px 10px 12px; align-items: center; }
  [data-side=rail] .side .label { display: none; }
  [data-side=rail] .side-top { flex-direction: column; gap: 8px; padding: 0 0 8px; }
  [data-side=rail] .side .nav { width: 44px; height: 44px; padding: 0; justify-content: center; }
  [data-side=rail] .switch { flex-direction: column; margin-bottom: 8px; } [data-side=rail] .switch a { width: 38px; }
  [data-side=rail] .switch .icon { display: block; }
  [data-side=rail] .count, [data-side=rail] .agent-nav .dot { display: none; } [data-side=rail] .agent-nav .tile { display: inline-grid; }
  [data-side=rail] .side-scroll { align-items: center; }
  [data-side=rail] .side-new[open] .side-form { position: fixed; left: 96px; width: 300px; z-index: 5; padding: 8px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-lg); }
  [data-side=rail] .side-label { width: 24px; min-height: 0; padding: 0; margin: 8px 0; border-top: 1px solid var(--border-strong); }
  [data-side=rail] .side-projects { align-items: center; }
  [data-side=rail] .side .tile-sm { margin: 0; }
  [data-side=rail] .side-bottom { justify-items: center; }
  [data-side=rail] .side-account { flex-direction: column; gap: 6px; }
  [data-side=rail] .side-bottom .setup-card { display: none; }
  [data-side=rail] .side-user { padding: 5px; }
}
@media (max-width: 1100px) {
  .main { padding: 28px 24px 64px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .grid-side { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); } .auth-art { display: none; }
}
.dock { display: none; }
@media (max-width: 720px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .side > a.nav { display: none; }  /* the dock below carries the sections */
  .dock { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10; display: flex; gap: 2px; padding: 5px;
    max-width: calc(100% - 16px); border-radius: 999px; background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--shadow-lg); }
  .dock a { display: flex; align-items: center; gap: 7px; height: 48px; padding: 0 12px; border-radius: 999px; color: var(--muted); font-weight: 700; }
  .dock .icon { width: 22px; height: 22px; }
  .dock span { display: none; }
  .dock a.on { background: var(--fill); color: var(--text); padding: 0 16px; }
  .dock a.on span { display: inline; }
  .side .tile-sm { margin: 0 0 0 -4px; }
  .side { position: static; height: auto; margin: 8px 8px 0; padding: 10px; flex-direction: row; flex-wrap: wrap; align-items: center; align-content: flex-start; gap: 4px; }
  .side-top { padding: 4px 6px; } .side-toggle, .side-new, .side-label, .side-agents, .side-bottom .setup-card, .side-bottom > .nav, .side-user { display: none; }
  .switch { margin: 0 0 0 auto; } .switch a { height: 34px; padding: 0 12px; }
  /* projects stay one tap away: a row that scrolls sideways under the menu; the dock carries the sections and agents */
  .side > .side-scroll { order: 9; flex: none; flex-direction: row; width: 100%; -webkit-mask-image: none; mask-image: none; overflow-x: auto; padding-bottom: 2px; }
  .side-projects { flex-direction: row; gap: 4px; }
  .side-projects .nav { flex: none; width: auto; max-width: 60vw; }
  .side .nav { width: auto; } .side-bottom { margin: 0; padding: 0; } .side-account { margin: 0; }
  .main { padding: 18px 12px 110px; }
  .grid-2, .choice-grid { grid-template-columns: minmax(0, 1fr); } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* tables marked .cards turn into one card per row, labels from data-label */
  .table.cards thead { display: none; }
  .table.cards, .table.cards tbody, .table.cards tr, .table.cards td { display: block; width: 100%; }
  .table.cards tr { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .table.cards tr:last-child { border-bottom: 0; }
  .table.cards td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0;
    text-align: right; max-width: none !important; }
  .table.cards td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; flex: none; font-family: var(--font); }
  .card-head { flex-wrap: wrap; }
  .table.cards td:first-child { padding-bottom: 6px; } .table.cards .chips { justify-content: flex-end; }
  h1, .wizard-main h1, .auth-form h1, .doc h1 { font-size: 26px; line-height: 32px; }
  .setup-banner { grid-template-columns: minmax(0, 1fr); } .setup-banner .spot { display: none; }
  .wizard-top { padding: 0 12px; gap: 8px; } .wizard-top .brand-name { display: none; } .stepper span:not(.now) em { display: none; }
  .stepper { gap: 4px; } .stepper i { width: 10px; } .wizard-top .btn-ghost { padding: 0 8px; }
  .wizard-main { padding: 24px 16px 56px; }
  .live-card { grid-template-columns: minmax(0, 1fr); }
  .prompt-card { grid-template-columns: minmax(0, 1fr); } .prompt-card .badge { display: none; }
  .props { grid-template-columns: 110px minmax(0, 1fr); }
  .db-row { grid-template-columns: minmax(0, 1fr) auto; } .db-row > .truncate { display: none; }
  /* rows keep the title and the status */
  .cols-home, .cols-project { grid-template-columns: minmax(0, 1fr) auto; } .cols-agents { grid-template-columns: 8px minmax(0, 1fr) auto; }
  :is(.cols-home, .cols-project, .cols-agents) .lmeta, .cols-project .lfolder { display: none; }
  .lpill:empty { display: none; }
  .panel .access-row { flex-wrap: wrap; }
  .toolbar .pop { margin-left: 0; } .pop-body { left: 0; right: auto; }
}
