/* Altibbi Social Analytics. Follows the Altibbi internal tool design standard (ALTIBBI-TOOL-DESIGN.md)
   and the Brand Hub (brand.altibbi.app). Tokens below are the standard's block; each one reads the live
   Brand Hub value (loaded from /api/tokens.css in index.html) and falls back to the published hex.
   Components use these variables only — no raw hex outside this block. Logical properties only. */

/* ---------- 2. Design tokens ---------- */
:root {
  color-scheme: light;
  /* Brand scale */
  --brand-50:  var(--color-brand-50, #E9EFFB);
  --brand-100: var(--color-brand-100, #C1D3F6);
  --brand-200: var(--color-brand-200, #98B6F2);
  --brand-500: var(--color-brand-500, #155EEF);
  --brand-600: var(--color-brand-600, #0C4ED4);
  --brand-900: var(--color-brand-900, #012670);

  /* Ink */
  --ink:   var(--color-ink, #17181A);
  --ink-2: var(--color-ink-2, #50545B);
  --ink-3: var(--color-ink-3, #6B7078);

  /* Surfaces and lines */
  --surface:   var(--color-surface, #FFFFFF);
  --surface-2: var(--color-surface-2, #F7F7F8);
  --surface-3: var(--color-surface-3, #F0F1F3);
  --line:      var(--color-line, #E6E6E8);

  /* Status: background / text / dot */
  --success-bg: #ECFDF5; --success-fg: #065F46; --success-dot: #10B981;
  --review-bg:  #FEF4E1; --review-fg:  #B54708; --review-dot:  #F79009;
  --error-bg:   #F9EBEF; --error-fg:   #860A27; --error-dot:   #CF274D;
  --active-bg:  #E9EFFB; --active-fg:  #0C4ED4; --active-dot:  #155EEF;
  --neutral-bg: #F0F1F3; --neutral-fg: #50545B; --neutral-dot: #6B7078;

  /* Type */
  --font-display: 'Tajawal', sans-serif;
  --font-text: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-data: 'JetBrains Mono', monospace;

  /* Radius */
  --r-sm: 8px; --r-row: 10px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-hero: 24px; --r-pill: 999px;

  /* Space: 4px rhythm */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

  /* Motion */
  --ease: cubic-bezier(.2,.7,.2,1);
  --t-fast: 150ms;

  /* Derived (from the tokens above, not new colours) */
  --float-shadow: 0 1px 2px rgba(23,24,26,.06), 0 8px 24px rgba(23,24,26,.10);
  /* Chart series per platform: brand scale only (section 12: no second accent, no rainbow charts). */
  --series-facebook: var(--brand-500);
  --series-instagram: var(--brand-900);
  --series-youtube: var(--brand-200);
  --series-linkedin: var(--brand-600);
  --series-x: var(--ink-3);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface-3); color: var(--ink); font: 400 15px/24px var(--font-text); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--brand-500); }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 700; color: var(--ink); }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
[dir="rtl"], .ar, bdi.ar { font-family: var(--font-text); line-height: 28px; letter-spacing: 0; }
.mono { font-family: var(--font-data); font-size: 13px; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { inline-size: 20px; block-size: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 4. App shell ---------- */
.app { display: flex; flex-wrap: wrap; gap: var(--s-3); padding: var(--s-3); min-block-size: 100vh; align-items: flex-start; }
.sidebar {
  flex: 0 0 248px; position: sticky; inset-block-start: var(--s-3); block-size: calc(100vh - 2 * var(--s-3));
  display: flex; flex-direction: column; gap: var(--s-6); padding: var(--s-4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); overflow-y: auto;
}
.tool { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-1) var(--s-2); }
.tool-mark { inline-size: 36px; block-size: 36px; border-radius: var(--r-md); background: var(--brand-50); display: grid; place-items: center; flex: none; }
.tool-mark img { inline-size: 26px; block-size: 26px; }
.tool-name { display: flex; flex-direction: column; }
.tool-name strong { font-family: var(--font-display); font-size: 17px; line-height: 22px; font-weight: 700; }
.tool-name span { font-size: 12px; line-height: 16px; color: var(--ink-3); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { margin: var(--s-3) var(--s-3) var(--s-1); font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-3); }
.nav button {
  position: relative; display: flex; align-items: center; gap: var(--s-3); block-size: 44px; padding-inline: var(--s-3);
  border: 0; border-radius: var(--r-row); background: none; color: var(--ink-2); cursor: pointer; text-align: start; font-weight: 500;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav button span { flex: 1; }
.nav button:hover { background: var(--surface-2); color: var(--ink); }
.nav button[aria-selected="true"] { background: var(--brand-50); color: var(--brand-500); font-weight: 600; }
.nav button[aria-selected="true"]::before { content: ""; position: absolute; inset-inline-start: 0; inset-block: 10px; inline-size: 3px; border-radius: var(--r-pill); background: var(--brand-500); }
.count { font-style: normal; font-size: 12px; line-height: 20px; font-weight: 600; min-inline-size: 24px; padding-inline: var(--s-2); border-radius: var(--r-pill); text-align: center; background: var(--neutral-bg); color: var(--neutral-fg); font-variant-numeric: tabular-nums; }
.nav button[aria-selected="true"] .count { background: var(--surface); color: var(--brand-600); }
.count.alert { background: var(--error-bg); color: var(--error-fg); }

.brand-card { margin-block-start: auto; display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-4); border-radius: var(--r-lg); background: var(--brand-50); text-decoration: none; color: var(--ink-2); }
.brand-card svg { inline-size: 44px; block-size: 44px; }
.brand-card strong { color: var(--ink); font-weight: 600; }
.brand-card span { font-size: 13px; line-height: 20px; }
.brand-card .quiet { color: var(--brand-600); font-weight: 600; }

.main { flex: 1 1 600px; min-inline-size: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); display: flex; flex-direction: column; min-block-size: calc(100vh - 2 * var(--s-3)); }
.topbar { display: flex; align-items: center; gap: var(--s-3); min-block-size: 64px; padding: var(--s-3) var(--s-6); border-block-end: 1px solid var(--line); flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: var(--s-2); font-size: 13px; line-height: 20px; font-weight: 500; color: var(--ink-3); margin-inline-end: auto; }
.crumbs b { color: var(--ink); font-weight: 600; }
.topsearch { position: relative; }
.topsearch svg { position: absolute; inset-inline-start: 14px; inset-block-start: 12px; color: var(--ink-3); inline-size: 20px; block-size: 20px; }
.topsearch input[type="search"] { block-size: 44px; inline-size: 300px; max-inline-size: 60vw; padding-inline: 44px 52px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.topsearch kbd { position: absolute; inset-inline-end: 10px; inset-block-start: 11px; font: 500 12px/20px var(--font-text); color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding-inline: 6px; }
.iconbtn { inline-size: 44px; block-size: 44px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; position: relative; transition: background-color var(--t-fast) var(--ease); }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.iconbtn .dot { position: absolute; inset-block-start: 10px; inset-inline-end: 10px; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--error-dot); box-shadow: 0 0 0 2px var(--surface); }
.avatar { inline-size: 40px; block-size: 40px; border-radius: 50%; background: var(--brand-900); color: var(--surface); display: grid; place-items: center; font: 600 14px/1 var(--font-text); flex: none; }
.popover { position: absolute; inset-block-start: 52px; inset-inline-end: 0; z-index: 30; inline-size: 340px; max-inline-size: 90vw; padding: var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--float-shadow); text-align: start; cursor: default; color: var(--ink-2); font-size: 14px; }
.popover h3 { font-size: 17px; line-height: 24px; margin-block-end: var(--s-2); }
.popover dl { margin: 0; display: grid; gap: var(--s-2); }
.popover dt { font-weight: 600; color: var(--ink); }
.popover dd { margin: 0 0 var(--s-1); }
.popover ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.anchor { position: relative; }

.content { inline-size: 100%; max-inline-size: 1200px; margin-inline: auto; padding: var(--s-8); display: flex; flex-direction: column; gap: var(--s-6); flex: 1; }
.pagehead { display: flex; flex-direction: column; gap: var(--s-1); }
.pagehead h1 { font-size: 40px; line-height: 48px; }
.pagehead p { margin: 0; color: var(--ink-2); }
.pagehead-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.footer { display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; padding: var(--s-6) var(--s-8); border-block-start: 1px solid var(--line); font-size: 13px; line-height: 20px; color: var(--ink-3); }

/* Grid: 12 columns, 24px gutters */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-6); }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-6 { grid-column: span 6; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }

/* ---------- Page toolbar (period, platforms, filters) ---------- */
.toolbar { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); max-inline-size: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented button { display: inline-flex; align-items: center; gap: 6px; block-size: 36px; padding-inline: var(--s-4); border: 0; border-radius: var(--r-pill); background: none; color: var(--ink-2); font-weight: 500; cursor: pointer; white-space: nowrap; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.segmented button svg.i { inline-size: 18px; block-size: 18px; }
.segmented button:hover { color: var(--ink); background: var(--surface); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--brand-600); font-weight: 600; box-shadow: 0 0 0 1px var(--brand-100); }
.custom-dates { display: flex; align-items: flex-end; gap: var(--s-2); }
.field { display: flex; flex-direction: column; gap: var(--s-1); }
.field > label, .field-label { font-size: 13px; line-height: 20px; font-weight: 500; color: var(--ink-2); }

.pchip { display: inline-flex; align-items: center; gap: var(--s-2); block-size: 44px; padding-inline: 6px var(--s-4); border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 500; cursor: pointer; transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.pchip.all { padding-inline: var(--s-4); }
.pchip:hover { border-color: var(--brand-100); color: var(--ink); }
.pchip[aria-pressed="true"] { background: var(--brand-50); border-color: var(--brand-500); color: var(--brand-600); font-weight: 600; }
.pchip .tick { display: none; }
.pchip[aria-pressed="true"] .tick { display: block; inline-size: 18px; block-size: 18px; }
.plogo { inline-size: 32px; block-size: 32px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--surface); background: var(--pc, var(--brand-500)); flex: none; }
.plogo svg { inline-size: 16px; block-size: 16px; fill: currentColor; }
.plogo.sm { inline-size: 24px; block-size: 24px; } .plogo.sm svg { inline-size: 13px; block-size: 13px; }
.plogo.lg { inline-size: 44px; block-size: 44px; border-radius: var(--r-md); } .plogo.lg svg { inline-size: 22px; block-size: 22px; }

/* ---------- 5. Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); block-size: 44px; padding-inline: var(--s-6); border-radius: var(--r-pill); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; border: 1px solid var(--brand-100); background: var(--surface); color: var(--brand-500); transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.btn:hover { background: var(--brand-50); }
.btn.primary { background: var(--brand-500); border-color: var(--brand-500); color: var(--surface); }
.btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn.hero-size { block-size: 48px; }
.btn.small { block-size: 36px; padding-inline: var(--s-4); }
.btn.danger { border-color: var(--error-bg); color: var(--error-fg); }
.btn.danger:hover { background: var(--error-bg); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn .count { background: var(--brand-500); color: var(--surface); }
.btn[aria-expanded="true"] { background: var(--brand-50); }
.quiet { display: inline-flex; align-items: center; gap: var(--s-1); color: var(--brand-500); font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; min-block-size: 36px; }
.quiet:hover { text-decoration: underline; }
.quiet .arrow::after { content: "→"; display: inline-block; }
[dir="rtl"] .quiet .arrow::after { content: "←"; }

/* ---------- Inputs ---------- */
input[type="date"], input[type="number"], input[type="search"], input[type="text"], select {
  block-size: 44px; padding-inline: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-md); background-color: var(--surface); color: var(--ink);
  transition: border-color var(--t-fast) var(--ease);
}
input:focus-visible, select:focus-visible { border-color: var(--brand-500); }
select { padding-inline-end: 36px; appearance: none; cursor: pointer; font-weight: 500;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2350545B' stroke-width='1.75' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
[dir="rtl"] select { background-position: left 12px center; }
select.small { block-size: 36px; }

/* ---------- Filters panel ---------- */
.filter-panel { padding: var(--s-6); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); display: flex; flex-direction: column; gap: var(--s-4); }
.fp-row { display: flex; gap: var(--s-6); flex-wrap: wrap; }
.fp-row .grow { flex: 1; min-inline-size: 240px; }
.range { display: flex; align-items: center; gap: var(--s-2); color: var(--ink-2); }
.range input { inline-size: 96px; }
.chipset { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chipset button { block-size: 36px; padding-inline: var(--s-3); border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; font-size: 14px; font-weight: 500; transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.chipset button:hover { border-color: var(--brand-100); }
.chipset button[aria-pressed="true"] { background: var(--brand-50); border-color: var(--brand-500); color: var(--brand-600); font-weight: 600; }
.chipset .ar { color: inherit; margin-inline-start: var(--s-1); font-size: 13px; }
.fp-foot { display: flex; justify-content: flex-end; gap: var(--s-3); padding-block-start: var(--s-4); border-block-start: 1px solid var(--line); }
.active-filters { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.fchip { display: inline-flex; align-items: center; gap: 6px; block-size: 36px; padding-inline: var(--s-3) var(--s-2); border-radius: var(--r-pill); background: var(--brand-50); color: var(--brand-600); font-size: 14px; font-weight: 500; border: 0; cursor: pointer; }
.fchip svg.i { inline-size: 16px; block-size: 16px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-6); min-inline-size: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; margin-block-end: var(--s-4); }
.card.flush .card-head { padding: var(--s-6) var(--s-6) 0; }
.card-head h2, .card-head h3 { font-size: 20px; line-height: 28px; }
.card-head p { margin: 2px 0 0; font-size: 13px; line-height: 20px; color: var(--ink-3); }
.card-tools { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.inset { background: var(--surface-2); border-radius: var(--r-md); padding: var(--s-4); }
.inset .ink3 { color: var(--ink-2); }

/* ---------- 6. Hero card ---------- */
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: var(--s-8); align-items: start;
  background: var(--brand-50); border-radius: var(--r-hero); padding: var(--s-10) var(--s-10) 72px; }
.hero-text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: var(--s-2); }
.hero-date { font-size: 13px; line-height: 20px; font-weight: 500; color: var(--ink-2); }
.hero h1 { font-size: 40px; line-height: 48px; }
.hero-ar { font-family: var(--font-display); font-size: 24px; line-height: 32px; font-weight: 500; color: var(--brand-600); }
.hero-lead { font-size: 16px; line-height: 26px; color: var(--ink-2); max-inline-size: 560px; margin: var(--s-2) 0 var(--s-3); }
.hero-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.next { position: relative; z-index: 1; background: var(--surface); border-radius: var(--r-xl); padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-3); }
.next h2 { font-size: 24px; line-height: 32px; }
.next .time { color: var(--ink-2); font-size: 14px; }
.next .stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.next .stats .inset { padding: var(--s-3); }
.next .stats span { display: block; font-size: 13px; line-height: 20px; color: var(--ink-2); }
.next .stats b { font-family: var(--font-display); font-size: 22px; line-height: 28px; font-variant-numeric: tabular-nums; }
.next .illo { position: absolute; inset-inline-end: var(--s-4); inset-block-start: var(--s-4); inline-size: 56px; block-size: 56px; }
.hero .trail { position: absolute; inset-inline: 0; inset-block-end: 0; block-size: 80px; }
.hero .trail svg { inline-size: 100%; block-size: 100%; }
.hero .halo { position: absolute; inset-inline-end: -60px; inset-block-start: -70px; inline-size: 260px; block-size: 260px; opacity: .55; }

/* ---------- Status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; block-size: 26px; padding-inline: 10px; border-radius: var(--r-pill); font-size: 13px; line-height: 20px; font-weight: 600; white-space: nowrap; inline-size: fit-content; }
.pill::before { content: ""; inline-size: 6px; block-size: 6px; border-radius: 50%; background: var(--dot); flex: none; }
.pill.success { background: var(--success-bg); color: var(--success-fg); --dot: var(--success-dot); }
.pill.review  { background: var(--review-bg);  color: var(--review-fg);  --dot: var(--review-dot); }
.pill.error   { background: var(--error-bg);   color: var(--error-fg);   --dot: var(--error-dot); }
.pill.active  { background: var(--active-bg);  color: var(--active-fg);  --dot: var(--active-dot); }
.pill.neutral { background: var(--neutral-bg); color: var(--neutral-fg); --dot: var(--neutral-dot); }

/* ---------- Metric cards ---------- */
.metrics { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-6); }
.metric { grid-column: span 3; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-3); min-inline-size: 0; }
.metric.hero-metric { grid-column: span 6; }
/* Secondary metrics share one row evenly, however many the selected platforms report. */
.metrics-secondary { grid-column: span 12; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s-6); }
.metrics-secondary .metric { grid-column: auto; }
.metric-top { display: flex; align-items: center; gap: var(--s-2); font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ink-2); }
.metric-icon { inline-size: 32px; block-size: 32px; border-radius: var(--r-sm); background: var(--brand-50); color: var(--brand-500); display: grid; place-items: center; flex: none; }
.metric-icon svg.i { inline-size: 18px; block-size: 18px; }
.metric-value { font-family: var(--font-display); font-size: 36px; line-height: 40px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hero-metric .metric-value { font-size: 44px; line-height: 48px; }
.metric-base { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; font-size: 13px; line-height: 20px; color: var(--ink-3); }
.chip { display: inline-flex; align-items: center; gap: 2px; block-size: 24px; padding-inline: var(--s-2); border-radius: var(--r-pill); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chip.good { background: var(--success-bg); color: var(--success-fg); }
.chip.bad { background: var(--error-bg); color: var(--error-fg); }
.chip.flat { background: var(--neutral-bg); color: var(--neutral-fg); }
.bars { display: flex; align-items: flex-end; gap: 4px; block-size: 40px; margin-block-start: auto; }
.hero-metric .bars { block-size: 56px; }
.bars span { inline-size: 6px; min-block-size: 3px; border-radius: 3px; background: var(--brand-100); }
.hero-metric .bars span { inline-size: 10px; }
.bars span:last-child { background: var(--brand-500); }
.bars span:hover { background: var(--brand-200); }
.bars span:last-child:hover { background: var(--brand-600); }
.missing { font-size: 13px; line-height: 20px; color: var(--ink-3); margin: 0; }

/* ---------- Charts ---------- */
.chart-box { position: relative; block-size: 300px; }
.chart-box.short { block-size: 240px; }
.chart-box.tall { block-size: 440px; }
.legend { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); margin: calc(-1 * var(--s-2)) 0 var(--s-3); color: var(--ink-2); font-size: 13px; line-height: 20px; font-weight: 500; }
.legend span { display: inline-flex; align-items: center; gap: var(--s-2); }
.swatch { inline-size: 10px; block-size: 10px; border-radius: 3px; flex: none; display: inline-block; }

/* ---------- Lists ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); padding-block: var(--s-3); border-block-start: 1px solid var(--line); }
.rows li:first-child { border-block-start: 0; padding-block-start: 0; }
.thumb { inline-size: 44px; block-size: 44px; border-radius: var(--r-md); background: var(--brand-50); color: var(--brand-500); display: grid; place-items: center; overflow: hidden; flex: none; position: relative; }
.thumb img { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; }
.thumb .plogo { position: absolute; inset-inline-end: 2px; inset-block-end: 2px; inline-size: 16px; block-size: 16px; }
.thumb .plogo svg { inline-size: 9px; block-size: 9px; }
.thumb > .plogo:only-child { position: static; inline-size: 24px; block-size: 24px; }
.thumb > .plogo:only-child svg { inline-size: 13px; block-size: 13px; }
.rank { inline-size: 28px; block-size: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 13px; font-weight: 600; background: var(--neutral-bg); color: var(--neutral-fg); flex: none; font-variant-numeric: tabular-nums; }
.row-title { font-weight: 600; color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-align: start; unicode-bidi: plaintext; }
.row-meta { font-size: 13px; line-height: 20px; color: var(--ink-3); }
.row-value { text-align: end; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-value span { display: block; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--ink-3); }
.rows li.lead-item { grid-template-columns: auto auto minmax(0, 1fr) auto; }

.bar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-4); }
.bar-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px var(--s-3); }
.bar-list .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-list .name .ar { color: var(--ink-3); font-weight: 400; line-height: inherit; }
.bar-list .name .sep { color: var(--ink-3); padding-inline: 6px; }
.bar-list .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-list .track { grid-column: 1 / -1; block-size: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.bar-list .fill { block-size: 100%; border-radius: var(--r-pill); background: var(--brand-500); }

/* Reminder strip */
.reminder { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-4); border-radius: var(--r-lg); background: var(--brand-50); }
.reminder .circle { inline-size: 44px; block-size: 44px; border-radius: 50%; background: var(--surface); color: var(--brand-500); display: grid; place-items: center; flex: none; }
.reminder .txt { flex: 1; min-inline-size: 0; }
.reminder strong { display: block; font-weight: 600; }
.reminder span { color: var(--ink-2); font-size: 14px; }

/* Podium (top posts) */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-6); }
.pod { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-3); min-inline-size: 0; }
.pod-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.pod-media { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-md); background: var(--brand-50); overflow: hidden; display: grid; place-items: center; }
.pod-media img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
.pod-caption { margin: 0; font-weight: 600; min-block-size: 56px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; unicode-bidi: plaintext; text-align: start; }
.pod-metric { display: flex; align-items: baseline; gap: var(--s-2); }
.pod-metric strong { font-family: var(--font-display); font-size: 36px; line-height: 40px; font-variant-numeric: tabular-nums; }
.pod-metric span { color: var(--ink-2); font-weight: 500; }
.pod-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); padding-block-start: var(--s-3); border-block-start: 1px solid var(--line); }
.pod-stats span { display: block; font-size: 13px; line-height: 20px; color: var(--ink-3); }
.pod-stats b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; block-size: 26px; padding-inline: 10px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500; background: var(--neutral-bg); color: var(--neutral-fg); white-space: nowrap; }
.tag.cat { background: var(--brand-50); color: var(--brand-600); }
.meta-line { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; font-size: 13px; line-height: 20px; color: var(--ink-3); }
.meta-line a { color: var(--brand-500); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; padding-block: 8px; margin-block: -8px; } /* 36px hit area in dense tables */
.meta-line a:hover { text-decoration: underline; }
.meta-line svg.i { inline-size: 14px; block-size: 14px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; position: relative; }
table { inline-size: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 20px; }
th, td { padding: var(--s-4); text-align: start; border-block-end: 1px solid var(--line); white-space: nowrap; vertical-align: middle; background: var(--surface); }
thead th { font-size: 13px; line-height: 20px; font-weight: 500; color: var(--ink-3); border-block-start: 1px solid var(--line); padding-block: var(--s-3); position: sticky; inset-block-start: 0; z-index: 1; }
td.num, th.num { text-align: end; }
tbody tr:hover td { background: var(--surface-2); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th.sorted { color: var(--brand-600); font-weight: 600; }
td.sorted { font-weight: 600; color: var(--ink); }
.sticky-col { position: sticky; inset-inline-start: 0; z-index: 1; border-inline-end: 1px solid var(--line); }
thead .sticky-col { z-index: 2; }
td.post { white-space: normal; min-inline-size: 320px; max-inline-size: 420px; }
.post-cell { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-3); align-items: center; inline-size: 380px; }
@media (max-width: 560px) { .post-cell { inline-size: 260px; } }
td .na, .na { color: var(--ink-3); }
td select { block-size: 36px; max-inline-size: 260px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-6); color: var(--ink-2); font-size: 13px; flex-wrap: wrap; }
.pager .btns { display: flex; gap: var(--s-2); }

/* Daily report table */
.daily tbody tr.total td { background: var(--brand-50); font-weight: 700; color: var(--ink); }
.daily tbody tr.month td { font-family: var(--font-display); font-size: 17px; font-weight: 700; padding-block-start: var(--s-6); }
.daily td.est { color: var(--ink-3); font-style: italic; }
.daily td, .daily th { padding: var(--s-3) var(--s-4); }
.daily .table-wrap { max-block-size: 720px; overflow: auto; }

/* ---------- Insights ---------- */
.finding { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-2); }
.finding .metric-top { margin-block-end: var(--s-1); }
.finding .f-value { font-family: var(--font-display); font-size: 24px; line-height: 32px; font-weight: 700; }
.finding .f-note { font-size: 14px; line-height: 22px; color: var(--ink-2); }
.heatmap { overflow-x: auto; }
.heat { display: grid; grid-template-columns: 44px repeat(24, minmax(22px, 1fr)); gap: 3px; min-inline-size: 640px; }
.heat .hl { font-size: 12px; color: var(--ink-3); text-align: center; }
.heat .dl { font-size: 13px; color: var(--ink-2); font-weight: 500; display: flex; align-items: center; }
.heat .c { block-size: 28px; border-radius: 5px; background: var(--surface-3); }
.heat .c.thin { background: var(--surface-2); outline: 1px dashed var(--line); outline-offset: -1px; }
.heat-legend { display: flex; align-items: center; gap: var(--s-2); justify-content: flex-end; margin-block-start: var(--s-3); color: var(--ink-3); font-size: 13px; flex-wrap: wrap; }
.heat-legend .ramp { display: inline-flex; gap: 2px; }
.heat-legend .ramp i { inline-size: 20px; block-size: 10px; border-radius: 3px; }
.heat-legend .thin-key { inline-size: 14px; block-size: 14px; border-radius: 3px; background: var(--surface-2); outline: 1px dashed var(--line); }

/* ---------- Labelling ---------- */
.ring { --p: 0; inline-size: 72px; block-size: 72px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--brand-500) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring::before { content: attr(data-label); inline-size: 56px; block-size: 56px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.metric.cover { flex-direction: row; align-items: center; gap: var(--s-4); }

/* ---------- Connections ---------- */
.provider { display: flex; flex-direction: column; gap: var(--s-4); }
.prov-head { display: flex; align-items: flex-start; gap: var(--s-3); }
.prov-logos { display: flex; }
.prov-logos .plogo + .plogo { margin-inline-start: -10px; box-shadow: 0 0 0 3px var(--surface); }
.prov-head > div { flex: 1; min-inline-size: 0; }
.prov-head p { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; line-height: 22px; }
.accounts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.account { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-2) var(--s-3); align-items: center; padding: var(--s-4); border-radius: var(--r-md); background: var(--surface-2); }
.account .avatar-img { position: relative; inline-size: 44px; block-size: 44px; border-radius: 50%; background: var(--brand-50); }
.account .avatar-img img { inline-size: 44px; block-size: 44px; border-radius: 50%; object-fit: cover; }
.account .avatar-img .plogo { position: absolute; inset-inline-end: -4px; inset-block-end: -4px; box-shadow: 0 0 0 2px var(--surface-2); }
.account .who strong { display: block; font-weight: 600; }
.account .who span { color: var(--ink-2); font-size: 13px; line-height: 20px; }
.account .acts, .account .status { grid-column: 1 / -1; display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--ink-2); }
.account .err { grid-column: 1 / -1; font-size: 13px; color: var(--error-fg); background: var(--error-bg); border-radius: var(--r-sm); padding: var(--s-2) var(--s-3); }
.prov-empty { color: var(--ink-2); font-size: 14px; padding: var(--s-4); border-radius: var(--r-md); background: var(--surface-2); }
.notice { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-lg); font-weight: 500; }
.notice.ok { background: var(--success-bg); color: var(--success-fg); }
.notice.bad { background: var(--error-bg); color: var(--error-fg); }
.fine-print { color: var(--ink-3); font-size: 13px; line-height: 20px; margin: 0; }

/* Audience */
.gender { display: flex; block-size: 14px; border-radius: var(--r-pill); overflow: hidden; gap: 2px; margin: var(--s-2) 0 var(--s-4); }
.gender span { display: block; block-size: 100%; }
.gender-legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); font-size: 14px; }
.gender-legend b { font-family: var(--font-display); font-size: 24px; line-height: 32px; display: block; font-variant-numeric: tabular-nums; }

/* ---------- 9. States ---------- */
.state { padding: var(--s-10) var(--s-6); text-align: center; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: var(--s-2); }
.state svg.illo { inline-size: 64px; block-size: 64px; margin-block-end: var(--s-2); }
.state strong { color: var(--ink); font-weight: 600; font-size: 16px; }
.state.compact { padding: var(--s-6) var(--s-4); }
.state.error strong { color: var(--error-fg); }
.skel { display: block; border-radius: var(--r-md); background: var(--surface-3); }
.skel.line { block-size: 14px; border-radius: var(--r-pill); }
.skel-metric { grid-column: span 3; display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-6); border: 1px solid var(--line); border-radius: var(--r-lg); }
.loading .chart-box, .loading .rows, .loading .bar-list { opacity: .5; transition: opacity var(--t-fast) var(--ease); }
.toast { position: fixed; inset-block-end: var(--s-6); inset-inline-start: 50%; translate: -50% 0; z-index: 50; display: flex; align-items: center; gap: var(--s-2); background: var(--ink); color: var(--surface); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); font-weight: 500; box-shadow: var(--float-shadow); }

/* ---------- Density (desktop) ----------
   Analytics screens need to show a lot at once. On mouse-and-keyboard screens everything steps down:
   14px body, 28px page title, 16px card padding and gaps, 36px controls. Touch screens keep 44px targets
   (see the pointer: coarse block below). Deliberate deviation from the standard's type scale, at the user's request. */
body { font-size: 14px; line-height: 20px; }
.app { gap: 10px; padding: 10px; }
.sidebar { flex-basis: 216px; padding: var(--s-3); gap: var(--s-4); inset-block-start: 10px; block-size: calc(100vh - 20px); border-radius: var(--r-lg); }
.main { border-radius: var(--r-lg); min-block-size: calc(100vh - 20px); }
.tool-mark { inline-size: 30px; block-size: 30px; border-radius: var(--r-sm); }
.tool-mark img { inline-size: 22px; block-size: 22px; }
.tool-name strong { font-size: 15px; line-height: 20px; }
.nav-label { margin: var(--s-2) var(--s-3) 2px; }
.nav button { block-size: 36px; gap: var(--s-2); padding-inline: var(--s-3) var(--s-2); font-size: 14px; }
.nav button svg.i { inline-size: 18px; block-size: 18px; }
.nav button[aria-selected="true"]::before { inset-block: 8px; }
.brand-card { padding: var(--s-3); gap: 4px; }
.brand-card svg { inline-size: 32px; block-size: 32px; }

.topbar { min-block-size: 52px; padding: var(--s-2) var(--s-6); gap: var(--s-2); }
.topsearch input[type="search"] { block-size: 36px; inline-size: 260px; padding-inline: 36px 44px; }
.topsearch svg { inset-block-start: 9px; inset-inline-start: 11px; inline-size: 18px; block-size: 18px; }
.topsearch kbd { inset-block-start: 7px; }
.iconbtn { inline-size: 36px; block-size: 36px; border-radius: var(--r-sm); }
.iconbtn svg.i { inline-size: 18px; block-size: 18px; }
.iconbtn .dot { inset-block-start: 7px; inset-inline-end: 7px; }
.avatar { inline-size: 32px; block-size: 32px; font-size: 12px; }
.popover { inset-block-start: 44px; }

.content { max-inline-size: 1400px; padding: var(--s-6); gap: var(--s-4); }
.pagehead h1 { font-size: 28px; line-height: 36px; }
.pagehead p { font-size: 14px; line-height: 20px; }
.view[style] { gap: var(--s-4) !important; }
.grid, .metrics { gap: var(--s-4); }
.footer { padding: var(--s-3) var(--s-6); font-size: 12px; }

.toolbar { gap: var(--s-2); }
.segmented { padding: 2px; }
.segmented button { block-size: 30px; padding-inline: var(--s-3); font-size: 13px; }
.segmented button svg.i { inline-size: 16px; block-size: 16px; }
.pchip { block-size: 34px; padding-inline: 4px var(--s-3); font-size: 13px; gap: 6px; }
.pchip.all { padding-inline: var(--s-3); }
.pchip .plogo { inline-size: 24px; block-size: 24px; }
.pchip .plogo svg { inline-size: 13px; block-size: 13px; }
.pchip[aria-pressed="true"] .tick { inline-size: 16px; block-size: 16px; }
.btn { block-size: 36px; padding-inline: var(--s-4); font-size: 14px; }
.btn.small { block-size: 30px; padding-inline: var(--s-3); font-size: 13px; }
.btn svg.i { inline-size: 18px; block-size: 18px; }
.quiet { min-block-size: 28px; font-size: 13px; }
input[type="date"], input[type="number"], input[type="search"], input[type="text"], select { block-size: 36px; font-size: 14px; border-radius: var(--r-sm); }
select.small { block-size: 30px; font-size: 13px; }
.chipset button { block-size: 30px; font-size: 13px; }
.fchip { block-size: 30px; font-size: 13px; }
.filter-panel { padding: var(--s-4); gap: var(--s-3); }

.card { padding: var(--s-4); border-radius: var(--r-md); }
.card.flush .card-head { padding: var(--s-4) var(--s-4) 0; }
.card-head { margin-block-end: var(--s-3); }
.card-head h2, .card-head h3 { font-size: 16px; line-height: 24px; }
.card-head p { font-size: 12px; line-height: 18px; margin-block-start: 0; }

/* Metrics: hero pair and secondary cards share one row where they fit. */
.metrics { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.metric, .metric.hero-metric, .skel-metric { grid-column: auto; }
.metric.hero-metric { grid-column: span 2; }
.metrics-secondary { display: contents; }
/* Wide screens: every card on one row. JS sets --units (2 per hero card + 1 per other card). */
@media (min-width: 1100px) { .metrics[style*="--units"] { grid-template-columns: repeat(var(--units), minmax(0, 1fr)); } }
.metric { padding: var(--s-3) var(--s-4); gap: 6px; border-radius: var(--r-md); }
.metric-top { font-size: 13px; line-height: 18px; gap: 6px; }
.metric-icon { inline-size: 24px; block-size: 24px; border-radius: 6px; }
.metric-icon svg.i { inline-size: 15px; block-size: 15px; }
.metric-value, .hero-metric .metric-value { font-size: 26px; line-height: 32px; }
.metric-base { font-size: 12px; line-height: 16px; gap: 6px; }
.chip { block-size: 20px; font-size: 12px; padding-inline: 6px; }
.chip svg.i { inline-size: 13px; block-size: 13px; }
.bars, .hero-metric .bars { block-size: 26px; gap: 3px; }
.bars span { inline-size: 5px; }
.hero-metric .bars span { inline-size: 8px; }
.missing { font-size: 12px; margin-block-start: calc(-1 * var(--s-2)); }
.finding .f-value { font-size: 18px; line-height: 24px; }
.finding .f-note { font-size: 13px; line-height: 18px; }

.chart-box { block-size: 240px; }
.chart-box.short { block-size: 200px; }
.chart-box.tall { block-size: 360px; }
.legend { font-size: 12px; margin-block-end: var(--s-2); }

.rows li { padding-block: var(--s-2); gap: var(--s-2); }
.thumb { inline-size: 36px; block-size: 36px; border-radius: var(--r-sm); }
.rank { inline-size: 22px; block-size: 22px; font-size: 12px; }
.row-title { font-size: 13px; line-height: 18px; }
.row-meta { font-size: 12px; line-height: 16px; }
.row-value { font-size: 13px; }
.row-value span { font-size: 11px; line-height: 14px; }
.bar-list { gap: var(--s-3); }
.bar-list li { font-size: 13px; gap: 4px var(--s-3); }
.bar-list .track { block-size: 6px; }
.reminder { padding: var(--s-3); gap: var(--s-3); border-radius: var(--r-md); }
.reminder .circle { inline-size: 32px; block-size: 32px; }
.reminder strong { font-size: 14px; }
.reminder span { font-size: 13px; }

table { font-size: 13px; line-height: 18px; }
th, td { padding: var(--s-2) var(--s-3); }
thead th { font-size: 12px; line-height: 16px; padding-block: var(--s-2); }
.post-cell { inline-size: 340px; gap: var(--s-2); }
.meta-line { font-size: 12px; line-height: 16px; gap: 6px; }
.tag { block-size: 22px; font-size: 12px; padding-inline: 8px; }
.pill { block-size: 22px; font-size: 12px; padding-inline: 8px; }
.plogo.lg { inline-size: 32px; block-size: 32px; border-radius: var(--r-sm); }
.plogo.lg svg { inline-size: 17px; block-size: 17px; }
.pager { padding: var(--s-3) var(--s-4); font-size: 12px; }
.daily td, .daily th { padding: 6px var(--s-3); }
.daily tbody tr.month td { font-size: 15px; padding-block-start: var(--s-4); }

.podium { gap: var(--s-4); }
.pod { padding: var(--s-3); gap: var(--s-2); border-radius: var(--r-md); }
.pod-media { aspect-ratio: 3 / 1; border-radius: var(--r-sm); }
.pod-caption { font-size: 13px; line-height: 18px; min-block-size: 36px; }
.pod-metric strong { font-size: 24px; line-height: 30px; }
.pod-stats { padding-block-start: var(--s-2); }
.pod-stats span { font-size: 11px; line-height: 14px; }
.pod-stats b { font-size: 13px; }

.heat .c { block-size: 22px; }
.ring { inline-size: 56px; block-size: 56px; }
.ring::before { inline-size: 44px; block-size: 44px; font-size: 13px; }
.account { padding: var(--s-3); }
.account .avatar-img, .account .avatar-img img { inline-size: 36px; block-size: 36px; }
.prov-head p { font-size: 13px; line-height: 18px; }
.prov-empty { font-size: 13px; padding: var(--s-3); }
.gender-legend b { font-size: 20px; line-height: 26px; }
.state { padding: var(--s-6) var(--s-4); }
.state svg.illo { inline-size: 48px; block-size: 48px; }

/* ---------- Account and team ---------- */
button.avatar { border: 0; cursor: pointer; }
.pw-form { display: flex; flex-direction: column; gap: var(--s-2); padding-block-start: var(--s-3); margin-block-start: var(--s-3); border-block-start: 1px solid var(--line); }
.pw-form input { inline-size: 100%; }
.form-error { margin: 0; color: var(--error-fg); background: var(--error-bg); border-radius: var(--r-sm); padding: var(--s-2) var(--s-3); font-size: 13px; }
.me-name { font-weight: 600; color: var(--ink); }
.add-user { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-3) var(--s-4); align-items: start; }
.add-user input, .add-user select { inline-size: 100%; }
.add-user .form-error, .add-user > div:last-child { grid-column: 1 / -1; }

/* ---------- Narrow screens ---------- */
@media (max-width: 1100px) {
  .span-8, .span-4, .span-6 { grid-column: span 12; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .podium { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { flex-basis: 100%; position: static; block-size: auto; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-label, .brand-card { display: none; }
  .main { flex-basis: 100%; }
  .content { padding: var(--s-4); }
  .topbar { padding: var(--s-3) var(--s-4); }
  .topsearch input { inline-size: 100%; }
  .topsearch { flex: 1 1 0; min-inline-size: 0; }
  .topsearch kbd { display: none; }
  .topsearch input[type="search"] { padding-inline-end: var(--s-3); }
  .crumbs { flex-basis: 100%; }
  .hero { padding: var(--s-6) var(--s-6) 72px; }
}
@media (max-width: 560px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric, .skel-metric { grid-column: auto; }
  .metric.hero-metric { grid-column: span 2; }
  .pagehead h1 { font-size: 24px; line-height: 32px; }
  .nav button { flex: 1 1 calc(50% - 2px); }
  .footer { padding: var(--s-4); }
}
@media (pointer: coarse) {
  .nav button, .btn, .btn.small, .pchip, .segmented button, .chipset button, select, select.small, .fchip, .iconbtn,
  input[type="date"], input[type="number"], input[type="search"], .topsearch input[type="search"] { block-size: 44px; }
  .iconbtn { inline-size: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
