/* Cuttl dashboard — design system. Same family as the marketing site (site/DESIGN.md, site/tokens.css):
   the interface is nearly monochrome (ink text, charcoal pill buttons, white surfaces) and all colour lives in pastel
   tints and the 3D clay characters, one per product area (SECTION_ART in app.js). Status colours carry meaning only.
   General Sans for headings and big numbers, Geist for UI, soft 20px cards with no shadows, no decorative motion. */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f2f5f9;
  --surface-3: #e7ecf2;
  --sidebar: #fafdff;
  --border: #e8ecf1;
  --border-strong: #d8dee6;
  --text: #0a0d12;
  --text-2: #535862;
  --text-3: #8d929b;
  --brand-fg: #ffffff;
  --accent: #181d27;
  --accent-soft: color-mix(in srgb, var(--accent) 7%, transparent);
  --charcoal: #181d27;
  --charcoal-hover: #262c39;
  --sky: #ebf5ff;
  --chart: #2a303c;
  --chart-2: #c9d3df;
  --ok: #157a4a;
  --warn: #a45e05;
  --danger: #c93333;
  --info: #2f6fd6;
  --ok-soft: color-mix(in srgb, var(--ok) 9%, transparent);
  --warn-soft: color-mix(in srgb, var(--warn) 9%, transparent);
  --danger-soft: color-mix(in srgb, var(--danger) 8%, transparent);
  --info-soft: color-mix(in srgb, var(--info) 8%, transparent);
  /* pastels from the site: icon discs and empty-state tiles only */
  --powder: #cce7ff; --lavender: #f1e6ff; --mint: #d3f6e3; --solar: #fff2be; --peach: #ffd1b8;
  --focus: color-mix(in srgb, var(--accent) 40%, transparent);
  --stage: #edf2f8;
  --shadow: none;
  --shadow-pop: 0 0 0 1px rgba(10, 13, 18, .06), 0 14px 32px -6px rgba(4, 69, 144, .16);
  --shadow-pill: inset 0 4px 2px rgba(255, 255, 255, .14), 0 1px 2px rgba(10, 13, 18, .45);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 5px;
  --pill: 8px;
  --font: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "General Sans", Geist, ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #0e0e0f; --surface-2: #161617; --surface-3: #1f1f21; --sidebar: #070708; --border: #1f1f21; --border-strong: #2c2c2e;
    --text: #ededed; --text-2: #a3a3a6; --text-3: #707073; --brand-fg: #0e0e0f; --accent: #ededed; --charcoal: #ededed; --charcoal-hover: #ffffff; --sky: #18181a;
    --chart: #cfcfd2; --chart-2: #2c2c2e; --ok: #4cb97a; --warn: #d99a3a; --danger: #ec6a6a; --info: #6aaeff; --stage: #000000;
    --powder: #1a2f47; --lavender: #2a2140; --mint: #15342a; --solar: #3a3216; --peach: #3d261b;
    --shadow-pop: 0 0 0 1px #2c2c2e, 0 16px 40px -8px rgba(0, 0, 0, .6); --shadow-pill: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #0e0e0f; --surface-2: #161617; --surface-3: #1f1f21; --sidebar: #070708; --border: #1f1f21; --border-strong: #2c2c2e;
  --text: #ededed; --text-2: #a3a3a6; --text-3: #707073; --brand-fg: #0e0e0f; --accent: #ededed; --charcoal: #ededed; --charcoal-hover: #ffffff; --sky: #18181a;
  --chart: #cfcfd2; --chart-2: #2c2c2e; --ok: #4cb97a; --warn: #d99a3a; --danger: #ec6a6a; --info: #6aaeff; --stage: #000000;
  --powder: #1a2f47; --lavender: #2a2140; --mint: #15342a; --solar: #3a3216; --peach: #3d261b;
  --shadow-pop: 0 0 0 1px #2c2c2e, 0 16px 40px -8px rgba(0, 0, 0, .6); --shadow-pill: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "ss01", "cv11"; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
h1 { font: 600 26px/1.2 var(--display); letter-spacing: -0.02em; }
h2 { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 13.5px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; }
svg.i { flex: none; vertical-align: -0.17em; }
[hidden] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 20px; background: color-mix(in srgb, var(--surface) 94%, transparent); border-bottom: 1px solid var(--border); backdrop-filter: saturate(1.4) blur(8px); }
.brand { display: flex; align-items: center; gap: 6px; text-decoration: none; font: 500 18px/1 var(--display); letter-spacing: -0.02em; color: var(--text); }
.brand-mark { display: inline-flex; color: var(--text); }
.crumbs { display: flex; gap: 6px; align-items: center; color: var(--text-3); min-width: 0; font-size: 13px; margin-left: 4px; }
.crumbs a { text-decoration: none; color: var(--text-2); }
.crumbs a:hover { color: var(--text); }
.crumbs > span:last-child { color: var(--text); font-weight: 500; }
.crumbs .sep { color: var(--border-strong); }

.app { max-width: 1440px; margin: 0 auto; padding: 24px 32px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; font-size: 13.5px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--pill); border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; text-decoration: none; font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--text); transition: background-color .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg.i { color: var(--text-2); }
.btn.primary { background: var(--charcoal); color: var(--brand-fg); border-color: var(--charcoal); font-weight: 600; box-shadow: var(--shadow-pill); }
.btn.primary svg.i { color: inherit; }
.btn.primary:hover { background: var(--charcoal-hover); border-color: var(--charcoal-hover); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-solid:hover { background: color-mix(in srgb, var(--danger) 88%, #000); }
.btn.icon { width: 34px; padding: 0; justify-content: center; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn.icon.sm { width: 30px; padding: 0; }
.input, select.input { height: 34px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); min-width: 0; font-size: 13px; transition: border-color .12s; }
.input:hover { border-color: color-mix(in srgb, var(--text) 25%, var(--border-strong)); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { padding-right: 28px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8b94' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.input::placeholder { color: var(--text-3); }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: var(--pill); gap: 2px; border: 1px solid var(--border); }
.seg button { border: 0; background: none; height: 26px; padding: 0 12px; border-radius: 6px; cursor: pointer; color: var(--text-2); font-weight: 500; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(0, 0, 0, .05); }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); cursor: pointer; user-select: none; font-size: 13px; }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--accent); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); gap: 12px; min-height: 52px; }
.card-head h2 { font-size: 14px; }
.card-head .faint { font-size: 12px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--text-2); font-weight: 500; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-color: var(--accent); }

/* ---------- sites ---------- */
.sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.site-card { display: block; padding: 16px 18px; text-decoration: none; transition: border-color .12s; }
.site-card:hover { border-color: var(--border-strong); background: color-mix(in srgb, var(--surface-2) 40%, var(--surface)); }
.site-card h2 { font-size: 14.5px; }
.site-card .faint { font-size: 13px; }
.site-card .meta { display: flex; gap: 16px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 12.5px; flex-wrap: wrap; }
.site-card .meta b { color: var(--text); font-weight: 500; }
.new-site { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; margin-bottom: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.stats > .card { border: 0; border-radius: 0; box-shadow: none; border-right: 1px solid var(--border); margin-right: -1px; border-bottom: 1px solid var(--border); margin-bottom: -1px; }
.stat { padding: 18px 20px; }
.stat .label { color: var(--text-2); font-size: 12.5px; }
.stat .value { font: 600 28px/1.15 var(--display); margin-top: 6px; letter-spacing: -0.02em; }
.stat .sub { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.stat .value.sm { font-size: 16px; margin-top: 8px; }
.overview-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-bottom: 12px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 168px; padding: 20px 16px 12px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar i { display: block; width: 100%; max-width: 40px; background: var(--chart); border-radius: 6px 6px 2px 2px; min-height: 2px; opacity: .9; transition: opacity .12s, background-color .12s; }
.bar:hover i { background: var(--accent); opacity: 1; }
.bar span { font-size: 11px; color: var(--text-3); }
.bar b { font-size: 11.5px; font-weight: 500; color: var(--text-2); }
.split { padding: 12px 16px 16px; display: grid; gap: 8px; }
.split-row { display: grid; grid-template-columns: 76px 1fr 40px; align-items: center; gap: 10px; font-size: 13px; color: var(--text); }
.meter { height: 6px; background: var(--surface-2); border-radius: var(--pill); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--chart-2); border-radius: var(--pill); }
.split-row:hover .meter i { background: var(--chart); }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 12px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.link { cursor: pointer; }
.table tbody tr.link:hover td { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.table .r { text-align: right; }
.table th:first-child, .table td:first-child { padding-left: 16px; }
.table th:last-child, .table td:last-child { padding-right: 16px; }
.table-wrap { overflow-x: auto; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: var(--pill); font-size: 11.5px; font-weight: 500; background: var(--surface-2); color: var(--text-2); white-space: nowrap; border: 1px solid var(--border); }
.badge svg.i { color: var(--text-3); }
.badge.rage::before, .badge.err::before, .badge.dead::before, .badge.conv::before, .badge.sig::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.rage::before { background: var(--danger); }
.badge.err::before { background: var(--warn); }
.badge.dead::before { background: var(--text-3); }
.badge.conv::before { background: var(--ok); }
.badge.sig::before { background: var(--info); }
.dev { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.dev svg.i { color: var(--text-3); }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; color: var(--text-3); font-size: 12.5px; border-top: 1px solid var(--border); }
.empty { padding: 56px 24px; text-align: center; color: var(--text-2); }
.empty h2 { color: var(--text); margin-bottom: 6px; font: 600 20px/1.3 var(--display); letter-spacing: -0.01em; }
.empty p { max-width: 460px; margin: 0 auto 16px; font-size: 13.5px; }
.empty-ic { display: flex; justify-content: center; margin-bottom: 14px; }
.empty-ic svg { width: 48px; height: 48px; }

/* ---------- player ---------- */
.player-layout { display: grid; grid-template-columns: 1fr 340px; gap: 12px; align-items: start; }
.stage { position: relative; background: var(--stage); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; display: grid; place-items: center; height: min(68vh, 720px); background-image: radial-gradient(circle, color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1px); background-size: 16px 16px; }
.stage .replayer-wrapper { position: absolute; top: 0; left: 0; transform-origin: 0 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .12); background: #fff; }
.stage .replayer-wrapper iframe { border: 0; display: block; }
.stage-msg { color: var(--text-2); font-size: 13px; }
.controls { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.timeline { position: relative; flex: 1; min-width: 200px; height: 28px; cursor: pointer; }
.timeline .track { position: absolute; left: 0; right: 0; top: 12px; height: 4px; background: var(--surface-3); border-radius: 2px; }
.timeline .fill { position: absolute; left: 0; top: 12px; height: 4px; background: var(--accent); border-radius: 2px; }
.timeline .knob { position: absolute; top: 7px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.timeline .mark { position: absolute; top: 4px; width: 2px; height: 6px; margin-left: -1px; background: var(--text-3); border-radius: 1px; }
.timeline .mark.page { top: 4px; height: 20px; width: 1px; background: var(--text-3); opacity: .5; }
.timeline .mark.rage { background: var(--danger); height: 8px; }
.time { font-family: var(--mono); font-size: 12px; color: var(--text-2); white-space: nowrap; }
.player-main { position: sticky; top: 60px; }
.side { display: grid; gap: 12px; }
.controls .speed { min-width: 40px; justify-content: center; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; padding: 14px 16px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.journey { list-style: none; margin: 0; padding: 4px 0; max-height: 420px; overflow: auto; position: relative; }
.journey li button { width: 100%; text-align: left; display: grid; grid-template-columns: 44px 18px 1fr; gap: 8px; align-items: start; padding: 7px 16px; border: 0; background: none; cursor: pointer; }
.journey li button:hover { background: var(--surface-2); }
.journey li.active button { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--accent); }
.journey .t { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); padding-top: 2px; }
.journey .ic { display: inline-flex; justify-content: center; padding-top: 2px; color: var(--text-3); }
.journey .d { overflow-wrap: anywhere; font-size: 13px; }
.ic.k-rage, .ic.k-error, .ic.k-console, .ic.k-network, .kind-ic.k-rage, .kind-ic.k-js_error, .kind-ic.k-error_click, .kind-ic.k-network { color: var(--danger); }
.ic.k-conversion { color: var(--ok); }
.ic.k-page { color: var(--text-2); }
.kind-ic { display: inline-flex; vertical-align: -2px; margin-right: 8px; color: var(--text-3); }

/* ---------- heatmaps ---------- */
.hm-layout { display: grid; grid-template-columns: 248px 1fr 272px; gap: 12px; align-items: start; }
.page-list { list-style: none; margin: 0; padding: 4px; max-height: calc(100vh - 260px); overflow: auto; }
.page-list button { width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; cursor: pointer; display: grid; gap: 1px; border-radius: var(--radius-sm); }
.page-list button:hover { background: var(--surface-2); }
.page-list button[aria-current="true"] { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.page-list .p { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.page-list .s { font-size: 11.5px; color: var(--text-3); }
.hm-toolbar { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.hm-stage { position: relative; background: var(--stage); height: max(460px, calc(100vh - 270px)); overflow: hidden; border-radius: 0 0 var(--radius) var(--radius); background-image: radial-gradient(circle, color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1px); background-size: 16px 16px; }
.hm-stage .replayer-wrapper { position: absolute; top: 0; transform-origin: 0 0; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .12); }
.hm-stage .replayer-wrapper iframe { border: 0; display: block; }
.hm-stage .replayer-mouse, .stage .replayer-mouse-tail { display: none; }
.hm-stage .center { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-2); text-align: center; padding: 24px; font-size: 13px; }
.legend { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); }
.legend i { display: block; width: 104px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #2c7bff, #00e5ff, #36ff5a, #ffe600, #ff2d2d); }
.legend.scroll i { background: linear-gradient(90deg, #2c3cff, #2cc4ff, #49ff7a, #ffd600, #ff2d2d); }
.el-list { list-style: none; margin: 0; padding: 4px 0; max-height: calc(100vh - 260px); overflow: auto; }
.el-list li { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; padding: 8px 16px; align-items: start; cursor: default; font-size: 13px; }
.el-list li:hover { background: var(--surface-2); }
.el-list .rank { color: var(--text-3); font-size: 11.5px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.el-main { display: grid; gap: 2px; min-width: 0; }
.el-list .sel { font-family: var(--mono); font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.el-list .lbl { font-size: 13px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.el-sig { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.el-n { display: grid; justify-items: end; line-height: 1.35; }
.el-n .faint { font-size: 11.5px; }

/* ---------- install / code ---------- */
.snippet { position: relative; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; overflow-x: auto; white-space: pre; }
.snippet .btn { position: absolute; top: 8px; right: 8px; height: 26px; padding: 0 9px; font-size: 12px; }
.snippet .btn:hover { background: var(--surface-3); }
.btn.copied, .btn.copied svg.i { color: var(--ok); }
.steps { display: grid; gap: 16px; }
.steps ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--text-2); }
.steps .card-pad { display: grid; gap: 12px; align-content: start; }
.steps .card-pad > p { margin: 0; }
.step-title { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.step-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-strong); font-size: 11.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; flex: none; }
.steps .card-pad > :not(.step-title) { margin-left: 32px; }
.steps .card-pad:not(:has(.step-n)) > * { margin-left: 0; }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--charcoal); color: var(--brand-fg); padding: 9px 16px; border-radius: var(--pill); font-size: 13px; font-weight: 500; z-index: 80; box-shadow: var(--shadow-pop); animation: toast-in .16s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 4px); } }

@media (max-width: 1100px) {
  .hm-layout { grid-template-columns: 220px 1fr; }
  .hm-layout > .hm-side { grid-column: 1 / -1; }
  .player-layout { grid-template-columns: 1fr; }
  .player-main { position: static; }
}
@media (max-width: 760px) {
  .app { padding: 20px 16px 48px; }
  .topbar { padding: 0 12px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .overview-grid, .hm-layout { grid-template-columns: 1fr; }
  .page-list { max-height: 220px; }
  .hide-sm { display: none; }
  .stage { height: 52vh; }
}

/* ---------- visitors ---------- */
.vtag { display: inline-flex; align-items: center; gap: 6px; }
.vtag i { width: 8px; height: 8px; border-radius: 2px; display: block; }
.badge.new { background: transparent; color: var(--text-3); }
.badge.ret { background: var(--surface-2); color: var(--text); }
.table tr.current td { background: var(--accent-soft); }
.split-row.wide { grid-template-columns: minmax(80px, 1.2fr) 1fr 32px; }
.scopebar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px; margin-bottom: 12px; flex-wrap: wrap; }
.scopebar .faint { font-size: 12px; }
.tabs .badge { height: 18px; padding: 0 5px; margin-left: 4px; font-size: 11px; }

/* ---------- segments ---------- */
.input.sm { height: 28px; font-size: 12.5px; padding: 0 8px; }
select.input.sm { padding-right: 26px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; flex: 1; min-width: 0; }
.chips > .faint { font-size: 13px; }
.linkbtn { border: 0; background: none; color: var(--text-2); cursor: pointer; font-size: 12.5px; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; padding: 0; font-weight: 500; }
.linkbtn:hover { color: var(--text); }
.breakdowns { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-bottom: 12px; }
button.split-row { border: 0; background: none; padding: 4px 6px; margin: -4px -6px; border-radius: 4px; cursor: pointer; text-align: left; width: calc(100% + 12px); }
button.split-row:hover { background: var(--surface-2); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-foot { margin: 0; padding: 0 16px 12px; font-size: 12px; }

/* ---------- connect AI ---------- */
.notice { margin-bottom: 16px; border-color: color-mix(in srgb, var(--warn) 28%, var(--border)); background: color-mix(in srgb, var(--warn) 5%, var(--surface)); font-size: 13.5px; }
.notice-ok { margin: 14px 0 8px; color: var(--ok); font-weight: 500; }
.client { margin-top: 16px; }
.client h3 { font-size: 13.5px; margin: 18px 0 8px; }
.client h3:first-child { margin-top: 0; }
.snippet span { white-space: pre-wrap; word-break: break-all; display: block; padding-right: 64px; }

/* ---------- dashboard: experience score ---------- */
.section-title { font-size: 13px; font-weight: 600; color: var(--text); margin: 28px 0 10px; letter-spacing: -0.005em; }
.pad { padding: 14px 16px; margin: 0; }
.pad-x { padding: 0 16px 12px; margin: 0; }
.nowrap { white-space: nowrap; }
.exp-card { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: center; padding: 16px 20px; margin-bottom: 12px; }
.exp-left .label { color: var(--text-2); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.exp-score { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 4px; }
.exp-score .num { font: 600 48px/1.05 var(--display); letter-spacing: -0.03em; }
.exp-left .sub { color: var(--text-3); font-size: 12px; }
.delta { display: inline-flex; align-items: center; gap: 1px; font-weight: 500; }
.delta.up { color: var(--ok); } .delta.down { color: var(--danger); }
.info { display: inline-flex; align-items: center; border: 0; background: none; color: var(--text-3); cursor: help; padding: 4px; border-radius: 4px; }
.info:hover { color: var(--text); background: var(--surface-2); }
.spark { width: 100%; height: 150px; display: block; }
.spark .gridline { stroke: var(--border); stroke-dasharray: 2 4; }
.spark .axis { fill: var(--text-3); font-size: 10px; font-family: var(--mono); }
.spark-line { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: var(--surface); stroke: var(--chart); stroke-width: 2; }
.grade, .score-chip { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: var(--pill); font-size: 11.5px; font-weight: 500; background: var(--surface-2); border: 1px solid var(--border); }
.grade::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.score-chip { min-width: 32px; justify-content: center; font-variant-numeric: tabular-nums; }
.g-great { color: var(--ok); } .g-good { color: color-mix(in srgb, var(--ok) 70%, var(--text-2)); }
.g-avg { color: var(--warn); } .g-poor { color: color-mix(in srgb, var(--danger) 75%, var(--warn)); } .g-vpoor { color: var(--danger); }
.exp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.rank-list { padding: 8px 12px 12px; display: grid; gap: 6px; }
.rank-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.bar-wrap { position: relative; height: 28px; border-radius: 8px; background: var(--surface-2); overflow: hidden; min-width: 0; }
.bar-fill { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--powder) 70%, transparent); }
.bar-text { position: relative; display: block; padding: 0 10px; line-height: 28px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-actions { display: inline-flex; gap: 4px; }
.icon-btn { width: 28px; height: 28px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--text-3); display: inline-grid; place-items: center; padding: 0; transition: background-color .12s, color .12s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.icon-btn.star.on, .star.on { color: var(--accent); }
.star.on svg path, .icon-btn.star.on svg path { fill: currentColor; }
.signal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px; }
.sig-tile { display: grid; gap: 1px; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-size: 12px; color: var(--text-3); transition: border-color .12s, background-color .12s; }
.sig-tile:hover { border-color: var(--border-strong); background: var(--surface-2); }
.sig-n { font-size: 18px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.sig-l { font-weight: 500; color: var(--text-2); font-size: 12.5px; }
.vitals { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 12px; }
.vital { display: grid; gap: 1px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); text-align: left; }
.v-name { font-size: 11.5px; font-weight: 500; color: var(--text-3); }
.v-val { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.v-rate { font-size: 11.5px; color: var(--text-3); text-transform: capitalize; display: inline-flex; align-items: center; gap: 5px; }
.v-rate::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.vital.good .v-rate::before { background: var(--ok); } .vital.needs-improvement .v-rate::before { background: var(--warn); } .vital.poor .v-rate::before { background: var(--danger); }
.forms-card { margin-bottom: 8px; }
.form-row { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 13px; }
.form-steps { display: flex; align-items: center; gap: 12px; color: var(--text-3); }
.form-steps span { display: grid; text-align: center; }
.form-steps small { color: var(--text-3); font-size: 11px; }
.form-steps b { color: var(--text); font-weight: 600; }

/* ---------- forms ---------- */
.forms-layout { display: grid; grid-template-columns: 248px 1fr; gap: 12px; align-items: start; }
.forms-layout > #form-report { display: grid; gap: 12px; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 16px 14px; flex-wrap: wrap; color: var(--text-2); font-size: 13px; }
.fields { padding: 0 16px 16px; display: grid; gap: 8px; }
.field-row { display: grid; grid-template-columns: minmax(100px, 200px) 1fr 60px; gap: 12px; align-items: center; font-size: 13px; }
.field-row .meter { height: 8px; }
.field-row .meter i { background: var(--chart); }

/* ---------- heatmaps: compare + observations ---------- */
.hm-toolbar select.input { height: 28px; }
.hm-panes { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 0; }
.hm-panes.two { grid-template-columns: 1fr 1fr; padding: 12px; }
.hm-panes.two .hm-stage { border-radius: var(--radius-sm); }
.pane-head { font-weight: 500; font-size: 12.5px; padding: 4px 2px; color: var(--text-2); }
.pane-foot { padding: 6px 12px 10px; font-size: 12px; }
.legend.friction i { background: linear-gradient(90deg, #7c3cff, #d12bd8, #ff2d6f, #ff2020); }
.legend[hidden] { display: none; }
.note-form { display: grid; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.note-form textarea { height: auto; padding: 8px 10px; resize: vertical; }
.note-form p { margin: 0; font-size: 12px; }
.notes { list-style: none; margin: 0; padding: 0; }
.notes li { padding: 12px 16px; border-bottom: 1px solid var(--border); display: grid; gap: 4px; }
.notes li:last-child { border-bottom: 0; }
.notes.wide li { padding: 14px 20px; }
.notes p { margin: 0; color: var(--text-2); font-size: 13px; }
.note-top { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.note-top b { font-weight: 500; }
.note-meta { font-size: 12px; }
.note-actions { display: flex; gap: 12px; }
.star { border: 0; background: none; cursor: pointer; color: var(--text-3); padding: 0; display: inline-flex; }
.star:hover { color: var(--text); }
.txt-rage { color: var(--danger); } .txt-dead { color: var(--text-2); }

/* ---------- recordings ---------- */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.star-btn.on { color: var(--text); }
.star-btn.on svg.i { color: var(--accent); }
tr.unwatched td:first-child { position: relative; }
tr.unwatched td:first-child::before { content: ""; position: absolute; left: 6px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--accent); }
tr.unwatched td:nth-child(2) { font-weight: 500; }
tr:not(.unwatched) .play-cell svg.i { color: var(--text-3); }
tr.sum-row td { background: var(--surface-2); color: var(--text-2); font-size: 13px; line-height: 1.6; }
.sum-label { font-weight: 600; color: var(--text); margin-right: 6px; display: inline-flex; align-items: center; gap: 4px; }
.summary-card .summary-text { margin: 0; padding: 12px 16px 14px; font-size: 13.5px; line-height: 1.6; }
.timeline .mark.signal { background: var(--info); height: 8px; }
.timeline .mark.note { background: var(--accent); top: 0; height: 28px; width: 2px; }
.timeline .mark.error { background: var(--warn); height: 8px; }
.timeline .mark.dead { background: var(--text-2); height: 8px; }

@media (max-width: 1100px) {
  .exp-grid, .exp-card { grid-template-columns: 1fr; }
  .signal-grid { grid-template-columns: repeat(2, 1fr); }
  .vitals { grid-template-columns: repeat(3, 1fr); }
  .hm-panes.two { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .forms-layout { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* ---------- shell: left sidebar ---------- */
.layout { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - 56px); }
.layout.no-sidebar { grid-template-columns: 1fr; }
.layout.no-sidebar .sidebar { display: none; }
.layout > .app { min-width: 0; width: 100%; }
.sidebar { position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; border-right: 1px solid var(--border); background: var(--sidebar); padding: 16px 12px 24px; }
.sb-site { padding: 0 4px 12px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.sb-site .input { width: 100%; height: 32px; font-weight: 500; background-color: var(--surface); }
.sb-label { font-size: 11.5px; font-weight: 500; color: var(--text-3); padding: 0 8px 4px; display: block; }
.sb-site .sb-label { padding: 0 2px 6px; }
.sb-group { margin-bottom: 12px; padding-top: 4px; }
.sb-item { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 13px; transition: background-color .1s, color .1s; }
.sb-item:hover { background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); }
.sb-item[aria-current="page"] { background: var(--surface-3); color: var(--text); font-weight: 600; }
.sb-item[aria-current="page"] .sb-ic { color: var(--text); }
.sb-ic { display: inline-flex; width: 24px; justify-content: center; color: var(--text-3); }
.sb-ic svg { width: 16px; height: 16px; stroke-width: 1.75; }
/* Clay icons (vector + #cuttl-clay filter). Large spots are filled clay in each icon's own colours (--cb body, --ca raised piece).
   The sidebar uses the outline version: flat grey at rest, its colours + clay when selected, with a small pop. */
/* neutral clay bodies (flask, gear, plug, bars) lighten in dark mode so they don't sink into the black */
:root { --clay-rest: #a3aab5; --clay-rest-2: #d5dae1; --clay-slate: #5b6576; --clay-grey: #9aa6b8; --clay-grey-2: #7c8698; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --clay-rest: #5f5f64; --clay-rest-2: #9a9aa0; --clay-slate: #eef0f4; --clay-grey: #e2e6ec; --clay-grey-2: #d6dbe3; } }
:root[data-theme="dark"] { --clay-rest: #5f5f64; --clay-rest-2: #9a9aa0; --clay-slate: #eef0f4; --clay-grey: #e2e6ec; --clay-grey-2: #d6dbe3; }
svg.clay { overflow: visible; flex: none; }
.clay .clay-b { fill: var(--cb); stroke: var(--cb); filter: url(#cuttl-clay); }
.clay .clay-a { fill: var(--ca); stroke: var(--ca); filter: url(#cuttl-clay); }
.clay g > :not([stroke-width]) { stroke: none; }
.clay g > [fill="none"] { fill: none; }
.clay-ol .clay-b > * { fill: none !important; stroke: var(--cb) !important; stroke-width: 2.2px; stroke-linejoin: round; stroke-linecap: round; }
.clay-ol .clay-a { fill: var(--co); stroke: var(--co); }
.sb-ic svg.clay { width: 18px; height: 18px; transition: transform 380ms var(--spring); }
.sb-item:not([aria-current="page"]) .clay .clay-b, .sb-item:not([aria-current="page"]) .clay .clay-a { filter: none; transition: fill var(--d2), stroke var(--d2); }
.sb-item:not([aria-current="page"]) .clay .clay-b > * { stroke: var(--clay-rest) !important; }
.sb-item:not([aria-current="page"]) .clay .clay-a { fill: var(--clay-rest-2); stroke: var(--clay-rest-2); }
.sb-item:not([aria-current="page"]):hover .clay .clay-b > * { stroke: var(--text-2) !important; }
.sb-item[aria-current="page"] .clay { transform: scale(1.12); }
@media (prefers-reduced-motion: reduce) { .sb-ic svg.clay { transition: none; } }
.sb-badge { margin-left: auto; display: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--pill); background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 500; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.sb-badge.on { display: inline-flex; }
.sb-item[data-k="issues"] .sb-badge.on { background: var(--danger-soft); color: var(--danger); }
.nav-toggle { display: none; }
.topbar .brand { white-space: nowrap; }
.seg.sm button { height: 22px; padding: 0 8px; font-size: 12px; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 56px; left: 0; z-index: 30; width: 260px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-pop); }
  .layout.nav-open .sidebar { transform: none; }
  .nav-toggle { display: inline-flex; }
  .layout.no-sidebar + * .nav-toggle, body:has(.layout.no-sidebar) .nav-toggle { display: none; }
}
/* Connect AI lives in the sidebar; the top-bar shortcut is only for the sites list, where there is no sidebar. */
body.share-mode .topbar-link, body:has(.layout:not(.no-sidebar)) .topbar-link { display: none; }
.share-note { margin-left: auto; font-size: 12px; }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(9, 9, 11, .4); display: grid; place-items: center; padding: 16px; animation: fade-in .12s ease-out; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-pop); animation: pop-in .16s ease-out; }
@keyframes fade-in { from { opacity: 0; } }
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { font-size: 14px; }
.modal-body { padding: 16px; display: grid; gap: 12px; font-size: 13.5px; }
.modal-body p { margin: 0; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.field { display: grid; gap: 4px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field .input, .field textarea { width: 100%; font-weight: 400; color: var(--text); }
textarea.input { height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.code { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-family: var(--mono); font-size: 11.5px; white-space: pre-wrap; overflow-x: auto; margin: 6px 0 0; }
.label { font-size: 12px; color: var(--text-3); font-weight: 500; }
.big { font: 600 28px/1.15 var(--display); letter-spacing: -0.02em; }
.ai-out h4 { margin: 14px 0 4px; font-size: 13.5px; }
.ai-out p { margin: 6px 0; line-height: 1.6; }
.ai-out ul { margin: 6px 0; padding-left: 20px; line-height: 1.6; }
.sref { display: inline-block; padding: 0 4px; border-radius: var(--pill); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-weight: 500; font-size: 11.5px; text-decoration: none; font-family: var(--mono); }
.sref:hover { border-color: var(--border-strong); }

/* ---------- issues ---------- */
.sev { height: 6px; border-radius: var(--pill); background: var(--surface-2); overflow: hidden; }
.sev i { display: block; height: 100%; background: var(--danger); opacity: .75; border-radius: var(--pill); }
.issue-title { font-weight: 500; display: flex; align-items: center; }
.status { display: inline-flex; height: 22px; align-items: center; gap: 5px; padding: 0 9px; border-radius: var(--pill); font-size: 11.5px; font-weight: 500; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.status.s-open::before { background: var(--danger); }
.status.s-regressed::before { background: var(--warn); }
.status.s-in_progress::before { background: var(--info); }
.status.s-resolved::before { background: var(--ok); }
/* outcome statuses shared by Change impact, Learnings and the experiment planner */
.status.imp-st-ok::before { background: var(--ok); }
.status.imp-st-bad::before { background: var(--danger); }
.status.imp-st-none::before { background: var(--text-3); }
.status.imp-st-wait::before { background: var(--warn); }
.status.imp-st-info::before { background: var(--info); }
.issue-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.issue-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.mini-bars { display: flex; align-items: flex-end; gap: 3px; height: 48px; }
.mini-bars i { flex: 1; max-width: 22px; min-height: 2px; background: var(--chart); border-radius: 2px 2px 0 0; opacity: .85; }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.mini-list a { text-decoration: none; }
.mini-list a:hover { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--border-strong); }
.mini-list li.faint { display: flex; align-items: center; gap: 6px; }
.pad-list { padding: 12px 16px 14px; }
.conv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px 16px; }
.conv-grid .span2 { grid-column: 1 / -1; font-size: 13px; }
.digest-card { margin-top: 12px; }
.digest-body { padding: 14px 16px 16px; }
.digest { font-size: 13.5px; line-height: 1.6; }
.digest-title { margin: 0 0 6px; color: var(--text-2); }
.digest-title b { color: var(--text); }
.digest ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.digest li { position: relative; padding-left: 14px; }
.digest li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 4px; height: 4px; border-radius: 50%; background: var(--text-3); }
.digest li.sub { padding-left: 30px; color: var(--text-2); }
.digest li.sub::before { left: 18px; width: 6px; height: 1px; border-radius: 0; }
.deploy-line { stroke: var(--text-3); stroke-dasharray: 3 3; stroke-width: 1; }
.deploy-label { fill: var(--text-2); font-size: 10px; font-weight: 500; font-family: var(--mono); }

/* ---------- funnels ---------- */
.funnel-steps { padding: 8px 16px 16px; display: grid; gap: 14px; }
.fstep-head { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13.5px; }
.fstep-n { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 500; color: var(--text-2); }
.fstep-nums { font-size: 12.5px; color: var(--text-2); text-align: right; }
.fbar { height: 20px; background: var(--surface-2); border-radius: 8px; overflow: hidden; margin: 6px 0 4px 38px; }
.fbar i { display: block; height: 100%; background: color-mix(in srgb, var(--chart) 80%, var(--surface)); border-radius: 8px; min-width: 2px; }
.fstep-foot { margin-left: 38px; font-size: 12px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.fe-row { display: grid; grid-template-columns: 28px 170px 1fr 160px 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
#set-body .fe-row { grid-template-columns: 1fr 150px 1fr 100px 32px; }

/* ---------- feedback ---------- */
.fb-list { list-style: none; margin: 0; padding: 0; }
.fb-list li { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.fb-list li:last-child { border-bottom: 0; }
.fb-rating { display: flex; }
.fb-body p { margin: 0 0 4px; line-height: 1.45; }
.rating, .nps { display: inline-flex; align-items: baseline; justify-content: center; gap: 1px; width: 44px; height: 28px; padding: 0; line-height: 28px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; background: var(--surface-2); border: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.rating small { font-size: 11px; color: var(--text-3); font-weight: 500; }
.rating.r1, .rating.r2, .nps.nd { color: var(--danger); }
.rating.r3, .nps.nn { color: var(--warn); }
.rating.r4, .rating.r5, .nps.np { color: var(--ok); }

/* ---------- settings ---------- */
.settings-layout { display: grid; grid-template-columns: 184px 1fr; gap: 24px; align-items: start; }
.settings-nav { display: grid; gap: 1px; position: sticky; top: 72px; }
.settings-nav a { padding: 7px 12px; border-radius: var(--pill); text-decoration: none; color: var(--text-2); font-weight: 500; font-size: 13px; }
.settings-nav a:hover { background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); }
.settings-nav a[aria-current="page"] { background: var(--surface-3); color: var(--text); }
/* Narrow screens: the settings nav becomes a horizontal, scrollable tab row (no sticky column over the content). */
@media (max-width: 760px) {
  .settings-nav { position: static; display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--border); padding-bottom: 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
  .settings-nav a { white-space: nowrap; flex: none; }
}
#set-body { display: grid; gap: 12px; }
#set-body .card-pad { display: grid; gap: 10px; }
#set-body h2 { margin-bottom: 2px; }
#set-body p { margin: 0; font-size: 13px; }
.check.block { display: flex; align-items: flex-start; gap: 10px; color: var(--text); }
.check.block input { margin-top: 3px; }
.check-grid { display: grid; gap: 10px; }
.check-grid > .label { margin-bottom: -2px; }
.check.block .faint { font-weight: 400; font-size: 12.5px; }
.check.block b { font-weight: 500; }
#set-body .field > select.input, #set-body .field > .input:not(textarea) { max-width: 440px; }
.range-head { display: flex; justify-content: space-between; align-items: baseline; max-width: 440px; }
.range-head b { color: var(--text); font-weight: 600; font-size: 13px; }
.range-field input[type=range] { max-width: 440px; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 25%, var(--border)); margin-top: 12px; }
input[type=range] { width: 100%; }
@media (max-width: 760px) { .settings-layout, .issue-meta, .issue-grid, .two-col { grid-template-columns: 1fr; } .fe-row, #set-body .fe-row { grid-template-columns: 1fr; } }

/* ---------- recordings & player extras ---------- */
.reasons { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.why { font-size: 11px; padding: 0 5px; line-height: 18px; border-radius: var(--pill); background: var(--surface-2); color: var(--text-3); }
.health { margin: 0 16px 12px; padding: 6px 10px; border-radius: var(--radius-sm); font-size: 12.5px; background: var(--surface-2); color: var(--text-2); }
.health.ok b { color: var(--ok); } .health.warn b { color: var(--warn); } .health.bad b { color: var(--danger); }
.summary-text { padding: 12px 16px; font-size: 13.5px; line-height: 1.6; }
.summary-text.clamped { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; padding-bottom: 0; margin-bottom: 4px; }
.sum-more { margin: 0 16px 10px; }
.dev-list { list-style: none; margin: 0; padding: 4px 0; max-height: 420px; overflow: auto; }
.dev-list button { width: 100%; text-align: left; display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 7px 16px; border: 0; background: none; cursor: pointer; font-size: 12.5px; }
.dev-list button:hover { background: var(--surface-2); }
.dev-list .t { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.dev-list li.error b { color: var(--danger); } .dev-list li.warn b { color: var(--warn); }
.dev-list b { font-weight: 500; }
.dev-list .code { font-size: 11px; }
.timeline .mark.console, .timeline .mark.network { background: var(--danger); height: 10px; }
.timeline .mark.feedback { background: var(--info); height: 12px; width: 2px; }
.timeline .mark.conversion { background: var(--ok); height: 14px; width: 2px; }
.backdrop-bar { padding: 8px 12px; background: color-mix(in srgb, var(--warn) 6%, var(--surface)); font-size: 12.5px; border-bottom: 1px solid var(--border); }
.notice a { font-weight: 500; }
.proxy { margin-top: 10px; }

@media (max-width: 760px) { .topbar .crumbs { display: none; } }
.table td .row-actions { opacity: .55; transition: opacity .12s; }
.table tr:hover td .row-actions { opacity: 1; }
.card-head h2 { white-space: nowrap; }
.card-head .head-actions { flex-wrap: nowrap; gap: 6px; }
@media (max-width: 760px) { .card-head { flex-wrap: wrap; } .card-head .head-actions { flex-wrap: wrap; } }

/* =====================================================================
   Motion. One easing family (ease-out "expo-ish"), three durations, transform/opacity only.
   Motion is functional: it confirms an action or shows where something came from, never decorates. Follows Rauno Freiberg's interface guidelines (press scale, <200ms interactions, hover only on hover devices) and
   Emil Kowalski's notes (enter from .96 not 0, tooltips: delay once then instant). Off under reduced motion.
   ===================================================================== */
:root { --spring: linear(0, .38 9%, .82 20%, 1.06 34%, 1.08 40%, 1.02 55%, .99 70%, 1); --ease-out: cubic-bezier(.22, 1, .36, 1); --ease-in-out: cubic-bezier(.65, 0, .35, 1); --d1: 120ms; --d2: 200ms; --d3: 320ms; }
html { text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
.btn, .icon-btn, .seg button, .sb-item, .chip button { user-select: none; -webkit-user-select: none; }

/* theme toggle */
.theme-slot { margin-left: auto; display: flex; }
.theme-slot + .topbar-link { margin-left: 4px; }
body.share-mode .share-note { margin-left: auto; }
body.share-mode .theme-slot { margin-left: 8px; }
.theme-toggle { padding: 2px; }
.theme-toggle button { width: 26px; height: 22px; padding: 0; justify-content: center; }
.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }
/* theme switch: the old page stays put while the new one is revealed by a growing circle (see setTheme) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 1; }

/* sliding thumb for segmented controls */
.seg.has-pill { position: relative; isolation: isolate; }
.seg.has-pill .seg-pill { position: absolute; top: 0; left: 0; z-index: -1; border-radius: 6px; background: var(--surface); box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(0, 0, 0, .06); transition: transform 420ms var(--spring), width 420ms var(--spring), opacity var(--d1); pointer-events: none; }
.seg.has-pill button[aria-pressed="true"] { background: transparent; box-shadow: none; }
.seg button { transition: color var(--d1); }

/* sidebar glide */
.sb-nav.has-pill { position: relative; isolation: isolate; }
.sb-pill { position: absolute; left: 0; right: 0; top: 0; z-index: -1; border-radius: 8px; background: var(--surface-3); transition: transform 340ms var(--ease-out), height 340ms var(--ease-out), opacity var(--d1); pointer-events: none; }
/* the pill paints the selection and glides between items; the item itself stays transparent */
.sb-nav.has-pill .sb-item[aria-current="page"] { background: transparent; }
@media (prefers-reduced-motion: reduce) { .sb-pill { transition: none; } }

/* top progress line */
.topline { position: fixed; top: 55px; left: 0; height: 2px; width: 100%; z-index: 40; pointer-events: none; transform-origin: 0 50%; transform: scaleX(0); opacity: 0; background: var(--accent); }
.topline.run { opacity: 1; animation: topline-run 2.4s cubic-bezier(.1, .7, .2, 1) forwards; }
.topline.end { opacity: 0; transform: scaleX(1); transition: opacity 280ms ease 60ms, transform 160ms var(--ease-out); }
@keyframes topline-run { from { transform: scaleX(0); } to { transform: scaleX(.85); } }

/* view entrance: blur fade, staggered by block */
.view-enter > *, .view-enter #tab > * { animation: rise-in 260ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 24ms); }
@keyframes rise-in { from { opacity: 0; transform: translateY(4px); } }

/* charts draw in */
.bar i { transform-origin: 50% 100%; animation: grow-y 560ms var(--ease-out) both; }
.bar:nth-child(2) i { animation-delay: 30ms; } .bar:nth-child(3) i { animation-delay: 60ms; } .bar:nth-child(4) i { animation-delay: 90ms; }
.bar:nth-child(5) i { animation-delay: 120ms; } .bar:nth-child(6) i { animation-delay: 150ms; } .bar:nth-child(7) i { animation-delay: 180ms; } .bar:nth-child(n+8) i { animation-delay: 210ms; }
.mini-bars i { transform-origin: 50% 100%; animation: grow-y 480ms var(--ease-out) both; }
.meter i, .fbar i, .bar-fill, .sev i, .ab-meter span { transform-origin: 0 50%; animation: grow-x 600ms var(--ease-out) both; }
.fstep:nth-child(2) .fbar i { animation-delay: 60ms; } .fstep:nth-child(3) .fbar i { animation-delay: 120ms; } .fstep:nth-child(n+4) .fbar i { animation-delay: 180ms; }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes grow-x { from { transform: scaleX(0); } }
.spark-line { stroke-dasharray: 2000; stroke-dashoffset: 0; animation: draw 900ms var(--ease-out) both; }
.spark-dot { animation: fade-in 300ms 500ms both; }
@keyframes draw { from { stroke-dashoffset: 2000; } }

/* press feedback + hover only where hover exists */
.btn, .icon-btn, .sig-tile, .chip button, .seg button { transition-property: background-color, border-color, color, transform, box-shadow; transition-duration: var(--d1); transition-timing-function: var(--ease-out); }
.btn, .icon-btn, .tgl { transition-property: background-color, border-color, color, transform, box-shadow; transition-duration: var(--d1), var(--d1), var(--d1), 420ms, var(--d1); transition-timing-function: var(--ease-out), var(--ease-out), var(--ease-out), var(--spring), var(--ease-out); }
.btn:active:not(:disabled), .icon-btn:active, .tgl:active { transform: scale(.94); transition-duration: 60ms; transition-timing-function: ease-out; }
.sig-tile:active, .site-card:active { transform: scale(.99); }
@media (hover: none) { .btn:hover, .icon-btn:hover, .sb-item:hover, .table tbody tr.link:hover td { background: inherit; } }
.table td { transition: background-color var(--d1); }
.sb-item svg { transition: transform var(--d2) var(--ease-out); }
.timeline .knob { transition: transform var(--d1) var(--ease-out); }
.timeline:hover .knob { transform: scale(1.15); }
.chip { animation: chip-in var(--d2) var(--ease-out) both; }
@keyframes chip-in { from { opacity: 0; transform: scale(.94); } }


/* shimmering text while AI / data is loading */
.shimmer-text { background: linear-gradient(90deg, var(--text-3) 0%, var(--text-3) 40%, var(--text) 50%, var(--text-3) 60%, var(--text-3) 100%); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }

/* tooltip */
.tip { position: fixed; z-index: 90; max-width: 320px; padding: 5px 10px; border-radius: 8px; background: var(--charcoal); color: var(--brand-fg); font-size: 12px; font-weight: 500; line-height: 1.4;
  pointer-events: none; opacity: 0; transform: translateY(2px) scale(.98); transition: opacity var(--d1), transform var(--d1) var(--ease-out); }
.tip.below { transform: translateY(-2px) scale(.98); }
.tip.on { opacity: 1; transform: none; }

/* modal + toast exits */
.modal-wrap.closing { animation: fade-out 140ms ease-in forwards; }
.modal-wrap.closing .modal { animation: pop-out 140ms ease-in forwards; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop-out { to { opacity: 0; transform: scale(.98); } }
.modal { transform-origin: 50% 40%; }
@keyframes pop-in { from { opacity: 0; transform: scale(.96); } }
.toast.out { animation: toast-out 160ms ease-in forwards; }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 4px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .shimmer-text { animation: none; color: var(--text-3); background: none; }
}

/* =====================================================================
   Segment toolbar + popovers (Linear / PostHog style filter builder)
   ===================================================================== */
.segbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; padding: 0; }
.segbar .btn .caret { color: var(--text-3); margin-left: -2px; }
.segbar .btn > span { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.segbar-div { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.segbar .chips { flex: 1; gap: 6px; }
.add-filter { color: var(--text-2); border: 1px dashed var(--border-strong); background: transparent; box-shadow: none; }
.add-filter:hover { border-style: solid; color: var(--text); }
.seg-clear { margin-left: auto; }
.chip { height: 30px; padding: 0; gap: 0; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--border-strong); font-size: 12.5px; overflow: hidden; }
.chip-body { display: inline-flex; align-items: center; gap: 5px; height: 100%; padding: 0 8px 0 10px; border: 0; border-radius: 0; background: none; font: inherit; color: inherit; cursor: default; }
button.chip-body { cursor: pointer; }
button.chip-body:hover { background: var(--surface-2); }
.chip-k { color: var(--text-2); font-weight: 500; }
.chip-op { color: var(--text-3); }
.chip-v { color: var(--text); font-weight: 500; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .chip-x { width: 24px; height: 100%; border: 0; border-left: 1px solid var(--border); border-radius: 0; background: none; color: var(--text-3); display: inline-grid; place-items: center; cursor: pointer; }
.chip .chip-x:hover { background: var(--surface-2); color: var(--text); }

.pop { position: fixed; z-index: 70; width: 280px; max-height: min(460px, calc(100vh - 80px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-pop); overflow: hidden; animation: pop-menu-in 150ms var(--ease-out); font-size: 13px; }
.pop.closing { animation: pop-menu-out 110ms ease-in forwards; }
@keyframes pop-menu-in { from { opacity: 0; transform: scale(.97) translateY(-2px); } }
@keyframes pop-menu-out { to { opacity: 0; transform: scale(.98); } }
.pop:focus { outline: none; }
.pop-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 40px; border-bottom: 1px solid var(--border); color: var(--text-3); flex: none; }
.pop-search input { flex: 1; border: 0; outline: 0; background: none; height: 100%; font-size: 13px; color: var(--text); min-width: 0; }
.pop-search input::placeholder { color: var(--text-3); }
.pop-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--border); font-weight: 600; flex: none; }
.pop-list { padding: 4px; display: grid; gap: 1px; }
.pop-list.scroll { overflow-y: auto; min-height: 0; flex: 1; overscroll-behavior: contain; }
.pop-group { padding: 8px 8px 4px; font-size: 11.5px; font-weight: 500; color: var(--text-3); }
.pop-group:first-child { padding-top: 4px; }
.pop-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0 8px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; text-decoration: none; }
.pop-row.hl, .pop-row:focus-visible { background: var(--surface-2); outline: none; }
.pop-row:disabled { color: var(--text-3); cursor: default; }
.pop-row.danger { color: var(--danger); }
.pop-row.danger .pop-ic { color: var(--danger); }
.pop-ic { display: inline-flex; width: 16px; justify-content: center; color: var(--text-3); flex: none; }
.pop-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-hint { color: var(--text-3); font-size: 12px; display: inline-flex; align-items: center; flex: none; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-hint.cur { color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--pill); padding: 0 6px; line-height: 18px; }
.pop-check { color: var(--text); display: inline-flex; flex: none; }
.pop-bar { width: 56px; height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; flex: none; }
.pop-bar i { display: block; height: 100%; background: var(--chart-2); border-radius: 2px; }
.pop-toggle { width: 26px; height: 16px; border-radius: 99px; background: var(--surface-3); position: relative; flex: none; transition: background-color var(--d2); }
.pop-toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform var(--d2) var(--ease-out); }
.pop-toggle.on { background: var(--text); }
.pop-toggle.on::after { transform: translateX(10px); }
.pop-sep { height: 1px; background: var(--border); margin: 0; flex: none; }
.pop-sub { font-size: 11.5px; font-weight: 500; color: var(--text-3); }
.pop-form { display: grid; gap: 8px; padding: 10px 12px 12px; flex: none; }
.pop-form.inline { grid-template-columns: 1fr auto; padding: 8px; }
.pop-form .btn { justify-content: center; }
.date-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.date-row .input { width: 100%; padding: 0 6px; }
.pop-empty { padding: 16px 12px; text-align: center; color: var(--text-3); }
.pop-foot { display: flex; gap: 6px; align-items: flex-start; padding: 8px 12px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 11.5px; line-height: 1.45; flex: none; }
.pop-foot svg { margin-top: 2px; }
.pop-foot code { font-size: 11px; padding: 0 3px; }
.pop-row-wrap { position: relative; }
.pop-row-wrap .pop-row { padding-right: 36px; }
.pop-del { position: absolute; right: 4px; top: 2px; width: 28px; height: 28px; opacity: 0; }
.pop-row-wrap:hover .pop-del, .pop-del:focus-visible { opacity: 1; }
.pop-del:hover { color: var(--danger); }
.icon-btn.sm { width: 24px; height: 24px; }
.menu .pop-row { min-height: 30px; }

/* toggle chips (replace loose checkboxes in toolbars) */
.tgl-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tgl { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 500; cursor: pointer; transition: background-color var(--d1), color var(--d1), border-color var(--d1); }
.tgl svg { color: var(--text-3); }
.tgl:hover { color: var(--text); }
.tgl[aria-pressed="true"] { background: var(--surface-2); border-color: color-mix(in srgb, var(--text) 30%, var(--border-strong)); color: var(--text); }
.tgl[aria-pressed="true"] svg { color: var(--accent); }
.tgl[disabled] { opacity: .55; cursor: not-allowed; }

.rating.bad { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 25%, var(--border)); align-items: center; }
.rating.good { color: var(--ok); background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 25%, var(--border)); align-items: center; }
.fb-body .faint { font-size: 12.5px; }

@media (max-width: 760px) {
  .segbar-div { display: none; }
  .seg-clear { margin-left: 0; }
  .fb-list li { grid-template-columns: 44px 1fr; }
  .fb-list li > .btn { grid-column: 2; justify-self: start; }
}
.path-cell { display: flex; align-items: center; gap: 4px; max-width: 200px; white-space: nowrap; }
.path-cell .ellipsis { min-width: 0; }
.path-cell svg { color: var(--text-3); flex: none; }
.badge.more { cursor: default; color: var(--text-2); }
.table .dev { white-space: nowrap; }
td.started { min-width: 120px; }
.sig-wrap { display: flex; gap: 4px; flex-wrap: nowrap; min-width: max-content; }
.visitor-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
@media (max-width: 1480px) { .hide-md { display: none; } }
.stage-note { position: absolute; left: 12px; bottom: 12px; right: 12px; max-width: 520px; display: flex; gap: 6px; align-items: flex-start; padding: 6px 10px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--border); color: var(--text-2); font-size: 12px; line-height: 1.45; z-index: 2; backdrop-filter: blur(6px); }
.stage-note svg { margin-top: 2px; color: var(--text-3); }

/* ===== traffic quality, channels, sensitive pages, script weight ===== */
.badge.bot { color: var(--warn); }
.badge.bot svg.i { color: var(--warn); }
.tq-row { margin-top: 12px; }
.tq-bar { display: flex; height: 8px; border-radius: var(--pill); overflow: hidden; background: var(--surface-2); gap: 2px; }
.tq-bar i { display: block; height: 100%; min-width: 3px; transform-origin: 0 50%; animation: grow-x 600ms var(--ease-out) both; }
.tq-legend { display: grid; gap: 2px; margin-top: 12px; }
.tq-item { display: grid; grid-template-columns: 10px 1fr auto 40px; gap: 8px; align-items: center; padding: 6px 8px; margin: 0 -8px; border: 0; background: none; border-radius: var(--radius-sm); cursor: pointer; text-align: left; font-size: 13px; color: var(--text); }
.tq-item:hover { background: var(--surface-2); }
.tq-item .faint { text-align: right; font-size: 12px; }
.tq-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }
.tq-note { margin: 10px 0 0; font-size: 12.5px; }
.tq-reasons { margin-top: 10px; font-size: 12.5px; }
.ch-name { color: var(--text); font-size: 13px; gap: 5px; }
.ch-name svg { color: var(--accent); }
.ch-meter { height: 3px; margin-top: 6px; max-width: 160px; }
.sens-list { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.sens-list .label { margin-bottom: 6px; }
.weight { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); display: grid; gap: 10px; font-size: 13px; }
.weight-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.weight-bar { display: flex; gap: 2px; height: 6px; border-radius: var(--pill); overflow: hidden; }
.weight-bar i { display: block; background: var(--chart); }
.weight-bar i.lazy { background: repeating-linear-gradient(135deg, var(--chart-2) 0 4px, transparent 4px 7px); border: 1px solid var(--chart-2); }
.weight-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.weight-list li { display: grid; grid-template-columns: 10px auto 1fr auto; gap: 8px; align-items: center; }
.weight-list .tq-dot { background: var(--chart); }
.weight-list .tq-dot.lazy { background: var(--chart-2); }
.weight-list .faint { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* player: inactive stretches + skip notice */
.timeline .idle-span { position: absolute; top: 10px; height: 8px; border-radius: 2px; pointer-events: none;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--text) 18%, transparent) 0 3px, transparent 3px 6px); }
.timeline.no-skip .idle-span { opacity: .35; }
.skip-note { position: absolute; top: 12px; left: 50%; transform: translate(-50%, -6px); display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  border-radius: 99px; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 500; opacity: 0; pointer-events: none; z-index: 3;
  transition: opacity var(--d2), transform var(--d2) var(--ease-out); }
.skip-note.on { opacity: 1; transform: translate(-50%, 0); }

/* ===== expanded view (recordings & heatmaps) ===== */
body.wide-view .layout { grid-template-columns: 60px 1fr; }
body.wide-view .sidebar { padding: 12px 8px; overflow-x: hidden; }
body.wide-view .sb-site, body.wide-view .sb-label, body.wide-view .sb-item > span:not(.sb-ic), body.wide-view .sb-badge { display: none !important; }
body.wide-view .sb-item { justify-content: center; padding: 0; }
body.wide-view .sb-group { margin-bottom: 8px; padding-top: 0; border-top: 1px solid var(--border); padding-top: 8px; }
body.wide-view .sb-group:first-child { border-top: 0; padding-top: 0; }
body.wide-view .app { max-width: none; padding: 16px 20px 32px; }
body.wide-view .page-head { margin-bottom: 12px; }
/* leave room for the page header above and the play controls below, so the controls stay on screen */
body.wide-view .stage { height: calc(100vh - 296px); min-height: 380px; }
body.wide-view .player-layout { grid-template-columns: minmax(0, 1fr) 360px; }
body.wide-view .player-layout .side, body.wide-view .player-layout .side .card { min-width: 0; }
body.wide-view .summary-card .card-head { flex-wrap: wrap; row-gap: 8px; }
body.wide-view .player-layout .side { max-height: calc(100vh - 140px); overflow: auto; }
body.wide-view .journey, body.wide-view .dev-list { max-height: calc(100vh - 420px); }
body.wide-view .hm-layout { grid-template-columns: 220px minmax(0, 1fr) 280px; }
body.wide-view .hm-stage { height: calc(100vh - 230px); min-height: 420px; }
body.wide-view .page-list { max-height: calc(100vh - 220px); }
/* the expand button stays a normal button; its icon (expand / collapse) shows the state */
@media (max-width: 1100px) { body.wide-view .player-layout, body.wide-view .hm-layout { grid-template-columns: 1fr; } }
@media (max-width: 900px) { body.wide-view .layout { grid-template-columns: 1fr; } }

/* ===== goals ===== */
.goal-form { display: grid; gap: 14px; }
.goal-types { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.goal-type { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-weight: 400; color: var(--text); font-size: 13px; transition: border-color var(--d1), background-color var(--d1); }
.goal-type:hover { border-color: var(--border-strong); }
.goal-type:has(input:checked) { border-color: color-mix(in srgb, var(--text) 30%, var(--border-strong)); background: var(--surface-2); }
.goal-type input { margin: 0; }
.goal-help { font-weight: 400; font-size: 12px; }
.goal-value { display: flex; align-items: center; gap: 8px; }
.goal-value .input { max-width: 160px; }
.goal-note { margin: 0; font-size: 12.5px; }
.goal-name { font-weight: 500; display: flex; align-items: center; gap: 6px; }
.goal-cur { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.goal-cur select.input { width: auto; }
.goal-empty { padding: 28px; display: grid; gap: 20px; }
.goal-empty-text { max-width: 640px; }
.goal-empty-text h2 { font-size: 16px; margin-bottom: 6px; }
.goal-empty-text p { margin: 0; font-size: 13.5px; line-height: 1.6; }
.goal-templates { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.goal-tpl { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-size: 13px; color: var(--text); transition: border-color var(--d1), background-color var(--d1); }
.goal-tpl:hover { border-color: var(--border-strong); background: var(--surface-2); }
.goal-tpl b { font-weight: 500; }
.goal-tpl .faint { font-size: 12.5px; }
.goal-tpl .art { margin-bottom: 8px; }
.goal-code { margin-top: 12px; }
.goal-code summary { cursor: pointer; list-style: none; border-bottom: 0; }
.goal-code summary::-webkit-details-marker { display: none; }
.goal-code[open] summary { border-bottom: 1px solid var(--border); }
.goal-code .card-pad { display: grid; gap: 10px; }
.goal-code .card-pad p { margin: 0; font-size: 12.5px; }
@media (max-width: 760px) { .goal-types { grid-template-columns: 1fr; } }

/* ===== setup checklist (dashboard) ===== */
.setup { margin-bottom: 12px; }
.setup .card-head > div:first-child { display: flex; align-items: baseline; gap: 10px; }
.setup-meter { width: 96px; height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.setup-meter i { display: block; height: 100%; background: var(--ok); border-radius: 2px; transition: width var(--d3) var(--ease-out); }
.setup-list { list-style: none; margin: 0; padding: 4px 0; }
.setup-list li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 16px; font-size: 13.5px; }
.setup-list li + li { border-top: 1px solid var(--border); }
.setup-list li > div { display: grid; gap: 1px; }
.setup-list li b { font-weight: 500; }
.setup-list li .faint { font-size: 12.5px; }
.setup-list li.done b { color: var(--text-3); font-weight: 400; }
.setup-art { position: relative; display: block; width: 36px; height: 36px; }
.setup-art .art { display: block; }
/* done steps keep their clay icon, redrawn in high-contrast monochrome: a white body in dark mode (charcoal in light)
   with the details in grey, plus the green tick badge */
.setup-list li.done .setup-art .clay { --cb: var(--text) !important; --ca: var(--text-3) !important; --co: var(--text-3) !important; }
.setup-check { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--surface); background: var(--surface-3); display: inline-grid; place-items: center; color: #fff; }
.setup-list li.done .setup-check { background: var(--ok); border-color: var(--ok); }
.setup-list li:not(.done) .setup-check { display: none; }

/* ===== switch + feedback prompts ===== */
.switch { position: relative; width: 32px; height: 18px; flex: none; border-radius: 99px; border: 0; padding: 0; background: var(--surface-3); cursor: pointer; transition: background-color var(--d2); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform 440ms var(--spring), width 160ms var(--ease-out); }
.switch:active::after { width: 18px; }
.switch[aria-checked="true"]:active::after { transform: translateX(10px); }
.switch[aria-checked="true"] { background: var(--text); }
.switch[aria-checked="true"]::after { transform: translateX(14px); background: var(--bg); }
.fb-prompts { margin-bottom: 12px; }
.fb-prompts.off { border-color: color-mix(in srgb, var(--warn) 30%, var(--border)); }
.fb-prompt-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.fb-prompt { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-top: 1px solid var(--border); font-size: 13px; }
.fb-prompt > div { display: grid; gap: 2px; min-width: 0; }
.fb-prompt b { font-weight: 500; }
.fb-prompt .faint { font-size: 12.5px; line-height: 1.45; }
.fb-prompt .switch { margin-top: 1px; }
.fb-prompt-opt { display: grid; gap: 4px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.fb-prompt-opt .input { width: 100%; max-width: 260px; }

.conv-empty { padding: 14px 16px; display: grid; gap: 10px; justify-items: start; }
.conv-empty p { margin: 0; font-size: 13px; }

#set-body .sub-h { font-size: 13px; font-weight: 600; margin: 8px 0 0; padding-top: 14px; border-top: 1px solid var(--border); }

/* File inputs match the rest of the controls instead of the browser default. */
input[type=file] { font-size: 12.5px; color: var(--text-2); max-width: 100%; }
input[type=file]::file-selector-button { height: 28px; padding: 0 10px; margin-right: 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 500 12.5px var(--font); cursor: pointer; transition: background-color var(--d1); }
input[type=file]::file-selector-button:hover { background: var(--surface-2); }

/* ===== home: the sites list opens like the marketing site's hero panel ===== */
.home-hero { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 48px 24px 40px; margin-bottom: 24px; border-radius: 14px;
  background: linear-gradient(#fff -8%, #fafdff 27%, #e1f1ff 89%, #f5faff 110%); }
:root[data-theme="dark"] .home-hero { background: linear-gradient(var(--surface), color-mix(in srgb, var(--sky) 70%, var(--surface))); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .home-hero { background: linear-gradient(var(--surface), color-mix(in srgb, var(--sky) 70%, var(--surface))); } }
.home-hero h1 { font-size: clamp(32px, 3.4vw, 44px); letter-spacing: -0.025em; }
.home-hero p { margin: 0 0 8px; max-width: 520px; font-size: 15px; }
.home-art { display: flex; gap: 6px; margin-bottom: 4px; }
.home-art .art:nth-child(2) { transform: translateY(-6px); }
.home-hero .new-site { justify-content: center; }
.home-hero .new-site .input { width: 200px; background: var(--surface); }
.site-card { padding: 20px 22px; }
.site-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.site-fav { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--powder); color: var(--accent); font: 600 16px/1 var(--display); }
.site-go { color: var(--text-3); transition: color var(--d1), transform var(--d1) var(--ease-out); }
.site-card:hover .site-go { color: var(--accent); transform: translateX(2px); }
.site-card h2 { font: 600 18px/1.25 var(--display); letter-spacing: -0.01em; }

/* saved stars are warm yellow, not ink */
.icon-btn.star.on, .star.on, .star-btn.on svg.i { color: #e0a100; }

/* ===== playful layer: confetti for real wins ===== */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 95; overflow: hidden; }
.confetti-layer i { position: absolute; width: 8px; height: 10px; border-radius: 2px; }

/* =====================================================================
   Controls: kept simple (the tactile "lip and press" test was removed at the user's request).
   Segmented switchers keep their sliding pill; everything else is flat. Brand colours only.
   ===================================================================== */
:root { --iris: #0069e0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --iris: #2f8bff; } }
:root[data-theme="dark"] { --iris: #2f8bff; }
body .btn.primary { background: var(--charcoal); border-color: var(--charcoal); color: var(--brand-fg); }
body .btn.primary:hover { background: var(--charcoal-hover); border-color: var(--charcoal-hover); }
body .btn.primary svg.i { color: var(--brand-fg); }
body select.input { cursor: pointer; }
body select.input:hover { border-color: color-mix(in srgb, var(--text) 22%, var(--border-strong)); }
body .hm-toolbar select.input { height: 30px; }
/* selects whose options carry an icon (customisable select; elsewhere the plain labels show) */
select.with-icons option svg.i, select.with-icons selectedcontent svg.i { color: var(--text-2); flex: none; }
select.with-icons selectedcontent { display: inline-flex; align-items: center; gap: 8px; }
select.with-icons > button { all: unset; display: contents; }
/* the option list matches the app's menus (customisable select, Chromium 135+; other browsers keep the native list) */
@supports (appearance: base-select) {
  body select.input, body select.input::picker(select) { appearance: base-select; }
  body select.input { display: inline-flex; align-items: center; color: var(--text); }
  body select.input::picker-icon { display: none; }
  body select.input::picker(select) { margin-top: 6px; padding: 4px; min-width: anchor-size(width); border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text);
    box-shadow: var(--shadow-pop); opacity: 1; transition: opacity 140ms ease-out, translate 140ms ease-out, display 140ms allow-discrete, overlay 140ms allow-discrete; }
  @starting-style { body select.input:open::picker(select) { opacity: 0; translate: 0 -4px; } }
  body select.input option { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 10px; border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; }
  body select.input option:hover, body select.input option:focus-visible { background: var(--surface-2); outline: none; }
  body select.input option:checked { font-weight: 600; }
  body select.input option::checkmark { order: 1; margin-left: auto; content: "✓"; color: var(--text); }
}
body .chip .chip-body[data-edit] { cursor: pointer; }
body .chip .chip-body[data-edit]:hover { background: var(--surface-2); }
/* Recordings summary cards: plain cards; the selected one gets a soft fill and its number in iris */
.rec-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
body .sumcard { display: grid; gap: 2px; text-align: left; padding: 13px 16px 14px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
  color: var(--text); font: inherit; background: var(--surface); transition: background-color var(--d1), border-color var(--d1); }
body .sumcard:hover { border-color: var(--border-strong); }
body .sumcard[aria-pressed="true"] { background: var(--surface-2); border-color: var(--border-strong); }
body .sumcard[aria-pressed="true"] .sc-v { color: var(--iris); }
body .sumcard[aria-pressed="true"] .sc-l { color: var(--text); }
body .sumcard:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
body .sc-l { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
body .sc-v { font: 600 26px/1.15 var(--display); letter-spacing: -0.02em; }
body .sc-d { font-size: 12px; color: var(--text-3); }
body .page-head h1 { font-size: 30px; }
@media (max-width: 760px) { body .rec-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Install tab: workspace/site ids and the domain lock */
.install-ids { display: grid; gap: 6px; margin: 12px 0 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.install-ids > div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; }
.install-ids dt { color: var(--text-3); font-size: 13px; }
.install-ids dd { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; }
.install-ids .mono { font-family: var(--mono); font-size: 13px; }
.warn-text { color: var(--warn); }
.install-status { margin-top: 12px; }
.install-status p { display: flex; align-items: center; gap: 6px; }
@media (max-width: 560px) { .install-ids > div { grid-template-columns: 1fr; gap: 2px; } }
/* Workspace switcher in the account menu */
.hs-ws-id { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.install-sub { font-size: 14px; margin: 18px 0 4px; }
