/* Beetle's shell, in the Silicon look that Silicon Accounts uses: a flat neutral page, near-black
   ink, the blue accent for links and focus, ink for filled buttons, and Allo as the face. Colour
   comes from the silicons themselves: each one's pixel avatar and the light of its own palette.
   Light only, as the account site is. */
@font-face { font-family: "Allo"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/allo/AlloVariable.woff2") format("woff2"); }
@property --ring-turn { syntax: "<angle>"; inherits: false; initial-value: 200deg; }

:root {
  color-scheme: light;
  --background: #fcfcfc;
  --surface: #ffffff;
  --canvas: #f8f8f8;
  --surface-muted: #f1f1f1;
  --surface-pressed: #e3e3e3;
  --foreground: #1b1b1b;
  --text-soft: #353535;
  --text-secondary: #505050;
  --text-muted: #6b6b6b;
  --text-faint: #a4a4a4;
  --border: #e9e9e9;
  --border-subtle: #f3f3f3;
  --border-strong: #c4c4c4;
  --border-control: color-mix(in oklab, var(--foreground) 16%, transparent);
  --accent: #3460f0;
  --accent-strong: #2449c9;
  --accent-subtle: #eef2fe;
  --primary: #181818;
  --primary-hover: #2e2e2e;
  --primary-pressed: #0d0d0d;
  --primary-foreground: #ffffff;
  --success: #2b7148;
  --warning: #8f560d;
  --danger: #b42318;
  /* The Silicon colours: four two-colour pairs, used where there is no silicon to take colour from. */
  --mark-1-from: #8c7bff; --mark-1-to: #4fd1c5;
  --mark-2-from: #ff8f7a; --mark-2-to: #ffc86b;
  --mark-3-from: #c17cff; --mark-3-to: #71c8ff;
  --mark-4-from: #4c86ff; --mark-4-to: #86e3b0;
  /* A silicon's own colours, set on whatever shows it. These are the fallback. */
  --av-1: var(--mark-1-from); --av-2: var(--mark-3-to); --av-3: var(--mark-1-to);
  --shadow-resting: 0 1px 2px rgb(30 30 28 / .04);
  --shadow-raised: 0 6px 18px rgb(30 30 28 / .06), 0 1px 3px rgb(30 30 28 / .04);
  --shadow-floating: 0 20px 48px rgb(30 30 28 / .1), 0 3px 10px rgb(30 30 28 / .05);
  --overlay: rgb(30 30 28 / .28);
  --r-control: 11px;
  --r-box: 14px;
  --r-over: 21px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: "Allo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}
/* Squircles where the browser draws them: the same corner, a little rounder and smoother. */
@supports (corner-shape: squircle) {
  :root { --r-box: 22.4px; --r-over: 33.6px; }
  .btn, .input, .textarea, .select, .prefixed, .side-item, .side-search, .nav-item, .main, .card, .list, .pick, .note, .empty, .editor, pre.file, .logs, .modal, .toast, .scard, .first, .signin-card, .code, .issue, .avatar, .call-ring, .item .logo { corner-shape: squircle; }
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: color-mix(in oklab, var(--foreground) 22%, transparent) transparent; }
html, body { height: 100%; margin: 0; }
body { background: var(--canvas); color: var(--foreground); font: 400 16px/1.4 var(--font); letter-spacing: -.01em; font-variation-settings: "ROND" 20; font-optical-sizing: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; overflow: hidden; }
button, input, textarea, select { font: inherit; letter-spacing: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-decoration: none; text-underline-offset: .2em; }
a:hover { color: var(--accent-strong); text-decoration: underline; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }
b, strong { font-weight: 500; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--foreground); color: var(--background); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code, .mono { font-family: var(--mono); font-size: .93em; letter-spacing: 0; font-variant-ligatures: none; }
.ic { display: inline-grid; place-items: center; width: 16px; height: 16px; flex: none; }
.ic svg { width: 100%; height: 100%; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-muted); }

/* ---------- the shell: a quiet grey frame, the page a white sheet inside it ---------- */
#app { display: flex; height: 100%; }
.side { width: 264px; flex: none; display: flex; flex-direction: column; gap: 2px; padding: 8px; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 8px; margin-bottom: 6px; border-radius: 22px; color: var(--foreground); font-weight: 500; flex: none; }
.brand:hover { color: var(--foreground); text-decoration: none; }
.brand small { color: var(--text-muted); font-size: 16px; font-weight: 400; }
.brand-mark { width: 24px; height: 24px; border-radius: 30%; background: var(--primary); color: var(--primary-foreground); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 16px; height: 16px; }
.side-search { position: relative; display: block; margin-bottom: 14px; flex: none; }
.side-search .ic { position: absolute; left: 8px; top: 8px; color: var(--text-muted); pointer-events: none; }
.side-search input { width: 100%; height: 32px; padding: 0 8px 0 32px; border: 1px solid transparent; border-radius: var(--r-control); background: var(--surface-muted); font-size: 14px; font-weight: 500; outline: 0; }
.side-search input::placeholder { color: var(--text-muted); }
.side-search input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-subtle); }
.side-label { padding: 14px 8px 6px; color: var(--text-muted); font-size: 12px; font-weight: 500; flex: none; }
.side-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; padding: 0 8px; }
.side-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0 8px; border: 0; border-radius: var(--r-control); background: none; color: var(--text-secondary); text-align: left; flex: none; transition: background .16s var(--ease); }
.side-item:hover { background: var(--surface-muted); color: var(--foreground); }
.side-item[aria-current="true"] { background: var(--surface-pressed); color: var(--foreground); font-weight: 500; }
.side-item .ic { color: currentColor; }
.side-item.silicon { min-height: 36px; padding-left: 6px; }
.side-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-tag { color: var(--text-muted); font-size: 12px; font-weight: 400; flex: none; }
.side-none { padding: 6px 8px; color: var(--text-muted); font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex: none; margin-right: 2px; }
.dot[data-state="running"] { background: var(--success); box-shadow: 0 0 0 3px color-mix(in oklab, var(--success) 14%, transparent); }
.dot[data-state="starting"] { background: #d99a2b; animation: pulse 1.2s ease-in-out infinite; }
.dot[data-state="crashed"] { background: var(--danger); }
@keyframes pulse { 50% { opacity: .35; } }
.side-foot { flex: none; display: flex; flex-direction: column; gap: 2px; padding-top: 8px; margin-top: 8px; border-top: 1px solid var(--border-subtle); }
.side-item.me { color: var(--foreground); padding-left: 4px; }
.side-item.me .ic { color: var(--text-muted); }

.main { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; margin: 8px 8px 8px 0; border: 1px solid #e7e7e7; border-radius: var(--r-box); background: var(--surface); overflow: hidden; }
.tab-frame { flex: 1; width: 100%; border: 0; background: var(--surface); display: block; }

/* ---------- pictures ---------- */
/* A person: their photo, or their initials on quiet grey. */
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 30%; overflow: hidden; flex: none; background: var(--surface-muted); color: var(--text-secondary); font-weight: 500; font-size: 13px; letter-spacing: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
/* A silicon: its pixel avatar on a rounded square washed in its own palette. */
.avatar.mark { background: linear-gradient(140deg, color-mix(in oklab, var(--av-1) 28%, var(--surface)), color-mix(in oklab, var(--av-3) 28%, var(--surface))); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--av-3) 30%, transparent); }
.avatar.mark img { width: 78%; height: 78%; object-fit: contain; image-rendering: pixelated; }
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.xl { width: 104px; height: 104px; font-size: 34px; }
.avatar.draft { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-strong); filter: saturate(.55); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-control); border: 1px solid var(--border-control); background: var(--surface); color: var(--foreground); font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap; transition: background .16s var(--ease), border-color .16s var(--ease), transform .16s var(--ease); }
.btn:hover { background: var(--canvas); color: var(--foreground); text-decoration: none; }
.btn:active:not([disabled]) { background: var(--surface-muted); transform: scale(.99); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--primary-foreground); }
.btn.primary:active:not([disabled]) { background: var(--primary-pressed); }
.btn.danger { border-color: color-mix(in oklab, var(--danger) 36%, transparent); color: var(--danger); }
.btn.danger:hover { background: color-mix(in oklab, var(--danger) 8%, var(--surface)); color: var(--danger); }
.btn.ghost { border-color: transparent; background: none; color: var(--text-secondary); }
.btn.ghost:hover { background: var(--surface-muted); color: var(--foreground); }
.btn.icon { width: 32px; padding: 0; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.sm.icon { width: 28px; padding: 0; }
.btn.lg { height: 40px; padding: 0 16px; font-size: 16px; }
.input, .textarea, .select { width: 100%; height: 36px; padding: 0 12px; border-radius: var(--r-control); border: 1px solid var(--border-control); background: var(--surface); outline: 0; transition: border-color .16s var(--ease), box-shadow .16s var(--ease); }
.textarea { height: auto; padding: 8px 12px; resize: vertical; line-height: 1.5; }
.select { padding-right: 8px; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:disabled, .textarea:disabled, .select:disabled { background: var(--canvas); color: var(--text-muted); }
.input.mono, .textarea.mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 14px; font-weight: 500; }
.field-hint { font-size: 12px; color: var(--text-muted); }
.field-hint.bad { color: var(--danger); }
.field-hint.good { color: var(--success); }
.prefixed { display: flex; align-items: center; border-radius: var(--r-control); border: 1px solid var(--border-control); background: var(--surface); transition: border-color .16s var(--ease), box-shadow .16s var(--ease); }
.prefixed:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.prefixed span { padding-left: 12px; color: var(--text-muted); font-family: var(--mono); font-size: 14px; letter-spacing: 0; }
.prefixed .input { border: 0; background: none; padding-left: 1px; font-family: var(--mono); font-size: 14px; letter-spacing: 0; box-shadow: none; }
.search { position: relative; }
.search .ic { position: absolute; left: 12px; top: 10px; color: var(--text-muted); }
.search .input { padding-left: 36px; border-color: transparent; background: var(--surface-muted); }
.search .input:focus { background: var(--surface); border-color: var(--accent); }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch input:disabled { cursor: default; }
.switch i { position: absolute; inset: 0; border-radius: 10px; background: #dedede; transition: background .16s var(--ease); }
.switch i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 .5px rgb(30 30 28 / .08), 0 1px 2px rgb(30 30 28 / .14), 0 2px 6px rgb(30 30 28 / .06); transition: transform .16s var(--ease); }
.switch input:checked + i { background: #1e1e1c; }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:disabled + i { opacity: .45; }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-muted); color: var(--text-secondary); font-size: 12px; font-weight: 500; letter-spacing: 0; white-space: nowrap; vertical-align: 1px; }
.badge.good { color: var(--success); background: color-mix(in oklab, var(--success) 8%, var(--surface)); border-color: color-mix(in oklab, var(--success) 22%, transparent); }
.badge.warn { color: var(--warning); background: color-mix(in oklab, var(--warning) 8%, var(--surface)); border-color: color-mix(in oklab, var(--warning) 22%, transparent); }
.badge.bad { color: var(--danger); background: color-mix(in oklab, var(--danger) 7%, var(--surface)); border-color: color-mix(in oklab, var(--danger) 22%, transparent); }
.badge .ic { width: 11px; height: 11px; }
input[type="radio"], input[type="checkbox"] { accent-color: #1e1e1c; }

/* ---------- pages ---------- */
.page { flex: 1; overflow-y: auto; }
.page-in { max-width: 896px; margin: 0 auto; padding: 40px 32px 72px; }
.page-in.narrow { max-width: 560px; }
.page-head { margin-bottom: 24px; }
.page-head.with-action { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head.with-action > div { flex: 1; min-width: 200px; }
.page-head h1 { font-size: 22px; line-height: 1.1; letter-spacing: -.03em; font-weight: 600; }
.page-head p { color: var(--text-secondary); margin-top: 8px; max-width: 62ch; }
.eyebrow { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-bottom: 8px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.lead { color: var(--text-soft); }
.card { border: 1px solid var(--border); border-radius: var(--r-box); background: var(--surface); padding: 16px; }
.card h3 { font-size: 16px; font-weight: 500; }
.section-title { font-size: 18px; line-height: 1.4; letter-spacing: -.03em; font-weight: 600; color: var(--foreground); margin: 16px 0 -4px; }
.note { padding: 10px 14px; border-radius: var(--r-box); border: 1px solid var(--border-subtle); background: var(--canvas); color: var(--text-secondary); font-size: 14px; }
.note.warn { border-color: color-mix(in oklab, var(--warning) 20%, transparent); background: color-mix(in oklab, var(--warning) 7%, var(--surface)); color: var(--warning); }
.note.bad { border-color: color-mix(in oklab, var(--danger) 20%, transparent); background: color-mix(in oklab, var(--danger) 6%, var(--surface)); color: var(--danger); }
.note.good { border-color: color-mix(in oklab, var(--success) 20%, transparent); background: color-mix(in oklab, var(--success) 7%, var(--surface)); color: var(--success); }
.loading { display: flex; align-items: center; gap: 10px; color: var(--text-muted); padding: 18px 0; font-size: 14px; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--surface-pressed); border-top-color: var(--foreground); animation: rot .7s linear infinite; flex: none; }
@keyframes rot { to { transform: rotate(360deg); } }
.empty { padding: 28px; text-align: center; color: var(--text-muted); border: 1px solid var(--border-subtle); background: var(--canvas); border-radius: var(--r-box); font-size: 14px; }

/* ---------- your silicons ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
/* A silicon's card: its avatar over a short strip with its name and id. Light from the avatar's
   own colours gathers behind it, then fades into the words. */
.scard { position: relative; display: grid; grid-template-rows: auto 1fr; min-width: 0; overflow: hidden; isolation: isolate; padding: 0; border: 1px solid var(--border); border-radius: var(--r-box); background: var(--surface); color: var(--foreground); text-align: left; transition: box-shadow .12s var(--ease), translate .12s var(--ease); }
@media (hover: hover) and (pointer: fine) { .scard:hover { box-shadow: var(--shadow-raised); translate: 0 -2px; } }
.scard-art { position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; background:
  linear-gradient(to bottom, transparent 35%, var(--surface)),
  radial-gradient(ellipse 82% 85% at 35% 38%, color-mix(in oklab, var(--av-1) 34%, var(--surface)), transparent 85%),
  radial-gradient(ellipse 82% 85% at 68% 46%, color-mix(in oklab, var(--av-3) 32%, var(--surface)), transparent 85%),
  linear-gradient(135deg, color-mix(in oklab, var(--av-1) 14%, var(--surface)), color-mix(in oklab, var(--av-2) 12%, var(--surface)) 55%, color-mix(in oklab, var(--av-3) 14%, var(--surface))); }
.scard-art img { position: absolute; inset: 0; width: auto; height: 72%; aspect-ratio: 1; margin: auto; object-fit: contain; image-rendering: pixelated; }
.scard-art img.photo { height: 100%; width: 100%; object-fit: cover; image-rendering: auto; }
.scard-words { display: grid; align-content: start; gap: 2px; min-width: 0; padding: 8px 12px 12px; }
.scard-name { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; font-size: 16px; font-weight: 500; }
.scard-name span:first-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scard-id { color: var(--text-muted); font: 500 12px/1.4 var(--mono); letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scard.draft .scard-art img { filter: saturate(.5); opacity: .8; }
/* The card that adds one: a dashed outline in the same shape. */
.scard.add { place-items: center; grid-template-rows: 1fr; min-height: 180px; border-style: dashed; border-color: var(--border-strong); background: none; color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.scard.add:hover { background: var(--canvas); box-shadow: none; translate: none; color: var(--foreground); }
.scard.add span { display: inline-flex; align-items: center; gap: 6px; }
/* No silicons yet: a tall banner of its own, deep green into moss and warm sand, with a fine grain. */
.first { position: relative; isolation: isolate; display: grid; min-height: 208px; align-content: end; justify-items: start; gap: 12px; padding: 24px; overflow: hidden; border-radius: var(--r-box); background: linear-gradient(135deg, #0f2a1d, #2f5d3a 55%, #c9b27c); color: #fff; }
.first::after { position: absolute; z-index: -1; inset: 0; content: ""; pointer-events: none; opacity: .6; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); background-size: 160px 160px; }
.first h2 { max-width: 14ch; font-size: 28px; line-height: 1.1; letter-spacing: -.03em; font-weight: 600; }
.first p { max-width: 38ch; color: rgb(255 255 255 / .82); font-size: 14px; }
.first .btn { margin-top: 4px; background: #fff; border-color: #fff; color: #181818; }
.first .btn:hover { background: #f1f1f1; }

/* ---------- sign in ---------- */
.signin { height: 100%; width: 100%; display: grid; place-items: center; padding: 24px; overflow-y: auto; }
.signin-card { width: min(400px, 100%); overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-over); background: var(--surface); box-shadow: var(--shadow-raised); text-align: center; }
/* The top of the card: the Silicon colours as light behind Beetle's mark, fading into the words. */
.signin-art { display: grid; place-items: center; height: 168px; background:
  linear-gradient(to bottom, transparent 40%, var(--surface)),
  radial-gradient(ellipse 82% 85% at 30% 34%, color-mix(in oklab, var(--mark-1-from) 34%, var(--surface)), transparent 85%),
  radial-gradient(ellipse 82% 85% at 72% 44%, color-mix(in oklab, var(--mark-1-to) 32%, var(--surface)), transparent 85%),
  linear-gradient(135deg, color-mix(in oklab, var(--mark-1-from) 14%, var(--surface)), color-mix(in oklab, var(--mark-3-to) 12%, var(--surface)) 55%, color-mix(in oklab, var(--mark-2-to) 16%, var(--surface))); }
.ring { display: inline-grid; flex: none; padding: 3px; border: 4px solid transparent; border-radius: 30%; background: linear-gradient(var(--surface), var(--surface)) padding-box, conic-gradient(from var(--ring-turn), var(--ring-1, var(--mark-1-from)), var(--ring-2, var(--mark-1-to)), var(--ring-3, var(--mark-2-to)), var(--ring-4, var(--mark-2-from)), var(--ring-1, var(--mark-1-from))) border-box; animation: ring-turn 6s linear infinite; }
@keyframes ring-turn { to { --ring-turn: 560deg; } }
.signin-mark { width: 60px; height: 60px; border-radius: 28%; background: var(--primary); color: var(--primary-foreground); display: grid; place-items: center; }
.signin-mark svg { width: 34px; height: 34px; }
.signin-body { padding: 4px 28px 28px; }
.signin-card h1 { font-size: 28px; line-height: 1.1; letter-spacing: -.03em; font-weight: 600; }
.signin-card .signin-body > p { color: var(--text-secondary); margin: 8px auto 24px; max-width: 30ch; }
.signin-body .btn.lg { width: 100%; }
.signin-foot { margin-top: 16px; color: var(--text-muted); font-size: 12px; }
.code { font-family: var(--mono); font-size: 28px; letter-spacing: .14em; padding: 14px; border-radius: var(--r-box); border: 1px solid var(--border-subtle); background: var(--canvas); margin: 4px 0; user-select: all; }

/* ---------- the setup steps ---------- */
.steps { display: flex; gap: 6px; margin-bottom: 28px; flex-wrap: wrap; }
.step-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 6px; border-radius: 999px; border: 1px solid transparent; background: var(--surface-muted); color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.step-pill b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); color: var(--text-secondary); font-size: 12px; font-weight: 500; box-shadow: var(--shadow-resting); }
.step-pill b .ic { width: 12px; height: 12px; }
.step-pill:hover:not([disabled]) { background: var(--surface-pressed); color: var(--foreground); }
.step-pill[aria-current="step"] { background: var(--primary); color: var(--primary-foreground); }
.step-pill[aria-current="step"]:hover { background: var(--primary-hover); color: var(--primary-foreground); }
.step-pill[aria-current="step"] b { background: var(--primary-foreground); color: var(--primary); box-shadow: none; }
.step-pill.done b { background: color-mix(in oklab, var(--success) 12%, var(--surface)); color: var(--success); }
.step-pill[disabled] { cursor: default; }
.foot { position: sticky; bottom: 0; margin-top: 32px; padding: 16px 0; display: flex; justify-content: space-between; gap: 12px; background: linear-gradient(transparent, var(--surface) 35%); }

/* ---------- settings ---------- */
.settings { display: flex; height: 100%; min-height: 0; }
.settings-nav { width: 224px; flex: none; border-right: 1px solid var(--border-subtle); padding: 12px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.settings-nav .who { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; min-width: 0; }
.settings-nav .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-nav .who small { display: block; color: var(--text-muted); font: 500 12px/1.4 var(--mono); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border: 0; border-radius: var(--r-control); background: none; color: var(--text-secondary); text-align: left; width: 100%; flex: none; transition: background .16s var(--ease); }
.nav-item:hover { background: var(--canvas); color: var(--foreground); }
.nav-item[aria-current="page"] { background: var(--surface-muted); color: var(--foreground); font-weight: 500; }
.nav-sep { height: 1px; background: var(--border-subtle); margin: 8px; flex: none; }
.settings-body { flex: 1; min-width: 0; overflow-y: auto; }
.settings-body .page-in { padding-top: 32px; max-width: 832px; }
.apply-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px 8px 32px; background: color-mix(in oklab, var(--warning) 8%, var(--surface)); border-bottom: 1px solid color-mix(in oklab, var(--warning) 20%, transparent); color: var(--warning); font-size: 14px; }

/* ---------- things to choose from ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.pick { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--r-box); border: 1px solid var(--border); background: var(--surface); text-align: left; min-height: 116px; color: inherit; cursor: pointer; transition: box-shadow .12s var(--ease), border-color .12s var(--ease); }
.pick:hover { border-color: var(--border-strong); box-shadow: var(--shadow-resting); }
.pick[aria-pressed="true"], .pick[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.pick h4 { margin: 0; font-size: 16px; font-weight: 500; display: flex; align-items: center; gap: 8px; padding-right: 26px; }
.pick p { color: var(--text-secondary); font-size: 14px; }
.pick .pick-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-muted); }
.pick .tick { position: absolute; right: 12px; top: 12px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; display: none; place-items: center; }
.pick .tick .ic { width: 12px; height: 12px; }
.pick[aria-pressed="true"] .tick, .pick[aria-checked="true"] .tick { display: grid; }
.list { border: 1px solid var(--border); border-radius: var(--r-box); background: var(--surface); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border-subtle); }
.item:first-child { border-top: 0; }
.item .grow b { font-weight: 500; }
.item .grow p { color: var(--text-secondary); font-size: 14px; }
.item .logo { width: 32px; height: 32px; border-radius: 30%; background: var(--surface-muted) center/cover; flex: none; display: grid; place-items: center; color: var(--text-secondary); font-size: 12px; font-weight: 500; }
.item-actions { display: flex; align-items: center; gap: 6px; flex: none; }

/* ---------- files ---------- */
.editor { display: flex; border: 1px solid var(--border); border-radius: var(--r-box); background: var(--background); overflow: hidden; min-height: 300px; height: min(62vh, 640px); transition: border-color .16s var(--ease), box-shadow .16s var(--ease); }
.editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.gutter { flex: none; padding: 14px 10px 14px 14px; text-align: right; color: var(--text-faint); font: 12.5px/1.6 var(--mono); letter-spacing: 0; user-select: none; overflow: hidden; white-space: pre; border-right: 1px solid var(--border-subtle); background: var(--canvas); min-width: 46px; }
.gutter .err { color: var(--danger); font-weight: 700; }
.gutter .wrn { color: var(--warning); font-weight: 700; }
.editor textarea { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: none; padding: 14px 16px; font: 12.5px/1.6 var(--mono); letter-spacing: 0; white-space: pre; overflow: auto; tab-size: 4; color: var(--foreground); }
.issues { display: flex; flex-direction: column; gap: 6px; }
.issue { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; border-radius: var(--r-control); border: 1px solid var(--border); background: var(--surface); font-size: 14px; text-align: left; width: 100%; color: inherit; }
.issue.error { border-color: color-mix(in oklab, var(--danger) 28%, transparent); background: color-mix(in oklab, var(--danger) 4%, var(--surface)); }
.issue.warning { border-color: color-mix(in oklab, var(--warning) 28%, transparent); background: color-mix(in oklab, var(--warning) 5%, var(--surface)); }
.issue b { font-family: var(--mono); font-size: 12px; letter-spacing: 0; color: var(--text-muted); flex: none; }
.issue code { display: block; color: var(--text-muted); margin-top: 2px; }
pre.file { margin: 0; padding: 14px 16px; border-radius: var(--r-box); border: 1px solid var(--border-subtle); background: var(--canvas); font: 12.5px/1.6 var(--mono); letter-spacing: 0; overflow: auto; max-height: 52vh; white-space: pre; }
.logs { height: min(66vh, 680px); overflow-y: auto; padding: 12px 14px; border-radius: var(--r-box); border: 1px solid var(--border-subtle); background: var(--canvas); font: 12px/1.6 var(--mono); letter-spacing: 0; color: var(--text-soft); }
.logs div { white-space: pre-wrap; overflow-wrap: anywhere; }
.logs time { color: var(--text-faint); margin-right: 10px; }
.logs .error { color: var(--danger); } .logs .warning { color: var(--warning); } .logs .send, .logs .reply { color: var(--accent); } .logs .tool, .logs .event, .logs .out { color: var(--text-muted); }

/* ---------- facts ---------- */
.facts { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.status-line { display: flex; align-items: center; gap: 9px; font-weight: 500; font-size: 16px; }
.status-line i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.status-line[data-state="running"] i { background: var(--success); box-shadow: 0 0 0 4px color-mix(in oklab, var(--success) 14%, transparent); }
.status-line[data-state="starting"] i { background: #d99a2b; animation: pulse 1.2s ease-in-out infinite; }
.status-line[data-state="crashed"] i { background: var(--danger); }

table.models { width: 100%; border-collapse: collapse; font-size: 14px; }
table.models th { text-align: left; font-weight: 500; color: var(--text-muted); font-size: 12px; padding: 0 8px 8px; }
table.models td { padding: 5px 8px 5px 0; vertical-align: middle; }
table.models td:last-child, table.models th:last-child { padding-right: 0; width: 1%; white-space: nowrap; }

/* ---------- dialogs and notices ---------- */
.modal-back { position: fixed; inset: 0; z-index: 80; background: var(--overlay); display: grid; place-items: center; padding: 20px; animation: fade .16s var(--ease); }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; border-radius: var(--r-over); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-floating); animation: rise .2s var(--ease); }
.modal.wide { width: min(860px, 100%); }
.modal header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 14px 10px 20px; }
.modal header h2 { font-size: 18px; line-height: 1.4; letter-spacing: -.03em; font-weight: 600; }
.modal-body { padding: 4px 20px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; translate: 0 8px; } }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 100; max-width: min(560px, calc(100vw - 32px)); padding: 10px 14px; border-radius: var(--r-control); background: var(--surface); border: 1px solid var(--border); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-floating); animation: rise .2s var(--ease); }
.toast.bad { border-color: color-mix(in oklab, var(--danger) 30%, transparent); color: var(--danger); }

/* ---------- a call ---------- */
/* The page gives way to the silicon: light from its own colours, its avatar in a ring of them. */
.call { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 28px; text-align: center; background:
  radial-gradient(ellipse 60% 55% at 38% 30%, color-mix(in oklab, var(--av-1) 30%, var(--surface)), transparent 80%),
  radial-gradient(ellipse 60% 55% at 64% 38%, color-mix(in oklab, var(--av-3) 28%, var(--surface)), transparent 80%),
  linear-gradient(135deg, color-mix(in oklab, var(--av-1) 12%, var(--surface)), color-mix(in oklab, var(--av-2) 10%, var(--surface)) 55%, color-mix(in oklab, var(--av-3) 12%, var(--surface))); animation: fade .2s var(--ease); }
.call::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to bottom, transparent 30%, var(--surface) 78%); }
.call { isolation: isolate; }
.call-ring { --ring-1: var(--av-1); --ring-2: var(--av-2); --ring-3: var(--av-3); --ring-4: var(--av-2); display: inline-grid; padding: 4px; border: 5px solid transparent; border-radius: calc(var(--r-over) + 9px); background: linear-gradient(var(--surface), var(--surface)) padding-box, conic-gradient(from var(--ring-turn), var(--ring-1), var(--ring-2), var(--ring-3), var(--ring-4), var(--ring-1)) border-box; animation: ring-turn 6s linear infinite, ring-breathe 4s var(--ease) infinite; margin-bottom: 8px; }
.call-ring .avatar { border-radius: var(--r-over); box-shadow: none; }
.call[data-phase="listening"] .call-ring, .call[data-phase="speaking"] .call-ring { animation-duration: 2.4s, 1.6s; }
.call[data-phase="muted"] .call-ring, .call[data-phase="error"] .call-ring { animation-play-state: paused; filter: saturate(.4); }
@keyframes ring-breathe { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 32px 2px color-mix(in oklab, var(--av-2) 45%, transparent); } }
.call h2 { font-size: 28px; line-height: 1.1; letter-spacing: -.03em; font-weight: 600; }
.call .phase { color: var(--text-secondary); min-height: 1.4em; }
.call .heard { max-width: 620px; min-height: 2.9em; font-size: 18px; line-height: 1.45; color: var(--foreground); }
.call .heard.them { color: var(--text-secondary); font-size: 16px; min-height: 1.4em; }
.call-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.call-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--text-tertiary, #6b6b6b); }
.call-foot .rec { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.call .hang { background: var(--danger); border-color: var(--danger); color: #fff; }
.call .hang:hover { background: color-mix(in oklab, var(--danger) 88%, #000); color: #fff; }

@media (max-width: 760px) {
  .side { width: 56px; padding: 8px 6px; align-items: center; }
  .brand { padding: 0; justify-content: center; width: 38px; }
  .brand > span:not(.brand-mark), .side-search, .side-label, .side-text, .side-tag, .side-item .dot, .side-none { display: none; }
  .side-list { margin: 0; padding: 0; align-items: center; }
  .side-item, .side-item.silicon, .side-item.me { width: 36px; padding: 0; justify-content: center; }
  .side-foot { align-items: center; }
  .main { margin-left: 0; }
  .page-in { padding: 24px 16px 64px; }
  .settings { flex-direction: column; }
  .settings-nav { width: 100%; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border-subtle); padding: 8px; }
  .settings-nav .who, .nav-sep { display: none; }
  .nav-item { width: auto; white-space: nowrap; }
  .facts { grid-template-columns: 1fr; gap: 2px 0; }
  .facts dd { margin-bottom: 8px; }
  .apply-bar { padding-left: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
