/* AI Answer Lab. Visual language of succession.media: Sora display, Inter body, Caveat notes,
   ink #0B1220, brand #2F6BFF, mist #F5F7FB, pill buttons, soft card shadows. White theme only. */

@font-face { font-family: "Sora"; src: url("/sora.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("/caveat.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F5F7FB;
  --ink: #0B1220;
  --soft: #1B2436;            /* ink-soft */
  --muted: #5B6678;
  --line: #E6EAF1;
  --line-strong: #D5DCE7;
  --blue: #2F6BFF;            /* brand */
  --blue-ink: #1E4FD1;        /* brand-dark */
  --tint: #EAF0FF;            /* brand-tint */
  --gold: #FFB400;
  --bar: #A9AFBB;
  --good: #16A34A;
  --good-ink: #15803D;
  --good-tint: #F0FDF4;
  --crit: #D03B3B;
  --crit-ink: #B42323;
  --crit-tint: #FEF2F2;
  --rival: #FFF4D6;
  --rival-ink: #6B4A00;
  --shadow: 0 1px 2px rgba(11, 18, 32, .04), 0 12px 32px -12px rgba(11, 18, 32, .12);
  --shadow-lg: 0 2px 4px rgba(11, 18, 32, .05), 0 28px 60px -20px rgba(11, 18, 32, .18);
  --shadow-cta: 0 10px 24px -6px rgba(47, 107, 255, .5);
  --radius: 24px;
  --radius-sm: 16px;
  --nav-bg: rgba(255, 255, 255, .85);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --display: "Sora", "Inter", ui-sans-serif, system-ui, sans-serif;
  --script: "Caveat", cursive;
  --llm-openai: #1BAF7A; --llm-gemini: #EB6834; --llm-perplexity: #4A3AA7;
  --grid: #E6EAF1; --axis: #5B6678; --rival-line: #A9AFBB;
}

/* White theme only, whatever the viewer's OS setting. */

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--sans); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); margin: 0; color: var(--ink); letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: 40px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.field-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.push { margin-left: auto; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Wordmark: Sora 800 caps with the brand-blue underline (site Logo.tsx) */
.wordmark { position: relative; display: inline-block; font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: -0.01em; line-height: 1; font-size: 19px; color: var(--ink); white-space: nowrap; user-select: none; }
.wordmark svg { position: absolute; left: 1.5%; bottom: -0.22em; width: 97%; height: 0.16em; pointer-events: none; }
.wordmark path { stroke: var(--blue); }
.slash { display: none; }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .18em; color: var(--blue); margin-bottom: 12px; }
.annotation { font-family: var(--script); font-weight: 700; color: var(--ink); display: inline-flex; align-items: flex-start; gap: 4px; }
.annotation span { display: inline-block; transform: rotate(-6deg); font-size: 30px; line-height: 1; }
.annotation svg { color: var(--blue); flex: none; margin-top: 12px; }

/* Buttons (site btn-primary / btn-ghost) */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 24px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); white-space: nowrap; transition: border-color .2s, color .2s, background-color .2s, transform .2s, box-shadow .2s; }
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: var(--shadow-cta); }
.btn.primary:hover { background: var(--blue-ink); border-color: var(--blue-ink); color: #fff; transform: translateY(-2px); }
.btn.primary:active { transform: translateY(0); }
.btn.primary::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 33%; background: rgba(255, 255, 255, .25); transform: translateX(-180%) skewX(-20deg); pointer-events: none; }
.btn.primary:hover::after { animation: btn-shine 1.1s ease; }
@keyframes btn-shine { 0% { transform: translateX(-180%) skewX(-20deg); } 60%, 100% { transform: translateX(320%) skewX(-20deg); } }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.small { height: 36px; padding: 0 16px; font-size: 13.5px; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; font-size: 13px; font-weight: 500; }
.link:hover { color: var(--blue); }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(900px 520px at 20% 0%, rgba(47, 107, 255, .12), transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow-lg); }
.login-card .brandline { margin-bottom: 36px; }
.login-card .wordmark { font-size: 24px; }
.login-card h1 { font-size: 30px; margin-bottom: 10px; }
.login-card p { color: var(--muted); margin-bottom: 24px; }
.login-card input { width: 100%; height: 50px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 20px; margin: 8px 0 14px; }
.login-card input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 4px var(--tint); }
.login-card .btn { width: 100%; height: 50px; }
.form-error { color: var(--crit-ink); font-size: 14px; margin-top: 12px; min-height: 21px; }

/* Header (site Nav.tsx) */
.top { position: sticky; top: 0; z-index: 10; background: var(--nav-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1280px; margin: 0 auto; padding: 0 32px; height: 72px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.brand .product { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); white-space: nowrap; }
.tabs { display: flex; gap: 32px; margin-left: 24px; }
.tabs button { position: relative; border: 0; background: none; padding: 8px 0; font-family: var(--display); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--soft); cursor: pointer; }
.tabs button::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 999px; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .3s ease-out; }
.tabs button:hover { color: var(--ink); }
.tabs button:hover::after { transform: scaleX(1); }
.tabs button[aria-selected="true"] { color: var(--blue); }
.tabs button[aria-selected="true"]::after { transform: scaleX(1); }
.meta { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.meta .link { border: 1px solid var(--line); border-radius: 999px; height: 32px; padding: 0 14px; background: var(--surface); }
.meta .link:hover { border-color: var(--blue); }

main { max-width: 1280px; margin: 0 auto; padding: 48px 32px 56px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.intro p { color: var(--muted); margin-top: 12px; max-width: 720px; font-size: 16px; line-height: 1.65; }

/* Cards */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; min-width: 0; transition: box-shadow .3s; }
.panel h2 { margin-bottom: 6px; }
.panel .note { color: var(--muted); font-size: 14px; margin-bottom: 16px; line-height: 1.55; }

/* Ask */
.ask { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 28px; }
.ask textarea { width: 100%; resize: vertical; min-height: 60px; border: 0; background: transparent; font-size: 18px; line-height: 1.45; padding: 6px 6px; outline: none; font-family: var(--sans); }
.ask-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; }
.toggles { display: flex; gap: 8px; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 600; user-select: none; color: var(--soft); }
.toggle:has(input:checked) { border-color: var(--blue); background: var(--tint); color: var(--blue-ink); }
.toggle input { accent-color: var(--blue); margin: 0; }
.toggle.off { color: var(--muted); border-style: dashed; cursor: not-allowed; background: transparent; }
.toggle small { font-weight: 500; color: var(--muted); }
.ask-row .btn { margin-left: auto; min-width: 140px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--soft); cursor: pointer; transition: border-color .2s, color .2s; }
.chip:hover { border-color: var(--blue); color: var(--blue); }

.columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; overflow: hidden; }
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.col-head h2 { font-size: 18px; margin: 0; }
.col-head .model { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--blue); background: var(--tint); border-radius: 999px; padding: 4px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.col-body { padding: 18px 22px 20px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--soft); white-space: nowrap; }
.badge.pc-yes { background: var(--good-tint); border-color: transparent; color: var(--good-ink); font-weight: 700; }
.badge.pc-no { color: var(--muted); }
.badge.site { background: var(--tint); border-color: transparent; color: var(--blue-ink); }
.badge.rival { background: var(--rival); border-color: transparent; color: var(--rival-ink); font-weight: 500; }
.badge svg { width: 13px; height: 13px; flex: none; }
.rivals-label { width: 100%; margin: 6px 0 0; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }

.waiting { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 18px 0; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { height: 12px; border-radius: 999px; background: linear-gradient(90deg, var(--line) 0%, var(--surface-2) 50%, var(--line) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; margin: 12px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }
.notice { border-radius: var(--radius-sm); padding: 14px 16px; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); color: var(--soft); }
.notice.error { background: var(--crit-tint); border-color: transparent; color: var(--crit-ink); }
.notice code { font-size: 12.5px; }

.answer { font-size: 15px; line-height: 1.65; color: var(--soft); overflow-wrap: anywhere; }
.answer.clamped { max-height: 560px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 85%, transparent); mask-image: linear-gradient(#000 85%, transparent); }
.answer > :first-child { margin-top: 0; }
.answer p, .answer ul, .answer ol, .answer table, .answer pre { margin: 0 0 12px; }
.answer h1, .answer h2, .answer h3, .answer h4 { font-family: var(--display); font-size: 16px; font-weight: 700; margin: 18px 0 8px; color: var(--ink); }
.answer ul, .answer ol { padding-left: 20px; }
.answer li { margin: 4px 0; }
.answer strong { color: var(--ink); }
.answer table { border-collapse: collapse; width: 100%; font-size: 13px; display: block; overflow-x: auto; }
.answer th, .answer td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.answer th { background: var(--surface-2); font-weight: 600; }
.answer code { font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 6px; }
.answer a { color: var(--blue); text-decoration: none; font-weight: 500; }
.answer a:hover { text-decoration: underline; }
.answer sup a { font-size: 11px; padding: 0 1px; }
mark.pc { background: var(--good-tint); color: var(--good-ink); font-weight: 700; padding: 0 4px; border-radius: 6px; box-shadow: inset 0 -2px 0 var(--good); }
mark.rival { background: var(--rival); color: var(--rival-ink); padding: 0 3px; border-radius: 5px; }
.more { margin-top: 10px; }

.sources { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.sources h3 { font-family: var(--sans); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 10px; }
.sources ol { margin: 0; padding-left: 22px; font-size: 13px; }
.sources li { margin: 5px 0; color: var(--muted); }
.sources li a { color: var(--soft); text-decoration: none; }
.sources li a:hover { color: var(--blue); }
.sources .dom { font-weight: 600; color: var(--ink); }
.sources li.pc-src .dom { color: var(--good-ink); }
.queries { font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.queries span { display: inline-block; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; margin: 3px 4px 3px 0; }
.col-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); padding: 12px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }

/* Baseline */
.batch-pick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
select { height: 46px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); padding: 0 16px; max-width: 100%; font-weight: 500; }
.progress { margin-bottom: 20px; }
.progress .track { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 10px; }
.progress .fill { height: 100%; background: var(--blue); border-radius: 999px; transition: width .4s; }
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr); gap: 20px; margin-bottom: 20px; }
.hero-figure .label, .tile .label, .kpi .label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.hero-figure .value { font-family: var(--display); font-weight: 800; font-size: 72px; line-height: 1; letter-spacing: -0.04em; color: var(--blue); margin: 14px 0 12px; }
.hero-figure .sub { color: var(--soft); font-size: 15px; line-height: 1.55; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tile .label { display: flex; justify-content: space-between; gap: 6px; }
.tile .value { font-family: var(--display); font-weight: 800; font-size: 44px; line-height: 1; letter-spacing: -0.03em; color: var(--blue); margin: 12px 0 16px; }
.tile dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; font-size: 13.5px; }
.tile dt { color: var(--muted); }
.tile dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile .err { color: var(--crit-ink); }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }

.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(96px, 34%) minmax(0, 1fr); align-items: center; gap: 12px; font-size: 14px; border-radius: 8px; padding: 2px 0; cursor: default; }
.bar-row .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--soft); }
.bar-row.pc .name { color: var(--blue); font-weight: 700; }
.bar-row .lane { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bar-row .bar { height: 14px; background: var(--bar); border-radius: 0 999px 999px 0; min-width: 2px; }
.bar-row.pc .bar { background: var(--blue); }
.bar-row .val { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; font-size: 13px; white-space: nowrap; }
.bar-row:not(.pc):hover .name, .bar-row:not(.pc):focus-visible .name { color: var(--ink); }
.tooltip { position: fixed; z-index: 50; pointer-events: none; background: #0B1220; color: #fff; font-size: 12.5px; padding: 10px 12px; border-radius: 14px; box-shadow: 0 12px 32px -8px rgba(11, 18, 32, .45); max-width: 280px; line-height: 1.5; border: 1px solid rgba(255, 255, 255, .1); }
.tooltip b { font-weight: 700; }

.grid-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tr.cat td { font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--ink); background: var(--surface-2); padding-top: 12px; }
table.grid td.prompt { color: var(--soft); min-width: 240px; }
table.grid td.cell { width: 160px; }
.cell-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid transparent; background: none; cursor: pointer; font-size: 13px; font-weight: 700; white-space: nowrap; transition: border-color .2s; }
.cell-btn svg { width: 14px; height: 14px; }
.cell-btn.yes { background: var(--good-tint); color: var(--good-ink); }
.cell-btn.no { color: var(--muted); border-color: var(--line); font-weight: 600; }
.cell-btn.err { background: var(--crit-tint); color: var(--crit-ink); }
.cell-btn:hover { border-color: var(--blue); }
.cell-empty { color: var(--muted); font-size: 13px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); margin: 6px 0 14px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.tag { display: inline-block; margin-left: 8px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--blue); background: var(--tint); border-radius: 999px; padding: 2px 8px; vertical-align: 1px; white-space: nowrap; }

.runner { margin-top: 24px; }
.runner summary { cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 18px; list-style: none; display: flex; align-items: center; gap: 12px; }
.runner summary::-webkit-details-marker { display: none; }
.runner summary::before { content: "+"; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; background: var(--blue); color: #fff; font-family: var(--sans); font-weight: 600; box-shadow: var(--shadow-cta); }
.runner[open] summary::before { content: "\2212"; }
.runner .body { margin-top: 20px; display: grid; gap: 18px; }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.lib fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px 14px; margin: 0; min-width: 0; }
.lib legend { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--blue); padding: 0 6px; }
.lib label { display: flex; gap: 10px; font-size: 14px; padding: 4px 0; color: var(--soft); cursor: pointer; }
.lib input { accent-color: var(--blue); margin-top: 4px; flex: none; }
.runner-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.runner-row input[type="text"] { height: 46px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); padding: 0 20px; min-width: 240px; flex: 1; }
.estimate { font-size: 14px; color: var(--soft); }
.empty { text-align: center; padding: 56px 16px; color: var(--muted); }
.empty h2 { color: var(--ink); margin-bottom: 8px; font-size: 24px; }

/* History */
.hist { display: grid; gap: 10px; }
.hist-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 14px 20px; text-decoration: none; color: inherit; transition: border-color .2s, transform .2s; }
.hist-row:hover { border-color: var(--blue); transform: translateY(-1px); }
.hist-row .q { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-row .when { font-size: 13px; color: var(--muted); white-space: nowrap; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dot { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; height: 26px; padding: 0 10px; border-radius: 999px; white-space: nowrap; }
.dot.yes { background: var(--good-tint); color: var(--good-ink); }
.dot.no { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); font-weight: 600; }
.dot.err { background: var(--crit-tint); color: var(--crit-ink); }
.section-gap { margin-top: 32px; }
#history h2 { margin: 8px 0 14px; }

/* Dialog */
dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(780px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(11, 18, 32, .5); backdrop-filter: blur(2px); }
.dlg-head { position: sticky; top: 0; background: var(--surface); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line); z-index: 1; }
.dlg-head p { color: var(--muted); font-size: 13px; margin-top: 6px; }
.dlg-body { padding: 20px 24px 24px; }

/* Footer (site Footer.tsx) */
.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-inner { max-width: 1280px; margin: 0 auto; padding: 28px 32px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.foot .wordmark { font-size: 16px; }

/* Trends */
.filters { display: flex; flex-wrap: wrap; gap: 18px 24px; align-items: flex-end; padding: 22px 28px; margin-bottom: 14px; }
.filter-group { display: grid; gap: 8px; }
.filter-group.grow { flex: 1; min-width: 220px; }
.filter-group.full { flex-basis: 100%; }
.filter-group input[type="search"] { height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 18px; width: 100%; }
.filter-group input[type="search"]:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 4px var(--tint); }
.seg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-chips.wrap { flex-wrap: wrap; }
.seg-chip { height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--soft); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; transition: border-color .2s, color .2s, background-color .2s; }
.seg-chip:hover { border-color: var(--blue); color: var(--blue); }
.seg-chip[aria-pressed="true"] { color: var(--blue-ink); border-color: var(--blue); background: var(--tint); }
.seg-chip .key { width: 14px; height: 3px; border-radius: 2px; background: var(--muted); }
.seg-chip .key.llm-openai { background: var(--llm-openai); }
.seg-chip .key.llm-gemini { background: var(--llm-gemini); }
.seg-chip .key.llm-perplexity { background: var(--llm-perplexity); }
.tr-summary { color: var(--muted); font-size: 14px; margin: 0 4px 20px; min-height: 22px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.kpi .value { font-family: var(--display); font-weight: 800; font-size: 48px; line-height: 1; letter-spacing: -0.03em; color: var(--blue); margin: 14px 0 14px; }
.kpi .delta { font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 12px; }
.kpi .delta.up { color: var(--good-ink); background: var(--good-tint); }
.kpi .delta.down { color: var(--crit-ink); background: var(--crit-tint); }
.kpi .delta.flat { color: var(--muted); background: var(--surface-2); font-weight: 600; }
.kpi .delta svg { width: 12px; height: 12px; }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.chart-panel.wide { grid-column: 1 / -1; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--soft); margin: 4px 0 4px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend svg { width: 18px; height: 8px; }
.chart-legend line.pc { stroke: var(--blue); }
.chart-legend line.rival { stroke: var(--rival-line); }
.chart-legend line.llm-openai { stroke: var(--llm-openai); }
.chart-legend line.llm-gemini { stroke: var(--llm-gemini); }
.chart-legend line.llm-perplexity { stroke: var(--llm-perplexity); }
.chart { position: relative; margin-top: 8px; }
.chart svg.plot { display: block; width: 100%; overflow: visible; }
.chart svg.plot:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 8px; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis-text { fill: var(--axis); font-size: 11px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.chart .end-label { fill: var(--soft); font-size: 11.5px; font-weight: 600; font-family: var(--sans); }
.chart .end-label .v { font-weight: 700; fill: var(--ink); font-variant-numeric: tabular-nums; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series.dashed { stroke-dasharray: 6 5; }
.chart .series.thick { stroke-width: 3; }
.chart .marker { stroke: var(--surface); stroke-width: 2; }
.chart .llm-openai { stroke: var(--llm-openai); }
.chart .llm-gemini { stroke: var(--llm-gemini); }
.chart .llm-perplexity { stroke: var(--llm-perplexity); }
.chart .pc { stroke: var(--blue); }
.chart .rival { stroke: var(--rival-line); }
.chart circle.llm-openai { fill: var(--llm-openai); }
.chart circle.llm-gemini { fill: var(--llm-gemini); }
.chart circle.llm-perplexity { fill: var(--llm-perplexity); }
.chart circle.pc { fill: var(--blue); }
.chart circle.rival { fill: var(--rival-line); }
.chart .milestone line { stroke: var(--blue); stroke-width: 1; stroke-dasharray: 3 4; opacity: .6; }
.chart .milestone text { fill: var(--blue); font-size: 11px; font-weight: 700; font-family: var(--sans); }
.chart .crosshair { stroke: var(--axis); stroke-width: 1; }
.chart-note { font-size: 13px; color: var(--muted); margin-top: 10px; }
.table-toggle { margin-top: 12px; font-size: 13px; }
.table-toggle summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.table-toggle table { margin-top: 10px; border-collapse: collapse; font-size: 12.5px; width: 100%; }
.table-toggle th, .table-toggle td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-toggle th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
.table-toggle .scroll { overflow-x: auto; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; }
.tooltip .tt-key { width: 12px; height: 3px; border-radius: 2px; background: currentColor; flex: none; }
.tooltip .tt-date { opacity: .7; font-size: 11.5px; margin-bottom: 4px; }
.tooltip .tt-key.llm-openai { background: #1BAF7A; }
.tooltip .tt-key.llm-gemini { background: #EB6834; }
.tooltip .tt-key.llm-perplexity { background: #9085E9; }
.tooltip .tt-key.pc { background: #4F83FF; }
.tooltip .tt-key.rival { background: #A9AFBB; }

.dumb { display: grid; gap: 11px; margin-top: 14px; }
.dumb-row { display: grid; grid-template-columns: minmax(110px, 30%) minmax(0, 1fr) 100px; gap: 14px; align-items: center; font-size: 14px; }
.dumb-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--soft); }
.dumb-row.pc .name { color: var(--blue); font-weight: 700; }
.dumb-row .track { position: relative; height: 16px; }
.dumb-row .track::before { content: ""; position: absolute; left: 0; right: 0; top: 7.5px; height: 1px; background: var(--grid); }
.dumb-row .span { position: absolute; top: 6.5px; height: 3px; background: var(--line-strong); border-radius: 2px; }
.dumb-row .dmark { position: absolute; top: 1px; width: 10px; height: 10px; margin-left: -7px; border-radius: 50%; border: 2px solid var(--surface); box-sizing: content-box; }
.dumb-row .dmark.first { background: var(--rival-line); }
.dumb-row .dmark.latest { background: var(--blue); }
.dumb-row .vals { text-align: right; font-variant-numeric: tabular-nums; color: var(--soft); white-space: nowrap; font-weight: 600; }
.dumb-legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 12px; }
.dumb-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dumb-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dumb-legend i.first { background: var(--rival-line); }
.dumb-legend i.latest { background: var(--blue); }

.mini-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.mini-form input, .mini-form select { height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 16px; }
.mini-form input:focus, .mini-form select:focus { border-color: var(--blue); outline: none; }
.mini-form input[type="text"] { flex: 1; min-width: 180px; }
.mini-form .btn { height: 40px; }
.mini-list { display: grid; gap: 4px; margin-top: 14px; max-height: 440px; overflow-y: auto; }
.mini-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mini-item .when { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--blue); background: var(--tint); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.mini-cat { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; margin: 16px 0 4px; color: var(--blue); }
.mini-q { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; color: var(--soft); padding: 5px 0; }
.form-msg { font-size: 13px; margin-top: 8px; min-height: 18px; color: var(--good-ink); }
.form-msg.error { color: var(--crit-ink); }
.trends-note { align-self: center; }

/* AI traffic */
#traffic > .panel { margin-bottom: 20px; }
.tf-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px; margin-bottom: 20px; }
.tf-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tf-card-head .label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); padding-top: 5px; }
.tf-card-head h2 { margin-bottom: 6px; }
.src-tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; flex: none; }
.src-tag.measured { background: var(--good-tint); color: var(--good-ink); }
.src-tag.estimate { background: var(--surface); color: var(--muted); border: 1px dashed var(--line-strong); }
.tf-empty { padding: 28px 0 8px; }
.tf-big { font-family: var(--display); font-weight: 800; font-size: 76px; line-height: 1; letter-spacing: -0.04em; color: var(--blue); margin: 18px 0 8px; }
.tf-sub { color: var(--soft); font-size: 15px; }
.tf-deltas { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.tf-deltas .delta { font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 12px; }
.tf-deltas .delta.up { color: var(--good-ink); background: var(--good-tint); }
.tf-deltas .delta.down { color: var(--crit-ink); background: var(--crit-tint); }
.tf-deltas .delta.flat { color: var(--soft); background: var(--surface-2); font-weight: 600; }
.tf-deltas .delta svg { width: 12px; height: 12px; }
.tf-dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; font-size: 14px; border-top: 1px solid var(--line); padding-top: 16px; }
.tf-dl dt { color: var(--muted); }
.tf-dl dd { margin: 0; text-align: right; font-weight: 700; }
.tf-dl dd .muted { font-weight: 500; }

.ranks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 4px; }
.rank { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px 18px; min-width: 0; background: var(--surface); }
.rank-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rank-n { font-family: var(--display); font-weight: 700; font-size: 12px; color: var(--blue-ink); background: var(--tint); border-radius: 999px; padding: 2px 9px; }
.rank-dom { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-name { font-family: var(--display); font-weight: 700; font-size: 17px; margin-top: 12px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-val { font-family: var(--display); font-weight: 800; font-size: 44px; line-height: 1; letter-spacing: -0.03em; color: var(--ink); margin: 10px 0 4px; }
.rank-sub { font-size: 13px; color: var(--muted); }
.rank-meta { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--soft); }
.src-chips { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; }
.src-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--soft); white-space: nowrap; }
.sdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--bar); flex: none; }
.sdot.chatgpt { background: var(--llm-openai); }
.sdot.gemini { background: var(--llm-gemini); }
.sdot.perplexity { background: var(--llm-perplexity); }
.tf-footnote { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); margin-top: 16px; line-height: 1.5; }
.tf-footnote svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--blue); }

.tf-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 8px; }
.tf-stat { background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px 16px; min-width: 0; }
.tf-stat .label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.tf-stat .value { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1.1; letter-spacing: -0.02em; color: var(--blue); margin: 8px 0 4px; }
.tf-stat .sub { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.tf-sub-split { margin: 24px 0 0; padding-top: 22px; border-top: 1px solid var(--line); }
.tf-h3 { font-family: var(--display); font-size: 16px; font-weight: 700; margin-bottom: 4px; }

.tf-caveat { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: center; background: var(--surface-2); box-shadow: none; }
.tf-caveat h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 8px; }
.tf-caveat h2 svg { width: 20px; height: 20px; color: var(--blue); flex: none; }
.tf-caveat p { color: var(--soft); font-size: 14.5px; line-height: 1.6; }
.tf-compare { display: grid; gap: 12px; }
.crow { display: grid; grid-template-columns: minmax(120px, 40%) minmax(0, 1fr) 56px; gap: 12px; align-items: center; font-size: 13.5px; }
.clabel { color: var(--soft); font-weight: 600; }
.clane { display: block; height: 14px; }
.cbar { display: block; height: 14px; border-radius: 0 999px 999px 0; min-width: 3px; }
.cbar.measured { background: var(--blue); }
.cbar.estimate { background: var(--bar); }
.cval { text-align: right; font-weight: 700; }
.tf-chips { margin: -4px 0 16px; }

.tf-table td.strong { font-weight: 700; color: var(--ink); }
.tf-table .src-chips { flex-wrap: nowrap; }
.tf-more { margin-top: 16px; }
.bars-blue .bar-row .bar { background: var(--blue); }
.tf-sites-toggle { margin-top: 4px; font-size: 14px; }
.tf-table td.num { white-space: nowrap; }
.tf-table tr.pc-row td { background: var(--tint); }
.tf-table tr.pc-row .tf-brand { color: var(--blue-ink); font-weight: 700; }
.tf-table .tf-brand { font-weight: 600; color: var(--ink); white-space: nowrap; }
.tf-table .tf-dom { font-size: 12.5px; font-weight: 400; color: var(--muted); margin-top: 1px; }
.tf-monthly .bar-row { grid-template-columns: minmax(96px, 40%) minmax(0, 1fr); }
.measured-note { font-size: 12px; font-weight: 600; color: var(--good-ink); margin-top: 2px; }

.tf-site-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 28px; margin-top: 16px; }
.tf-site { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tf-site-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 600; }
.tf-site-name .muted { font-weight: 400; }
.tf-site-status { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 9px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.tf-site-status.ok { background: var(--good-tint); color: var(--good-ink); }
.tf-site-status.error { background: var(--crit-tint); color: var(--crit-ink); }

@media (max-width: 1100px) {
  .columns { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .charts { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tf-hero { grid-template-columns: 1fr; }
  .tf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs { gap: 22px; margin-left: 8px; }
  .brand .product { display: none; }
}
@media (max-width: 760px) {
  .top-inner { height: auto; flex-wrap: wrap; padding: 14px 16px 0; gap: 10px 12px; }
  .tabs { order: 3; width: 100%; margin: 0; gap: 22px; overflow-x: auto; padding: 4px 0 10px; }
  .tabs button { flex: none; }
  .pill { display: none; }
  main { padding: 28px 16px 40px; }
  h1 { font-size: 30px; }
  .intro p { font-size: 15px; }
  .panel { padding: 20px; border-radius: 20px; }
  .tiles, .split { grid-template-columns: 1fr; }
  .hero-figure .value { font-size: 56px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi .value { font-size: 34px; }
  .tile .value { font-size: 38px; }
  .ask-row .btn { width: 100%; margin-left: 0; }
  .hist-row { grid-template-columns: 1fr; gap: 8px; }
  .foot-inner { padding: 22px 16px; }
  table.grid td.prompt { min-width: 160px; }
  table.grid td.cell { width: auto; }
  .cell-btn { padding: 0 9px; }
  .runner-row input[type="text"] { min-width: 0; }
  .dumb-row { grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) 84px; }
  .filters { padding: 16px; }
  .annotation span { font-size: 24px; }
  .trends-note { display: none; }
  .intro .pill { display: inline-flex; }
  .kpi .label, .tile .label, .hero-figure .label { letter-spacing: .08em; overflow-wrap: anywhere; }
  .seg-chip { height: 34px; padding: 0 13px; font-size: 13px; }
  .ranks { grid-template-columns: 1fr; }
  .tf-big { font-size: 60px; }
  .rank-val { font-size: 38px; }
  .tf-caveat { grid-template-columns: 1fr; gap: 20px; }
  .crow { grid-template-columns: minmax(96px, 42%) minmax(0, 1fr) 48px; }
  .tf-stat .value { font-size: 24px; }
  .tf-site-list { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: minmax(96px, 42%) minmax(0, 1fr); gap: 10px; }
  .tf-monthly .bar-row { grid-template-columns: minmax(96px, 46%) minmax(0, 1fr); }
  .tf-card-head { flex-wrap: wrap; }
}
