/* Noise — design system. Black and white (or white on black), strong type, soft structure:
   rounded controls, light lines and tinted surfaces instead of boxes and heavy rules. The logo's
   red marks the slash, focus and live state; its blue, green and yellow stay small signals. */

@font-face { font-family: "Noise Display"; src: url("../fonts/Archivo-Display.woff2") format("woff2"); font-weight: 500 800; font-stretch: 100% 125%; font-display: swap; }
@font-face { font-family: "Noise Sans"; src: url("../fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Noise Mono"; src: url("../fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

/* ---- Themes ------------------------------------------------------------------------------- */
:root {
  --ink: #0a0a0a;
  --ink-2: #3d3d3d;
  --muted: #6b6b6b;
  --faint: #a3a3a3;
  --line: #e7e7e5;
  --line-strong: #0a0a0a;
  --field: #cfcfcd;
  --paper: #ffffff;
  --raised: #ffffff;
  --wash: #f4f4f2;
  /* The logo's red is the accent. Blue, green and yellow are its companions: small signals only
     (a dot, a tab, a pulse), never large fills, so black and white stay in charge. */
  --accent: #cd2826;
  --blue: #1f45f5;
  --green: #1fbf3f;
  --yellow: #f9cc14;
  --good: #0a7d32;
  --bad: #c2240c;
  --shadow: 0 18px 50px rgba(0, 0, 0, .14);
  --soft: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f2f2f0; --ink-2: #cfcfcc; --muted: #9a9a96; --faint: #63635f; --line: #262625; --line-strong: #f2f2f0; --field: #3a3a38;
    --paper: #0c0c0c; --raised: #141413; --wash: #191918; --good: #4cc27a; --bad: #ff6b5a; --shadow: 0 18px 50px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #f2f2f0; --ink-2: #cfcfcc; --muted: #9a9a96; --faint: #63635f; --line: #262625; --line-strong: #f2f2f0; --field: #3a3a38;
  --paper: #0c0c0c; --raised: #141413; --wash: #191918; --good: #4cc27a; --bad: #ff6b5a; --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
:root {
  --display: "Noise Display", "Archivo", "Helvetica Neue", Arial, sans-serif;
  --sans: "Noise Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Noise Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --nav-w: 224px;
  --agent-w: 420px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  /* Corners: controls are pills, fields and tiles are rounded, surfaces rounder still. */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --pill: 999px;
}

/* The logo is inline SVG: its letters take the text colour, the dot stays red, and on hover three
   letters fill with colour from inside while the dot hops. */
.noise-logo { display: block; height: 100%; width: auto; color: var(--ink); overflow: visible; }
.noise-logo .sp { stroke-dasharray: 1 2; stroke-dashoffset: 1; opacity: 0; transition: stroke-dashoffset .4s cubic-bezier(.4, 0, .6, 1), opacity .1s linear .35s; }
.noise-logo .dot { transform-box: fill-box; transform-origin: center bottom; transition: transform .55s cubic-bezier(.3, 1.7, .5, 1); }
:is(a, span):hover > .noise-logo .sp, a:focus-visible > .noise-logo .sp { stroke-dashoffset: 0; opacity: 1; transition: stroke-dashoffset .65s cubic-bezier(.3, .8, .2, 1), opacity .05s linear; }
:is(a, span):hover > .noise-logo .sp2, a:focus-visible > .noise-logo .sp2 { transition-delay: 80ms; }
:is(a, span):hover > .noise-logo .sp3, a:focus-visible > .noise-logo .sp3 { transition-delay: 160ms; }
:is(a, span):hover > .noise-logo .dot, a:focus-visible > .noise-logo .dot { transform: translateY(-18%); }
@media (prefers-reduced-motion: reduce) {
  .noise-logo .sp { stroke-dashoffset: 0; transition: opacity .3s; }
  :is(a, span):hover > .noise-logo .sp, a:focus-visible > .noise-logo .sp { transition: opacity .3s; }
  :is(a, span):hover > .noise-logo .dot, a:focus-visible > .noise-logo .dot { transform: none; }
}

/* The logo has a version for each background. */
.on-dark { display: none !important; }
:root[data-theme="dark"] .on-light { display: none !important; }
:root[data-theme="dark"] .on-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .on-light { display: none !important; }
  :root:not([data-theme="light"]) .on-dark { display: block !important; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--ink); color: var(--paper); }
[hidden] { display: none !important; }
kbd { font: 500 11px/1 var(--mono); border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px; color: var(--muted); background: var(--paper); }

/* ---- Shell -------------------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100vh; }
.shell.with-agent { grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--agent-w); }
.nav { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px 12px 14px; gap: 14px; }
.nav .logo { display: block; padding: 2px 8px 6px; }
.nav .logo { height: 32px; padding: 4px 8px 6px; }
.switcher { width: 100%; border: 1px solid var(--line); background: var(--paper); padding: 8px 10px; font-weight: 600; border-radius: var(--r-sm); cursor: pointer; }
.command { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border: 1px solid transparent; background: var(--wash); color: var(--muted); padding: 8px 8px 8px 11px; cursor: text; text-align: left; border-radius: var(--r-sm); }
.command:hover { border-color: var(--line); color: var(--ink); }
.command .slash { color: var(--accent); font: 800 15px/1 var(--display); margin-right: 6px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.nav ul { gap: 2px; }
.nav a.item { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; text-decoration: none; color: var(--ink-2); font-weight: 500; border-radius: var(--r-sm); }
.nav a.item:hover { background: var(--wash); color: var(--ink); }
.nav a.item[aria-current="page"] { color: var(--ink); background: var(--wash); font-weight: 600; }
.nav .badge { font: 600 11px/1 var(--sans); background: var(--accent); color: #fff; padding: 3px 7px; border-radius: var(--pill); }
.nav .rule { border-top: 1px solid var(--line); margin: 2px 8px; }
/* Desktop: the top bar and body are just the nav's own children; the phone controls are hidden. */
.nav-top, .nav-body { display: contents; }
.nav-ask, .nav-menu { display: none; }
.nav .account { margin-top: auto; }
.account summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; border: 1px solid transparent; border-radius: var(--r-sm); }
.account summary::-webkit-details-marker { display: none; }
.account summary:hover, .account[open] summary { border-color: var(--line); }
.account summary b { display: block; font-weight: 600; }
.account summary span { display: block; color: var(--muted); font-size: 12px; }
.account .menu { border: 1px solid var(--line); border-radius: var(--r); margin-top: 6px; padding: 12px 10px; display: grid; gap: 10px; }
.account .menu label, .account .menu .menu-field { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.account .menu select { border: 1px solid var(--line); background: var(--paper); padding: 5px 8px; border-radius: var(--r-sm); }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; background: var(--wash); border-radius: var(--pill); }
.segmented button { border: 0; background: none; padding: 5px 0; font-size: 12px; cursor: pointer; color: var(--muted); border-radius: var(--pill); }
.segmented button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--soft); font-weight: 600; }
/* Whether the tracking script has been seen on the customer's site. */
.seen { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; }
.seen .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.seen .dot.on { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent); }
/* A project's web address in Settings. */
.address { display: grid; gap: 4px; margin-top: 16px; padding: 14px 16px; background: var(--wash); border-radius: var(--r); }
.address-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.address-row b { overflow-wrap: anywhere; }
/* The dashboard's period and its sources. */
.period-pick { display: grid; gap: 8px; justify-items: end; }
.segmented.period { display: inline-flex; grid-template-columns: none; }
.segmented.period button { padding: 6px 14px; font-size: 13px; }
.period-pick .range { display: flex; align-items: center; gap: 8px; }
.sources { margin-top: 8px; display: grid; gap: 14px; }
.sources-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.sources-head h2 { margin: 34px 0 0; }
.sources .filters { display: flex; gap: 8px; flex-wrap: wrap; }
.sources table.data { margin-top: 2px; }

main.view { min-width: 0; padding: 26px 40px 80px; max-width: 1320px; }
main.view[aria-busy="true"] { opacity: .55; transition: opacity .2s .15s; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 6px; margin-bottom: 26px; }
.page-head h1 { font: 700 32px/1.05 var(--display); font-stretch: 112%; letter-spacing: -.02em; margin: 0; }
.page-head p { margin: 7px 0 0; color: var(--muted); max-width: 64ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
h2 { font: 700 18px/1.2 var(--display); font-stretch: 108%; letter-spacing: -.01em; margin: 34px 0 12px; }
h3 { font: 600 15px/1.3 var(--sans); margin: 0 0 6px; }

/* Sections inside a tabbed page: the tab names the section, so its own title is hidden. */
.section-tabs { display: inline-flex; gap: 2px; padding: 4px; background: var(--wash); border-radius: var(--pill); margin: -10px 0 24px; overflow-x: auto; max-width: 100%; }
.section-tabs a { padding: 7px 15px; text-decoration: none; font-weight: 600; color: var(--muted); white-space: nowrap; border-radius: var(--pill); }
.section-tabs a:hover { color: var(--ink); }
.section-tabs a[aria-current="page"] { color: var(--ink); background: var(--paper); box-shadow: var(--soft); }
.embedded > .page-head { border-bottom: 0; padding: 0; margin-bottom: 18px; align-items: center; }
.embedded > .page-head h1 { display: none; }
.embedded > .page-head p { margin: 0; }

/* ---- Controls ----------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); padding: 8px 16px; font-weight: 600; cursor: pointer; text-decoration: none; border-radius: var(--pill); white-space: nowrap; transition: background .15s, opacity .15s, transform .15s var(--ease); }
.btn:hover { opacity: .86; }
.btn:active { transform: scale(.98); }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--field); }
.btn.secondary:hover { background: var(--wash); opacity: 1; }
.btn.ghost { background: transparent; color: var(--ink); border-color: transparent; padding-inline: 6px; }
.btn.ghost:hover { background: var(--wash); opacity: 1; }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.slash { color: var(--accent); font-family: var(--display); font-weight: 800; }
select.inline, input.inline { border: 1px solid var(--field); background: var(--paper); padding: 7px 10px; border-radius: var(--r-sm); }

.field { display: grid; gap: 5px; }
.field > span { font-weight: 600; font-size: 13px; }
.field small { color: var(--muted); font-size: 12px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--field); background: var(--paper); padding: 9px 12px; border-radius: var(--r-sm); transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 10%, transparent); }
.field.bad input, .field.bad select, .field.bad textarea { border-color: var(--bad); }
.field .problem { color: var(--bad); font-size: 12px; font-weight: 500; }
.form { display: grid; gap: 16px; max-width: 640px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
.form .buttons { display: flex; gap: 8px; padding-top: 6px; }
.check { display: flex; gap: 8px; align-items: center; }
.refs { border-color: var(--field) !important; }

/* Tiles: a choice shown as a grid of icons instead of a dropdown. */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); grid-auto-rows: max-content; gap: 8px; max-height: 380px; overflow-y: auto; padding: 2px; }
.tiles.compact { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 6px; }
.tile { display: grid; gap: 8px; align-content: start; justify-items: start; text-align: left; border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 12px 13px 13px; cursor: pointer; min-height: 88px; font: inherit; border-radius: var(--r); transition: border-color .15s, background .15s; }
.tile .icon { flex: none; }
.tile .t { font-weight: 600; font-size: 13px; line-height: 1.25; }
.tile .h { font-size: 12px; color: var(--muted); line-height: 1.35; }
.tile:hover { border-color: var(--faint); }
.tile[aria-checked="true"], .tile[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tile[aria-checked="true"] .h, .tile[aria-pressed="true"] .h { color: inherit; opacity: .72; }
.tiles.compact .tile { min-height: 40px; padding: 9px 10px; grid-template-columns: 18px 1fr; align-items: center; gap: 9px; }
.tiles.compact .tile .t { font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; max-width: 100%; }
.tiles-group { grid-column: 1 / -1; font: 600 12px/1 var(--sans); color: var(--muted); padding: 10px 0 2px; }
.tiles-group:first-child { padding-top: 0; }
.tiles > p.muted { grid-column: 1 / -1; margin: 4px 0; }
#autonomy { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; }
.tiles-note { grid-column: 1 / -1; margin: 2px 0 0; min-height: 1.4em; color: var(--muted); font-size: 12px; }
.tile .aa { font-size: 22px; line-height: 1; font-weight: 600; }
/* A row of icon chips for filters. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .tile { min-height: 0; padding: 7px 14px 7px 11px; grid-template-columns: 18px auto; align-items: center; gap: 8px; border-radius: var(--pill); }
.chips .tile .t { font-weight: 500; }
.toolbar { display: flex; gap: 18px; flex-wrap: wrap; align-items: end; margin-bottom: 18px; }
.toolbar .range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .range input { width: auto; }
.toolbar .field > span { font: 600 12px/1 var(--sans); color: var(--muted); }

/* ---- Data --------------------------------------------------------------------------------- */
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font: 500 12px/1 var(--sans); color: var(--muted); padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr.link { cursor: pointer; }
table.data tr.link:hover td { background: var(--wash); }
table.data tr.link:hover td:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
table.data tr.link:hover td:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
table.data tr.link td:first-child { padding-left: 8px; }
table.data tr.link td:last-child { padding-right: 8px; }
table.data:has(tr.link) th:first-child { padding-left: 8px; }
table.data:has(tr.link) th:last-child { padding-right: 8px; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.metric { padding: 16px 18px 18px 0; border-bottom: 1px solid var(--line); }
.metric + .metric { padding-left: 18px; border-left: 1px solid var(--line); }
.metrics.grid2 { grid-template-columns: 1fr 1fr; }
.metrics.grid2 .metric { padding: 18px 18px 20px; border-left: 0; }
.metrics.grid2 .metric:nth-child(odd) { padding-left: 0; border-right: 1px solid var(--line); }
.metric .label { font: 500 13px/1.2 var(--sans); color: var(--muted); }
.metric .value { font: 700 38px/1.05 var(--display); font-stretch: 112%; letter-spacing: -.03em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.metric .note { color: var(--muted); font-size: 12px; margin-top: 4px; }
.faint { color: var(--faint); }
.absent { font: 600 12.5px/1.2 var(--sans); color: var(--muted); background: var(--wash); padding: 4px 10px; border-radius: var(--pill); display: inline-block; cursor: help; }
.metric .absent { margin-top: 16px; }
table.data .absent { font: inherit; color: var(--faint); background: none; padding: 0; }

.pill { display: inline-block; font: 600 12px/1 var(--sans); padding: 5px 10px; border-radius: var(--pill); background: var(--wash); color: var(--ink); white-space: nowrap; }
.pill.live { background: var(--ink); color: var(--paper); }
.pill.live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; animation: pulse 2s ease-in-out infinite; }
.pill.quiet { color: var(--muted); }
.pill.good { background: color-mix(in srgb, var(--good) 12%, var(--paper)); color: var(--good); }
.pill.bad { background: color-mix(in srgb, var(--bad) 10%, var(--paper)); color: var(--bad); }
@keyframes pulse { 50% { opacity: .35; } }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 36px; }
.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.box { border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.box.strong { border-color: var(--field); box-shadow: var(--soft); }
.empty { background: var(--wash); border-radius: var(--r-lg); padding: 32px; display: grid; gap: 10px; justify-items: start; }
.empty h3 { font: 700 18px/1.2 var(--display); font-stretch: 108%; }
.empty p { margin: 0; color: var(--muted); max-width: 56ch; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--wash); font: 600 12px/1 var(--sans); color: var(--muted); }
.steps li.done::before { content: "✓"; background: var(--ink); color: var(--paper); }
.steps li.done > span:not(.muted) { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.bar { height: 6px; background: var(--wash); position: relative; border-radius: var(--pill); overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--ink); border-radius: var(--pill); }
.chart { width: 100%; height: 170px; display: block; color: var(--ink); }
.qr { width: 180px; height: 180px; border: 1px solid var(--line); border-radius: var(--r); padding: 10px; background: #fff; }
.qr svg { width: 100%; height: 100%; display: block; }
.copy { display: flex; gap: 8px; align-items: center; }
.copy code { font: 12.5px var(--mono); background: var(--wash); padding: 8px 10px; border-radius: var(--r-sm); overflow-wrap: anywhere; flex: 1; }
.notice { padding: 12px 16px; background: var(--wash); border-radius: var(--r); }
.notice.warn { background: color-mix(in srgb, var(--accent) 9%, var(--paper)); }

/* ---- Overview hero and the globe ---------------------------------------------------------- */
.hero { display: grid; grid-template-columns: minmax(260px, 440px) minmax(0, 1fr); gap: 40px; align-items: center; margin-bottom: 8px; }
.globe { position: relative; width: 100%; aspect-ratio: 1 / 1; }
.globe canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.globe canvas:active { cursor: grabbing; }
.globe-tip { position: absolute; background: var(--raised); color: var(--ink); padding: 6px 10px; font-size: 12px; pointer-events: none; border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--soft); white-space: nowrap; z-index: 2; }
.globe-note { color: var(--muted); font-size: 12px; margin: 6px 0 0; max-width: 46ch; }

/* ---- Overlays ----------------------------------------------------------------------------- */
dialog.sheet { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0; width: min(720px, 94vw); max-height: 90vh; box-shadow: var(--shadow); background: var(--paper); color: var(--ink); overflow: hidden; }
dialog.sheet::backdrop { background: rgba(10, 10, 10, .32); backdrop-filter: blur(2px); }
dialog.sheet header { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); z-index: 1; }
dialog.sheet header h2 { margin: 0; }
/* A long sheet scrolls inside itself, so its buttons can always be reached. */
dialog.sheet[open] { display: flex; flex-direction: column; }
dialog.sheet .body { padding: 22px; overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; }
.toast { background: var(--ink); color: var(--paper); padding: 10px 18px; font-weight: 500; box-shadow: var(--shadow); border-radius: var(--pill); animation: rise .2s var(--ease); }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---- Agent panel -------------------------------------------------------------------------- */
.agent-panel { position: sticky; top: 0; height: 100vh; border-left: 1px solid var(--line); display: grid; grid-template-rows: auto 1fr auto; background: var(--paper); }
.agent-panel header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.agent-panel header h2 { margin: 0; font-size: 17px; }
.agent-panel .log { overflow-y: auto; padding: 18px; display: grid; gap: 14px; align-content: start; }
.agent-panel .msg { max-width: 100%; }
.agent-panel .msg.person { justify-self: end; background: var(--ink); color: var(--paper); padding: 9px 13px; max-width: 88%; white-space: pre-wrap; border-radius: 16px 16px 4px 16px; }
.agent-panel .msg.agent { white-space: pre-wrap; line-height: 1.55; }
.agent-panel .msg.action { font: 500 12.5px/1.35 var(--sans); color: var(--muted); }
.agent-panel .msg.action b { color: var(--ink); font-weight: 600; }
.agent-panel .msg.action a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.agent-panel .msg.action.bad b { color: var(--accent); }
.agent-panel .msg.approval { padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--yellow) 55%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--yellow) 10%, var(--raised)); font-size: 13px; line-height: 1.4; }
.agent-panel .msg.approval a { color: inherit; }
.agent-panel .msg.status { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.agent-panel form { border-top: 1px solid var(--line); padding: 14px 18px 18px; display: grid; gap: 8px; }
.agent-panel textarea { width: 100%; min-height: 70px; border: 1px solid var(--field); border-radius: var(--r); background: var(--paper); padding: 11px 13px; resize: vertical; }
.agent-panel textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 10%, transparent); }
.agent-panel .hint { font-size: 12px; color: var(--muted); }
.thinking { display: inline-flex; gap: 4px; }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); animation: blink 1s infinite; }
.thinking i:nth-child(2) { animation-delay: .15s; } .thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .2; } }

/* ---- Funnel editor ------------------------------------------------------------------------ */
.editor { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; align-items: start; }
.ask-page { display: grid; gap: 10px; margin-bottom: 8px; }
.ask-page .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-page { padding: 16px; background: var(--wash); border-radius: var(--r-lg); }
.ask-page .field > span { font: 700 16px/1.2 var(--display); font-stretch: 108%; }
.ask-page .chips .tile { min-height: 0; padding: 6px 12px; display: inline-flex; font-size: 13px; border-radius: var(--pill); border-color: transparent; }
.ask-page .chips .tile:hover { border-color: var(--field); }
.ask-page .btn { justify-self: start; }
.frame .page-tabs { display: flex; gap: 2px; }
.frame .page-tabs { padding: 3px; background: var(--wash); border-radius: var(--pill); }
.frame .page-tabs button { border: 0; background: none; padding: 4px 12px; font: 600 12px var(--sans); color: var(--muted); cursor: pointer; border-radius: var(--pill); }
.frame .page-tabs button[aria-selected="true"] { color: var(--ink); background: var(--paper); box-shadow: var(--soft); }
.editor .parts { border-top: 1px solid var(--line-strong); }
.editor .part { display: grid; grid-template-columns: 1fr auto; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.editor .part:hover { background: var(--wash); }
.editor .part[aria-selected="true"] { box-shadow: inset 2px 0 0 var(--accent); padding-left: 10px; }
.editor .part b { font: 500 11px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.editor .part span { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: #fff; position: sticky; top: 16px; box-shadow: var(--soft); }
.frame .bar-top { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); font: 12px var(--mono); color: var(--muted); gap: 10px; background: var(--paper); }
.frame .bar-top > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame iframe { width: 100%; height: 72vh; border: 0; display: block; background: #fff; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tabs button { background: none; border: 0; padding: 8px 12px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---- Sign-in ------------------------------------------------------------------------------ */
.gate { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.gate .brand { background: #0a0a0a; color: #f2f2f0; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.gate .brand .site-logo { height: 40px; align-self: flex-start; display: block; }
.gate .brand .noise-logo { color: inherit; }
.gate .brand h1 { font: 700 clamp(40px, 5.2vw, 76px)/0.98 var(--display); font-stretch: 118%; letter-spacing: -.035em; margin: 0; max-width: 12ch; }
.gate .brand p { color: #a8a8a4; max-width: 42ch; margin: 18px 0 0; }
.gate .panel { padding: 48px; display: grid; align-content: center; justify-items: start; gap: 18px; max-width: 520px; }
.gate .panel h2 { margin: 0; font-size: 28px; }
.gate .panel .form { width: 100%; }
.codes { display: grid; grid-template-columns: repeat(2, auto); gap: 6px 24px; font: 15px var(--mono); padding: 18px; border-radius: var(--r); background: var(--wash); }

@media (max-width: 1100px) {
  .shell.with-agent { grid-template-columns: var(--nav-w) minmax(0, 1fr); }
  .agent-panel { position: fixed; right: 0; top: 0; width: min(var(--agent-w), 100vw); z-index: 30; box-shadow: var(--shadow); }
  .split, .editor { grid-template-columns: 1fr; }
  .editor .frame { order: -1; position: static; }
  .frame iframe { height: 60vh; }
  .hero { grid-template-columns: 1fr; }
  .hero .globe { max-width: 440px; justify-self: center; }
}
@media (max-width: 760px) {
  .shell, .shell.with-agent { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .nav { position: sticky; top: 0; z-index: 25; height: auto; overflow: visible; background: var(--paper); border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 16px; gap: 0; }
  .nav-top { display: flex; align-items: center; gap: 8px; }
  .nav-top .logo { margin-right: auto; height: 30px; padding: 3px 0; }
  .nav-ask, .nav-menu { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 6px 13px; font-weight: 500; cursor: pointer; border-radius: var(--pill); }
  .nav-ask .slash { color: var(--accent); font: 800 14px/1 var(--display); }
  .nav-menu[aria-expanded="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
  .nav-body { display: none; }
  .nav.open .nav-body { display: flex; flex-direction: column; gap: 12px; padding: 14px 0 6px; max-height: calc(100vh - 56px); overflow-y: auto; }
  .nav.open .nav-body .command { display: none; }
  .nav .account { margin-top: 0; }
  .embedded > .page-head { align-items: flex-start; }
  table.data td.mono, table.data td a { overflow-wrap: anywhere; }
  table.data .absent { white-space: nowrap; }
  table.data .opt { display: none; }
  main.view { padding: 20px 18px 80px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .period-pick { justify-items: start; }
  .page-head h1 { font-size: 28px; }
  .gate { grid-template-columns: 1fr; }
  .gate .brand { min-height: 42vh; }
  .form .row, .form .row3 { grid-template-columns: 1fr; }
  .metrics.grid2 { grid-template-columns: 1fr; }
  .metrics.grid2 .metric:nth-child(odd) { border-right: 0; padding-right: 0; }
  .metrics.grid2 .metric { padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* "What do you want more of?": the way in, handing the person's words to the agent (D48). */
.describe { display: grid; gap: 10px; margin: 0 0 28px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--raised); box-shadow: 0 20px 40px -34px rgba(0, 0, 0, .35); }
.describe h2 { margin: 0; }
.describe p { margin: 0; max-width: 70ch; }
.describe textarea { width: 100%; min-height: 84px; resize: vertical; font: inherit; }
