/* Hopit console demo. System fonts only; no external requests.
   Theme follows the Hopit.ai brand deck: white paper, near-black serif headlines, monospace uppercase
   labels, one royal-blue accent, and thin intersecting loops (the logo and the login backdrop). */
:root {
  --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #FAFAF8; --sunken: #F4F4F1;
  --ink: #111111; --muted: #56565B; --faint: #8C8C91; --line: #E7E7E3; --line-2: #D3D3CE;
  --side: #FFFFFF; --side-ink: #1C1C1E;
  --accent: #2E3BEB; --accent-ink: #FFFFFF; --accent-soft: #EDEFFF; --accent-line: #AAB1FA;
  --good: #1A7F4B; --good-soft: #E3F4EA; --bad: #B42318; --bad-soft: #FDE7E4; --warn: #8A5A00; --warn-soft: #FBF0D6;
  --info: #0E7490; --info-soft: #E1F2F6; --violet: #6B4FBB; --violet-soft: #EEE9FB; --neutral-soft: #EFEFEC;
  --grid: #F0F0ED; --focus: #2E3BEB;
  --shadow: none;
  --shadow-lg: 0 12px 32px rgba(17, 17, 17, .12);
  --f: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", Charter, "Source Serif Pro", "Palatino Linotype", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C0C0E; --surface: #141416; --surface-2: #18181B; --sunken: #101012;
    --ink: #EDEDEA; --muted: #A4A4A9; --faint: #74747A; --line: #26262A; --line-2: #35353B;
    --side: #0C0C0E; --side-ink: #DADAD6;
    --accent: #8A94FF; --accent-ink: #0A0B24; --accent-soft: #1B1E45; --accent-line: #3E47A8;
    --good: #6BD39A; --good-soft: #15301F; --bad: #F48A7E; --bad-soft: #3B1C19; --warn: #E9B95E; --warn-soft: #36290F;
    --info: #67C6D8; --info-soft: #10303A; --violet: #B09BF2; --violet-soft: #251E3D; --neutral-soft: #222226;
    --grid: #1E1E22; --focus: #8A94FF; --shadow: none; --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C0C0E; --surface: #141416; --surface-2: #18181B; --sunken: #101012;
  --ink: #EDEDEA; --muted: #A4A4A9; --faint: #74747A; --line: #26262A; --line-2: #35353B;
  --side: #0C0C0E; --side-ink: #DADAD6;
  --accent: #8A94FF; --accent-ink: #0A0B24; --accent-soft: #1B1E45; --accent-line: #3E47A8;
  --good: #6BD39A; --good-soft: #15301F; --bad: #F48A7E; --bad-soft: #3B1C19; --warn: #E9B95E; --warn-soft: #36290F;
  --info: #67C6D8; --info-soft: #10303A; --violet: #B09BF2; --violet-soft: #251E3D; --neutral-soft: #222226;
  --grid: #1E1E22; --focus: #8A94FF; --shadow: none; --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--f); -webkit-text-size-adjust: 100%; overflow-x: hidden; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.005em; }
h1 { font-size: 1.45rem; font-weight: 700; }
h2 { font-size: 1.08rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
code, .mono { font-family: var(--mono); font-size: .86em; }
code { background: var(--sunken); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
svg { fill: currentColor; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .84rem; }
.num { font-variant-numeric: tabular-nums; }

/* Shell */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; color: var(--side-ink); z-index: 40; }
.side-brand { display: flex; align-items: center; gap: 9px; padding: 2px 6px; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; }
.side-name { font-weight: 750; font-size: 1.05rem; }
.side-tag { font-size: .72rem; color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 0 6px; }
.ws { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 10px; text-align: left; cursor: default; }
.ws-av { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: .78rem; flex: none; }
.ws-t { display: grid; line-height: 1.25; min-width: 0; }
.ws-n { font-weight: 650; }
.ws-s { font-size: .75rem; color: var(--muted); }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-ink); text-decoration: none; font-weight: 520; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.nav a:hover { background: var(--sunken); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.nav a[aria-current="page"] svg { opacity: 1; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; border-radius: 10px; background: var(--info-soft); color: var(--info); font-size: .72rem; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.nav-badge.warn { background: var(--warn-soft); color: var(--warn); }
.side-foot { margin-top: auto; }
.research-link { width: 100%; display: flex; gap: 10px; align-items: flex-start; text-align: left; border: 1px dashed var(--line-2); background: transparent; border-radius: 10px; padding: 10px; cursor: pointer; }
.research-link svg { width: 18px; height: 18px; flex: none; color: var(--violet); margin-top: 2px; }
.research-link span { display: grid; font-weight: 600; }
.research-link small { font-weight: 400; color: var(--muted); font-size: .76rem; }
.research-link:hover { border-color: var(--violet); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.icon-btn.menu { display: none; }
.crumbs { font-size: .9rem; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs b { color: var(--ink); font-weight: 650; }
.demo-badge { font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sim-clock { font-family: var(--mono); font-size: .78rem; color: var(--muted); white-space: nowrap; }
#view { padding: 24px; max-width: 1240px; width: 100%; margin: 0 auto; display: grid; gap: 20px; align-content: start; outline: none; }

/* Controls */
.btn { text-decoration: none; color: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-2); background: var(--surface); padding: 7px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: .88rem; min-height: 36px; white-space: nowrap; box-shadow: var(--shadow); }
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.sm { padding: 4px 10px; min-height: 30px; font-size: .82rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--muted); flex: none; }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { color: var(--ink); }
.field { display: grid; gap: 6px; }
.field > label, .field > .lbl { font-weight: 600; font-size: .86rem; }
.field .help { font-size: .8rem; color: var(--muted); }
select, input[type="text"], input[type="url"], input[type="number"], input[type="password"] { border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; padding: 8px 10px; min-height: 38px; width: 100%; max-width: 460px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 550; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .tr { width: 36px; height: 20px; border-radius: 10px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.toggle .tr::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked + .tr { background: var(--accent); }
.toggle input:checked + .tr::after { transform: translateX(16px); }
.toggle input:focus-visible + .tr { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Cards, headers */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; max-width: 72ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-h p { color: var(--muted); font-size: .84rem; margin-top: 2px; }
.card-b { padding: 16px 18px; display: grid; gap: 14px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }
.kpi { padding: 16px 18px; display: grid; gap: 4px; }
.kpi-l { font-size: .8rem; color: var(--muted); font-weight: 550; }
.kpi-n { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi-d { font-size: .8rem; color: var(--muted); }
.kpi-d.up { color: var(--good); }
.empty { padding: 40px 20px; text-align: center; display: grid; justify-items: center; gap: 10px; color: var(--muted); }
.empty h2 { color: var(--ink); }
.callout { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); display: flex; gap: 12px; align-items: flex-start; }
.callout.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.callout.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.callout.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.callout.good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.callout .ci { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; background: var(--surface); }
.callout > div { display: grid; gap: 4px; min-width: 0; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 650; padding: 2px 9px; border-radius: 999px; white-space: nowrap; background: var(--neutral-soft); color: var(--muted); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.violet { background: var(--violet-soft); color: var(--violet); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.live::before { animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.tag { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* Tables */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; font-weight: 600; font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .r { text-align: right; }
.tbl .t-main { font-weight: 600; }
.tbl .t-sub { font-size: .78rem; color: var(--muted); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.progress { height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; min-width: 90px; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s; }
.progress.warn > i { background: var(--warn); }
.progress.bad > i { background: var(--bad); }
.progress.big { height: 10px; border-radius: 5px; }

/* Wizard */
.stepper { display: flex; gap: 0; list-style: none; padding: 0; margin: 0; counter-reset: s; overflow-x: auto; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-size: .86rem; color: var(--muted); border-bottom: 2px solid var(--line); white-space: nowrap; }
.stepper .sn { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; font-size: .74rem; font-weight: 700; flex: none; }
.stepper li.done { color: var(--ink); border-color: var(--accent-line); }
.stepper li.done .sn { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stepper li.cur { color: var(--ink); font-weight: 650; border-color: var(--accent); }
.stepper li.cur .sn { border-color: var(--accent); color: var(--accent); }
.wiz-foot { display: flex; justify-content: space-between; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.choice { position: relative; border: 1.5px solid var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 6px; cursor: pointer; background: var(--surface); text-align: left; }
.choice:hover { border-color: var(--line-2); }
.choice.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice.off { cursor: not-allowed; opacity: .6; background: var(--surface-2); }
.choice .ch-t { font-weight: 650; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.choice .ch-d { font-size: .82rem; color: var(--muted); }
.choice .soon { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--neutral-soft); padding: 1px 7px; border-radius: 999px; }
.drop { border: 2px dashed var(--line-2); border-radius: 12px; padding: 26px; text-align: center; display: grid; justify-items: center; gap: 6px; color: var(--muted); cursor: pointer; background: var(--surface-2); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop svg { width: 26px; height: 26px; }
.drop b { color: var(--ink); }
.vres { display: grid; gap: 10px; }
.vstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.vstat { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.vstat b { font-size: 1.3rem; display: block; font-variant-numeric: tabular-nums; }
.vstat.good b { color: var(--good); } .vstat.bad b { color: var(--bad); } .vstat.warn b { color: var(--warn); }
.issues { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: .86rem; }
.issues li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.review { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.review dt, .review dd { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.review dt { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: .84rem; }
.review dt:last-of-type, .review dd:last-of-type { border-bottom: 0; }

/* Code */
.code { margin: 0; background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-family: var(--mono); font-size: .8rem; line-height: 1.55; overflow: auto; white-space: pre; max-height: 360px; }
.code .c { color: var(--faint); }
.code .k { color: var(--accent); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { border: 0; background: none; padding: 8px 12px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 600; font-size: .86rem; }
.tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.copy-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Versions / changes */
.ver { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ver-h { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--surface-2); flex-wrap: wrap; }
.ver-h .vn { font-weight: 750; font-size: 1rem; }
.ver-h .vm { color: var(--muted); font-size: .82rem; }
.ver-h .va { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.changes { list-style: none; margin: 0; padding: 0; }
.changes li { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.changes .ct { font-weight: 600; }
.changes .cd { font-size: .82rem; color: var(--muted); }
.changes .cx { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }

/* Lineage / timeline */
.lineage { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: 6px 2px 10px; }
.node { flex: none; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 8px 12px; background: var(--surface); display: grid; gap: 2px; min-width: 140px; }
.node b { font-size: .88rem; }
.node small { color: var(--muted); font-size: .74rem; }
.node.model { border-color: var(--info); }
.node.harness { border-color: var(--accent); }
.node.active { box-shadow: 0 0 0 3px var(--accent-soft); }
.node.blocked { border-style: dashed; border-color: var(--bad); opacity: .85; }
.node.base { border-color: var(--line-2); background: var(--surface-2); }
.link { flex: none; width: 28px; height: 2px; background: var(--line-2); position: relative; }
.link::after { content: ""; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left-color: var(--line-2); border-right: 0; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; position: relative; padding-bottom: 18px; }
.timeline li::before { content: ""; position: absolute; left: 12px; top: 24px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.tl-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; background: var(--neutral-soft); color: var(--muted); }
.tl-dot.harness { background: var(--accent-soft); color: var(--accent); }
.tl-dot.model { background: var(--info-soft); color: var(--info); }
.tl-dot.bad { background: var(--bad-soft); color: var(--bad); }
.tl-dot.wait { background: var(--warn-soft); color: var(--warn); }
.tl-b { display: grid; gap: 3px; padding-top: 2px; }
.tl-t { font-weight: 650; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-m { font-size: .78rem; color: var(--faint); font-family: var(--mono); }
.cycle { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cyc { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 4px; position: relative; background: var(--surface-2); }
.cyc b { font-size: .9rem; }
.cyc span { font-size: .8rem; color: var(--muted); }
.cyc.on { border-color: var(--accent); background: var(--accent-soft); }

/* Charts */
.chart { width: 100%; min-height: 60px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--f); fill: var(--muted); font-size: 11.5px; }
.chart .gl { stroke: var(--grid); }
.chart .val { fill: var(--ink); font-weight: 650; }
.legend { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 60; background: rgba(10, 14, 20, .38); display: flex; justify-content: flex-end; }
.drawer-panel { width: min(560px, 100%); height: 100%; background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease; }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 16px 18px; overflow-y: auto; display: grid; gap: 14px; align-content: start; }
.logs { margin: 0; padding: 12px; list-style: none; background: var(--sunken); border-radius: 10px; font-family: var(--mono); font-size: .76rem; display: grid; gap: 3px; max-height: 50vh; overflow-y: auto; }
.logs li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; }
.logs .lt { color: var(--faint); }
.logs .lw { color: var(--warn); }
.logs .le { color: var(--bad); }
.logs .lo { color: var(--good); }
.research h3 { margin-top: 4px; }
.r-banner { border-radius: 10px; padding: 10px 12px; background: var(--violet-soft); color: var(--violet); font-weight: 650; font-size: .86rem; }
.r-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; }
.r-item .src { font-size: .76rem; color: var(--faint); }
.r-bars { display: grid; gap: 6px; }
.r-bar { display: grid; grid-template-columns: 150px minmax(0, 1fr) 46px; gap: 8px; align-items: center; font-size: .82rem; }
.r-bar .tr { height: 10px; background: var(--sunken); border-radius: 5px; overflow: hidden; }
.r-bar .tr i { display: block; height: 100%; border-radius: 5px; }

/* Toasts */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: grid; gap: 8px; width: min(380px, calc(100vw - 36px)); }
.toast { background: var(--ink); color: var(--bg); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow-lg); font-size: .86rem; display: flex; gap: 10px; align-items: flex-start; animation: up .2s ease; }
.toast i { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--accent); }
.toast.warn i { background: var(--warn); } .toast.bad i { background: var(--bad); } .toast.good i { background: var(--good); }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Responsive */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cycle { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(10, 14, 20, .35); z-index: 35; }
  .icon-btn.menu { display: grid; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .top { padding: 0 14px; gap: 8px; }
  #view { padding: 16px; }
  .sim-clock { display: none; }
}
@media (max-width: 600px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; }
  .kpi-n { font-size: 1.3rem; }
  #ffBtn span { display: none; }
  .crumbs { display: none; }
  .top-actions { margin-left: auto; }
  .vstats { grid-template-columns: minmax(0, 1fr); }
  .review { grid-template-columns: minmax(0, 1fr); }
  .review dt { border-bottom: 0; padding-bottom: 2px; }
  .changes li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .changes .cx { justify-content: flex-start; }
  .cycle { grid-template-columns: minmax(0, 1fr); }
  .stepper .sl { display: none; }
  .stepper li.cur .sl { display: inline; }
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .tbl.stack td { border: 0; padding: 4px 14px; }
  .tbl.stack td[data-l]::before { content: attr(data-l); display: block; font-size: .7rem; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
  .tbl.stack .row-actions { justify-content: flex-start; }
  .r-bar { grid-template-columns: 110px minmax(0, 1fr) 40px; }
}
.kpi-n { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .tbl th, .tbl td { padding: 8px 10px; }
  .kpi-n { font-size: 1.15rem; }
}

/* ---- v4: projects, history, trace viewer ---- */
.proj-head { display: flex; justify-content: space-between; align-items: center; padding: 0 6px; margin-bottom: -6px; }
.proj-new { font-size: .8rem; font-weight: 600; text-decoration: none; }
.projects { display: grid; gap: 4px; }
.proj { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 1px solid transparent; background: transparent; border-radius: 9px; padding: 7px 9px; cursor: pointer; }
.proj:hover { background: var(--sunken); }
.proj.on { background: var(--surface); border-color: var(--line-2); box-shadow: var(--shadow); }
.proj-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.proj-dot.good { background: var(--good); } .proj-dot.info { background: var(--info); }
.proj-t { display: grid; min-width: 0; line-height: 1.25; flex: 1; }
.proj-n { font-weight: 600; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-s { font-size: .74rem; color: var(--muted); }
.page-head h1 .pill { vertical-align: middle; margin-left: 4px; font-size: .74rem; }
.grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.kpi { position: relative; }
.spark { width: 100%; height: 30px; margin-top: 4px; display: block; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.feed-i { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: .88rem; }
.feed-i:first-child { border-top: 0; padding-top: 0; }
.feed-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; background: var(--faint); }
.feed-dot.good { background: var(--good); } .feed-dot.bad { background: var(--bad); } .feed-dot.warn { background: var(--warn); } .feed-dot.info { background: var(--info); }
.loop-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.loopd { border-top: 1px solid var(--line); }
.loopd summary { padding: 10px 14px; cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--muted); }
.loopd[open] summary { color: var(--ink); }
.loop-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; padding: 0 14px 14px; }
.loop-grid .tbl td { padding: 7px 8px; font-size: .84rem; }
.samples-list { display: grid; gap: 6px; margin: 6px 0 10px; }
.sample { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 10px; cursor: pointer; font-size: .84rem; }
.sample:hover { border-color: var(--accent); }
.sample .mono { color: var(--faint); font-size: .76rem; }
.sample-t { flex: 1; min-width: 140px; }
.pair-row { display: grid; gap: 6px; margin-bottom: 10px; }
.trig { display: flex; gap: 6px; flex-wrap: wrap; }
.conv .card-h h2 { margin-top: 2px; }
.conv-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.turns { display: grid; gap: 10px; }
.turn { display: grid; gap: 4px; max-width: 88%; }
.turn .who { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; }
.bubble { padding: 9px 12px; border-radius: 12px; font-size: .9rem; overflow-wrap: anywhere; border: 1px solid transparent; }
.turn.customer { justify-self: start; }
.turn.customer .bubble { background: var(--sunken); border-top-left-radius: 4px; }
.turn.agent { justify-self: end; }
.turn.agent .who { text-align: right; }
.turn.agent .bubble { background: var(--accent-soft); border-top-right-radius: 4px; }
.turn.tool { max-width: 100%; justify-self: stretch; }
.toolcall { border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); font-family: var(--mono); font-size: .76rem; overflow: hidden; }
.toolcall-h { display: flex; gap: 8px; align-items: center; padding: 6px 10px; flex-wrap: wrap; }
.toolcall-h .fn { font-weight: 600; overflow-wrap: anywhere; }
.toolcall-h .kind { font-family: var(--f); font-size: .68rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--neutral-soft); color: var(--muted); }
.toolcall-h .kind.write { background: var(--warn-soft); color: var(--warn); }
.toolcall pre { margin: 0; padding: 6px 10px; border-top: 1px dashed var(--line); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.hl-note { font-size: .78rem; font-weight: 600; padding: 4px 2px 0; }
.hl-bad .bubble, .hl-bad .toolcall { border-color: var(--bad); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 22%, transparent); }
.hl-bad .hl-note { color: var(--bad); }
.hl-good .bubble, .hl-good .toolcall { border-color: var(--good); box-shadow: 0 0 0 2px color-mix(in srgb, var(--good) 22%, transparent); }
.hl-good .hl-note { color: var(--good); }
.hl-guard .bubble, .hl-guard .toolcall { border-color: var(--warn); box-shadow: 0 0 0 2px color-mix(in srgb, var(--warn) 22%, transparent); }
.hl-guard .hl-note { color: var(--warn); }
.turn.agent .hl-note { text-align: right; }
@media (max-width: 1200px) { .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .loop-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- login + onboarding shell ---------- */
.shell.no-chrome .side, .shell.no-chrome .top { display: none; }
.shell.no-chrome { grid-template-columns: minmax(0, 1fr); }
.shell.no-chrome .main { min-height: 100vh; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 28px; }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-weight: 750; font-size: 1.05rem; }
.login-card h1 { margin: 0 0 4px; font-size: 1.3rem; }
.login-card > p { color: var(--muted); font-size: .86rem; margin: 0 0 18px; }
.login-list { display: grid; gap: 10px; }
.login-acc { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; cursor: pointer; text-align: left; width: 100%; }
.login-acc:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- trace-split attribution (illustrative, not a trained metric) ---------- */
.split-row { display: flex; align-items: center; gap: 10px; padding: 10px 18px 0; }
.split-bar { flex: 1; max-width: 260px; height: 8px; border-radius: 999px; overflow: hidden; background: var(--neutral-soft); display: flex; }
.split-bar i { display: block; height: 100%; }
.split-l { font-size: .74rem; color: var(--muted); }

textarea { border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; padding: 8px 10px; width: 100%; max-width: 560px; font: inherit; resize: vertical; }
@media (max-width: 600px) { .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .turn { max-width: 96%; } }

/* ---------- Hopit brand layer: serif headlines, mono labels, loop mark ---------- */
h1, h2, .login-card h1 { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.22rem; }
.tag, .side-tag, .demo-badge, .crumbs, .sim-clock, .split-l, .nav-badge { font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.crumbs { font-size: .74rem; }
.crumbs b { font-weight: 600; }
.side-tag { border: 0; padding: 0; color: var(--faint); font-size: .66rem; }
.side-name { font-family: var(--mono); font-weight: 600; font-size: .86rem; letter-spacing: .06em; text-transform: uppercase; }
.demo-badge { font-weight: 500; font-size: .64rem; color: var(--accent); background: transparent; border: 1px solid var(--accent-line); }
.logo { width: 30px; height: 30px; border-radius: 0; background: none; color: var(--ink); display: inline-block; flex: none; }
.logo svg { width: 100%; height: 100%; display: block; fill: none; }
.btn { border-radius: 999px; }
.btn.primary:hover { filter: none; background: var(--ink); border-color: var(--ink); }
.nav a[aria-current="page"] { background: transparent; color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); border-radius: 0 8px 8px 0; }
.ws-av { border-radius: 50%; }
.login-wrap { position: relative; overflow: hidden; }
.login-card { position: relative; z-index: 1; border-radius: 4px; }
.login-brand { font-family: var(--mono); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: .9rem; }
.login-loops { position: absolute; right: -14vw; top: 50%; transform: translateY(-50%); width: min(78vw, 880px); height: auto; pointer-events: none; opacity: .9; z-index: 0; }
.login-loops circle { fill: none; }
.login-loops text { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; fill: var(--muted); }
.login-loops .lp-a { stroke: var(--accent); stroke-width: 1.4; }
.login-loops .lp-b { stroke: var(--ink); stroke-width: .8; opacity: .55; }
.login-loops .lp-dot { fill: var(--accent); }
.login-loops .lp-t { fill: var(--accent); }
@media (max-width: 760px) { .login-loops { right: -60vw; opacity: .35; } }
@media (min-width: 900px) { .login-wrap { justify-items: start; padding-left: 8vw; } .login-loops { right: -10vw; width: min(62vw, 820px); } }

/* ---------- provisioned project: ready cards and deploy kit ---------- */
.ready-ver { display: flex; align-items: baseline; gap: 12px; }
.ready-ver .mono { font-size: 1.5rem; font-family: var(--serif); font-weight: 500; color: var(--ink); }
.kit-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.kit-files .btn { font-family: var(--mono); font-size: .76rem; font-weight: 500; }
.review dd { overflow-wrap: anywhere; }
@media (max-width: 760px) { .review { grid-template-columns: 1fr; } .review dt { border-bottom: 0; padding-bottom: 2px; } }
.card-b { grid-template-columns: minmax(0, 1fr); }
.card-b > * { min-width: 0; }
.kit-files .btn { white-space: normal; max-width: 100%; text-align: left; height: auto; }
