/* GenDash pass 1. Cold-case palette: frost, ink, chive, butter, glacier, berry. */
:root {
  --frost: #EEF3F7;
  --ink: #1C2A36;
  --ink-2: #4A5B6A;
  --ink-3: #7B8B99;
  --chive: #3E8E6A;
  --butter: #E7B53C;
  --glacier: #4F8DB8;
  --berry: #C0587E;
  --lilac: #8C7BC4;
  --slate: #8A99A8;

  --glass: rgba(255, 255, 255, .56);
  --glass-strong: rgba(255, 255, 255, .74);
  --glass-edge: rgba(255, 255, 255, .85);
  --glass-line: rgba(28, 42, 54, .08);
  --shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 12px 32px -18px rgba(28, 58, 84, .35);
  --field: rgba(255, 255, 255, .7);
  --grid: rgba(28, 42, 54, .07);

  --r-lg: 22px; --r-md: 16px; --r-sm: 11px;
  --gap: 14px;
  --font: "Onest", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
:root[data-theme="dark"] {
  --frost: #0F1A24; --ink: #E6EEF4; --ink-2: #AFC0CE; --ink-3: #7F93A4;
  --chive: #5DB88D; --butter: #F0C457; --glacier: #74AEDB; --berry: #E07FA1; --lilac: #A99AE0; --slate: #6F8294;
  --glass: rgba(24, 38, 52, .55); --glass-strong: rgba(28, 44, 60, .78); --glass-edge: rgba(255,255,255,.12);
  --glass-line: rgba(255,255,255,.07); --field: rgba(10, 20, 30, .45); --grid: rgba(255,255,255,.07);
  --shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 16px 36px -20px rgba(0,0,0,.8);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: inherit; }
html { height: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0; min-height: 100%; font-family: var(--font); color: var(--ink); background: var(--frost);
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  padding: 14px clamp(12px, 3vw, 32px) 32px; max-width: 1320px; margin-inline: auto;
}
button, input, select { font: inherit; color: inherit; }
svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--glacier); outline-offset: 2px; }

/* Category themes: the light and the glass take the category's hue; chart colours never change */
@property --aur1 { syntax: "<color>"; inherits: true; initial-value: #BFDCEF; }
@property --aur2 { syntax: "<color>"; inherits: true; initial-value: #E3ECF4; }
@property --aur3 { syntax: "<color>"; inherits: true; initial-value: #C9E6D6; }
@property --tint { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0); }
@property --mark { syntax: "<color>"; inherits: true; initial-value: #E7B53C; }
:root { --aur1: #A9CDE8; --aur2: #D2E3F1; --aur3: #EEF3F7; --tint: rgba(170,205,232,.12); --mark: #E7B53C;
  transition: --aur1 1s ease, --aur2 1s ease, --aur3 1s ease, --tint .8s ease, --mark .8s ease; }
:root[data-cat="yogurt"] { --aur1: #8FC2EC; --aur2: #C6DFF4; --aur3: #EEF3F7; --tint: rgba(130,185,235,.18); --mark: #5B9FD8; }
:root[data-cat="sour_cream"] { --aur1: #A9D3B3; --aur2: #D3E9D6; --aur3: #EEF3F7; --tint: rgba(150,205,165,.18); --mark: #6AAE7E; }
:root[data-cat="cream_cheese"] { --aur1: #F2BE98; --aur2: #F8DCC6; --aur3: #EEF3F7; --tint: rgba(240,180,135,.18); --mark: #E58E55; }
:root[data-cat="butter"] { --aur1: #F1D27A; --aur2: #F8E7B4; --aur3: #EEF3F7; --tint: rgba(240,205,100,.18); --mark: #DDA42A; }
:root[data-theme="dark"] { --aur1: #1E3C55; --aur2: #1A2E40; --aur3: #0F1A24; --tint: rgba(120,170,210,.06); }
:root[data-theme="dark"][data-cat="yogurt"] { --aur1: #1D4466; --aur2: #173550; --aur3: #0F1A24; --tint: rgba(110,170,230,.09); }
:root[data-theme="dark"][data-cat="sour_cream"] { --aur1: #1F4634; --aur2: #1A3529; --aur3: #0F1A24; --tint: rgba(120,200,150,.08); }
:root[data-theme="dark"][data-cat="cream_cheese"] { --aur1: #4C3222; --aur2: #3A281D; --aur3: #0F1A24; --tint: rgba(240,170,120,.08); }
:root[data-theme="dark"][data-cat="butter"] { --aur1: #4A3E18; --aur2: #3A3116; --aur3: #0F1A24; --tint: rgba(240,200,90,.08); }

/* Drifting light behind the glass */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; animation: bloom 1.4s ease-out both; }
@keyframes bloom { from { opacity: 0; transform: scale(.94); filter: saturate(.6); } }
.aurora { background: linear-gradient(180deg, var(--aur1) 0%, var(--aur2) 32%, var(--aur3) 72%); }
.aurora i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .35; animation: drift 38s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { width: 46vw; height: 46vw; left: -10vw; top: -14vw; background: var(--aur1); }
.aurora i:nth-child(2) { width: 38vw; height: 38vw; right: -8vw; top: -10vh; background: var(--aur1); animation-duration: 46s; }
.aurora i:nth-child(3) { display: none; }
:root[data-theme="dark"] .aurora i { opacity: .22; }
@keyframes drift { to { transform: translate(6vw, 4vh) scale(1.08); } }

/* Glass surface, with a light that follows the pointer (set by app.js) */
.glass {
  position: relative; background: linear-gradient(var(--tint), var(--tint)), var(--glass); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(18px) saturate(1.35); backdrop-filter: blur(18px) saturate(1.35);
  box-shadow: var(--shadow);
}
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(380px circle at var(--lx, -500px) var(--ly, -500px), rgba(255,255,255,.38), transparent 60%);
  opacity: var(--lo, 0); transition: opacity .3s;
}
:root[data-theme="dark"] .glass::after { background: radial-gradient(380px circle at var(--lx, -500px) var(--ly, -500px), rgba(160,200,230,.10), transparent 60%); }

/* Header: brand, back square, one-line panel, settings */
.top { display: grid; grid-template-columns: 158px 56px 56px minmax(0, 1fr) 44px; grid-template-areas: "brand back fwd panel settings" ". . . tip ."; gap: 0 10px; align-items: center; }
.panel { margin-left: 4px; }
.brand { grid-area: brand; display: grid; gap: 2px; min-width: 0; }
.brand-name { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 22px; letter-spacing: -.015em; }
.brand-mark { width: 13px; height: 13px; border-radius: 50%; background: var(--mark); box-shadow: 0 0 0 4px color-mix(in srgb, var(--mark) 25%, transparent); flex: none; }
.brand-sub { color: var(--ink-3); font-size: 14px; padding-left: 22px; white-space: nowrap; }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--glass-edge); background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); }
.icon-btn svg { width: 20px; height: 20px; }
.settings-wrap { grid-area: settings; position: relative; justify-self: end; }
.back { grid-area: back; width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); align-self: start; }
.back svg { width: 22px; height: 22px; }
.back:disabled { cursor: default; color: var(--ink-3); opacity: .55; }

.panel { grid-area: panel; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; border-radius: 22px; padding: 8px 14px 8px 10px; min-height: 72px; z-index: 6; }
.ask { min-width: 0; }
.field { position: relative; display: flex; align-items: center; }
.field textarea, .m-ask textarea { width: 100%; resize: none; border: 1px solid transparent; border-radius: 13px; background: var(--field); padding: 11px 14px; font: inherit; font-size: 17px; line-height: 1.35; outline: none; overflow: hidden; transition: border-color .15s; display: block; }
.field textarea { padding-right: 150px; }
.field textarea:focus, .m-ask textarea:focus { border-color: rgba(79,141,184,.45); }
.field textarea.interim, .m-ask textarea.interim { color: var(--ink-3); font-style: italic; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 12px 5px 10px; font-size: 13px; font-weight: 500; cursor: pointer;
  border: 1px solid rgba(79,141,184,.35); background: rgba(79,141,184,.12); color: var(--glacier); white-space: nowrap; flex: none; }
.pill svg { width: 15px; height: 15px; }
.pill.inline { position: absolute; right: 8px; bottom: 8px; animation: pillIn .3s ease-out both; }
.pill[hidden] { display: none; }
@keyframes pillIn { from { opacity: 0; transform: translateX(6px); } }

/* Mode switch: side by side, greyed; a dot marks a mode forced for the next command */
.mode { display: flex; gap: 12px; }
.mode button { display: flex; align-items: center; gap: 7px; border: 0; background: none; padding: 4px 2px; font-size: 12.5px; color: var(--ink-3); cursor: pointer; white-space: nowrap; }
.mode i { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid currentColor; display: grid; place-items: center; opacity: .7; flex: none; }
.mode button[aria-pressed="true"] { color: var(--ink-2); }
.mode button[aria-pressed="true"] i { background: var(--ink-3); border-color: var(--ink-3); opacity: 1; }
.mode button[aria-pressed="true"] i::after { content: ""; width: 7px; height: 4px; border: 1.8px solid var(--frost); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.mode button.next { color: var(--ink); }
.mode button.next i { border-color: var(--butter); background: rgba(231,181,60,.25); }
.mode button.next::after { content: "next"; font-size: 11px; color: var(--butter); font-weight: 600; }

/* Tip line under the panel: faint, no box, fades between tips */
.tip { grid-area: tip; margin: 7px 0 0 12px; min-height: 18px; font-size: 12.5px; color: var(--ink-3); opacity: .85; transition: opacity .5s ease; }
.tip.fade { opacity: 0; }
.tip.error { color: var(--berry); opacity: 1; }
.tip b { font-weight: 600; color: var(--ink-2); }
.m-ask { display: none; }

/* The one bold element: the voice button */
.voice {
  --size: 60px; position: relative; width: var(--size); height: var(--size); border-radius: 50%; border: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #F8D77A, var(--butter) 55%, #C8921C);
  color: #2B2206; display: grid; place-items: center; margin-block: -2px;
  box-shadow: 0 10px 28px -8px rgba(199,140,20,.7), 0 0 0 6px rgba(231,181,60,.18), inset 0 2px 0 rgba(255,255,255,.55);
  transition: transform .15s ease, box-shadow .2s ease;
}
.voice:hover { transform: translateY(-1px); }
.voice:active { transform: scale(.97); }
.voice .mic { width: 30px; height: 30px; stroke-width: 2.2; transition: opacity .2s; }
.voice .halo { position: absolute; inset: -10px; border-radius: 50%; border: 2px solid rgba(231,181,60,.55); opacity: 0; }
.voice .meter { position: absolute; display: flex; gap: 3px; align-items: center; height: 28px; opacity: 0; transition: opacity .2s; }
.voice .meter b { width: 4px; height: 28px; border-radius: 2px; background: #2B2206; transform: scaleY(.15); transition: transform .08s linear; }
.voice[data-state="listening"] .mic, .voice[data-state="long"] .mic { opacity: 0; }
.voice[data-state="listening"] .meter, .voice[data-state="long"] .meter { opacity: 1; }
.voice[data-state="listening"] .halo, .voice[data-state="long"] .halo { animation: halo 1.6s ease-out infinite; }
.voice[data-state="long"] { background: radial-gradient(circle at 35% 30%, #9FD4B8, var(--chive) 60%, #2B6B4E); color: #fff; }
.voice[data-state="long"] .meter b { background: #fff; }
.voice[data-state="busy"] .mic { animation: breathe 1s ease-in-out infinite; }
@keyframes halo { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }
@keyframes breathe { 50% { opacity: .35; } }

/* Settings panel */
.settings { position: absolute; right: 0; top: 54px; width: 250px; border-radius: var(--r-md); padding: 14px 16px; background: var(--glass-strong); z-index: 20; }
.set-title { margin: 4px 0 8px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.set-title + .toggles, .toggles { display: grid; gap: 6px; margin-bottom: 10px; }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; padding: 3px 0; }
.switch input { accent-color: var(--chive); width: 17px; height: 17px; margin: 0; }
.set-note { margin: 8px 0 0; font-size: 12px; color: var(--ink-3); }

/* Slot under the panel: categories sit at the top until voice starts, then slide down under the chips */
.slot { position: relative; height: 128px; margin-top: 6px; }
.chip-row { position: absolute; left: 0; right: 0; top: 0; display: flex; gap: 10px; align-items: flex-start; opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .35s ease, transform .35s ease; }
.slot[data-active="true"] .chip-row { opacity: 1; transform: none; pointer-events: auto; }
.cats { position: absolute; left: 0; right: 0; top: 0; overflow-x: auto; scrollbar-width: none; transition: transform .5s cubic-bezier(.2,.8,.2,1); -webkit-mask-image: linear-gradient(90deg, #000 94%, transparent); mask-image: linear-gradient(90deg, #000 94%, transparent); }
.slot[data-active="true"] .cats { transform: translateY(58px); }
.cats::-webkit-scrollbar { display: none; }
.cat-track { display: flex; gap: 6px; padding: 2px 24px 2px 2px; width: max-content; }
.cat { border: 1px solid transparent; background: transparent; padding: 9px 16px; border-radius: 12px; font-weight: 500; font-size: 15px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.cat:hover { background: var(--glass); }
.cat[aria-current="true"] { background: var(--glass-strong); border-color: var(--glass-edge); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
.q-pill { padding: 7px 12px 7px 14px; font-size: 13.5px; }
.q-pill svg { transition: transform .2s; }
.q-pill[aria-expanded="true"] svg { transform: rotate(180deg); }
.questions { position: absolute; right: 0; top: 52px; width: min(560px, 100%); border-radius: var(--r-md); padding: 8px; z-index: 30; background: var(--glass-strong); }
.questions[hidden] { display: none; }
.questions p { margin: 6px 10px 6px; font-size: 12.5px; color: var(--ink-3); }
.questions button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 10px; font-size: 14.5px; cursor: pointer; }
.questions button:hover, .questions button:focus-visible { background: var(--field); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; padding: 2px; overflow: hidden; }
.chip { border: 1px solid var(--glass-edge); background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-radius: 999px; padding: 8px 16px 8px 13px; font-size: 14px; white-space: nowrap; flex: none; cursor: pointer; box-shadow: var(--shadow); transition: transform .12s, background .15s; }
.chip:hover { transform: translateY(-1px); }
.chip.provisional { opacity: .6; border-style: dashed; }
.chip[aria-pressed="true"] { background: var(--chive); color: #fff; border-color: var(--chive); }
.chip .sc { margin-left: 6px; font-size: 12px; opacity: .6; font-variant-numeric: tabular-nums; }

.chip { display: inline-flex; align-items: center; gap: 7px; }
.chip .kd { width: 7px; height: 7px; border-radius: 50%; background: var(--kind, var(--ink-3)); flex: none; }
.chip small { font-size: 12px; color: var(--ink-3); margin-right: -2px; }
.chip[data-kind="view"] { --kind: var(--glacier); }
.chip[data-kind="place"] { --kind: var(--chive); }
.chip[data-kind="brand"] { --kind: var(--lilac); }
.chip[data-kind="time"] { --kind: var(--butter); }
.chip[data-kind="size"] { --kind: var(--slate); }
.chip[data-kind="product"] { --kind: var(--ink-3); }
.chip.heard { background: rgba(231,181,60,.16); border-color: rgba(231,181,60,.55); }

/* Filters */
.filters { margin-top: 0; border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.filters[hidden] { display: none; }
.f { display: grid; gap: 4px; min-width: 130px; flex: 1 1 130px; max-width: 220px; }
.f span { font-size: 12px; color: var(--ink-3); }
.f select { appearance: none; border: 1px solid var(--glass-line); background: var(--field) url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237B8B99' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 10px center / 16px;
  border-radius: 10px; padding: 8px 32px 8px 11px; font-size: 14px; cursor: pointer; }
.f-reset { border: 0; background: none; color: var(--glacier); font-size: 13.5px; cursor: pointer; padding: 8px 4px; margin-left: auto; }

.f select.unset { color: var(--ink-3); }
.f-sum { display: none; }
.f-body { display: contents; }

/* Canvas: fixed frame that regenerates as one block */
.canvas { position: relative; margin-top: 16px; display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); min-height: 720px; align-content: start; }
.invite { grid-column: 1 / -1; min-height: 720px; display: grid; place-content: start center; padding-top: 200px; text-align: center; gap: 10px; border-radius: var(--r-lg); border: 1px dashed var(--glass-line); }
.invite strong { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: clamp(22px, 2.2vw, 28px); letter-spacing: .005em; color: var(--ink-2); opacity: .7; line-height: 1.3; }
.invite strong em { font-style: italic; }
.invite span { font-size: 13.5px; color: var(--ink-3); opacity: .75; }
.invite.first > * { animation: unblur 1.1s ease-out .5s both; }
@keyframes unblur { from { opacity: 0; filter: blur(10px); } }
.insights { grid-column: 1 / -1; border-radius: var(--r-md); padding: 12px 18px; border-left: 3px solid var(--chive); }
.ins-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ins-list li { display: grid; grid-template-columns: 10px 1fr; gap: 10px; align-items: baseline; max-width: 90ch; }
.ins-list li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--chive)); transform: translateY(-1px); }
.ins-list li.neg { --dot: var(--berry); }
.ins-list li.opp { --dot: var(--butter); }
.ins-list b { font-weight: 600; font-variant-numeric: tabular-nums; }
.ins-foot { margin: 8px 0 0 20px; font-size: 11.5px; color: var(--ink-3); }
.view-head { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 2px -2px; }
.view-title { margin: 0; font-size: clamp(20px, 2.3vw, 26px); font-weight: 600; letter-spacing: -.015em; }
.view-meta { font-size: 13px; color: var(--ink-3); }
.card { border-radius: var(--r-md); padding: 16px 18px; display: flex; flex-direction: column; min-width: 0; }
.card h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card .sub-t { margin: 2px 0 10px; font-size: 12.5px; color: var(--ink-3); }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; }
.s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: span 12; }
.chart { position: relative; flex: 1; min-height: 300px; }
.chart.tall { min-height: 300px; }
.chart.short { min-height: 190px; }

/* KPI cards */
.kpi { gap: 2px; padding-bottom: 12px; }
.kpi .k-label { font-size: 13px; color: var(--ink-2); }
.kpi .k-value { font-size: clamp(24px, 2.4vw, 30px); font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .k-delta { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.up { color: var(--chive); } .down { color: var(--berry); } .flat { color: var(--ink-3); }
.kpi .spark { height: 42px; margin-top: 6px; position: relative; }

/* Heatmap table */
.heat-wrap { overflow-x: auto; }
.heat { border-collapse: separate; border-spacing: 4px; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.heat th { font-weight: 500; color: var(--ink-3); text-align: right; padding: 4px 6px; white-space: nowrap; }
.heat th:first-child, .heat td:first-child { text-align: left; }
.heat td { padding: 8px 8px; border-radius: 8px; text-align: right; white-space: nowrap; }
.heat td:first-child { font-weight: 500; background: none !important; padding-left: 2px; }

/* Size of prize */
.prize { justify-content: space-between; border-left: 3px solid var(--butter); }
.prize .p-value { font-size: clamp(30px, 3.2vw, 40px); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 6px 0 2px; }
.prize p { margin: 0; color: var(--ink-2); max-width: 46ch; }
.prize .p-how { margin-top: 12px; font-size: 12.5px; color: var(--ink-3); }

/* Data table */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--glass-line); white-space: nowrap; }
.tbl th { font-weight: 500; color: var(--ink-3); }
.tbl th:first-child, .tbl td:first-child { text-align: left; }

.k-note { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.numbers { grid-column: 1 / -1; border-radius: var(--r-md); padding: 4px 18px; }
.numbers summary { cursor: pointer; padding: 12px 0; font-weight: 600; font-size: 14px; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 8px; }
.numbers summary::-webkit-details-marker { display: none; }
.numbers summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .2s; }
.numbers[open] summary::before { transform: rotate(45deg); }
.numbers .tbl-wrap { padding-bottom: 14px; }
.numbers .heat-wrap { padding-bottom: 14px; }

/* Generating: skeleton of the incoming layout with a light sweep */
.sk { border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--glass-edge); position: relative; overflow: hidden; }
.sk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.55) 45%, rgba(231,181,60,.18) 50%, transparent 70%); transform: translateX(-100%); animation: sweep .6s cubic-bezier(.4,0,.2,1) forwards; }
:root[data-theme="dark"] .sk::after { background: linear-gradient(100deg, transparent 20%, rgba(160,200,230,.14) 45%, rgba(240,196,87,.12) 50%, transparent 70%); }
.sk.h-ins { height: 86px; } .sk.h-kpi { height: 128px; } .sk.h-chart { height: 390px; }
.canvas::before { content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--butter), var(--glacier), transparent); opacity: 0; transform: scaleX(0); transform-origin: left; }
.canvas.gen::before { animation: line .55s ease-out forwards; }
@keyframes sweep { to { transform: translateX(100%); } }
@keyframes line { 0% { opacity: 1; transform: scaleX(0); } 80% { opacity: 1; transform: scaleX(1); } 100% { opacity: 0; transform: scaleX(1); } }
.canvas.reveal > * { animation: resolve .38s ease-out both; }
@keyframes resolve { from { opacity: 0; filter: blur(6px); } }

.foot { margin-top: 28px; text-align: center; font-size: 12.5px; color: var(--ink-3); }
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); border-radius: 14px; padding: 12px 18px; font-size: 14px; max-width: min(460px, 90vw); z-index: 50; background: var(--glass-strong); }
.toast[hidden] { display: none; }


@media (max-width: 1000px) {
  .s3 { grid-column: span 6; } .s4, .s5, .s7, .s8, .s6 { grid-column: span 12; }
}
@media (max-width: 760px) {
  body { padding-inline: 12px; }
  .top { grid-template-columns: 58px minmax(0, 1fr) 44px; grid-template-areas: "brand brand settings" "back panel panel" "mask mask mask" "tip tip tip"; gap: 12px 10px; }
  .brand { grid-auto-flow: column; justify-content: start; align-items: baseline; gap: 10px; }
  .brand-name { font-size: 19px; } .brand-sub { padding-left: 0; font-size: 13px; }
  .back { width: 58px; height: 58px; border-radius: 17px; align-self: center; }
  .panel { grid-template-columns: minmax(0, 1fr) auto; min-height: 58px; padding: 6px 8px 6px 14px; }
  .ask { display: none; }
  .mode { order: -1; gap: 14px; }
  .voice { --size: 48px; }
  .m-ask { grid-area: mask; display: flex; align-items: flex-end; gap: 8px; border-radius: 16px; padding: 6px; }
  .m-ask[hidden] { display: none; }
  .m-ask textarea { font-size: 16px; padding: 9px 12px; }
  .ai-dot { flex: none; width: 34px; height: 34px; border-radius: 11px; border: 1px solid rgba(79,141,184,.35); background: rgba(79,141,184,.12); color: var(--glacier); font-size: 12px; font-weight: 700; letter-spacing: .02em; cursor: pointer; margin-bottom: 2px; }
  .tip { margin: 0 0 0 4px; }
  .slot { height: 150px; }
  .slot[data-active="true"] .cats { transform: translateY(96px); }
  .q-pill, .questions { display: none !important; }
  .chip { font-size: 13px; padding: 6px 11px 6px 10px; gap: 6px; }
  .chips { gap: 6px; }
  .filters { padding: 0; display: block; }
  .f-sum { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; border: 0; background: none; padding: 13px 16px; font-size: 14px; color: var(--ink-2); cursor: pointer; text-align: left; }
  .f-sum span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .f-sum svg { width: 16px; height: 16px; flex: none; transition: transform .2s; }
  .filters.open .f-sum svg { transform: rotate(180deg); }
  .f-body { display: none; }
  .filters.open .f-body { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 14px 14px; }
  .f { max-width: none; min-width: 0; }
  .s3, .s4, .s5, .s6, .s7, .s8, .s12 { grid-column: span 12; }
  .kpi .k-value { font-size: 24px; }
  .card { padding: 14px; }
  .canvas, .invite { min-height: 460px; }
  .invite { padding-top: 90px; padding-inline: 20px; }
  .sk.h-chart { height: 300px; }
  .view-head { flex-direction: column; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .aurora, .aurora i, .voice .halo, .invite.first > *, .sk::after, .canvas.gen::before, .canvas.reveal > * { animation: none !important; }
  .cats, .chip-row { transition: none; }
}

/* Canvas cards stay white: the theme lives around the canvas, not on the data */
.canvas .glass { background: rgba(255,255,255,.94); -webkit-backdrop-filter: none; backdrop-filter: none; }
:root[data-theme="dark"] .canvas .glass { background: rgba(18,30,42,.94); }

/* Brand is the home button */
.brand { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.brand:hover .brand-name { opacity: .8; }

/* Back and forward share one square, split by a recessed divider */
.nav-sq { grid-area: back; width: 72px; height: 72px; border-radius: 20px; display: grid; grid-template-columns: 1fr 1fr; align-self: start; }
.nav-sq::before { content: ""; position: absolute; left: 50%; top: 14px; bottom: 14px; width: 1px; background: rgba(28,42,54,.16); box-shadow: 1px 0 0 rgba(255,255,255,.9); pointer-events: none; z-index: 1; }
.nav-sq button { position: relative; border: 0; background: none; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); transition: background .2s, box-shadow .2s; }
.nav-sq button:first-child { border-radius: 20px 0 0 20px; } .nav-sq button:last-child { border-radius: 0 20px 20px 0; }
.nav-sq button svg { width: 19px; height: 19px; }
.nav-sq button:not(:disabled):hover { background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.95), rgba(255,255,255,.2) 75%); box-shadow: inset 0 0 14px rgba(231,181,60,.32); }
.nav-sq button:disabled { color: var(--ink-3); opacity: .45; cursor: default; }

/* Hover hints under icons */
[data-tip] { position: relative; }
[data-tip]:not(:disabled):hover::after { content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--frost);
  font-size: 12px; font-weight: 500; padding: 5px 9px; border-radius: 8px; white-space: nowrap; z-index: 40; pointer-events: none; }
.hot[data-tip]:hover::after { white-space: normal; width: 240px; left: auto; right: 0; transform: none; text-align: left; line-height: 1.4; }

/* Mic: ten greeting pulses, a quicker glow on hover, green and swelling with your voice while listening */
.voice.greet .halo { animation: greet 3s ease-out 1.2s 10; }
@keyframes greet { 0% { transform: scale(.9); opacity: 0; } 12% { opacity: .9; } 55% { transform: scale(1.45); opacity: 0; } 100% { opacity: 0; } }
.voice:hover .halo { animation: halo 1.1s ease-out infinite; }
.voice[data-state="listening"] .meter, .voice[data-state="long"] .meter { opacity: 0 !important; }
.voice[data-state="listening"] .mic, .voice[data-state="long"] .mic { opacity: 1 !important; color: var(--chive); transform: scale(calc(1 + var(--lvl, 0) * .45)); transition: transform .08s linear; stroke-width: 2.6; }
.voice[data-state="long"] { background: radial-gradient(circle at 35% 30%, #F8D77A, var(--butter) 55%, #C8921C); color: #2B2206; }

/* Filter tools: fire (live) and reset above the panel, apply below */
.filter-wrap { position: relative; margin-top: 4px; }
.f-tools { position: absolute; right: 12px; top: -34px; display: flex; align-items: center; gap: 10px; z-index: 5; }
.f-reset { border: 0; background: none; color: var(--glacier); font-size: 13px; cursor: pointer; padding: 4px 2px; margin: 0; }
.hot { width: 30px; height: 30px; border-radius: 10px; border: 1px solid var(--glass-edge); background: var(--glass-strong); display: grid; place-items: center; cursor: pointer; color: var(--ink-3); box-shadow: var(--shadow); }
.hot svg { width: 17px; height: 17px; }
.hot[aria-pressed="true"] { color: #D64545; }
.hot[aria-pressed="true"] svg { fill: rgba(214,69,69,.22); }
.apply-row { display: flex; justify-content: center; }
.apply { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 9px 18px 9px 14px; background: var(--ink); color: var(--frost); font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 8px 20px -10px rgba(28,42,54,.6); animation: pillIn .3s ease-out both; }
.apply svg { width: 17px; height: 17px; stroke-width: 2.5; }
.apply[hidden] { display: none; }
.canvas .frame { grid-column: 1 / -1; min-height: var(--fit, 420px); border-radius: var(--r-lg); border: 1px dashed var(--glass-line); }
.canvas.empty { min-height: 0; }
.hist-sub { margin: 14px 10px 4px !important; font-weight: 600; color: var(--ink-2) !important; }

@media (max-width: 760px) {
  .nav-sq { width: 58px; height: 58px; border-radius: 17px; align-self: center; }
  .nav-sq::before { top: 12px; bottom: 12px; }
  [data-tip]:hover::after { display: none; }
  .f-tools { top: -32px; right: 6px; }
  .filter-wrap { margin-top: 34px; }
}

/* pass2-04: back and forward as two separate buttons */
.nav-sq { display: none; }
.nav-btn { width: 56px; height: 72px; border-radius: 18px; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); align-self: start; transition: box-shadow .2s, background .2s; }
.back-b { grid-area: back; } .fwd-b { grid-area: fwd; }
.nav-btn svg { width: 20px; height: 20px; }
.nav-btn:not(:disabled):hover { box-shadow: var(--shadow), inset 0 0 16px rgba(231,181,60,.3); }
.nav-btn:disabled { color: var(--ink-3); opacity: .45; cursor: default; }
.mode[hidden] { display: none; }

/* Mic: hover dims and lifts, no glow; glow only while recording; full colour while active */
.voice:hover .halo { animation: none; }
.voice:hover { transform: translateY(-2px); filter: brightness(.93); }
.voice[data-state="listening"], .voice[data-state="long"], .voice[data-state="busy"], .voice:active { filter: none; }
.voice[data-state="listening"]:hover, .voice[data-state="long"]:hover { transform: none; filter: none; }
.voice.greet:hover .halo { animation: greet 3s ease-out 1.2s 10; }

/* Two-step reset: dimmed canvas and the hint beside Reset */
.canvas.dim { opacity: .38; filter: grayscale(.35); transition: opacity .35s ease, filter .35s ease; pointer-events: none; }
.f-hint { font-size: 12px; color: var(--ink-3); animation: pillIn .3s ease-out both; }
.f-hint[hidden] { display: none; }

@media (max-width: 760px) {
  .top { grid-template-columns: 46px 46px minmax(0, 1fr) 44px; grid-template-areas: "brand brand brand settings" "back fwd panel panel" "mask mask mask mask" "tip tip tip tip"; gap: 12px 8px; }
  .nav-btn { width: 46px; height: 58px; border-radius: 15px; align-self: center; }
  .panel { margin-left: 0; }
  .f-hint { display: none; }
}

/* pass2-05: even header spacing, super category switcher, company, icons, stable chips */
.top { grid-template-columns: 170px 64px 64px minmax(0, 1fr) auto; gap: 0 16px; }
.panel { margin-left: 0; }
.nav-btn { width: 64px; height: 72px; align-self: center; }
.panel { align-self: center; }
.brand { align-self: center; display: grid; gap: 3px; }
.brand-name { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; font-size: 22px; letter-spacing: -.015em; color: var(--ink); cursor: pointer; display: flex; align-items: center; gap: 9px; }
.brand-name:hover { opacity: .8; }
.super { position: relative; padding-left: 22px; }
.brand-sub { border: 0; background: none; padding: 2px 0; font: inherit; font-size: 14.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.brand-sub svg { width: 15px; height: 15px; transition: transform .2s; }
.brand-sub[aria-expanded="true"] svg { transform: rotate(180deg); }
.super-menu { position: absolute; left: 12px; top: 28px; width: 210px; border-radius: 14px; padding: 6px; background: var(--glass-strong); z-index: 40; display: grid; }
.super-menu[hidden] { display: none; }
.super-menu button { border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: 9px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.super-menu button.on { font-weight: 600; background: var(--field); }
.super-menu button:disabled { color: var(--ink-3); opacity: .6; cursor: default; }
.super-menu span { font-size: 11.5px; }
.settings-wrap { display: flex; align-items: center; gap: 12px; }
.company { font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; padding: 6px 12px; border-radius: 10px; border: 1px dashed rgba(28,42,54,.18); }
.tip { margin-left: 26px; }
.cat-track { padding-left: 0; }
.q-pill { transition: transform .15s, box-shadow .15s, background .15s; }
.q-pill:hover { transform: translateY(-1px); background: rgba(79,141,184,.2); box-shadow: 0 6px 14px -8px rgba(79,141,184,.6); }
.q-pill .lead { width: 15px; height: 15px; }
.chip[aria-pressed="true"] .kd { background: #fff; }
/* Slot: small until the first command, then opens once */
.slot { height: 52px; transition: height .45s cubic-bezier(.2,.8,.2,1); }
.slot[data-active="true"] { height: 128px; }
/* Fire hint opens upward so it never covers the filters */
.hot[data-tip]:hover::after { top: auto; bottom: calc(100% + 8px); }
/* Reset: icon, hint, and a warning tone after the first press */
.f-reset { display: inline-flex; align-items: center; gap: 5px; }
.f-reset svg { width: 14px; height: 14px; }
.f-reset[data-tip]:hover::after { top: auto; bottom: calc(100% + 8px); }
.f-hint { color: #B4532A; background: rgba(235,130,60,.14); border: 1px solid rgba(235,130,60,.35); padding: 3px 9px; border-radius: 8px; font-weight: 500; }
@media (max-width: 760px) {
  .top { grid-template-columns: 46px 46px minmax(0, 1fr) auto; gap: 12px 8px; }
  .nav-btn { width: 46px; height: 58px; }
  .company { display: none; }
  .slot { height: 48px; } .slot[data-active="true"] { height: 150px; }
}

/* pass2-06 */
.top { grid-template-columns: max-content 64px 64px minmax(0, 1fr) auto; }
.brand-name { border-radius: 10px; padding: 2px 6px; margin: -2px -6px; }
.brand-sub { color: var(--ink-2); gap: 6px; }
.chev { display: inline-block; font-size: 17px; line-height: 1; transition: transform .2s; transform-origin: 45% 55%; }
.brand-sub[aria-expanded="true"] .chev { transform: rotate(90deg); }
.super { padding-left: 20px; }
.super-menu hr { border: 0; border-top: 1px solid var(--glass-line); margin: 6px 4px; width: auto; }
.super-menu .company { margin: 2px 10px 6px; padding: 0; border: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
/* Focus outline for keyboard only, following each element's rounded corners */
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--glacier); outline-offset: 3px; }
/* Theme button shows the mode you would switch to */
#themeBtn .sun { display: none; }
:root[data-theme="dark"] #themeBtn .sun { display: block; }
:root[data-theme="dark"] #themeBtn .moon { display: none; }
#themeBtn[data-tip]:hover::after, #settingsBtn[data-tip]:hover::after { left: auto; right: 0; transform: none; }
/* Hints: wider, two lines at most, above everything */
.filter-wrap { z-index: 20; }
.hot[data-tip]:hover::after, .f-reset[data-tip]:hover::after { width: 330px; white-space: normal; }
/* Spacing: lower filters on the start screen, a little more room when populated */
.slot { height: 92px; }
.slot[data-active="true"] { height: 150px; }
/* Space tip to the right of the mic, before the first search */
.space-tip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.space-tip[hidden] { display: none; }
.space-tip kbd { font: inherit; font-size: 11.5px; font-weight: 600; color: var(--ink-2); padding: 2px 8px; border-radius: 6px; border: 1px solid var(--glass-line); border-bottom-width: 2px; background: var(--field); }
@media (max-width: 760px) {
  .top { grid-template-columns: 46px 46px minmax(0, 1fr) auto; }
  .slot { height: 56px; } .slot[data-active="true"] { height: 150px; }
  .space-tip { display: none !important; }
  #themeBtn { width: 40px; height: 40px; }
}

/* Mode: neither ticked means Auto; a tick forces the next command and looks the same for both */
.mode button[aria-pressed="true"] { color: var(--ink); }
.mode button[aria-pressed="true"] i { background: var(--ink-2); border-color: var(--ink-2); opacity: 1; }
.mode.away { display: none; }
.mode-label { font-size: 12.5px; font-weight: 600; color: var(--chive); white-space: nowrap; animation: pillIn .3s ease-out both; }
.mode-label[hidden] { display: none; }
/* Tip line: examples only, spread across the panel's width */
.tip { white-space: nowrap; overflow: hidden; }
.tip .ex-label { color: var(--ink-3); margin-right: 14px; }
.tip b { margin-right: 22px; }
.tip.fade { transition: opacity .45s ease; }

/* Filter clarity: notes where a filter cannot apply, and the chosen cell in grids */
.view-note { grid-column: 1 / -1; margin: -4px 4px 0; font-size: 12.5px; color: var(--ink-3); }
.heat td.strong { outline: 2px solid var(--ink-2); outline-offset: -2px; font-weight: 700; }

/* pass2-07: categories sit on the filters; the open space above them holds the chips */
.slot { height: 150px; display: flex; flex-direction: column; justify-content: flex-end; transition: none; }
.slot[data-active="true"] { height: 150px; }
.chip-row { top: 18px; }
.cats, .slot[data-active="true"] .cats { position: relative; top: auto; transform: none; transition: none; }
.filter-wrap { margin-top: 10px; }
.f-tools { top: -46px; }
.questions { top: 62px; }
/* Back and forward match the square buttons on the right */
.top { grid-template-columns: max-content 44px 44px minmax(0, 1fr) auto; }
.nav-btn { width: 44px; height: 44px; border-radius: 14px; align-self: center; box-shadow: var(--shadow); }
.nav-btn svg { width: 18px; height: 18px; }
/* Questions and History: bright on hover and while open */
.q-pill:hover, .q-pill[aria-expanded="true"] { background: var(--glacier); border-color: var(--glacier); color: #fff; box-shadow: 0 8px 18px -8px rgba(79,141,184,.8); }
/* Watermarks: light, faint, sharing one left edge */
.wm-product, .wm-region { position: absolute; left: 66%; font-weight: 300; font-size: 56px; line-height: 1; letter-spacing: -.01em; pointer-events: none; white-space: nowrap; user-select: none; }
.wm-product { bottom: 2px; color: rgba(255,255,255,.34); z-index: 0; animation: unblur .6s ease-out both; }
.wm-product:empty { display: none; }
:root[data-theme="dark"] .wm-product { color: color-mix(in srgb, var(--mark) 22%, transparent); }
.insights { position: relative; overflow: hidden; }
.wm-region { top: 50%; transform: translateY(-50%); color: color-mix(in srgb, var(--mark) 24%, transparent); }
.cats, .chip-row, .f-tools { z-index: 2; }
/* Focus ring drawn inside category buttons so the row never clips it */
.cat:focus-visible { outline-offset: -3px; }
@media (max-width: 760px) {
  .top { grid-template-columns: 44px 44px minmax(0, 1fr) auto; }
  .slot, .slot[data-active="true"] { height: 150px; }
  .f-tools { top: -40px; }
  .wm-product, .wm-region { display: none; }
}
