/* AMOS pilot — Newpost design language (PO95). Tokens first; every component uses them. */

/* ---------------------------------------------------------------- fonts (bundled, OFL) */
@font-face { font-family: "Rubik"; font-weight: 400; font-display: swap; src: url("/static/fonts/rubik-hebrew-400-normal.woff2") format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Rubik"; font-weight: 500; font-display: swap; src: url("/static/fonts/rubik-hebrew-500-normal.woff2") format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Rubik"; font-weight: 700; font-display: swap; src: url("/static/fonts/rubik-hebrew-700-normal.woff2") format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Rubik"; font-weight: 800; font-display: swap; src: url("/static/fonts/rubik-hebrew-800-normal.woff2") format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Rubik"; font-weight: 400; font-display: swap; src: url("/static/fonts/rubik-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Rubik"; font-weight: 500; font-display: swap; src: url("/static/fonts/rubik-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Rubik"; font-weight: 700; font-display: swap; src: url("/static/fonts/rubik-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Rubik"; font-weight: 800; font-display: swap; src: url("/static/fonts/rubik-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Noto Sans Hebrew"; font-weight: 400; font-display: swap; src: url("/static/fonts/noto-sans-hebrew-hebrew-400-normal.woff2") format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Noto Sans Hebrew"; font-weight: 500; font-display: swap; src: url("/static/fonts/noto-sans-hebrew-hebrew-500-normal.woff2") format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Noto Sans Hebrew"; font-weight: 600; font-display: swap; src: url("/static/fonts/noto-sans-hebrew-hebrew-600-normal.woff2") format("woff2"); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Noto Sans Hebrew"; font-weight: 400; font-display: swap; src: url("/static/fonts/noto-sans-hebrew-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Noto Sans Hebrew"; font-weight: 500; font-display: swap; src: url("/static/fonts/noto-sans-hebrew-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Noto Sans Hebrew"; font-weight: 600; font-display: swap; src: url("/static/fonts/noto-sans-hebrew-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------------------------------------------------------------- tokens */
:root {
  --ink: #1b1030; --ink-2: #2a1d45; --ink-3: #3a2c58;
  --orange: #f15a22; --orange-2: #f7941d; --orange-ink: #b83c0c; --orange-tint: #fff1ea;
  --yellow: #ffc93c; --yellow-tint: #fff7de; --yellow-ink: #7a5200;
  --purple: #5b2a86; --purple-chart: #6e3aa8; --purple-tint: #f3edfa;
  --bg: #f7f6f3; --surface: #ffffff; --surface-2: #fbfaf8; --line: #e9e6ef; --line-2: #dcd7e5;
  --text: #1b1030; --text-2: #4f4862; --text-3: #7a7389;
  --good: #16794a; --good-tint: #e6f4ec; --warn: #9a5a00; --warn-tint: #fdf1dc;
  --bad: #b42318; --bad-tint: #fdecea; --neutral: #6b6578; --neutral-tint: #f0eef3;
  --font-display: "Rubik", "Segoe UI", system-ui, sans-serif;
  --font-body: "Noto Sans Hebrew", "Segoe UI", system-ui, sans-serif;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 999px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px;
  --shadow-1: 0 1px 2px rgba(27, 16, 48, .06), 0 1px 1px rgba(27, 16, 48, .04);
  --shadow-2: 0 8px 24px rgba(27, 16, 48, .08), 0 2px 6px rgba(27, 16, 48, .05);
  --focus: 0 0 0 3px rgba(241, 90, 34, .35);
  --sidebar: 248px;
  --heading: #1b1030; --sidebar-bg: #1b1030; --tooltip-bg: #1b1030;
  --primary-bg: #1b1030; --primary-fg: #ffffff; --primary-hover: #2a1d45;
  --chart-1: #6e3aa8; --chart-prev: #a9a3b5; --grid: #ece9f1; --axis: #7a7389;
  color-scheme: light;
}
/* dark: its own steps (the chart hue validated against the dark surface), not an automatic flip */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #120b21; --surface: #1b1330; --surface-2: #221838; --line: #2e2546; --line-2: #3d3358;
  --text: #f3f0fa; --text-2: #cdc6de; --text-3: #9d95b2; --heading: #f7f4fd;
  --sidebar-bg: #0b0616; --tooltip-bg: #2d2247; --primary-bg: #f7f4fd; --primary-fg: #1b1030; --primary-hover: #e4dcf5;
  --purple: #c9a6f5; --purple-tint: #2a1c45; --orange-ink: #ff9a6b; --orange-tint: #3a1d10;
  --yellow-tint: #33280c; --yellow-ink: #ffd877;
  --good: #5fd39a; --good-tint: #12301f; --warn: #f3b24c; --warn-tint: #3a2a0c; --bad: #ff8a80; --bad-tint: #3b1414;
  --neutral: #b5aec8; --neutral-tint: #2a2340;
  --chart-1: #a27be6; --chart-prev: #6f6884; --grid: #2a2240; --axis: #9d95b2;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 8px 24px rgba(0,0,0,.45);
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #120b21; --surface: #1b1330; --surface-2: #221838; --line: #2e2546; --line-2: #3d3358;
  --text: #f3f0fa; --text-2: #cdc6de; --text-3: #9d95b2; --heading: #f7f4fd;
  --sidebar-bg: #0b0616; --tooltip-bg: #2d2247; --primary-bg: #f7f4fd; --primary-fg: #1b1030; --primary-hover: #e4dcf5;
  --purple: #c9a6f5; --purple-tint: #2a1c45; --orange-ink: #ff9a6b; --orange-tint: #3a1d10;
  --yellow-tint: #33280c; --yellow-ink: #ffd877;
  --good: #5fd39a; --good-tint: #12301f; --warn: #f3b24c; --warn-tint: #3a2a0c; --bad: #ff8a80; --bad-tint: #3b1414;
  --neutral: #b5aec8; --neutral-tint: #2a2340;
  --chart-1: #a27be6; --chart-prev: #6f6884; --grid: #2a2240; --axis: #9d95b2;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 8px 24px rgba(0,0,0,.45);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--heading); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 28px; font-weight: 800; line-height: 1.15; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
a { color: var(--purple); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar-bg); color: #fff; }
.sidebar-inner { display: flex; flex-direction: column; padding: var(--s-5) var(--s-4); position: sticky; top: 0; height: 100vh; }
.brand { display: flex; flex-direction: column; gap: var(--s-2); padding: 0 var(--s-2) var(--s-5); border-bottom: 1px solid rgba(255,255,255,.08); }
.brand img { width: 132px; height: auto; display: block; }
.brand .product { font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .12em; color: rgba(255,255,255,.62); }
.nav { display: flex; flex-direction: column; gap: var(--s-1); margin-top: var(--s-5); }
.nav a { display: flex; align-items: center; gap: var(--s-3); padding: 10px var(--s-3); border-radius: var(--r-sm); color: rgba(255,255,255,.72); text-decoration: none; font-weight: 500; position: relative; transition: background .15s, color .15s; }
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.on { background: rgba(255,255,255,.10); color: #fff; }
.nav a.on::before { content: ""; position: absolute; inset-inline-start: -16px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(180deg, var(--orange-2), var(--orange)); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--s-3); }
.env { border-radius: var(--r-md); padding: var(--s-3); background: rgba(255,255,255,.06); font-size: 13px; line-height: 1.45; }
.env strong { display: flex; align-items: center; gap: var(--s-2); font-family: var(--font-display); font-weight: 700; font-size: 14px; color: #fff; }
.env span { color: rgba(255,255,255,.66); }
.env .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 3px rgba(255,201,60,.18); }
.env.live .dot { background: #3ccf8e; box-shadow: 0 0 0 3px rgba(60,207,142,.18); }
.btn-quiet { background: transparent; border: 1px solid rgba(255,255,255,.16); color: rgba(255,255,255,.8); }
.btn-quiet:hover { background: rgba(255,255,255,.06); color: #fff; }

.content { min-width: 0; padding: var(--s-6) clamp(16px, 3vw, 48px) var(--s-7); }
.view { max-width: 1320px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s-5); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-4); flex-wrap: wrap; }
.eyebrow { margin: 0 0 6px; font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: .1em; color: var(--orange-ink); }
.page-head p.lead { margin: 6px 0 0; color: var(--text-2); max-width: 640px; }
.context { display: flex; gap: var(--s-3); flex-wrap: wrap; }

/* ---------------------------------------------------------------- controls */
button, .btn { font: 600 14px/1 var(--font-body); border-radius: var(--r-sm); padding: 10px 16px; border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center; gap: var(--s-2); white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn-primary { background: var(--primary-bg); color: var(--primary-fg); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { background: linear-gradient(135deg, var(--orange), var(--orange-2)); color: var(--ink); }
.btn-accent:hover { filter: brightness(1.04); }
.btn-secondary { background: var(--surface); color: var(--heading); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--ink-3); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: #f0c7c2; }
.btn-danger:hover { background: var(--bad-tint); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
button:disabled { opacity: .5; cursor: default; }
button svg { width: 16px; height: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.field small { color: var(--text-3); font-weight: 400; }
select, input { font: 15px/1.2 var(--font-body); color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 9px 12px; min-height: 40px; }
select { padding-inline-end: 32px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: 12px 50%, 17px 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select:hover, input:hover { border-color: var(--text-3); }
select:focus, input:focus { outline: none; border-color: var(--orange); box-shadow: var(--focus); }
.context select { min-width: 220px; }
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.segmented button { background: transparent; color: var(--text-2); padding: 7px 12px; font-weight: 500; border-radius: 6px; }
.segmented button:hover { color: var(--heading); background: var(--surface-2); }
.segmented button[aria-pressed="true"] { background: var(--primary-bg); color: var(--primary-fg); }
.toolbar { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.custom-range { display: inline-flex; gap: var(--s-2); align-items: center; }
.custom-range input { min-height: 36px; padding: 6px 10px; }
.meta { color: var(--text-3); font-size: 13px; }

/* ---------------------------------------------------------------- surfaces */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line); }
.panel-head p { margin: 2px 0 0; color: var(--text-3); font-size: 13px; }
.panel-body { padding: var(--s-5); }
.grid-2 { display: grid; grid-template-columns: 3fr 2fr; gap: var(--s-5); }
.notice { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); border: 1px solid; font-size: 14px; }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.notice.test { background: var(--yellow-tint); border-color: var(--line-2); color: var(--yellow-ink); }
.notice.live { background: var(--purple-tint); border-color: var(--line-2); color: var(--purple); }
.notice a { color: inherit; font-weight: 600; }

/* ---------------------------------------------------------------- KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s-4); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); box-shadow: var(--shadow-1); position: relative; overflow: hidden; min-height: 124px; }
.kpi::after { content: ""; position: absolute; inset-inline-start: 0; top: 0; height: 3px; width: 100%; background: var(--line); }
.kpi.accent::after { background: linear-gradient(90deg, var(--orange-2), var(--orange)); }
.kpi .label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.kpi .value { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1.15; margin-top: 10px; color: var(--heading); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi .value.text { font-size: 20px; font-weight: 700; margin-top: 14px; }
.kpi .sub { margin-top: 6px; font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- charts */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 34%) 1fr 96px; gap: var(--s-3); align-items: center; font-size: 14px; padding: 2px 0; border-radius: 6px; position: relative; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.bar-row .track { height: 12px; background: var(--neutral-tint); border-radius: 4px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--chart-1); border-radius: 4px; min-width: 2px; transition: width .4s ease; }
.bar-row .val { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-weight: 600; text-align: left; color: var(--heading); }
.bar-row:hover .fill { filter: brightness(.9); }
.bar-row:hover { background: var(--surface-2); }
.tooltip { position: fixed; z-index: 50; pointer-events: none; background: var(--tooltip-bg); color: #fff; padding: 8px 12px; border-radius: var(--r-sm); font-size: 13px; box-shadow: var(--shadow-2); max-width: 280px; }
.tooltip b { display: block; font-family: var(--font-display); margin-bottom: 2px; }
.split { display: flex; height: 14px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--surface); }
.split span { display: block; height: 100%; }
.legend { display: flex; flex-direction: column; gap: 10px; margin-top: var(--s-4); }
.legend div { display: flex; align-items: center; gap: var(--s-2); font-size: 14px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .count { margin-inline-start: auto; font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.c-good { background: var(--good); } .c-warn { background: #d08a1a; } .c-bad { background: var(--bad); } .c-neutral { background: #a9a3b5; }

/* ---------------------------------------------------------------- table */
.table-tools { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.search { position: relative; }
.search input { padding-inline-start: 36px; min-width: 220px; min-height: 36px; }
.search svg { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }
.chips { display: inline-flex; gap: 6px; }
.chip { background: var(--surface); border: 1px solid var(--line-2); color: var(--text-2); padding: 6px 12px; border-radius: var(--r-pill); font-weight: 500; font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--primary-fg); }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: start; font-weight: 600; font-size: 12px; color: var(--text-3); padding: 12px var(--s-5); border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
table.data th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
table.data th button:focus-visible { box-shadow: var(--focus); border-radius: 4px; }
table.data th .arrow { opacity: .35; } table.data th[aria-sort] .arrow { opacity: 1; color: var(--orange-ink); }
table.data td { padding: 14px var(--s-5); border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-2); }
.cell-name { font-weight: 600; color: var(--heading); }
.cell-id { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.cell-num { font-family: var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.share { display: flex; align-items: center; gap: var(--s-2); min-width: 160px; }
.share .mini { flex: 1; height: 6px; background: var(--neutral-tint); border-radius: 3px; overflow: hidden; }
.share .mini span { display: block; height: 100%; background: var(--chart-1); border-radius: 3px; }
.share .pct { width: 40px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { background: var(--good-tint); color: var(--good); }
.pill.warn { background: var(--warn-tint); color: var(--warn); }
.pill.bad { background: var(--bad-tint); color: var(--bad); }
.pill.neutral { background: var(--neutral-tint); color: var(--neutral); }
.pill.info { background: var(--purple-tint); color: var(--purple); }

/* ---------------------------------------------------------------- states */
.skeleton { background: linear-gradient(90deg, var(--neutral-tint) 25%, var(--surface-2) 37%, var(--neutral-tint) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } .bar-row .fill { transition: none; } }
.empty { text-align: center; padding: var(--s-7) var(--s-5); color: var(--text-2); }
.empty svg { width: 40px; height: 40px; color: var(--text-3); margin-bottom: var(--s-3); }
.empty h3 { margin-bottom: 6px; }
.error-box { display: flex; gap: var(--s-3); padding: var(--s-4); background: var(--bad-tint); color: var(--bad); border-radius: var(--r-md); font-size: 14px; }
#toasts { position: fixed; bottom: 24px; inset-inline-end: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--tooltip-bg); color: #fff; padding: 12px 16px; border-radius: var(--r-md); box-shadow: var(--shadow-2); font-size: 14px; max-width: 380px; display: flex; gap: var(--s-2); align-items: center; animation: rise .2s ease; }
.toast.bad { background: var(--bad); }
.toast svg { width: 18px; height: 18px; flex: none; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------------------------------------------------------- connections */
.provider { overflow: hidden; }
.provider-head { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-5); }
.provider-mark { width: 48px; height: 48px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--purple-tint); color: var(--purple); flex: none; }
.provider-mark svg { width: 24px; height: 24px; }
.provider-head .who { flex: 1; min-width: 0; }
.provider-head p { margin: 2px 0 0; color: var(--text-3); font-size: 13px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.step { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-4) var(--s-5); font-size: 14px; color: var(--text-3); }
.step + .step { border-inline-start: 1px solid var(--line); }
.step .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 13px; background: var(--surface); border: 1px solid var(--line-2); flex: none; }
.step.now { color: var(--heading); font-weight: 600; } .step.now .n { border-color: var(--orange); color: var(--orange-ink); box-shadow: 0 0 0 3px rgba(241,90,34,.15); }
.step.done { color: var(--text-2); } .step.done .n { background: var(--good); border-color: var(--good); color: var(--surface); }
.provider-body { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-5); }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); }
.fact .k { font-size: 12px; color: var(--text-3); } .fact .v { font-weight: 600; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.form-grid .wide { grid-column: 1 / -1; }
.copy-line { display: flex; align-items: center; gap: var(--s-2); background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: var(--r-sm); padding: 8px 8px 8px 12px; }
.copy-line code { flex: 1; font-size: 13px; color: var(--heading); overflow: hidden; text-overflow: ellipsis; }
details.more { border-top: 1px solid var(--line); padding: var(--s-4) var(--s-5); }
details.more summary { cursor: pointer; color: var(--purple); font-weight: 600; font-size: 14px; }
details.more[open] summary { margin-bottom: var(--s-4); }
.provider.soon { opacity: .78; }
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s-3); }
.client-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); background: var(--surface-2); }
.client-card b { font-family: var(--font-display); color: var(--heading); }
.client-card span { display: block; color: var(--text-3); font-size: 13px; margin-top: 2px; }
.add-client { display: flex; gap: var(--s-2); margin-top: var(--s-4); }
.add-client input { flex: 1; max-width: 360px; }
.row-blocked td { color: var(--text-3); }

/* ---------------------------------------------------------------- requests (test data only) */
.req { display: grid; grid-template-columns: 1fr auto; gap: var(--s-2) var(--s-4); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line); }
.req:last-child { border-bottom: 0; }
.req .title { font-weight: 600; color: var(--heading); }
.req .meta { grid-column: 1 / -1; }
.req .confirm { grid-column: 1 / -1; display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.req code { background: var(--surface-2); border: 1px solid var(--line); padding: 2px 8px; border-radius: 6px; font-size: 13px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1500px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2 { grid-template-columns: 1fr; } .facts { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar-inner { position: static; height: auto; flex-direction: row; align-items: center; gap: var(--s-4); padding: var(--s-3) var(--s-4); flex-wrap: wrap; }
  .brand { border: 0; padding: 0; flex-direction: row; align-items: center; } .brand img { width: 96px; }
  .nav { flex-direction: row; margin: 0; } .nav a.on::before { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; flex-direction: row; } .env span { display: none; }
  .content { padding: var(--s-5) var(--s-4) var(--s-7); }
  .steps { grid-template-columns: 1fr; } .step + .step { border-inline-start: 0; border-top: 1px solid var(--line); }
  .form-grid { grid-template-columns: 1fr; }
  .context select { min-width: 0; width: 100%; } .context { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr 1fr; gap: var(--s-3); } .kpi { padding: var(--s-3) var(--s-4); min-height: 0; } .kpi .value { font-size: 22px; } .kpi .value.text { font-size: 16px; } .kpi .sub { white-space: normal; } .bar-row { grid-template-columns: 1fr 84px; } .bar-row .track { grid-column: 1 / -1; grid-row: 2; } h1 { font-size: 24px; } }
.stack { display: flex; flex-direction: column; gap: var(--s-5); }
.btn { text-decoration: none; }
.clients > p { grid-column: 1 / -1; margin: 0; }
.help-link { font-size: 14px; font-weight: 600; }

/* ---------------------------------------------------------------- PO96: deltas, trend, theme */
.kpi .value { font-size: 28px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: var(--r-pill); margin-inline-end: 6px; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.delta.up { background: var(--good-tint); color: var(--good); }
.delta.down { background: var(--bad-tint); color: var(--bad); }
.delta.flat { background: var(--neutral-tint); color: var(--neutral); }
.kpi .sub { display: flex; align-items: center; flex-wrap: wrap; row-gap: 4px; }
.trend-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.trend-legend { display: flex; gap: var(--s-4); font-size: 13px; color: var(--text-2); }
.trend-legend span { display: inline-flex; align-items: center; gap: 6px; }
.trend-legend i { width: 18px; height: 0; border-top: 2px solid var(--chart-1); display: inline-block; }
.trend-legend i.prev { border-top: 2px dashed var(--chart-prev); }
.trend { position: relative; width: 100%; height: 280px; direction: ltr; }
.trend svg { width: 100%; height: 100%; display: block; overflow: visible; }
.trend .grid line { stroke: var(--grid); stroke-width: 1; }
.trend .axis text { fill: var(--axis); font: 11px var(--font-body); font-variant-numeric: tabular-nums; }
.trend .area { fill: var(--chart-1); opacity: .10; }
.trend .line { fill: none; stroke: var(--chart-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trend .prev { fill: none; stroke: var(--chart-prev); stroke-width: 2; stroke-dasharray: 5 4; stroke-linejoin: round; }
.trend .cross { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.trend .dot { fill: var(--chart-1); stroke: var(--surface); stroke-width: 2; }
.trend .dot.prev-dot { fill: var(--chart-prev); }
.trend .hit { fill: transparent; cursor: crosshair; }
.tooltip .row { display: flex; justify-content: space-between; gap: 16px; }
.tooltip .muted { color: rgba(255,255,255,.65); }
.theme-toggle { justify-content: space-between; }
.theme-toggle b { font-weight: 600; color: #fff; }
td.cell-num .muted, .cell-sub { font-size: 12px; color: var(--text-3); }
.spend-cell { min-width: 120px; }
.spend-cell .mini { height: 4px; background: var(--neutral-tint); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.spend-cell .mini span { display: block; height: 100%; background: var(--chart-1); border-radius: 2px; }
#campaigns th, #campaigns td { padding-inline: 12px; }
#campaigns th:first-child, #campaigns td:first-child { padding-inline-start: var(--s-5); min-width: 180px; }
#campaigns th:last-child, #campaigns td:last-child { padding-inline-end: var(--s-5); }
/* ---------------------------------------------------------------- PO97: sign-in */
.auth-page { background: radial-gradient(1200px 600px at 85% -10%, rgba(241,90,34,.22), transparent 60%), radial-gradient(900px 500px at 0% 110%, rgba(91,42,134,.35), transparent 60%), var(--sidebar-bg); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-5); padding: var(--s-6) var(--s-4); }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); color: rgba(255,255,255,.7); font-family: var(--font-display); font-weight: 700; letter-spacing: .1em; font-size: 13px; }
.auth-brand img { width: 168px; height: auto; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 20px; padding: var(--s-6); box-shadow: 0 24px 64px rgba(0,0,0,.35); }
.auth-card h1 { font-size: 24px; margin-bottom: 4px; }
.auth-card .stack { gap: var(--s-4); }
.auth-card input { width: 100%; min-height: 46px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; padding: 13px 16px; font-size: 15px; }
.link-button { background: none; border: 0; color: var(--purple); padding: 4px; font-weight: 500; justify-content: center; }
.code-input { text-align: center; letter-spacing: .5em; font-family: var(--font-display); font-size: 24px !important; font-weight: 700; }
.qr { width: 200px; height: 200px; margin: 0 auto; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.qr svg { width: 100%; height: 100%; display: block; }
.manual code { display: block; margin-top: var(--s-2); font-size: 15px; letter-spacing: .08em; word-break: break-all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin: 0; padding: var(--s-3) var(--s-5); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
.meter { height: 4px; background: var(--neutral-tint); border-radius: 2px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--orange), var(--good)); transition: width .2s; }
.auth-foot { color: rgba(255,255,255,.55); font-size: 13px; margin: 0; text-align: center; }
.user-box { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); font-size: 13px; color: rgba(255,255,255,.8); padding: var(--s-2) var(--s-3); }
.user-box b { color: #fff; display: block; font-size: 14px; }
