/* LLMediation — AI Visibility Platform */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #fbfbfa;
  --line: #e7e5e1;
  --line-soft: #f0efec;
  --ink: #16150f;
  --ink-2: #55524a;
  --ink-3: #8a867c;
  --brand: #4f46e5;
  --brand-soft: #eef2ff;
  --brand-ink: #3730a3;
  --pos: #0f9d58;
  --pos-soft: #e8f5ee;
  --neg: #d64545;
  --neg-soft: #fdecec;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20,18,12,.05), 0 8px 24px -12px rgba(20,18,12,.12);
  /* One typeface throughout. IBM Plex Sans is used for every role — display,
     body and data — because it has genuine tabular numerals, which is what the
     old monospace face was actually there for. Alignment is handled by
     font-variant-numeric rather than by a second family. */
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --serif: var(--sans);
  --mono: var(--sans);
}
:root[data-theme="dark"] {
  --bg: #131211; --surface: #1b1a18; --surface-2: #201f1c; --line: #302e2a; --line-soft: #262421;
  --ink: #f5f3ef; --ink-2: #b3aea4; --ink-3: #837e74;
  --brand: #8b83ff; --brand-soft: #241f52; --brand-ink: #c3bdff;
  --pos: #4ade80; --pos-soft: #16301f; --neg: #f87171; --neg-soft: #331917;
  --warn: #fbbf24; --warn-soft: #33280f;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------------------------------------------------------------- shell */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.logo { display: flex; align-items: center; gap: 9px; padding: 18px 18px 14px; }
.logo-mark { width: 24px; height: 24px; flex: none; object-fit: contain; }
.logo-word { font-weight: 600; font-size: 17px; letter-spacing: -.012em; }

.ws-switch { margin: 0 12px 14px; position: relative; }
.ws-switch select {
  width: 100%; appearance: none; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px 28px 8px 10px; font-size: 13px; font-weight: 550; cursor: pointer;
}
.ws-switch::after { content: '⌄'; position: absolute; right: 11px; top: 5px; color: var(--ink-3); pointer-events: none; }

.nav { padding: 0 8px; flex: 1; }
.nav-group { margin-bottom: 16px; }
.nav-label { font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 0 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 500; font-size: 13.5px; margin-bottom: 1px;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active {
  background: var(--brand); color: #fff; font-weight: 600;
  box-shadow: 0 4px 14px -6px color-mix(in srgb, var(--brand) 65%, transparent);
}
.nav a.active svg { opacity: 1; }
.nav a svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.nav a .count { margin-left: auto; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.nav a.active .count { color: rgba(255,255,255,.85); }

.side-foot { padding: 12px 16px 16px; border-top: 1px solid var(--line-soft); font-size: 11.5px; color: var(--ink-3); }
.side-foot .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 5px; }

/* Three states, because "system" is a real choice and not the absence of one. */
.theme-toggle { display: flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 2px; }
.theme-toggle button {
  flex: 1; border: 0; background: none; cursor: pointer; border-radius: 5px;
  padding: 4px 0; font-size: 11px; font-weight: 550; color: var(--ink-3);
  font-family: inherit; transition: background .12s, color .12s;
}
.theme-toggle button:hover { color: var(--ink-2); }
.theme-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20,18,12,.07); }
.theme-toggle button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.icon-btn { background: none; border: 1px solid var(--line); border-radius: 6px; width: 26px; height: 24px; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding: 14px 26px 12px;
}
.topbar h1 { font-family: var(--sans); font-size: 25px; font-weight: 600; margin: 0 0 2px; letter-spacing: -.022em; }
.topbar .sub { color: var(--ink-3); font-size: 13px; }
.topbar-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.filters { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; align-items: center; }

.content { padding: 22px 26px 60px; max-width: 1560px; width: 100%; }

/* --------------------------------------------------------------- pieces */
.btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm);
  padding: 7px 13px; font-size: 13px; font-weight: 550; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; transition: .12s;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 5px 11px; font-size: 12.5px; font-weight: 500; cursor: pointer; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: var(--ink-3); }
.chip.on { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, transparent); color: var(--brand-ink); font-weight: 600; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.chip select { border: none; background: none; cursor: pointer; font-size: 12.5px; font-weight: 550; outline: none; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.card > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card h2 { font-size: 14px; font-weight: 650; margin: 0; letter-spacing: -.005em; }
.card .hint { font-size: 11.5px; color: var(--ink-3); }

.grid { display: grid; gap: 14px; }
.g-kpi { grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); }
.g-2 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.g-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.span-2 { grid-column: span 2; }
@media (max-width: 900px) { .app { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } .span-2 { grid-column: auto; } }

/* Every KPI tile app-wide, not just the AI-visibility page -- a brand-tinted
   lift instead of the flat neutral shadow every other card uses, so the
   numbers that matter most on each page read as elevated at a glance. */
.card.kpi { border-radius: 14px; box-shadow: 0 10px 28px -16px color-mix(in srgb, var(--brand) 32%, transparent), var(--shadow); }
.kpi .label { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.kpi .value { font-size: 32px; font-weight: 600; line-height: 1.1; margin: 8px 0 4px; letter-spacing: -.028em; font-variant-numeric: tabular-nums; }
.kpi .value small { font-family: var(--sans); font-size: 14px; color: var(--ink-3); font-weight: 500; }
.kpi .foot { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }

.delta { font-weight: 650; font-size: 12px; padding: 1px 6px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--pos); background: var(--pos-soft); }
.delta.down { color: var(--neg); background: var(--neg-soft); }
.delta.flat { color: var(--ink-3); background: var(--line-soft); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-3); padding: 0 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--surface-2); }
.table-wrap { overflow-x: auto; margin: 0 -18px -16px; padding: 0 18px; }

.tag {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 5px;
  background: var(--line-soft); color: var(--ink-2); white-space: nowrap;
}
.tag.owned { background: var(--brand-soft); color: var(--brand-ink); }
.tag.pos { background: var(--pos-soft); color: var(--pos); }
.tag.neg { background: var(--neg-soft); color: var(--neg); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }

.bar-track { height: 7px; border-radius: 4px; background: var(--line-soft); overflow: hidden; min-width: 60px; }
.bar-fill { height: 100%; border-radius: 4px; }

.swatch { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex: none; }
.brandcell { display: flex; align-items: center; gap: 8px; }
.mono { font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: -.005em; }
.muted { color: var(--ink-3); }
.empty { padding: 42px 20px; text-align: center; color: var(--ink-3); }
.empty h3 { font-weight: 600; font-size: 16px; color: var(--ink-2); margin: 0 0 6px; letter-spacing: -.01em; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------------------------------------------------------------- modal */
.overlay {
  position: fixed; inset: 0; background: rgba(20,18,12,.45); z-index: 60;
  display: flex; align-items: flex-start; justify-content: center; padding: 5vh 20px; overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--surface); border-radius: var(--radius); width: min(880px, 100%);
  box-shadow: 0 24px 64px -16px rgba(0,0,0,.4); border: 1px solid var(--line);
}
.modal header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.modal header h2 { font-weight: 600; font-size: 19px; margin: 0; letter-spacing: -.018em; }
.modal .body { padding: 20px 22px; }
.modal footer { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px;
  background: var(--surface-2); font-size: 13.5px;
}
.field textarea { min-height: 100px; resize: vertical; font-family: var(--mono); font-size: 12.5px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: -1px; border-color: var(--brand); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/*
 * A checkbox is not a text input and must not inherit its full width.
 *
 * `.field input { width: 100% }` above was written for text fields and caught
 * checkboxes too, stretching the box across the row and pushing its own label
 * out of reach of it. Anything tickable opts back out here rather than each
 * one carrying an inline override.
 */
.field input[type="checkbox"], .field input[type="radio"] { width: auto; flex: none; margin: 0; }

/* Label beside the control rather than above it, which is what a tickable
   option needs and what `.field label { display: block }` prevents. */
.field label.check {
  display: flex; align-items: flex-start; gap: .55rem;
  font-weight: 400; cursor: pointer; margin-bottom: 0;
}
.field label.check input { margin-top: .2rem; }

.answer {
  background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  padding: 14px 16px; font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; max-height: 44vh; overflow-y: auto;
}
.answer mark { background: color-mix(in srgb, var(--brand) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; font-weight: 600; }
.answer mark.rival { background: color-mix(in srgb, var(--neg) 20%, transparent); }
.md h1, .md h2, .md h3 { font-weight: 600; letter-spacing: -.018em; margin: 18px 0 8px; }
.md h1 { font-size: 19px; } .md h2 { font-size: 16px; } .md h3 { font-size: 14px; }
.md p, .md li { font-size: 13.5px; line-height: 1.65; }
.md code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.md ul, .md ol { padding-left: 20px; }

.progress { height: 5px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: var(--brand); transition: width .4s ease; }

/* ---------------------------------------------------- metric definitions */
.info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 13px; height: 13px; border-radius: 50%; flex: none;
  border: 1px solid var(--ink-3); color: var(--ink-3);
  font-size: 9px; font-weight: 700; line-height: 1; font-style: normal;
  cursor: help; vertical-align: middle; margin-left: 4px;
  transition: border-color .12s, color .12s, background .12s;
  user-select: none;
}
.info:hover, .info:focus-visible { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); outline: none; }
.info:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 30%, transparent); }
th .info { margin-left: 3px; }

.tip {
  position: fixed; z-index: 200; max-width: 310px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px;
  box-shadow: 0 4px 22px -6px rgba(20,18,12,.28), 0 1px 2px rgba(20,18,12,.08);
  padding: 11px 13px; font-size: 12.5px; line-height: 1.55;
  text-transform: none; letter-spacing: normal; font-weight: 400;
  pointer-events: none;
}
.tip .t-term { font-weight: 650; font-size: 12.5px; margin-bottom: 3px; }
.tip .t-formula {
  margin-top: 7px; padding: 5px 7px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--line-soft);
  font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--ink-2);
}
.tip .t-caution {
  margin-top: 7px; padding-left: 8px; border-left: 2px solid var(--warn);
  color: var(--ink-2); font-size: 11.5px;
}
@media (prefers-reduced-motion: no-preference) { .tip { animation: tipIn .1s ease-out; } }
@keyframes tipIn { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 90;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 550; box-shadow: var(--shadow);
}
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.heat td.cell { text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12px; color: var(--ink); border-radius: 4px; }
.split { display: flex; gap: 18px; align-items: flex-start; }
.scroll-y { max-height: 420px; overflow-y: auto; }

/* ------------------------------------------------- support access strip
 *
 * Loud on purpose, in both applications. An operator inside a customer's
 * account and a customer looking at their own screen must never be able to
 * confuse the two, and the only reliable way to guarantee that is for the
 * page to look different while it is happening.
 */
.ops-impersonating,
.impersonation-banner {
  display: flex; align-items: center; gap: .65rem; flex-wrap: wrap;
  padding: .55rem 1.1rem;
  font-size: 12.5px; line-height: 1.5;
  background: #f0803f; color: #1b1206;
  border-bottom: 1px solid rgba(0, 0, 0, .22);
}
/*
 * The customer shell is a two-column grid, so the banner has to be told to
 * span it. Without this it takes the sidebar's cell and renders as a tall
 * orange column down the left, pushing the navigation into the content area.
 */
.impersonation-banner {
  grid-column: 1 / -1;
  position: sticky; top: 0; z-index: 60;
}
/*
 * The sidebar is sticky at the top of the viewport. While the banner is there,
 * it has to start below it, or the two overlap as soon as the page scrolls.
 * The height is measured after render because the banner wraps on narrow
 * screens and a hard-coded offset would be wrong at exactly the widths where
 * being wrong is most visible.
 */
body.is-impersonated .sidebar {
  top: var(--imp-h, 0px);
  height: calc(100vh - var(--imp-h, 0px));
}
.ops-impersonating a,
.impersonation-banner a,
.impersonation-banner button {
  color: #1b1206; font-weight: 600; text-decoration: underline; text-underline-offset: 2px;
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
}
.ops-impersonating .spacer,
.impersonation-banner .spacer { flex: 1 1 auto; }
.ops-impersonating .dot,
.impersonation-banner .dot {
  width: .5rem; height: .5rem; border-radius: 50%;
  background: #1b1206; flex: none;
  animation: imp-pulse 2s ease-in-out infinite;
}
@keyframes imp-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .25 } }
/* A pulsing dot is decoration for anyone who does not want motion; the words
   carry the meaning, so it simply stops. */
@media (prefers-reduced-motion: reduce) {
  .ops-impersonating .dot, .impersonation-banner .dot { animation: none; }
}
/* The whole customer app is outlined while an operator is driving it, so the
   state is visible from any scroll position rather than only at the top. */
body.is-impersonated { box-shadow: inset 0 0 0 3px #f0803f; }

/* A failed action, said out loud rather than logged to a console nobody has
   open. Fixed to the bottom so it is visible wherever the page is scrolled. */
.ops-action-error {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 200;
  display: flex; align-items: center; gap: 1rem;
  max-width: 46rem; margin: 0 auto;
  padding: .7rem 1rem;
  font-size: 13px; line-height: 1.5;
  background: #b3261e; color: #fff;
  border-radius: 8px; box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}
.ops-action-error span { flex: 1 1 auto; }
.ops-action-error button {
  flex: none; background: rgba(255, 255, 255, .18); color: #fff;
  border: 0; border-radius: 5px; padding: .3rem .7rem; font: inherit; cursor: pointer;
}
.ops-action-error button:hover { background: rgba(255, 255, 255, .3); }

/* The server predates its own source. Loud, because the symptom is otherwise a
   button that silently does nothing, which reads as a bug in the feature. */
.ops-stale {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .6rem 1.1rem;
  background: #7a2e12; color: #fff;
  font-size: 12.5px; line-height: 1.5;
  border-bottom: 1px solid rgba(0, 0, 0, .3);
}
.ops-stale code {
  font-family: var(--mono, ui-monospace, Menlo, monospace);
  background: rgba(255, 255, 255, .16); padding: .12rem .45rem; border-radius: 4px;
}
.kb-link { display: inline-flex; align-items: center; gap: .38rem; }
.kb-link svg { width: 14px; height: 14px; flex: none; }

/* Simulated data, said plainly at the top of the numbers it describes. Quieter
   than an error, because nothing is wrong: a source is simply not connected. */
.provenance-notice {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .7rem .95rem; margin: 0 0 1rem;
  background: color-mix(in srgb, var(--warn, #b8860b) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warn, #b8860b) 30%, transparent);
  border-radius: var(--radius-sm, 6px);
  font-size: 12.5px; line-height: 1.55; color: var(--ink-2);
}
.provenance-notice b { color: var(--ink); }
.provenance-notice .mark { color: var(--warn, #b8860b); font-size: 15px; line-height: 1.1; }
.provenance-notice a { color: var(--brand); }

/* The action panel at the top of Query intelligence. Numbered because the
   items are ranked by what the data says matters most, not by preference. */
.action-panel .actions { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.action-panel .action { display: flex; gap: .85rem; align-items: flex-start; }
.action-panel .action .n {
  flex: none; width: 1.55rem; height: 1.55rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.action-panel .head { font-weight: 600; font-size: 14.5px; line-height: 1.45; }
.action-panel .why { color: var(--ink-2); font-size: 13px; line-height: 1.6; margin-top: .2rem; max-width: 78ch; }
.action-panel .qs { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.action-panel .qs .chip {
  font-size: 11.5px; padding: .15rem .5rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink-2); cursor: pointer; max-width: 34ch;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.action-panel .qs .chip:hover { color: var(--ink); border-color: var(--brand); }
.action-panel .caveat {
  margin: 1rem 0 0; padding-top: .8rem; border-top: 1px solid var(--line-soft);
  color: var(--ink-3); font-size: 12.5px; line-height: 1.6;
}

/* Last sampled, what is waiting, and the way to run it again. */
.sampling-bar { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.sampling-bar .when { font-size: 15px; font-weight: 600; margin-top: .1rem; }
.sampling-bar .scope { font-size: 12px; margin-top: .15rem; }
.sampling-bar .spacer { flex: 1 1 auto; }
.sampling-bar .waiting {
  font-size: 12.5px; line-height: 1.55; color: var(--ink-2);
  padding: .5rem .8rem; border-radius: var(--radius-sm, 6px);
  background: color-mix(in srgb, var(--warn, #b8860b) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warn, #b8860b) 32%, transparent);
  max-width: 46ch;
}
.sampling-bar .waiting b { color: var(--ink); }

/* ------------------------------------------------------ AI visibility page
 *
 * Scoped under .hero so nothing here leaks onto the ad-spend/ROAS pages,
 * which keep the plain card look. Purple is not a new brand color: --brand
 * is already #4f46e5 (indigo), so the gradient below is that same token
 * pushed brighter and given room to breathe, not a palette swap.
 */
.hero-band {
  margin: -22px -26px 18px; padding: 30px 26px 44px;
  background:
    radial-gradient(720px 260px at 88% -10%, color-mix(in srgb, var(--brand) 30%, transparent), transparent 70%),
    linear-gradient(160deg, color-mix(in srgb, var(--brand) 16%, var(--bg)), var(--bg) 62%);
  border-bottom: 1px solid var(--line);
}
.hero-band .hero-title { font-size: 22px; font-weight: 650; letter-spacing: -.02em; margin: 0 0 3px; }
.hero-band .hero-sub { color: var(--ink-2); font-size: 13px; max-width: 62ch; }
.hero-badges { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 10px 5px 6px; font-size: 12px; font-weight: 600; color: var(--ink-2);
  box-shadow: var(--shadow);
}
.hero-badge .dot {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 700;
}

.g-hero { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 18px; }
.hero-kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 17px; box-shadow: 0 10px 30px -14px rgba(79, 70, 229, .28), var(--shadow);
  position: relative;
}
.hero-kpi .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hero-kpi .icon {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: var(--brand-soft); color: var(--brand-ink);
  display: grid; place-items: center;
}
.hero-kpi .icon svg { width: 16px; height: 16px; }
.hero-kpi .label { font-size: 12px; color: var(--ink-2); font-weight: 550; margin-top: 12px; }
.hero-kpi .value { font-size: 27px; font-weight: 650; letter-spacing: -.025em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.hero-kpi .foot { margin-top: 5px; }

.hero-mentions { display: grid; gap: 3px; }
.hero-mention-row {
  display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 11px;
  padding: 9px 4px; border-bottom: 1px solid var(--line-soft);
}
.hero-mention-row:last-child { border-bottom: none; }
.hero-mention-row .dot { width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.hero-mention-row .name { font-weight: 600; font-size: 13px; }
.hero-mention-row .sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.hero-mention-row .figure { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }

/* Guidance inside the log upload dialog. */
.note-block { font-size: 13px; line-height: 1.6; color: var(--ink-2); margin-bottom: 1.1rem; }
.note-block p { margin: 0 0 .7rem; }
.note-block b { color: var(--ink); }
.note-block .fmt {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm, 6px); padding: .7rem .8rem; margin: .5rem 0 .8rem;
  font-family: var(--mono, ui-monospace, Menlo, monospace);
  font-size: 11px; line-height: 1.7; overflow-x: auto; white-space: pre;
}
