/* Newguard Builder — daylight glass
   Ground: light grey with soft periwinkle aurora glows (all CSS, no assets).
   Material: frosted glass panels — translucent white, backdrop blur,
   1px navy hairlines, soft offset shadows.
   Accent: periwinkle #4C63E6; the primary action is a periwinkle gradient
   pill with white text and a blue bloom.
   Red stays reserved for destructive actions.
   Brand: the .ngw wordmark (cursor + NG at rest; NEWGUARD on hover, the
   tail sliding out of the G) — hovering anywhere on .brand plays it.
   Interaction contract: every control presses. Hover lifts on a slow
   ease-out with a glow bloom; :active compresses instantly (.06s); release
   springs back on an overshoot curve. That fast-in / springy-out asymmetry
   is what makes clicks feel physical — keep it when editing. */
:root {
  --ground-0: #E7E9F0;
  --ground-1: #EEF0F5;
  --glass: rgba(255, 255, 255, .62);
  --glass-2: rgba(255, 255, 255, .78);
  --raised: rgba(76, 99, 230, .08);
  --line: rgba(24, 33, 66, .14);
  --line-soft: rgba(24, 33, 66, .08);
  --ink: #182142;
  --muted: #545F82;
  --accent: #4C63E6;
  --accent-deep: #3B50C9;
  --accent-soft: rgba(76, 99, 230, .12);
  --cta-grad: linear-gradient(180deg, #445CE0 0%, #5F7BF0 100%);
  --on-cta: #FFFFFF;
  --user-grad: linear-gradient(135deg, #3D4FD0 0%, #5A75EE 100%);
  --danger: #C03A31;
  --danger-ink: #A32B23;
  --danger-line: rgba(192, 58, 49, .4);
  --danger-bg: rgba(220, 70, 60, .08);
  --ok: #0E8A5F;
  --warn: #9A6A12;
  --shadow-rest: 0 2px 10px rgba(24, 33, 66, .1);
  --shadow-lift: 0 6px 18px rgba(24, 33, 66, .14), 0 2px 30px rgba(76, 99, 230, .12);
  --bloom: 0 4px 18px rgba(76, 99, 230, .35), 0 10px 40px rgba(76, 99, 230, .22);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .5, 1);
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --display: var(--sans);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.5;
  background-color: var(--ground-0);
}
/* daylight ground on a fixed layer (background-attachment:fixed is broken on iOS) */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(900px 620px at 88% -12%, rgba(96, 122, 255, .14), transparent 65%),
    radial-gradient(760px 540px at -8% 108%, rgba(63, 88, 230, .1), transparent 65%),
    radial-gradient(640px 420px at 55% 118%, rgba(129, 104, 255, .08), transparent 65%),
    linear-gradient(180deg, var(--ground-1) 0%, var(--ground-0) 55%, #E2E5EF 100%);
}
.view { min-height: 100vh; display: flex; flex-direction: column; animation: view-in .34s var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } }
[hidden] { display: none !important; }
h1 { font-family: var(--display); font-weight: 800; font-size: clamp(30px, 4vw, 38px); margin: 0 0 6px; letter-spacing: -.02em; color: #1B2650; }
.sub { color: var(--muted); margin: 0 0 26px; }
.mono { font-family: var(--mono); font-size: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(76, 99, 230, .25); }

/* thin scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(24, 33, 66, .25) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(24, 33, 66, .22); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background-color: rgba(24, 33, 66, .38); }
*::-webkit-scrollbar-track { background: transparent; }

/* ---- brand: Newguard wordmark ----
   Rest: cursor + NG. Hover: the G-U-A-R-D group slides right while a cover
   riding inside it uncovers E and W exactly at the G's edge, and a second
   cover wipes U-A-R-D clear just behind it — the mark resolves to NEWGUARD.
   Colour = currentColor; the covers are *painted*, so --ngw-bg must match
   the colour sitting behind the mark (the glass header over the ground).
   The box is sized for the full word, so expanding never shifts layout. */
.ngw {
  --ngw-travel: 340ms;
  --ngw-wipe: 400ms;
  --ngw-ease: cubic-bezier(.34, 1.06, .4, 1);    /* travel: slight overshoot */
  --ngw-wipe-ease: cubic-bezier(.62, 0, .3, 1);  /* wipe: never passes its anchor */
  --ngw-bg: #F8F9FB;
  display: block; color: var(--ink); width: 232px;
}
.ngw svg { display: block; width: 100%; height: auto; }
.ngw .cov { fill: var(--ngw-bg); }
.ngw-tail {
  transform: translate(-260px, 0);
  transition: transform var(--ngw-travel) var(--ngw-ease);
}
.cov-ta {
  transform: translate(1032px, 0) scaleX(1) translate(-1032px, 0);
  transition: transform var(--ngw-wipe) var(--ngw-wipe-ease);
}
.brand:hover .ngw-tail, .ngw:hover .ngw-tail, .ngw.is-open .ngw-tail { transform: translate(0, 0); }
.brand:hover .cov-ta, .ngw:hover .cov-ta, .ngw.is-open .cov-ta { transform: translate(1032px, 0) scaleX(0) translate(-1032px, 0); }
/* glyph library holder — present, measurable by <use>, out of flow */
.glyphs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---- banner ---- */
.app-banner {
  background: rgba(76, 99, 230, .1); color: var(--ink);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  padding: 10px 20px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap;
}
.app-banner.error { background: rgba(220, 70, 60, .1); color: #7E211A; border-bottom-color: var(--danger-line); }
.app-banner code { font-family: var(--mono); background: rgba(24, 33, 66, .08); padding: 1px 6px; border-radius: 6px; }

/* ---- buttons: the press system ---- */
.btn {
  font: 600 13px var(--sans); color: var(--ink);
  background: var(--glass-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 15px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  box-shadow: var(--shadow-rest);
  transition:
    transform .32s var(--ease-spring),
    box-shadow .32s var(--ease-out),
    background .16s var(--ease-out),
    border-color .16s var(--ease-out),
    color .16s var(--ease-out);
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn:hover { border-color: rgba(76, 99, 230, .45); background: #FFFFFF; transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn:active { transform: translateY(1px) scale(.96); box-shadow: 0 1px 4px rgba(24, 33, 66, .18); transition-duration: .06s; }
.btn.primary { background: var(--cta-grad); border-color: transparent; color: var(--on-cta); box-shadow: var(--bloom); }
.btn.primary:hover { box-shadow: 0 6px 24px rgba(76, 99, 230, .45), 0 14px 52px rgba(76, 99, 230, .3); transform: translateY(-1px); }
.btn.primary:active { box-shadow: 0 2px 10px rgba(76, 99, 230, .35); transform: translateY(1px) scale(.96); }
.btn.danger { color: var(--danger-ink); border-color: var(--danger-line); background: var(--danger-bg); }
.btn.danger:hover { border-color: var(--danger); background: rgba(220, 70, 60, .14); box-shadow: 0 6px 18px rgba(24, 33, 66, .12), 0 2px 24px rgba(220, 70, 60, .18); }
.btn.big { padding: 12px 28px; font-size: 15px; }
.btn.wide { width: 100%; justify-content: center; margin-top: 14px; }
.btn.icon { padding: 7px 11px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn.ghost:hover { color: var(--ink); border-color: var(--line); background: rgba(255, 255, 255, .8); }
.btn.mode.active, .btn.vp.active { background: var(--accent-soft); border-color: rgba(76, 99, 230, .45); color: var(--accent-deep); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 14px rgba(76, 99, 230, .14); }
.btn:disabled { opacity: .45; cursor: default; }
.btn:disabled:hover, .btn:disabled:active { border-color: var(--line); background: var(--glass-2); transform: none; box-shadow: var(--shadow-rest); }

/* ---- home ---- */
.home-head {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 28px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .6);
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 11px; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.home-main { padding: 38px 28px; max-width: 1100px; width: 100%; margin: 0 auto; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 20px; }
.pcard {
  position: relative; background: var(--glass); border: 1px solid var(--line); border-radius: 18px;
  cursor: pointer; overflow: hidden;
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow-rest), inset 0 1px 0 rgba(255, 255, 255, .7);
  transition: transform .32s var(--ease-spring), box-shadow .32s var(--ease-out), border-color .16s var(--ease-out), background .16s var(--ease-out);
}
.pcard:hover {
  border-color: rgba(76, 99, 230, .4); background: var(--glass-2);
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(24, 33, 66, .14), 0 4px 40px rgba(76, 99, 230, .12), inset 0 1px 0 rgba(255, 255, 255, .9);
}
.pcard:active { transform: translateY(0) scale(.985); box-shadow: var(--shadow-rest); transition-duration: .06s; }
.pcard-body { padding: 16px 18px 18px; position: relative; }
.pcard h3 { margin: 0 0 4px; font: 700 16px var(--display); word-break: break-word; }
.pcard .meta { color: var(--muted); font-size: 12.5px; }
.pcard-actions { display: flex; gap: 2px; margin-top: 14px; }
.pcard-actions .btn { padding: 6px 12px; font-size: 11.5px; }

/* ---- live site thumbnail ----
   The iframe renders the real page at desktop width and is shrunk by
   --pscale (set from the card's width in app.js), so the card shows the
   site's actual desktop layout instead of its phone breakpoint. */
.pthumb {
  --pscale: .2;
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: linear-gradient(180deg, #FFFFFF 0%, #F3F4F9 100%);
  border-bottom: 1px solid var(--line-soft);
}
.pthumb iframe {
  position: absolute; top: 0; left: 0; border: 0;
  transform: scale(var(--pscale)); transform-origin: 0 0;
  pointer-events: none;                 /* the whole card is the button */
  opacity: 0; transition: opacity .4s var(--ease-out);
}
.pthumb.is-loaded iframe { opacity: 1; }
/* Top-down fade so the thumbnail hands off to the card body instead of
   ending on an arbitrary slice of the page. */
.pthumb::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 34%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .82) 100%);
  pointer-events: none;
}
.pthumb.empty-thumb { display: grid; place-items: center; }
.pthumb.empty-thumb span {
  font: 600 12px var(--sans); color: var(--muted); letter-spacing: .02em;
  padding: 0 18px; text-align: center;
}
.pthumb.empty-thumb::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, rgba(24, 33, 66, .035) 0 8px, transparent 8px 16px);
}
.empty { color: var(--muted); margin-top: 26px; max-width: 46ch; }
.empty b { color: var(--ink); }

/* status chips — dot + caps */
.pill {
  font: 700 10.5px var(--sans); letter-spacing: .09em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .55);
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.pill.ready { color: var(--ok); border-color: rgba(14, 138, 95, .4); }
.pill.ready::before { box-shadow: 0 0 8px rgba(14, 138, 95, .5); }
.pill.error { color: var(--danger-ink); border-color: var(--danger-line); }
.pill.building, .pill.busy { color: var(--accent-deep); border-color: rgba(76, 99, 230, .45); animation: pulse 1.4s ease-in-out infinite; }
.pill.building::before, .pill.busy::before { background: var(--accent); box-shadow: 0 0 10px rgba(76, 99, 230, .7); }
.pcard .pill {
  position: absolute; top: -14px; right: 14px;
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(24, 33, 66, .12);
}

/* ---- brief ---- */
.brief-main { padding: 38px 28px 80px; max-width: 760px; width: 100%; margin: 0 auto; }
.field-group {
  background: var(--glass); border: 1px solid var(--line); border-radius: 18px; padding: 20px;
  margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px;
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow-rest), inset 0 1px 0 rgba(255, 255, 255, .7);
}
.lab { font: 700 11px var(--sans); letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }
input, textarea, select {
  font: 400 14px var(--sans); color: var(--ink); background: rgba(255, 255, 255, .75);
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 13px; width: 100%;
  transition: border-color .16s var(--ease-out), box-shadow .25s var(--ease-out), background .16s var(--ease-out);
}
input::placeholder, textarea::placeholder { color: rgba(84, 95, 130, .8); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent); background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(76, 99, 230, .14), 0 0 18px rgba(76, 99, 230, .1);
}
input, select { accent-color: var(--accent); }
select { cursor: pointer; }
select:hover { border-color: rgba(76, 99, 230, .45); background: #FFFFFF; }
.pick-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.pick { position: relative; }
.pick input { position: absolute; opacity: 0; }
.pick span {
  display: flex; flex-direction: column; gap: 2px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 14px; cursor: pointer;
  font-size: 12px; color: var(--muted); height: 100%;
  background: rgba(255, 255, 255, .45);
  transition: transform .32s var(--ease-spring), border-color .16s var(--ease-out), background .16s var(--ease-out), box-shadow .32s var(--ease-out), color .16s var(--ease-out);
}
.pick span b { color: var(--ink); font-size: 13px; }
.pick span:hover { border-color: rgba(76, 99, 230, .4); background: #FFFFFF; transform: translateY(-1px); }
.pick span:active { transform: scale(.97); transition-duration: .06s; }
.pick input:checked + span {
  border-color: rgba(76, 99, 230, .55); color: var(--accent-deep);
  background: linear-gradient(180deg, rgba(76, 99, 230, .14), rgba(76, 99, 230, .05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 0 18px rgba(76, 99, 230, .12);
}
.pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check-row, .color-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chk {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; cursor: pointer; font-size: 13px;
  background: rgba(255, 255, 255, .45);
  transition: transform .32s var(--ease-spring), border-color .16s var(--ease-out), background .16s var(--ease-out), box-shadow .32s var(--ease-out);
}
.chk:hover { border-color: rgba(76, 99, 230, .4); background: #FFFFFF; transform: translateY(-1px); }
.chk:active { transform: scale(.96); transition-duration: .06s; }
.chk input { width: auto; }
.chk input[type=color] { padding: 0; width: 34px; height: 24px; border: none; background: none; cursor: pointer; border-radius: 6px; }
.chk:has(input:checked) { border-color: rgba(76, 99, 230, .55); background: var(--accent-soft); box-shadow: 0 0 14px rgba(76, 99, 230, .1); }

/* ---- inspiration library (brief form) ---- */
.lab-hint { font-size: 12px; color: var(--muted); margin: -4px 0 0; }
.inspo-list { display: flex; flex-direction: column; gap: 8px; }
.inspo-list:empty { display: none; }
.inspo-empty { font-size: 12.5px; color: var(--muted); margin: 0; }
.inspo-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 14px;
  background: rgba(255, 255, 255, .45);
  transition: border-color .16s var(--ease-out), background .16s var(--ease-out), box-shadow .32s var(--ease-out);
}
.inspo-item:hover { border-color: rgba(76, 99, 230, .4); background: #FFFFFF; }
.inspo-item.on { border-color: rgba(76, 99, 230, .55); background: var(--accent-soft); box-shadow: 0 0 14px rgba(76, 99, 230, .1); }
.inspo-item input[type=checkbox] { width: auto; flex: none; }
.inspo-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.inspo-body b { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inspo-note { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inspo-open, .inspo-del {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 999px; border: 1px solid transparent;
  background: none; color: var(--muted); font: 400 15px var(--sans); cursor: pointer; text-decoration: none;
  transition: color .16s var(--ease-out), border-color .16s var(--ease-out), background .16s var(--ease-out);
}
.inspo-open:hover { color: var(--accent-deep); border-color: rgba(76, 99, 230, .4); background: #FFFFFF; }
.inspo-del { font-size: 17px; line-height: 1; }
.inspo-del:hover { color: #B3261E; border-color: rgba(179, 38, 30, .35); background: #FFFFFF; }
.inspo-add { display: flex; gap: 8px; flex-wrap: wrap; }
.inspo-add input[type=url] { flex: 1 1 200px; }
.inspo-add input:not([type=url]) { flex: 2 1 240px; }
.inspo-add .btn { flex: none; }

/* ---- editor cockpit ---- */
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  background: rgba(255, 255, 255, .6); border-bottom: 1px solid var(--line-soft); flex-wrap: wrap;
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  position: relative; z-index: 5;
}
.ed-name { font: 700 15px var(--display); }
.page-select { width: auto; padding: 6px 11px; font-size: 13px; border-radius: 999px; }
.mode-group {
  display: flex; gap: 4px; background: rgba(24, 33, 66, .06); padding: 3px; border-radius: 999px;
  border: 1px solid var(--line-soft); box-shadow: inset 0 2px 6px rgba(24, 33, 66, .08);
}
.mode-group .btn { border: 1px solid transparent; background: transparent; box-shadow: none; }
.mode-group .btn:hover { background: rgba(255, 255, 255, .85); border-color: transparent; transform: none; }
.mode-group .btn:active { transform: scale(.94); }
.mode-group .btn.active:hover { background: var(--accent-soft); }
.spacer { flex: 1; }

/* height:100vh + the minmax(0,1fr) row keep the cockpit viewport-bound, so
   the chat and inspector scroll inside their panels instead of growing the
   page (and the stage stays exactly one screen tall for the MacBook fit). */
#view-editor { height: 100vh; }
.cockpit {
  flex: 1; display: grid; min-height: 0; position: relative;
  grid-template-columns: var(--chat-w, 320px) minmax(0, 1fr) var(--insp-w, 300px);
  grid-template-rows: minmax(0, 1fr);
}
.chat, .inspector {
  background: rgba(255, 255, 255, .55); display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
}
.chat { border-right: 1px solid var(--line-soft); }
.inspector { border-left: 1px solid var(--line-soft); overflow-y: auto; }
.panel-title { font: 700 11px var(--sans); letter-spacing: .11em; text-transform: uppercase; color: var(--muted); padding: 13px 14px 8px; display: flex; gap: 10px; align-items: center; }
.panel-title .spacer { flex: 1; }
.working { color: var(--accent-deep); animation: pulse 1.2s ease-in-out infinite; text-transform: none; letter-spacing: 0; font-weight: 500; }
@keyframes pulse { 50% { opacity: .4; } }
.btn.tiny { padding: 3px 10px; font-size: 11px; letter-spacing: 0; text-transform: none; }

/* chat rows — one per running/parked chat, stacked at the top of the panel */
.chat-tabs {
  display: flex; flex-direction: column; gap: 4px;
  padding: 0 10px 8px; max-height: 168px; overflow-y: auto; flex-shrink: 0;
  border-bottom: 1px solid var(--line-soft);
}
.chat-tab {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 6px 8px; border-radius: 11px; border: 1px solid transparent;
  transition: background .16s var(--ease-out), border-color .16s var(--ease-out);
}
.chat-tab:hover { background: rgba(255, 255, 255, .75); border-color: var(--line-soft); }
.chat-tab.active { background: var(--accent-soft); border-color: rgba(76, 99, 230, .4); }
.ctab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); flex-shrink: 0; }
.chat-tab.busy .ctab-dot { background: var(--accent); box-shadow: 0 0 8px rgba(76, 99, 230, .7); animation: pulse 1.2s ease-in-out infinite; }
.ctab-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ctab-main b { font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctab-task { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-tab.busy .ctab-task { color: var(--accent-deep); }
.ctab-model {
  font: 500 9.5px var(--mono); text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); flex-shrink: 0;
}
.ctab-model.m-haiku { color: var(--ok); border-color: rgba(14, 138, 95, .4); background: rgba(14, 138, 95, .07); }
.ctab-model.m-sonnet { color: var(--accent-deep); border-color: rgba(76, 99, 230, .4); background: var(--accent-soft); }
.ctab-model.m-opus { color: #6D3FC0; border-color: rgba(109, 63, 192, .4); background: rgba(109, 63, 192, .08); }
.ctab-unread { color: var(--accent); font-size: 9px; flex-shrink: 0; }
.ctab-x {
  background: none; border: none; color: var(--muted); font-size: 11px; cursor: pointer;
  border-radius: 6px; width: 18px; height: 18px; flex-shrink: 0; opacity: 0;
  transition: opacity .14s var(--ease-out), color .14s var(--ease-out);
}
.chat-tab:hover .ctab-x { opacity: .8; }
.ctab-x:hover { color: var(--danger); opacity: 1; }
.chat-hint { flex: 1; font-size: 10.5px; color: var(--muted); align-self: center; line-height: 1.3; }
.msg.model { font: 500 11px var(--mono); color: var(--muted); padding: 1px 4px; animation: none; }
.msg.model b { color: var(--accent-deep); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }

/* chat feed */
.chat-feed { flex: 1; overflow-y: auto; padding: 4px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { border-radius: 14px; padding: 9px 13px; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; animation: msg-in .28s var(--ease-out); }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.msg.user { background: var(--user-grad); color: #F4F7FF; align-self: flex-end; max-width: 92%; border-bottom-right-radius: 5px; box-shadow: 0 4px 14px rgba(61, 79, 208, .3); }
.msg.claude { background: rgba(255, 255, 255, .8); border: 1px solid var(--line-soft); border-bottom-left-radius: 5px; }
.msg.tool { font: 400 11.5px var(--mono); color: var(--muted); padding: 1px 4px; animation: none; }
.msg.tool b { color: var(--accent-deep); font-weight: 500; }
.msg.err { background: rgba(220, 70, 60, .09); border: 1px solid var(--danger-line); color: #7E211A; }
.msg.done { font: 500 11px var(--mono); color: var(--ok); letter-spacing: .06em; text-transform: uppercase; padding: 2px 4px; }
.msg.sep { font: 700 10.5px var(--sans); color: var(--muted); letter-spacing: .12em; text-transform: uppercase; text-align: center;
  padding: 6px 0 2px; border-top: 1px solid var(--line-soft); margin-top: 4px; animation: none; }
.chat-form { border-top: 1px solid var(--line-soft); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-form textarea { resize: none; font-size: 13.5px; }
.chat-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* stage */
.stage { background: rgba(24, 33, 66, .05); display: flex; min-width: 0; position: relative; }
.stage-inner { flex: 1; display: flex; justify-content: center; padding: 16px; min-width: 0; }
#site-frame {
  width: var(--vp, 100%); max-width: 100%; height: 100%;
  border: 1px solid var(--line); border-radius: 14px; background: #fff;
  box-shadow: 0 16px 48px rgba(24, 33, 66, .16), 0 2px 40px rgba(76, 99, 230, .08);
  transition: width .3s var(--ease-out), transform .45s var(--ease-out);
}

/* MacBook fit — the frame renders at a true 1440×900 (16:10) and is scaled
   by app.js to fit the canvas, so the preview shows exactly what a MacBook
   shows instead of whatever width the stage happens to be. */
.stage-tools { position: absolute; top: 24px; right: 26px; z-index: 6; display: flex; align-items: center; gap: 8px; }
.fit-mac { padding: 7px; }
.fit-mac svg { width: 16px; height: 16px; }
.fit-mac.active { background: var(--accent-soft); border-color: rgba(76, 99, 230, .45); color: var(--accent-deep); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 14px rgba(76, 99, 230, .14); }
.stage-inner.mac-fit { align-items: center; overflow: hidden; }
.stage-inner.mac-fit #site-frame { flex: 0 0 auto; max-width: none; transform-origin: center center; }

/* waiting canvas — nothing to preview yet.
   While Claude writes the first pages the stage holds the spark in the middle
   of the canvas, turning; the preview's own 404 is blank so nothing shows in
   the corner. Idle with no pages, the mark rests instead of spinning. */
.stage-wait {
  position: absolute; inset: 0; z-index: 5; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  animation: view-in .4s var(--ease-out);
}
.stage-wait[hidden] { display: none; }
.stage-wait-mark {
  width: 78px; height: 78px; color: #D97757; fill: currentColor;
  transform-origin: 50% 50%;
  animation: stage-spin 3.4s linear infinite;
  filter: drop-shadow(0 8px 22px rgba(217, 119, 87, .28));
}
.stage-wait-note { font-size: 13px; color: var(--muted); letter-spacing: .01em; }
.stage-wait.is-idle .stage-wait-mark { animation: none; opacity: .45; filter: none; }
@keyframes stage-spin { to { transform: rotate(360deg); } }

/* ---- change log ----
   The canvas narrates itself: every change that lands on it — a hand edit or
   a finished Claude turn — slides in at the bottom right and fades out again,
   so the last few steps are always readable without asking. The clock button
   keeps the full timeline; ⌘Z / ⇧⌘Z drive the same stack. */
.hist-dock {
  position: absolute; right: 20px; bottom: 18px; z-index: 7;
  /* never wider than the canvas it belongs to, however narrow that gets */
  max-width: calc(100% - 40px);
  display: flex; flex-direction: column; align-items: flex-end; gap: 9px;
  pointer-events: none;
}
.hist-dock > * { pointer-events: auto; }

.hist-toasts { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.hist-toast {
  display: flex; align-items: center; gap: 8px; max-width: min(320px, 100%);
  font-size: 12.5px; color: var(--ink);
  background: var(--glass-2); backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px 5px 11px;
  box-shadow: var(--shadow-rest);
  animation: hist-toast-in .3s var(--ease-spring) both, hist-toast-out .7s var(--ease-out) 3.4s both;
}
.hist-toast > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-mark { flex-shrink: 0; font-size: 10px; line-height: 1; color: var(--accent); }
.hist-toast.undo .hist-mark, .hist-toast.redo .hist-mark { font-size: 13px; color: var(--muted); }
.hist-toast.err { border-color: var(--danger-line); background: rgba(220, 70, 60, .12); color: #7E211A; }
.hist-toast.err .hist-mark { color: var(--danger); font-weight: 800; }
@keyframes hist-toast-in { from { opacity: 0; transform: translateY(8px) scale(.96); } }
@keyframes hist-toast-out { to { opacity: 0; transform: translateY(-4px); } }

.hist-btn {
  position: relative; display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; color: var(--muted); cursor: pointer;
  background: var(--glass-2); backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--shadow-rest);
  transition: transform .3s var(--ease-spring), box-shadow .3s var(--ease-out), color .2s var(--ease-out);
}
.hist-btn:hover { color: var(--accent-deep); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.hist-btn:active { transform: translateY(1px) scale(.94); transition-duration: .06s; }
.hist-btn[aria-expanded=true] { color: var(--accent-deep); border-color: rgba(76, 99, 230, .45); background: #FFFFFF; }
.hist-btn svg { width: 16px; height: 16px; }
.hist-count {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px;
  display: grid; place-items: center; border-radius: 999px;
  font: 600 10px var(--mono); color: var(--on-cta); background: var(--cta-grad);
  box-shadow: 0 1px 6px rgba(76, 99, 230, .45);
}

.hist-panel {
  width: 292px; max-width: 100%; max-height: min(50vh, 360px); display: flex; flex-direction: column; overflow: hidden;
  background: var(--glass-2); backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lift);
  animation: hist-panel-in .28s var(--ease-spring) both;
}
@keyframes hist-panel-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.hist-head { display: flex; align-items: center; gap: 6px; padding: 9px 9px 9px 13px; border-bottom: 1px solid var(--line-soft); }
.hist-title { font: 700 10.5px var(--sans); letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }
.hist-x {
  display: grid; place-items: center; width: 22px; height: 22px; padding: 0; flex-shrink: 0;
  border: none; border-radius: 50%; background: none; color: var(--muted); cursor: pointer;
  transition: background .18s var(--ease-out), color .18s var(--ease-out);
}
.hist-x:hover { background: var(--raised); color: var(--ink); }
.hist-x svg { width: 12px; height: 12px; }
.hist-list { flex: 1; min-height: 0; overflow-y: auto; padding: 5px 0; }
.hist-row {
  display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left;
  font: inherit; color: var(--ink); background: none; border: none;
  padding: 6px 13px; cursor: pointer; transition: background .16s var(--ease-out);
}
.hist-row:hover { background: var(--raised); }
.hist-row .hist-what { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-row .hist-when { flex-shrink: 0; font: 400 10.5px var(--mono); color: var(--muted); }
.hist-row.current { background: var(--accent-soft); }
.hist-row.current .hist-what { font-weight: 600; }
.hist-row.undone { opacity: .5; }
.hist-row.undone .hist-what { text-decoration: line-through; text-decoration-color: var(--line); }
.hist-row.undone .hist-mark { color: var(--muted); }
.hist-none { margin: 0; padding: 10px 14px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.hist-foot { padding: 8px 13px; border-top: 1px solid var(--line-soft); font-size: 11px; color: var(--muted); }

/* inspector */
.insp-empty { color: var(--muted); font-size: 12.5px; padding: 6px 14px; line-height: 1.7; }
.insp-empty b { color: var(--ink); }
.insp-target { display: flex; align-items: center; gap: 8px; padding: 2px 14px 10px; }
.tag-chip {
  font: 600 11px var(--mono); background: var(--cta-grad); color: var(--on-cta);
  border-radius: 6px; padding: 2px 8px; text-transform: uppercase;
  box-shadow: 0 1px 8px rgba(76, 99, 230, .3);
}
#insp-id { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.insp-sec { border-top: 1px solid var(--line-soft); padding: 11px 14px 12px; }
.insp-lab { font: 700 10.5px var(--sans); letter-spacing: .11em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; }
.ctl-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ctl-row label { font-size: 12px; color: var(--muted); width: 58px; flex-shrink: 0; }
.ctl-row select { flex: 1; min-width: 0; }
.ctl-row input[type=range] { flex: 1; min-width: 0; padding: 0; border: none; background: none; box-shadow: none; }
.ctl-row input[type=color] { padding: 2px; width: 40px; height: 26px; flex-shrink: 0; border-radius: 8px; cursor: pointer; }
.ctl-row select { width: auto; padding: 5px 10px; font-size: 12.5px; border-radius: 10px; }
.ctl-row input:not([type=color]):not([type=range]) { padding: 6px 10px; font-size: 12.5px; }
.mini {
  background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px;
  width: 22px; height: 22px; cursor: pointer; flex-shrink: 0;
  transition: transform .32s var(--ease-spring), border-color .16s var(--ease-out), color .16s var(--ease-out);
}
.mini:hover { border-color: var(--danger); color: var(--danger); }
.mini:active { transform: scale(.88); transition-duration: .06s; }
#insp-body { padding-bottom: 4px; }
#insp-body .btn.wide { width: calc(100% - 28px); margin: 10px 14px 14px; }
.palette { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.blk { font-size: 12px; padding: 6px 12px; }
.btn.blk.armed { background: var(--cta-grad); border-color: transparent; color: var(--on-cta); box-shadow: 0 2px 14px rgba(76, 99, 230, .35); }
.add-hint { margin-top: 10px; font-size: 12px; color: var(--accent-deep); }
.settings { margin-top: auto; }

/* ---- SEO/AEO audit meter + dashboard ---- */
.audit-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font: 700 11px var(--sans); letter-spacing: .07em; color: var(--muted);
  background: rgba(24, 33, 66, .06); border: 1px solid var(--line-soft); border-radius: 999px;
  padding: 3px 12px 3px 5px; cursor: pointer;
  box-shadow: inset 0 2px 6px rgba(24, 33, 66, .08);
  transition: transform .32s var(--ease-spring), border-color .16s var(--ease-out), background .16s var(--ease-out), box-shadow .32s var(--ease-out);
}
.audit-chip:hover { border-color: rgba(76, 99, 230, .45); background: rgba(255, 255, 255, .85); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.audit-chip:active { transform: translateY(1px) scale(.96); transition-duration: .06s; }
.audit-chip .g-lab { margin-right: 5px; }
.audit-chip.scanning .g-arc { animation: pulse 1.2s ease-in-out infinite; }

.gauge { position: relative; width: 30px; height: 30px; display: inline-grid; place-items: center; flex-shrink: 0; }
.gauge svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-width: 3.4; }
.gauge .g-track { stroke: rgba(24, 33, 66, .12); }
.gauge .g-arc {
  stroke: var(--muted); stroke-linecap: round;
  stroke-dasharray: 97.4; stroke-dashoffset: 97.4;
  transition: stroke-dashoffset .8s var(--ease-out), stroke .3s var(--ease-out);
}
.gauge .g-num { font: 700 10px var(--mono); color: var(--ink); letter-spacing: 0; }
.gauge.big { width: 64px; height: 64px; }
.gauge.big circle { stroke-width: 3; }
.gauge.big .g-num { font-size: 17px; }
.g-arc.good { stroke: var(--ok); filter: drop-shadow(0 0 4px rgba(14, 138, 95, .4)); }
.g-arc.mid { stroke: var(--warn); filter: drop-shadow(0 0 4px rgba(154, 106, 18, .35)); }
.g-arc.poor { stroke: var(--danger); filter: drop-shadow(0 0 4px rgba(192, 58, 49, .4)); }

.modal.audit-modal { max-width: min(1280px, 94vw); display: flex; flex-direction: column; max-height: 92vh; padding: 26px 30px; }
.audit-head { display: flex; align-items: flex-start; gap: 10px; }
.audit-head > div:first-child { flex: 1; }
.audit-head h2 { margin-bottom: 2px; }
.audit-head p { margin: 0; }
.audit-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 14px; }
.score-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: rgba(255, 255, 255, .6); border: 1px solid var(--line-soft); border-radius: 16px;
}
.score-card b { display: block; font: 700 14px var(--display); letter-spacing: .02em; }
.score-card span:not(.gauge):not(.g-num) { color: var(--muted); font-size: 12px; line-height: 1.45; display: block; margin-top: 2px; }
.audit-filter { align-self: flex-start; margin-bottom: 12px; }
.audit-list { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
.audit-empty { color: var(--muted); font-size: 13px; }

.acheck {
  border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(255, 255, 255, .5);
  transition: border-color .16s var(--ease-out), background .16s var(--ease-out);
}
.acheck[open], .acheck:hover { border-color: var(--line); background: rgba(255, 255, 255, .85); }
.acheck summary {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; list-style: none;
  font-size: 13px;
}
.acheck summary::-webkit-details-marker { display: none; }
.acheck .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.acheck .dot.pass { background: var(--ok); box-shadow: 0 0 8px rgba(14, 138, 95, .5); }
.acheck .dot.warn { background: var(--warn); box-shadow: 0 0 8px rgba(154, 106, 18, .45); }
.acheck .dot.fail { background: var(--danger); box-shadow: 0 0 8px rgba(192, 58, 49, .5); }
.acheck .dot.na { background: rgba(24, 33, 66, .25); }
.acheck .a-label { font-weight: 600; }
.acheck .a-detail { color: var(--muted); font-size: 12.5px; flex: 1; text-align: right; }
.acheck .a-cat {
  font: 700 9.5px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line-soft); border-radius: 999px; padding: 2px 8px; flex-shrink: 0;
}
.acheck .a-weight { font: 500 10.5px var(--mono); color: var(--muted); flex-shrink: 0; }
.acheck .a-body { padding: 2px 14px 12px 33px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.acheck .a-body p { margin: 0 0 8px; }
.acheck .a-body .a-why b { color: var(--ink); font-weight: 600; }
.acheck .a-items { margin: 0 0 10px; padding: 0; list-style: none; }
.acheck .a-items li {
  font-family: var(--mono); font-size: 11.5px; padding: 4px 10px; border-left: 1px solid var(--line);
  margin-bottom: 3px; background: rgba(24, 33, 66, .05); border-radius: 0 8px 8px 0;
  color: var(--accent-deep); word-break: break-word;
}
.acheck .a-items li .a-page { color: var(--muted); margin-right: 8px; }
.acheck .btn.fix { font-size: 11.5px; padding: 5px 12px; }
.audit-group-title {
  font: 700 10.5px var(--sans); letter-spacing: .11em; text-transform: uppercase; color: var(--muted);
  margin: 10px 2px 2px;
}
.audit-group-title:first-child { margin-top: 0; }

@media (max-width: 720px) {
  .audit-scores { grid-template-columns: 1fr; }
  .acheck .a-detail { display: none; }
}

/* ---- modal ---- */
.modal-back {
  position: fixed; inset: 0; background: rgba(24, 32, 70, .35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: grid; place-items: center; z-index: 50; padding: 20px;
  animation: back-in .22s var(--ease-out);
}
@keyframes back-in { from { opacity: 0; } }
.modal {
  background: rgba(255, 255, 255, .88); border: 1px solid var(--line); border-radius: 20px; padding: 22px;
  width: 100%; max-width: 400px;
  backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 24px 70px rgba(24, 33, 66, .28), inset 0 1px 0 rgba(255, 255, 255, .9);
  animation: modal-in .3s var(--ease-out);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
/* Closing plays the entrance in reverse — .closing is removed once hidden. */
.modal-back.closing { animation: back-out .22s var(--ease-out) forwards; pointer-events: none; }
.modal-back.closing .modal { animation: modal-out .22s var(--ease-out) forwards; }
@keyframes back-out { to { opacity: 0; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }
.modal.settings-modal { max-width: 520px; }
.settings-body { min-height: 120px; display: grid; gap: 18px; }
.set-sec { border-top: 1px solid var(--line-soft); padding-top: 14px; }
.set-sec h3 { font: 700 13.5px var(--display); margin: 0 0 4px; }
.set-sec > p { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; line-height: 1.55; }
.set-row { display: flex; gap: 8px; align-items: center; }
.set-row input { flex: 1; min-width: 0; }
.set-hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; line-height: 1.55; }
.set-hint b { color: var(--ink); }
.set-steps { margin: 8px 0 10px; padding-left: 20px; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.set-steps b { color: var(--ink); font-weight: 600; }
.set-code {
  font: 500 11px var(--mono); color: var(--accent-deep); background: rgba(24, 33, 66, .06);
  border-radius: 6px; padding: 2px 6px; user-select: all; word-break: break-all;
}
.set-status { font-size: 13px; margin: 0 0 10px; }
.nf-toggle {
  display: flex; align-items: center; gap: 12px; width: 100%; cursor: pointer;
  background: rgba(255, 255, 255, .55); border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 10px 12px; font: inherit; color: inherit; text-align: left;
  transition: background .15s, border-color .15s;
}
.nf-toggle:hover { background: rgba(5, 189, 186, .07); border-color: rgba(5, 189, 186, .35); }
.nf-logo { height: 20px; width: auto; display: block; flex-shrink: 0; }
.nf-summary {
  margin-left: auto; display: flex; align-items: center; gap: 7px;
  color: var(--muted); font-size: 12px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nf-summary::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: #c3c9da; flex-shrink: 0;
}
.nf-toggle.is-connected .nf-summary::before { background: #2fbf71; }
.nf-chev { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; transition: transform .3s var(--ease-out); }
.nf-toggle[aria-expanded="true"] .nf-chev { transform: rotate(180deg); }

/* The drawer glides open: grid rows ease 0fr → 1fr, so it animates to its
   natural height with no fixed max-height guesswork. */
.nf-drawer {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .35s var(--ease-out);
}
.nf-drawer.open { grid-template-rows: 1fr; }
.nf-drawer-in {
  overflow: hidden; min-height: 0; padding: 0 4px;
  visibility: hidden; opacity: 0; transform: translateY(-4px);
  transition: visibility 0s .35s, opacity .3s, transform .3s var(--ease-out);
}
.nf-drawer.open .nf-drawer-in {
  visibility: visible; opacity: 1; transform: none;
  transition: visibility 0s, opacity .3s .08s, transform .35s var(--ease-out);
}
.nf-drawer-in > .set-hint:first-child { margin: 12px 0 10px; }
.set-empty { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }
.users-list { list-style: none; margin: 0 0 10px; padding: 0; }
.users-list:empty { margin: 0; }
.users-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 10px; border: 1px solid var(--line-soft); border-radius: 10px; margin-bottom: 6px;
  background: rgba(255, 255, 255, .55);
  animation: user-row-in .3s var(--ease-out);
}
@keyframes user-row-in { from { opacity: 0; transform: translateY(-4px); } }
.users-list li.settled { animation: none; }
.users-list .u-email { font: 500 12.5px var(--mono); color: var(--ink); word-break: break-all; }
.users-list .u-remove { flex-shrink: 0; }
.modal h2 { font: 700 17px var(--display); margin: 0 0 6px; }
.modal p { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

@media (max-width: 1100px) { .cockpit { --chat-w: 260px; --insp-w: 250px; } }

@media (max-width: 760px) {
  .cockpit { grid-template-columns: 1fr; grid-template-rows: minmax(180px, 28vh) minmax(300px, 1fr) auto; }
  .chat { border-right: none; border-bottom: 1px solid var(--line-soft); }
  .inspector { border-left: none; border-top: 1px solid var(--line-soft); max-height: 40vh; }
}

@media (max-width: 640px) {
  .home-head { padding: 10px 16px; }
  .ngw { width: 178px; }
  .home-main, .brief-main { padding-left: 16px; padding-right: 16px; }
  .field-group { padding: 16px; }
}

/* ---- full-screen preview (Esc) — liquid glass cockpit ----
   Esc lifts the site to the whole window and the chrome gets out of its way:
   the topbar, chat and inspector sit there as nothing but the outlines of
   their controls, and only fill in as smoked glass — blur, specular edge,
   pale iridescent ink (text via background-clip, icons via the #mb-iri-grad
   SVG gradient) — under the cursor. Entry/exit morphs through the View
   Transitions API; the named groups below glide each panel out of its dock. */
.stage { view-transition-name: mb-stage; }
.topbar { view-transition-name: mb-topbar; }
.chat { view-transition-name: mb-chat; }
.inspector { view-transition-name: mb-inspector; }
::view-transition-group(mb-stage), ::view-transition-group(mb-topbar),
::view-transition-group(mb-chat), ::view-transition-group(mb-inspector) {
  animation-duration: .55s;
  animation-timing-function: cubic-bezier(.3, .9, .25, 1);
}

body.mb-full { overflow: hidden; }
body.mb-full .stage { position: fixed; inset: 0; z-index: 10; background: #0D1126; }
body.mb-full .stage-inner { padding: 0; }
body.mb-full #site-frame { border: none; border-radius: 0; box-shadow: none; }
body.mb-full .stage-wait-note { color: #A9BEFF; }
body.mb-full .topbar {
  position: fixed; z-index: 20; top: 14px; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 28px);
  border-radius: 24px; padding: 8px 14px;
}
body.mb-full .chat {
  position: fixed; z-index: 15; left: 14px; top: 84px; bottom: 14px;
  width: clamp(250px, 23vw, 330px); border-radius: 24px;
}
body.mb-full .inspector {
  position: fixed; z-index: 15; right: 14px; top: 84px; bottom: 14px;
  width: clamp(240px, 22vw, 310px); border-radius: 24px;
}
/* the MacBook chip ducks out from under the floating topbar */
body.mb-full .stage-tools { top: auto; bottom: 20px; right: 50%; transform: translateX(50%); }

/* the change log lives on the dark stage in full screen, so it takes the
   liquid-glass treatment with the rest of the chrome */
body.mb-full :is(.hist-btn, .hist-toast, .hist-panel) {
  background: rgba(11, 15, 34, .58); border-color: rgba(255, 255, 255, .22); color: #E9EFFF;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 10px 34px rgba(0, 0, 0, .38);
}
body.mb-full .hist-btn:hover, body.mb-full .hist-btn[aria-expanded=true] { background: rgba(21, 27, 56, .72); color: #FFFFFF; }
body.mb-full .hist-btn svg { stroke: url(#mb-iri-grad); }
body.mb-full .hist-head { border-bottom-color: rgba(255, 255, 255, .14); }
body.mb-full .hist-foot { border-top-color: rgba(255, 255, 255, .14); }
body.mb-full :is(.hist-title, .hist-when, .hist-foot, .hist-none, .hist-x) { color: rgba(211, 222, 252, .66); }
body.mb-full .hist-row { color: #E9EFFF; }
body.mb-full :is(.hist-row:hover, .hist-x:hover) { background: rgba(255, 255, 255, .12); }
body.mb-full .hist-row.current { background: rgba(255, 255, 255, .16); }
body.mb-full .hist-toast.err { background: rgba(220, 70, 60, .22); border-color: rgba(255, 154, 147, .45); color: #FFC9C4; }

/* ---- resting state: the panels dissolve ----
   Esc is for looking at the site, so at rest the chrome hands the screen
   back: no plate, no blur, no drifting sheen — only the hairline outlines of
   the controls stay behind. Hover a panel (or focus it, or leave Claude
   mid-answer) and the smoked glass fades in under the cursor. --mb-ghost
   drives the pure content, --mb-chrome the controls that survive at rest. */
body.mb-full :is(.topbar, .chat, .inspector) {
  --mb-ghost: 0; --mb-chrome: .92;
  border: 1px solid transparent;
  background: transparent;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: none;
  color: #EFF3FF;
  transition: background .32s var(--ease-out), border-color .32s var(--ease-out),
              box-shadow .32s var(--ease-out), backdrop-filter .32s var(--ease-out);
}
/* the glass, only under the cursor: smoked base, specular edge, no sheen */
body.mb-full :is(.topbar, .chat, .inspector):is(:hover, :focus-within),
body.mb-full .chat:has(#chat-busy:not([hidden])) {
  --mb-ghost: 1; --mb-chrome: 1;
  border-color: rgba(255, 255, 255, .26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .015) 45%, rgba(255, 255, 255, .045)),
    rgba(11, 15, 34, .74);
  backdrop-filter: blur(26px) saturate(1.3); -webkit-backdrop-filter: blur(26px) saturate(1.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 22px 60px rgba(4, 8, 28, .45);
}

/* pure content — gone at rest, back with the glass */
body.mb-full :is(.chat, .inspector) :is(.chat-tabs, .chat-feed, .chat-hint, .cl-star, .working, .usage, .insp-empty, #insp-body, .insp-sec),
body.mb-full .topbar :is(.ed-name, .pill) {
  opacity: var(--mb-ghost);
  transition: opacity .32s var(--ease-out);
}
body.mb-full :is(.chat, .inspector) .panel-title {
  color: rgba(226, 234, 255, calc(var(--mb-ghost) * .62));
  transition: color .32s var(--ease-out);
}
/* controls stay as outlines — the only chrome left over the site at rest */
body.mb-full :is(.topbar, .chat, .inspector) :is(.btn:not(.mode-group *), .mode-group, .audit-chip, .page-select) {
  opacity: var(--mb-chrome);
  transition: opacity .32s var(--ease-out), border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
body.mb-full :is(.topbar, .chat, .inspector) .btn:disabled { opacity: calc(var(--mb-chrome) * .5); }
/* stage chrome fades the same way, so nothing sits on the site uninvited */
body.mb-full :is(.stage-tools, .hist-btn) { opacity: .5; transition: opacity .32s var(--ease-out); }
body.mb-full :is(.stage-tools:hover, .hist-btn:hover, .hist-btn[aria-expanded=true]) { opacity: 1; }

/* ink — a whisper of iridescence instead of a rainbow: a pale cool wash with
   the faintest warm turn through the middle, and no drift animation. Only
   bare labels take it; a button needs a solid colour so its chip can carry a
   scrim behind the text (a clipped background can't sit over one). */
body.mb-full :is(.topbar, .chat, .inspector) :is(.insp-lab, .g-lab, .g-num, .ed-name) {
  background-image: linear-gradient(100deg, #EDF2FF, #F5E9EE 38%, #E6F2F3 68%, #EAEFFF);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #E7EDFF;
}
/* icons take the same muted ink (CSS stroke beats the stroke="currentColor"
   attribute); #mb-iri-grad is now a pale static wash, not a rainbow */
body.mb-full :is(.topbar, .chat, .inspector) .btn:not(.danger) svg,
body.mb-full .fit-mac svg { stroke: url(#mb-iri-grad); }

/* buttons: a hairline chip over a faint smoked backing, so the outline reads
   over a white site as well as a dark one. The chip thins out once the panel
   fills in behind it — it only has to carry itself while it stands alone. */
body.mb-full :is(.topbar, .chat, .inspector) .btn:not(.danger),
body.mb-full .fit-mac {
  background: rgba(8, 12, 30, calc(.56 - var(--mb-ghost) * .46));
  color: #EDF2FF; -webkit-text-fill-color: currentColor;
  border-color: rgba(255, 255, 255, calc(.44 - var(--mb-ghost) * .04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background .32s var(--ease-out), border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
body.mb-full :is(.topbar, .chat, .inspector) .btn:not(.danger):hover,
body.mb-full .fit-mac:hover {
  background: rgba(46, 58, 104, .55); color: #FFFFFF;
  border-color: rgba(255, 255, 255, .58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), 0 6px 20px rgba(4, 8, 28, .35);
}
body.mb-full :is(.btn.mode.active, .btn.vp.active, .fit-mac.active) {
  background: rgba(72, 88, 150, .62); color: #FFFFFF;
  border-color: rgba(255, 255, 255, .62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42);
}
body.mb-full :is(.topbar, .chat, .inspector) .btn.danger {
  color: #FF9A93; border-color: rgba(255, 130, 120, .5); background: rgba(120, 34, 30, .34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
body.mb-full .mode-group { background: transparent; border-color: rgba(255, 255, 255, .16); box-shadow: none; }
body.mb-full .audit-chip {
  background: rgba(8, 12, 30, calc(.56 - var(--mb-ghost) * .5)); border-color: rgba(255, 255, 255, .26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
body.mb-full .gauge .g-track { stroke: rgba(255, 255, 255, .2); }

/* fields read as smoked wells rather than white washes — the same chip
   backing as the buttons, so they hold up with the panel gone */
body.mb-full :is(.topbar, .chat, .inspector) :is(input:not([type=range]):not([type=color]), textarea, select) {
  background: rgba(9, 13, 32, calc(var(--mb-ghost) * .34));
  border-color: rgba(255, 255, 255, calc(.16 + var(--mb-ghost) * .1));
  color: rgba(239, 243, 255, calc(.12 + var(--mb-ghost) * .88));
  transition: background .32s var(--ease-out), border-color .32s var(--ease-out), color .32s var(--ease-out);
}
body.mb-full :is(.topbar, .chat, .inspector) :is(input, textarea)::placeholder { color: rgba(211, 222, 252, calc(var(--mb-ghost) * .55)); }
body.mb-full :is(.topbar, .chat, .inspector) :is(input:not([type=range]):not([type=color]), textarea, select):focus {
  border-color: rgba(255, 255, 255, .55); background: rgba(9, 13, 32, .5);
  box-shadow: 0 0 0 3px rgba(158, 210, 255, .18);
}
body.mb-full :is(.topbar, .chat, .inspector) select:hover { border-color: rgba(255, 255, 255, .48); background: rgba(9, 13, 32, .44); }

/* status pills brightened for the dark glass */
body.mb-full .pill { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .24); color: #D6E0FF; }
body.mb-full .pill.ready { color: #63E6B0; border-color: rgba(99, 230, 176, .5); }
body.mb-full .pill.building, body.mb-full .pill.busy { color: #A9BEFF; border-color: rgba(169, 190, 255, .55); }
body.mb-full .pill.error { color: #FF9A93; border-color: rgba(255, 154, 147, .5); }

/* panel interiors */
body.mb-full .chat-form { border-top-color: rgba(255, 255, 255, .14); }
body.mb-full .insp-sec { border-top-color: rgba(255, 255, 255, .12); }
body.mb-full .insp-empty { color: rgba(211, 222, 252, .62); }
body.mb-full .insp-empty b { color: #EFF3FF; }
body.mb-full .ctl-row label { color: rgba(211, 222, 252, .66); }
body.mb-full .working, body.mb-full .add-hint { color: #AFC6FF; }
body.mb-full .mini { border-color: rgba(255, 255, 255, .25); color: rgba(211, 222, 252, .7); }
body.mb-full .msg.claude { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .15); color: #ECF1FF; }
body.mb-full .msg.tool { color: rgba(207, 224, 255, .6); }
body.mb-full .msg.tool b { color: #AFC6FF; }
body.mb-full .msg.err { background: rgba(220, 70, 60, .16); border-color: rgba(255, 140, 130, .35); color: #FFC9C4; }
body.mb-full .msg.done { color: #63E6B0; }
body.mb-full .msg.sep { border-top-color: rgba(255, 255, 255, .14); color: rgba(207, 224, 255, .6); }
body.mb-full :is(.chat, .inspector), body.mb-full :is(.chat, .inspector) * { scrollbar-color: rgba(255, 255, 255, .3) transparent; }

/* browsers without view transitions still get a soft entrance */
@supports not (view-transition-name: none) {
  body.mb-full .chat, body.mb-full .inspector { animation: mb-glass-in .45s var(--ease-out); }
  body.mb-full .topbar { animation: mb-bar-in .45s var(--ease-out); }
  body.mb-full .stage { animation: mb-stage-in .4s var(--ease-out); }
}
@keyframes mb-glass-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes mb-bar-in { from { opacity: 0; transform: translateX(-50%) translateY(-14px); } }
@keyframes mb-stage-in { from { opacity: .4; transform: scale(.985); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .btn:hover, .btn:active, .pcard:hover, .pcard:active, .pick span:hover, .pick span:active,
  .chk:hover, .chk:active, .mini:active, .mode-group .btn:active, .audit-chip:hover, .audit-chip:active { transform: none; }
}

/* ---- first-run setup wizard ---- */
.setup-modal { max-width: 480px; }
.setup-step {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.setup-step:first-of-type { border-top: 0; }
.step-dot {
  width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; flex-shrink: 0;
  background: rgba(24, 33, 66, .15); box-shadow: inset 0 0 0 1px rgba(24, 33, 66, .2);
}
.step-dot.ok { background: var(--ok, #0E8A5F); box-shadow: 0 0 10px rgba(14, 138, 95, .45); }
.step-dot.busy { background: var(--accent, #4C63E6); box-shadow: 0 0 10px rgba(76, 99, 230, .6); animation: pulse 1.4s ease-in-out infinite; }
.step-dot.err { background: #C43A30; box-shadow: 0 0 10px rgba(196, 58, 48, .45); }
.step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.step-body b { font-size: 14px; }
.step-note { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.step-note.err { color: #7E211A; }
.step-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.step-actions:empty { display: none; }
.setup-log {
  margin: 4px 0 0; padding: 8px 10px; max-height: 96px; overflow: auto;
  background: rgba(24, 33, 66, .06); border: 1px solid var(--line); border-radius: 10px;
  font-size: 11px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.setup-code { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.code-row { display: flex; gap: 8px; }
.code-row input {
  flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255, 255, 255, .8); font-size: 12.5px;
}
.code-row input:focus { outline: 2px solid rgba(76, 99, 230, .4); outline-offset: 1px; }


/* ---- the Claude panel wears Claude's own skin ----
   Everything else in the cockpit stays daylight-glass periwinkle; the chat
   column matches the ask-Claude popovers on the canvas (mb-editor.js): warm
   paper, near-black ink, clay #D97757 accent, pill controls, hairline rules.
   Scoped to .chat so no other panel picks it up. */
.chat {
  --clay: #D97757;
  --clay-soft: #FBE9E2;
  --cl-ink: #141413;
  --cl-muted: #7C7A72;
  --cl-paper: #FAF9F5;
  --cl-sand: #F0EEE6;
  --cl-line: rgba(20, 20, 19, .11);
  background: var(--cl-paper);
  border-right: 1px solid var(--cl-line);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  color: var(--cl-ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* header */
.chat .panel-title { color: var(--cl-muted); letter-spacing: .1em; padding: 12px 13px 9px; }
.chat .cl-star { width: 13px; height: 13px; color: var(--clay); margin-right: -3px; flex-shrink: 0; }
.chat .working { color: var(--clay); }
.chat .btn.tiny {
  background: var(--cl-sand); border-color: var(--cl-line); color: var(--cl-ink);
  box-shadow: none; border-radius: 999px; font-weight: 600;
}
.chat .btn.tiny:hover { background: var(--clay-soft); border-color: var(--clay); transform: none; box-shadow: none; }
.chat .btn.tiny:active { transform: scale(.95); }

/* chat rows */
.chat .chat-tabs { border-bottom: 1px solid var(--cl-line); }
.chat .chat-tab:hover { background: var(--cl-sand); border-color: transparent; }
.chat .chat-tab.active { background: var(--clay-soft); border-color: rgba(217, 119, 87, .45); }
.chat .ctab-dot { background: rgba(20, 20, 19, .2); }
.chat .chat-tab.busy .ctab-dot { background: var(--clay); box-shadow: 0 0 8px rgba(217, 119, 87, .65); }
.chat .ctab-main b { color: var(--cl-ink); }
.chat .ctab-task { color: var(--cl-muted); }
.chat .chat-tab.busy .ctab-task { color: var(--clay); }
.chat .ctab-model { border-color: var(--cl-line); color: var(--cl-muted); background: #fff; }
.chat .ctab-model.m-haiku { color: #4A7C59; border-color: rgba(74, 124, 89, .35); background: rgba(74, 124, 89, .08); }
.chat .ctab-model.m-sonnet { color: #A64B28; border-color: rgba(217, 119, 87, .45); background: var(--clay-soft); }
.chat .ctab-model.m-opus { color: #6B4E8F; border-color: rgba(107, 78, 143, .35); background: rgba(107, 78, 143, .08); }
.chat .ctab-unread { color: var(--clay); }
.chat .ctab-x { color: var(--cl-muted); }

/* the transcript — you speak in a sand bubble, Claude answers on the page */
.chat .chat-feed { padding: 8px 14px 14px; gap: 10px; }
.chat .msg { font-size: 13.5px; line-height: 1.55; }
.chat .msg.user {
  background: var(--cl-sand); color: var(--cl-ink); border: 1px solid var(--cl-line);
  border-radius: 16px; border-bottom-right-radius: 6px; padding: 8px 13px;
  box-shadow: none; max-width: 90%;
}
.chat .msg.claude {
  background: transparent; border: none; border-radius: 0;
  padding: 2px 2px 4px; color: var(--cl-ink);
}
.chat .msg.tool { font: 400 11.5px var(--mono); color: var(--cl-muted); }
.chat .msg.tool b { color: var(--clay); }
.chat .msg.model { font: 500 11px var(--mono); color: var(--cl-muted); }
.chat .msg.model b { color: var(--clay); }
.chat .msg.done { color: #4A7C59; }
.chat .msg.err { background: rgba(192, 58, 49, .07); border-color: rgba(192, 58, 49, .3); color: #8C2D24; border-radius: 12px; }
.chat .msg.sep { color: var(--cl-muted); border-top-color: var(--cl-line); }

/* composer — textarea and buttons share one rounded card, like Claude's */
.chat .chat-form {
  border-top: none; background: var(--cl-paper); margin: 0 11px 12px; padding: 8px 8px 8px;
  border: 1px solid rgba(20, 20, 19, .16); border-radius: 20px; gap: 4px;
  transition: border-color .14s var(--ease-out), box-shadow .14s var(--ease-out);
}
.chat .chat-form:focus-within { border-color: var(--clay); box-shadow: 0 0 0 2.5px rgba(217, 119, 87, .16); }
.chat .chat-form textarea {
  background: transparent; border: none; border-radius: 0;
  color: var(--cl-ink); font-family: inherit; padding: 4px 6px 0; box-shadow: none;
}
.chat .chat-form textarea::placeholder { color: var(--cl-muted); }
.chat .chat-form textarea:focus { border: none; box-shadow: none; }
.chat .chat-actions { align-items: center; padding: 0 2px 1px; }
.chat .chat-hint { color: var(--cl-muted); }
.chat .chat-actions .btn.primary {
  background: var(--clay); border-color: transparent; color: #fff; border-radius: 999px;
  box-shadow: 0 2px 10px rgba(217, 119, 87, .3);
}
.chat .chat-actions .btn.primary:hover { background: #C86643; box-shadow: 0 4px 16px rgba(217, 119, 87, .4); }
.chat .chat-actions .btn.primary:active { box-shadow: 0 1px 6px rgba(217, 119, 87, .3); }
.chat .chat-actions .btn.danger {
  background: #fff; border-color: rgba(192, 58, 49, .35); color: #8C2D24; box-shadow: none; border-radius: 999px;
}
.chat .chat-actions .btn.danger:hover { background: rgba(192, 58, 49, .08); border-color: rgba(192, 58, 49, .55); box-shadow: none; }
.chat, .chat * { scrollbar-color: rgba(20, 20, 19, .22) transparent; }

/* ---- the plan's 5-hour window, on the floor of the panel ----
   Claude subscriptions meter work in a rolling 5-hour window, so the one number
   worth having permanently in view is how much of it is gone. It gets a band
   across the bottom edge of the panel — full bleed, no radius, so it reads as
   the floor rather than as another control — filled orange from the left as the
   window burns down, with the caption riding on top of the fill.
   The three fills deepen clay → orange → red-orange, and all three are light
   enough that the near-black caption stays legible whether a given word happens
   to sit over the filled part or the empty track. */
.usage { flex-shrink: 0; user-select: none; cursor: default; }
.usage-band {
  position: relative; display: flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 13px; overflow: hidden;
  background: rgba(20, 20, 19, .055);
  font: 500 10px var(--sans); letter-spacing: .04em; color: var(--cl-ink);
}
.usage-fill {
  position: absolute; inset: 0 auto 0 0; width: 0%;
  background: var(--clay);
  transition: width .55s var(--ease-out), background-color .3s var(--ease-out);
}
/* everything but the fill rides above it */
.usage-band > :not(.usage-fill) { position: relative; }
.usage-gap { flex: 1; }
.usage-label { text-transform: uppercase; letter-spacing: .09em; opacity: .68; }
.usage-pct { font-weight: 700; font-variant-numeric: tabular-nums; }
.usage-reset { font-variant-numeric: tabular-nums; opacity: .68; }
.usage.warn .usage-fill { background: #E2650F; }
.usage.hot .usage-fill { background: #DD4B14; }

/* full-screen preview keeps the smoked-glass treatment; only the clay accents
   carry through so the panel still reads as Claude's. */
body.mb-full .chat { color: #E7EDFF; font-family: var(--sans); }
body.mb-full .chat .cl-star { color: #F0B39B; }
body.mb-full .chat .msg.user { background: var(--user-grad); border: none; color: #F4F7FF; }
body.mb-full .chat .msg.claude { background: rgba(255, 255, 255, .08); padding: 9px 13px; border-radius: 14px; color: #ECF1FF; }
/* over the smoked glass the caption goes light, so the fill drops to a tint
   that the light text still reads over. */
body.mb-full .usage-band { background: rgba(255, 255, 255, .10); color: #EAF0FF; }
body.mb-full .usage-fill { background: rgba(217, 119, 87, .6); }
body.mb-full .usage.warn .usage-fill { background: rgba(226, 101, 15, .68); }
body.mb-full .usage.hot .usage-fill { background: rgba(221, 75, 20, .74); }

body.mb-full .chat .chat-form { background: transparent; border-color: rgba(255, 255, 255, calc(.14 + var(--mb-ghost) * .14)); }
body.mb-full .chat .chat-form textarea {
  background: rgba(9, 13, 32, calc(var(--mb-ghost) * .34));
  border-color: rgba(255, 255, 255, calc(.16 + var(--mb-ghost) * .12));
  color: rgba(234, 240, 255, calc(.12 + var(--mb-ghost) * .88));
}

/* ---- resizable / hideable cockpit columns + the zoom pill ----
   The two side panels are grid columns sized by --chat-w / --insp-w. A grip
   sits on each seam (drag to resize, double-click to reset); the ‹ › button in
   each panel header collapses that column to nothing and leaves a rail on the
   edge to bring it back. Widths and hidden state persist per browser. */
.col-grip {
  position: absolute; top: 0; bottom: 0; width: 9px; z-index: 7; cursor: col-resize;
  left: calc(var(--chat-w, 320px) - 4px);
}
.col-grip.is-right { left: auto; right: calc(var(--insp-w, 300px) - 4px); }
.col-grip::after {
  content: ''; position: absolute; inset: 0 3px; border-radius: 2px;
  background: transparent; transition: background .16s var(--ease-out);
}
.col-grip:hover::after, .col-grip.dragging::after { background: rgba(76, 99, 230, .55); }
body.col-dragging { cursor: col-resize; user-select: none; }
body.col-dragging iframe { pointer-events: none; }

/* rails — the way back once a panel is hidden */
.col-rail {
  position: absolute; top: 50%; z-index: 8; display: flex; align-items: center; gap: 6px;
  transform: translateY(-50%); cursor: pointer;
  font: 700 10.5px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  background: var(--glass-2); border: 1px solid var(--line-soft); border-left: none;
  border-radius: 0 12px 12px 0; padding: 12px 8px 12px 6px;
  writing-mode: vertical-rl; box-shadow: var(--shadow-rest);
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  transition: color .16s var(--ease-out), border-color .16s var(--ease-out), background .16s var(--ease-out);
}
.col-rail.is-left { left: 0; }
.col-rail.is-right { right: 0; border-left: 1px solid var(--line-soft); border-right: none; border-radius: 12px 0 0 12px; }
.col-rail svg { width: 13px; height: 13px; rotate: 90deg; }
.col-rail:hover { color: var(--accent-deep); border-color: rgba(76, 99, 230, .4); background: #FFFFFF; }

/* collapsed columns */
.cockpit.no-chat { --chat-w: 0px; }
.cockpit.no-insp { --insp-w: 0px; }
/* a collapsed panel keeps its (zero-width) column so the stage never jumps
   into the wrong grid track — it just goes invisible and untabbable */
.cockpit.no-chat > .chat, .cockpit.no-insp > .inspector { visibility: hidden; }
.cockpit.no-chat #grip-chat, .cockpit.no-insp #grip-insp { display: none; }
body.mb-full .col-grip { display: none; }
body.mb-full .col-rail { background: rgba(14, 18, 40, .5); border-color: rgba(255, 255, 255, .28); color: #D6E2FF; }

@media (max-width: 760px) {
  .col-grip { display: none; }
  .col-rail { writing-mode: horizontal-tb; top: auto; bottom: 8px; border-radius: 12px; border: 1px solid var(--line-soft); }
  .col-rail svg { rotate: none; }
  .cockpit.no-chat { grid-template-rows: 0 minmax(300px, 1fr) auto; }
  .cockpit.no-insp { grid-template-rows: minmax(180px, 28vh) minmax(300px, 1fr) 0; }
  .cockpit.no-chat.no-insp { grid-template-rows: 0 minmax(300px, 1fr) 0; }
}

/* zoom pill — one control: − , the live percentage, + */
.zoom-pill {
  display: flex; align-items: center; gap: 2px; padding: 3px;
  background: var(--glass-2); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: var(--shadow-rest);
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
}
.zoom-btn, .zoom-num {
  border: none; background: transparent; color: var(--ink); cursor: pointer;
  border-radius: 999px; transition: background .14s var(--ease-out), color .14s var(--ease-out);
}
.zoom-btn { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; }
.zoom-btn svg { width: 13px; height: 13px; }
.zoom-num { font: 600 11.5px var(--mono); padding: 4px 7px; min-width: 46px; letter-spacing: -.01em; }
.zoom-btn:hover, .zoom-num:hover { background: var(--accent-soft); color: var(--accent-deep); }
.zoom-btn:active, .zoom-num:active { transform: scale(.92); transition-duration: .06s; }
.zoom-btn:disabled { opacity: .35; cursor: default; background: transparent; color: var(--ink); }

/* zoomed previews scroll inside the stage */
#site-frame { transform-origin: top center; }
.stage-inner.zoomed { overflow: auto; align-items: flex-start; }
.stage-inner.zoomed #site-frame { flex: 0 0 auto; max-width: none; transform-origin: top left; }
body.mb-full .zoom-pill { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .28); }
body.mb-full :is(.zoom-btn, .zoom-num) { color: #E7EDFF; }
body.mb-full :is(.zoom-btn, .zoom-num):hover { background: rgba(255, 255, 255, .14); color: #FFFFFF; }
body.mb-full .zoom-btn svg { stroke: #E7EDFF; }

/* ==================== launch checklist ==================== */
.launch-main { padding: 38px 28px 90px; max-width: 880px; width: 100%; margin: 0 auto; }

.launch-hero {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px 22px; margin-bottom: 22px;
  background: var(--glass); border: 1px solid var(--line-soft); border-radius: 16px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-rest);
}
.launch-badge {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(24, 33, 66, .08); color: var(--muted);
  transition: background .2s var(--ease-out), color .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.launch-badge svg { width: 22px; height: 22px; }
.launch-badge.ok { background: rgba(14, 138, 95, .12); color: var(--ok); box-shadow: 0 0 18px rgba(14, 138, 95, .25); }
.launch-badge.warn { background: rgba(154, 106, 18, .12); color: var(--warn); box-shadow: 0 0 18px rgba(154, 106, 18, .2); }
.launch-badge.err { background: var(--danger-bg); color: var(--danger); box-shadow: 0 0 18px rgba(192, 58, 49, .2); }
.launch-badge.busy { background: var(--accent-soft); color: var(--accent-deep); animation: pulse 1.4s ease-in-out infinite; }
.launch-verdict { flex: 1; min-width: 230px; }
.launch-verdict b { display: block; font: 700 17px var(--display); }
.launch-verdict span { color: var(--muted); font-size: 12.5px; line-height: 1.5; display: block; margin-top: 2px; }
.launch-scores { display: flex; align-items: center; gap: 8px; }
.launch-scores .g-lab { font: 700 10.5px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: 10px; }

.launch-list { display: flex; flex-direction: column; gap: 8px; }
.launch-list .audit-group-title:first-child { margin-top: 0; }

/* an item Claude is actively fixing */
.acheck .dot.busy { background: var(--accent); box-shadow: 0 0 10px rgba(76, 99, 230, .6); animation: pulse 1.4s ease-in-out infinite; }
.fix-row { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.fix-note { color: var(--muted); font-size: 11.5px; }

.launch-dl {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 20px 22px; margin-top: 26px;
  background: var(--glass); border: 1px solid var(--line-soft); border-radius: 16px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-rest);
  transition: border-color .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.launch-dl b { display: block; font: 700 15px var(--display); }
.launch-dl span { color: var(--muted); font-size: 12.5px; line-height: 1.5; display: block; margin-top: 2px; max-width: 52ch; }
.launch-dl.ready { border-color: rgba(14, 138, 95, .4); box-shadow: 0 0 26px rgba(14, 138, 95, .14), var(--shadow-rest); }

/* the publish-to-Netlify card sits above the zip download */
.launch-pub { margin-top: 26px; }
.launch-pub + .launch-dl { margin-top: 12px; }
.launch-pub.ready { border-color: rgba(14, 138, 95, .4); box-shadow: 0 0 26px rgba(14, 138, 95, .14), var(--shadow-rest); }
.pub-url {
  display: inline-block; margin-top: 6px;
  font: 600 13px var(--sans); color: var(--accent-deep); text-decoration: none;
  border-bottom: 1px solid currentColor; word-break: break-all;
}
.pub-url:hover { color: var(--accent); }
.pub-account { color: var(--muted); font-size: 11.5px; display: block; margin-top: 8px; }
.pub-account b { font-weight: 600; }
.linkish {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--muted); font: inherit; text-decoration: underline;
}
.linkish:hover { color: var(--danger); }
.pub-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pub-connect { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pub-connect input {
  width: 300px; max-width: 100%;
  padding: 9px 12px; font: 500 12.5px var(--mono, monospace);
  background: var(--field, #fff); color: inherit;
  border: 1px solid var(--line-soft); border-radius: 10px;
}
.pub-connect input:focus { outline: none; border-color: var(--accent); }
.pub-hint { color: var(--muted); font-size: 11px; line-height: 1.5; text-align: right; width: 100%; }
.pub-hint a { color: var(--accent-deep); }
#launch-deploy.working { opacity: .75; animation: pulse 1.4s ease-in-out infinite; }

@media (max-width: 640px) {
  .launch-scores { width: 100%; }
  .launch-dl { flex-direction: column; align-items: stretch; }
  .launch-dl .btn { justify-content: center; }
  .pub-side { align-items: stretch; }
  .pub-connect { justify-content: stretch; }
  .pub-connect input { width: 100%; }
  .pub-hint { text-align: left; }
}
