/* Stealthbox Cloud mockups. Same palette and type as the box console (agent/console.html
   in the Stealthbox repo): dark only, system sans, mono for data. Layout: a left nav rail,
   a page header with the page's main action, then cards on a 12-column grid that stacks
   to one column on phones. Spec callouts (.spec) are hidden until "Show spec notes". */
:root {
  color-scheme: dark;
  --ground: #0E1014; --panel: #161920; --raised: #1D212A; --line: #2A2F3A; --line-soft: #222630;
  --ink: #E8EAEF; --muted: #9AA1AD; --soft: #C3C8D1;
  --accent: #7AA7FF; --accent-strong: #3D6FF0; --accent-wash: #17223A; --accent-line: #263A66; --accent-ink: #B9CEFF;
  --needs: #F5B23E; --needs-ink: #F8CB73; --needs-wash: #2C2310; --needs-line: #5C4415;
  --ok: #3FB950; --ok-ink: #7FDB98; --ok-wash: #11261A; --ok-line: #1F4A2C;
  --wait: #8A919E; --bad: #FF8A80; --bad-wash: #2E1513; --bad-line: #5A2622; --live: #FF5A4E;
  --admin: #C28BFF; --admin-wash: #23183A; --admin-line: #43306A;
  --spec: #5FD4C4; --spec-wash: #0F2A27;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 14px/1.5 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.mono { font-family: var(--mono); font-size: 13px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.small { font-size: 12.5px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.nav { background: var(--panel); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; padding: 4px 8px 14px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.mark { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, var(--accent-strong), #6C4FE0); position: relative; flex: none; }
.mark::after { content: ""; position: absolute; inset: 6px; border: 2px solid rgba(255,255,255,.85); border-radius: 3px; }
.brand .tag { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--admin); background: var(--admin-wash); border: 1px solid var(--admin-line); border-radius: 99px; padding: 1px 7px; }
.nav .group { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 14px 8px 4px; }
.nav a.link { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--soft); }
.nav a.link:hover { background: var(--raised); color: var(--ink); text-decoration: none; }
.nav a.link[aria-current="page"] { background: var(--raised); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.nav a.link .count { margin-left: auto; font-size: 11.5px; font-weight: 700; color: #1A1305; background: var(--needs); border-radius: 99px; padding: 0 7px; }
.nav .ico { width: 16px; height: 16px; flex: none; opacity: .85; }
.nav .foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #3A4A70; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.nav .foot .who { min-width: 0; font-size: 13px; }
.nav .foot .who span { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { min-width: 0; padding: 22px 28px 56px; display: grid; gap: 20px; align-content: start; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.page-head h1 { font-size: 24px; line-height: 1.2; }
.page-head .sub { color: var(--muted); margin-top: 4px; max-width: 70ch; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }

/* ---------- grid and cards ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-head h2 { font-size: 15px; }
.card-head .meta { color: var(--muted); font-size: 12.5px; }
.card.needs { border-color: var(--needs-line); background: linear-gradient(0deg, var(--panel), var(--needs-wash)); }
.card.flat { background: transparent; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 2px; }
.stat .k { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12.5px; color: var(--muted); }
.meter { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent-strong); border-radius: 99px; }
.meter.warn span { background: var(--needs); }

/* pills and dots */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line); color: var(--soft); white-space: nowrap; }
.pill.ok { color: var(--ok-ink); border-color: var(--ok-line); background: var(--ok-wash); }
.pill.needs { color: var(--needs-ink); border-color: var(--needs-line); background: var(--needs-wash); }
.pill.bad { color: var(--bad); border-color: var(--bad-line); background: var(--bad-wash); }
.pill.live { color: #FFB3AD; border-color: #5A2622; background: #2A1110; }
.pill.info { color: var(--accent-ink); border-color: var(--accent-line); background: var(--accent-wash); }
.pill.admin { color: var(--admin); border-color: var(--admin-line); background: var(--admin-wash); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--wait); }
.dot.ok { background: var(--ok); } .dot.needs { background: var(--needs); } .dot.bad { background: var(--bad); }
.dot.live { background: var(--live); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dot.live { animation: none; } }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 9px; border-radius: 8px; background: var(--raised); border: 1px solid var(--line); color: var(--soft); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--raised); cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: #3A4150; text-decoration: none; }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn.amber { background: var(--needs); border-color: var(--needs); color: #1A1305; }
.btn.danger { background: transparent; border-color: var(--bad-line); color: var(--bad); }
.btn.quiet { background: transparent; }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.google { background: #fff; color: #1F1F1F; border-color: #DADCE0; min-height: 44px; padding: 0 18px; font-size: 15px; }

/* tables */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
td.r, th.r { text-align: right; }
td.num, th.num { text-align: right; font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover { background: var(--raised); }
td .clip { display: block; max-width: 42ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td .sub { display: block; color: var(--muted); font-size: 12px; }

/* key/value */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* forms */
.field { display: grid; gap: 6px; }
.field label, .label { font-weight: 600; font-size: 13px; }
.field .hint { color: var(--muted); font-size: 12.5px; }
input[type="text"], input[type="email"], input[type="search"], input[type="number"], input[type="url"], select, textarea {
  min-height: 36px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--ground); width: 100%;
}
textarea { min-height: 80px; resize: vertical; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 10px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar input[type="search"] { max-width: 280px; }
.toolbar select { width: auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button, .seg a { border: 0; background: transparent; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg [aria-pressed="true"], .seg [aria-current="page"] { background: var(--raised); color: var(--ink); }
.switch { width: 36px; height: 20px; border-radius: 99px; background: var(--line); position: relative; flex: none; border: 0; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--soft); transition: left .15s; }
.switch[aria-checked="true"] { background: var(--accent-strong); }
.switch[aria-checked="true"]::after { left: 18px; background: #fff; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.setting:last-child { border-bottom: 0; }
.setting .what { min-width: 0; }
.setting .what span { display: block; color: var(--muted); font-size: 12.5px; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 8px 12px; color: var(--muted); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--ink); }

/* banners */
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--accent-line); background: var(--accent-wash); color: var(--accent-ink); }
.banner.needs { border-color: var(--needs-line); background: var(--needs-wash); color: var(--needs-ink); }
.banner.bad { border-color: var(--bad-line); background: var(--bad-wash); color: var(--bad); }
.banner .grow { flex: 1; min-width: 200px; }

/* code */
pre, .code { margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; background: var(--ground); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; color: var(--soft); white-space: pre; }
.code-wrap { position: relative; }
.code-wrap .btn { position: absolute; top: 6px; right: 6px; }

/* browser thumbnails and frames: drawn, not screenshots */
.thumb { width: 72px; height: 45px; border-radius: 6px; border: 1px solid var(--line); background: var(--line-soft); overflow: hidden; flex: none; position: relative; }
.thumb::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 9px; background: var(--site, #3A4150); }
.thumb::after { content: ""; position: absolute; left: 8px; right: 20px; top: 16px; height: 4px; border-radius: 2px; background: #3A4150; box-shadow: 0 9px 0 #30353F, 0 18px 0 #30353F; }
.frame { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #F4F5F7; color: #1C1F24; }
.frame .chrome { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: #DEE1E6; color: #3C4043; font-size: 12px; }
.frame .chrome .lights { display: flex; gap: 5px; } .frame .chrome .lights i { width: 9px; height: 9px; border-radius: 50%; background: #B9BDC3; display: block; }
.frame .chrome .addr { flex: 1; background: #fff; border-radius: 99px; padding: 3px 12px; font-family: var(--mono); font-size: 11.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.frame .page { padding: 16px; display: grid; gap: 10px; min-height: 220px; }

/* steps timeline */
.steps { display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 28px 96px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.step .n { width: 24px; height: 24px; border-radius: 50%; background: var(--raised); border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--soft); }
.step .shot { width: 96px; height: 60px; }
.step .what strong { display: block; }
.step .what span { color: var(--muted); font-size: 13px; }

/* bar chart (divs, to scale: heights are percentages of the card's max) */
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; align-items: end; height: 120px; padding-top: 6px; }
.bars span { display: block; background: var(--accent-strong); border-radius: 3px 3px 0 0; min-height: 2px; }
.bars span.today { background: var(--accent); }
.axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11.5px; font-family: var(--mono); }

/* empty and onboarding */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.steps-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.steps-nav span { font-size: 12.5px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.steps-nav span.done { color: var(--ok-ink); border-color: var(--ok-line); }
.steps-nav span.now { color: var(--ink); border-color: var(--accent); }

/* spec callouts */
.spec { display: none; font-size: 12.5px; line-height: 1.45; color: var(--spec); background: var(--spec-wash); border: 1px dashed var(--spec); border-radius: 8px; padding: 8px 10px; }
.spec b { font-weight: 700; }
body.show-spec .spec { display: block; }
.spec-toggle { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 20; }
.spec-toggle .btn { border-color: var(--spec); color: var(--spec); background: var(--spec-wash); }
.mockup-tag { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 20; font-size: 11.5px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; }

/* responsive */
@media (max-width: 1080px) {
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
  .span-3 { grid-column: span 6; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); border-right: 0; border-bottom: 1px solid var(--line); gap: 2px; }
  .nav .group, .nav .foot { display: none; }
  .brand { padding: 4px 8px; width: 100%; }
  .nav a.link { padding: 6px 8px; font-size: 13px; }
  main { padding: 18px max(16px, env(safe-area-inset-left, 0px)) 72px; padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .span-3 { grid-column: span 12; }
  .step { grid-template-columns: 24px minmax(0, 1fr); }
  .step .shot, .step .side { grid-column: 2; }
  .mockup-tag { display: none; }
}
