/* Search Arsenal — Phase 1c dashboard design system.
   Direction B (Endorsed Family). Tokens are copied VERBATIM from
   design/SEARCH-ARSENAL-TOKENS.md (dark, primary mode) — do not retune here.
   Legacy auth/picker classes are preserved via the compat-alias block. */

:root {
  /* --- ground (inherited from scaffold, deliberately) --- */
  --bg:            #060b18; /* page ground */
  --surface:       #0a1224; /* raised sections */
  --card:          #0c1426; /* cards, panels */
  --card-hover:    #111c34;
  --tile:          #0a1020; /* the family app-icon ground */

  /* --- lines --- */
  --divider:       #1a2744; /* 1.33 on bg — decorative rule ONLY, never a control boundary */
  --border:        #5a6684; /* 3.43 on bg — clears WCAG 1.4.11 3:1; use on inputs/toggles/controls */

  /* --- ink --- */
  --text:          #e8eaf0; /* 16.33 on bg — AAA */
  --muted:         #8a97b5; /* 6.71 on bg · 6.27 on card — AA for body/secondary */
  --dim:           #5a6684; /* 3.43 on bg — NON-TEXT ONLY (icons, meta glyphs), never body copy */

  /* --- Search signal --- */
  --accent:        #5b9bff; /* 7.09 on bg · 6.84 on tile — interactive text/icons/active */
  --accent-strong: #2f6fdb; /* tile & solid-button fill; white-on-it = 4.75 (AA) */
  --accent-quiet:  rgba(91,155,255,.14); /* active-row / selected tint */

  /* --- trend semantics (RESERVED — never used for engine identity) --- */
  --pos:  #34d399; /* 10.22 on bg — AAA. ALWAYS paired with ▲ / + */
  --neg:  #f87171; /*  7.10 on bg — AA.  ALWAYS paired with ▼ / − */
  --flat: #8a97b5; /*  6.71 on bg — trend flat, paired with — */
  --warn: #fbbf24; /* 11.77 on bg — AAA. advisories, quota */

  --radius: 10px; --radius-sm: 8px; --radius-tile: 22%; /* one radius decision: 10px = precise, not soft/pill */

  /* --- Arsenal family signals (switcher only; NEVER trend/data) --- */
  --ads:        #f5a623; /* Ads Arsenal amber */
  --conversion: #b98bff; /* Conversion Arsenal violet */

  /* --- tinted trend grounds --- */
  --pos-bg: rgba(52,211,153,.13);
  --neg-bg: rgba(248,113,113,.13);
  --warn-bg: rgba(251,191,36,.13);

  /* --- type --- */
  --font-display: 'Archivo Expanded','Saira SemiExpanded','Archivo',system-ui,sans-serif;
  --font-body: 'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',system-ui,sans-serif;

  /* --- legacy compatibility aliases (map old scaffold names onto the new tokens
         so login/signup/property-picker keep rendering unchanged) --- */
  --bg-elevated:  var(--surface);
  --border-hover: #2a3d66;
  --accent-light: var(--accent);
  --accent-dim:   var(--accent-quiet);
  --up: var(--pos);   --up-bg: var(--pos-bg);
  --down: var(--neg); --down-bg: var(--neg-bg);
}

/* ---- Self-hosted type (OFL; no external font CDN). Local families come
   FIRST in the token stacks (--font-body / --font-display); the system
   fallbacks in those stacks remain after them. Inter = variable latin
   (weights 400/450/600 via the wght axis). 'Archivo Expanded' = a static
   Archivo instance pinned to Expanded width (wdth 125) at weight 600, so
   display text renders expanded without any per-element variation settings. ---- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Archivo Expanded';
  font-style: normal;
  font-weight: 600;
  font-stretch: 125%;
  font-display: swap;
  src: url('/fonts/archivo-expanded-600.woff2') format('woff2');
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  font-feature-settings: 'cv05' 1;
}

/* Tabular lining figures wherever numbers must align. */
.tnum { font-feature-settings: 'tnum' 1, 'cv05' 1; font-variant-numeric: tabular-nums lining-nums; }
/* Archivo Expanded display device — tile titles, wordmark, section identity. */
.display {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--divider); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Wordmark (legacy auth pages) ---- */
.wordmark { display: flex; flex-direction: column; gap: 2px; }
.wordmark .mark {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text);
}
.wordmark .mark span { color: var(--muted); }
.wordmark .byline {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
}

/* ---- Auth pages ---- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 36px 32px;
}
.auth-card .wordmark { align-items: center; margin-bottom: 28px; }
.auth-card h1 { font-size: 17px; font-weight: 600; text-align: center; margin-bottom: 20px; }

/* ---- Forms ---- */
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit; font-size: 14px;
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s;
}
input:focus { border-color: var(--accent); }

.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--card-hover);
  color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--border-hover); }
.btn-primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #061020; }
.btn-block { display: block; width: 100%; margin-top: 20px; }
.btn:disabled { opacity: .5; cursor: default; }

.form-error {
  display: none;
  background: var(--neg-bg);
  color: var(--neg);
  border-radius: var(--radius-sm);
  font-size: 13px;
  padding: 10px 12px; margin-top: 16px;
}
.form-error.show { display: block; }
.auth-alt { text-align: center; font-size: 13px; color: var(--muted); margin-top: 20px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---- App shell ---- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--divider);
  padding: 18px 14px 20px;
  display: flex; flex-direction: column; gap: 20px;
}

/* ---- Family switcher (Direction B) ---- */
.family { display: flex; flex-direction: column; gap: 6px; }
.family-current {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  background: var(--tile);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  padding: 10px 10px;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.family-current:hover { border-color: var(--border-hover); background: var(--card-hover); }
.family-current[aria-expanded="true"] { border-color: var(--accent); }
.keystone { width: 26px; height: 26px; flex-shrink: 0; display: block; }
.family-word { display: flex; flex-direction: column; line-height: 1.15; }
.family-word .p {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text);
}
.family-word .f {
  font-family: var(--font-display);
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--muted);
}
.family-chev { margin-left: auto; color: var(--dim); transition: transform .18s ease; }
.family-current[aria-expanded="true"] .family-chev { transform: rotate(180deg); }

.family-menu { display: none; flex-direction: column; gap: 4px; padding: 2px 0 2px; }
.family-menu.open { display: flex; }
.family-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px; overflow: hidden;
}
.family-item .keystone { width: 18px; height: 18px; opacity: .9; flex-shrink: 0; }
.family-item .fi-word { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.family-item.locked { color: var(--muted); cursor: not-allowed; }
.family-item .lock { margin-left: auto; color: var(--dim); display: inline-flex; flex-shrink: 0; }
.family-item .lock-label {
  font-family: var(--font-body);
  font-size: 9px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin-left: 5px; flex-shrink: 0;
}
.family-item.active { border-color: var(--divider); background: var(--accent-quiet); color: var(--text); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  color: var(--muted); font-size: 14px; padding: 8px 10px;
  border-radius: var(--radius-sm); display: flex; align-items: center; gap: 8px;
}
.nav a:hover { color: var(--text); background: var(--card-hover); text-decoration: none; }
.nav a.active { color: var(--text); background: var(--accent-quiet); }
.nav a .soon { margin-left: auto; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.sidebar-foot { margin-top: auto; font-size: 12px; color: var(--dim); display: flex; flex-direction: column; gap: 6px; }
#whoami { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot button { background: none; border: none; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; padding: 0; text-align: left; }
.sidebar-foot button:hover { color: var(--text); }

.main { flex: 1; padding: 26px 32px 48px; max-width: 1180px; min-width: 0; }

/* ---- Topbar ---- */
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.topbar h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; outline: none; }
.range-meta { font-size: 12px; color: var(--muted); text-align: right; }
.range-meta .rng { color: var(--text); }
.conn-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  border: 1px solid var(--divider); border-radius: 999px;
  padding: 4px 10px; color: var(--muted); background: var(--surface);
}
.conn-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.conn-pill.ok { color: var(--pos); } .conn-pill.ok .dot { background: var(--pos); }
.conn-pill.warn { color: var(--warn); } .conn-pill.warn .dot { background: var(--warn); }

/* ---- Sample ribbon + reconnect banner (designed states) ---- */
.ribbon {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 18px;
}
.ribbon .rb-txt { font-size: 13px; color: var(--text); }
.ribbon .rb-txt b { color: var(--accent); }
.ribbon .rb-sub { font-size: 12px; color: var(--muted); }
.ribbon .btn { margin-left: auto; padding: 8px 16px; }

.banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--warn-bg);
  border: 1px solid var(--divider);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 18px;
}
.banner .bn-icon { color: var(--warn); flex-shrink: 0; display: inline-flex; }
.banner .bn-txt { font-size: 13px; color: var(--text); }
.banner .bn-txt .bn-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.banner .btn { margin-left: auto; }

/* ---- Bento dashboard grid ---- */
.dashboard { display: block; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.grid + .grid { margin-top: 14px; }

.tile {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 16px 18px;
  min-width: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile-title {
  font-family: var(--font-display);
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text);
}
.tile-sub { font-size: 11px; color: var(--muted); }

/* span helpers (desktop 12-col) */
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; }
.c6 { grid-column: span 6; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }

/* ---- KPI tile ---- */
.kpi { justify-content: space-between; }
.kpi-figure {
  font-size: 34px; font-weight: 600; line-height: 1.02; letter-spacing: -.015em; color: var(--text);
}
.kpi-figure .unit { font-size: 17px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.kpi-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.delta {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid transparent;
}
.delta .arrow { font-size: 11px; line-height: 1; }
.delta.pos  { color: var(--pos);  background: var(--pos-bg); }
.delta.neg  { color: var(--neg);  background: var(--neg-bg); }
.delta.flat { color: var(--flat); background: rgba(138,151,181,.12); }
.delta-note { font-size: 11px; color: var(--muted); }
.goal-note {
  font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--divider); border-radius: 4px; padding: 1px 6px;
}

/* ---- Trend tile ---- */
.trend-body { display: flex; flex-direction: column; gap: 10px; }
.spark-wrap { width: 100%; }
.spark { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; }
.legend .lg { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.legend .sw { width: 18px; height: 3px; border-radius: 2px; display: inline-block; }
.legend .lg b { color: var(--text); font-weight: 600; }

/* ---- Table ---- */
.tbl-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data thead th {
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-align: left; padding: 8px 10px;
  border-bottom: 1px solid var(--divider);
  white-space: nowrap; position: sticky; top: 0; background: var(--card);
}
table.data th.num, table.data td.num { text-align: right; font-variant-numeric: tabular-nums lining-nums; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--text); }
table.data th.sorted { color: var(--accent); }
table.data th .sort-ar { font-size: 10px; margin-left: 4px; opacity: .95; }
table.data tbody td { padding: 9px 10px; border-bottom: 1px solid var(--divider); color: var(--text); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--card-hover); }
table.data td.q { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.data td.dim { color: var(--muted); }

/* ---- Channel bars ---- */
.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.bar-lbl { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-val { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums lining-nums; }
.bar-track { grid-column: 1 / -1; height: 8px; background: var(--tile); border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 4px; min-width: 3px;
  transform-origin: left center; animation: barGrow .5s cubic-bezier(0.23,1,0.32,1) both; }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---- Inline half-null / unavailable ---- */
.tile.unavailable { align-items: flex-start; justify-content: center; gap: 6px; color: var(--muted); }
.unavailable .ua-title { color: var(--text); }
.unavailable .ua-msg { font-size: 12.5px; color: var(--muted); }

/* ---- Skeletons (exact tile geometry) ---- */
.sk { position: relative; overflow: hidden; background: var(--divider); border-radius: 6px; }
.sk::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(138,151,181,.10), transparent);
  transform: translateX(-100%); animation: sk 1.25s ease-in-out infinite;
}
@keyframes sk { 100% { transform: translateX(100%); } }
.sk-line { height: 11px; margin: 6px 0; }
.sk-fig { height: 34px; width: 60%; margin: 6px 0 10px; }
.sk-chip { height: 20px; width: 44%; border-radius: 999px; }
.sk-chart { height: 150px; width: 100%; }
.sk-row { height: 14px; margin: 11px 0; }

/* ---- Legacy connect / picker / props (kept functional) ---- */
.card {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.card h2 { font-size: 15px; font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card .desc { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.badge-ok { color: var(--pos); background: var(--pos-bg); }
.badge-warn { color: var(--warn); background: var(--warn-bg); }

.picker-group { margin: 18px 0; }
.picker-group h3 { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.picker-list { display: flex; flex-direction: column; gap: 6px; }
.picker-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  padding: 10px 12px; cursor: pointer; font-size: 14px;
  transition: border-color .15s, background .15s;
}
.picker-item:hover { border-color: var(--border-hover); background: var(--card-hover); }
.picker-item input { accent-color: var(--accent); }
.picker-item .meta { color: var(--muted); font-size: 12px; margin-left: auto; }
.picker-empty { color: var(--muted); font-size: 13px; padding: 6px 0; }

.prop-list { display: flex; flex-direction: column; gap: 8px; }
.prop-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 14px;
}
.prop-row .kind {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  color: var(--accent); background: var(--accent-quiet);
  border-radius: 4px; padding: 2px 8px; flex-shrink: 0;
}
.prop-row .ext { color: var(--muted); font-size: 12px; margin-left: auto; }

.status-line { font-size: 13px; color: var(--muted); margin-top: 14px; min-height: 18px; }
.status-line.err { color: var(--neg); }
.status-line.ok { color: var(--pos); }

/* ---- Responsive ---- */
@media (max-width: 1023px) {
  .c3 { grid-column: span 6; }
  .c4, .c8 { grid-column: span 12; }
}
@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .sidebar { width: auto; border-right: none; border-bottom: 1px solid var(--divider); flex-direction: column; }
  .main { padding: 20px 16px 40px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .c3 { grid-column: span 1; }
  .c4, .c6, .c8, .c12 { grid-column: span 2; }
  .kpi-figure { font-size: 28px; }
  .topbar h1 { font-size: 19px; }
}
@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr; }
  .c3 { grid-column: span 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ==== Search explorer (design: SEARCH-WHITELABEL-DIRECTION §A) ==== */
.toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.seg-btn {
  background: transparent; border: none; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--muted);
  padding: 7px 13px;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--border); }
.seg-btn[aria-pressed="true"] { background: var(--accent-quiet); color: var(--text); }
.seg-btn:hover { color: var(--text); }
.dev-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 10px;
}
.dev-select:disabled { opacity: .55; cursor: not-allowed; }
.rowcount { margin-left: auto; font-size: 12px; color: var(--muted); }
.lens-def { font-size: 12px; color: var(--muted); margin: 0 0 12px; }

.devstrip { margin: 4px 0 14px; }
.devstrip-bar {
  display: flex; gap: 2px; height: 8px;
  background: var(--tile); border-radius: 4px; overflow: hidden;
}
.devseg { display: block; height: 100%; }
.devstrip-legend { display: flex; gap: 14px; margin-top: 6px; flex-wrap: wrap; }
.devleg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.devsw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

.sx-tile { padding: 6px 10px 10px; }
/* per-cell value+delta stack (denser than the KPI chip: color + glyph, no pill) */
.vstack { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.vstack .v { font-size: 14px; font-weight: 450; }
.dcell { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; }
.dcell.pos { color: var(--pos); }
.dcell.neg { color: var(--neg); }
.dcell.flat { color: var(--flat); }
table.data tbody tr { height: 44px; }

.oppcell { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.oppbar { width: 60px; height: 6px; background: var(--tile); border-radius: 3px; overflow: hidden; display: inline-block; }
.oppfill { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.sx-empty { padding: 36px 16px; text-align: center; }
.sx-empty .e1 { font-size: 13px; color: var(--text); }
.sx-empty .e2 { font-size: 13px; color: var(--muted); margin-top: 4px; }
.sx-empty .btn { margin-top: 16px; }
.sx-more-wrap { display: flex; justify-content: center; padding: 10px 0 4px; }
.sx-more-wrap[hidden] { display: none; }

@media (max-width: 720px) {
  .toolbar { gap: 8px; }
  .rowcount { margin-left: 0; width: 100%; }
  /* keep Key, Clicks, Position (+ Opportunity); hide Impressions + CTR */
  table.data th:nth-child(3), table.data td:nth-child(3),
  table.data th:nth-child(4), table.data td:nth-child(4) { display: none; }
}

/* ==== Branding settings (design: SEARCH-WHITELABEL-DIRECTION §B) ==== */
.brand-layout { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .brand-layout { grid-template-columns: 1fr; } }
.brand-form .accent-row { display: flex; align-items: center; gap: 10px; }
.brand-form input[type="color"] {
  width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer;
}
.brand-form #b-hex { width: 110px; }
.brand-form .field-err { border-color: var(--neg); }
.brand-form .btn-primary { margin-top: 20px; }
.pb-row {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--muted); margin-top: 18px; cursor: pointer;
}
.pb-row input { accent-color: var(--accent); width: 15px; height: 15px; flex-shrink: 0; }

.brand-preview { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
/* the report miniature: a real fragment of the report on true white, flat (no shadow) */
.mini-sheet {
  background: #ffffff;   /* --r-paper: print-true white */
  border: 1px solid #c3ccdd;  /* sheet edge, screen-only in the real report */
  border-radius: var(--radius);
  color: #16203a;
  padding: 22px 24px;
}
.mini-inner { max-width: 500px; }
.mini-masthead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.mini-brand { min-width: 0; }
.mini-wordmark { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; color: #16203a; } /* --r-ink: 16.13 on paper, AAA */
.mini-logo { max-height: 26px; display: block; }
.mini-period { font-size: 10px; color: #4a5568; text-align: right; } /* --r-muted: 7.53 on paper, AAA */
.mini-rule { height: 3px; margin-top: 10px; }
.mini-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.mini-tile {
  background: #f6f8fc; border: 1px solid #e3e8f0; border-radius: 8px; /* --r-card ground, --r-hairline rule */
  padding: 9px 11px; display: flex; flex-direction: column; gap: 2px;
}
.mini-lbl { font-size: 9.5px; font-weight: 600; color: #4a5568; } /* --r-muted: 7.53 on paper */
.mini-val { font-size: 19px; font-weight: 600; color: #16203a; line-height: 1.1; } /* --r-ink */
.mini-delta {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9.5px; font-weight: 600; color: #067647; /* --r-pos: 5.69 on paper, AA, system-locked */
  background: rgba(6,118,71,.09); border-radius: 4px; padding: 1px 5px; width: fit-content;
}
.mini-stat { font-size: 11px; color: #4a5568; margin-top: 12px; } /* --r-muted */
.mini-accent { font-weight: 600; }

.dark-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.mini-brand-dark { font-size: 13px; font-weight: 600; color: var(--text); }
.dark-chip-note { margin-left: auto; font-size: 11px; color: var(--muted); }

.verdicts h2 { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.vrow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 0; border-bottom: 1px solid var(--divider);
  font-size: 12.5px; color: var(--muted);
}
.vrow:last-child { border-bottom: none; }
.vrow b { color: var(--text); font-weight: 600; }
.vicon { flex-shrink: 0; font-size: 11px; width: 16px; text-align: center; }
.vicon.ok { color: var(--pos); }
.vicon.adj { color: var(--warn); }
.vswatches { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }
.vswatch { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border); display: inline-block; }
.vhex { font-size: 11px; color: var(--muted); }
.varrow { color: var(--dim); font-size: 11px; }
.view-sample { align-self: flex-start; }
