/* HPH Advantum Feed - shared design system for the console pages (Pipeline + Providers).
   Light and dark are separately chosen token sets (not an automatic invert). Status colors are validated with the
   dataviz palette validator against each mode's surface:
     light #2e7d4f #3d6aa8 #a8820a #b0302a  - all checks pass
     dark  #3d9a66 #5a88cf #a59528 #dc5478  - all checks pass                                                     */

/* HPH brand typefaces, self-hosted (no external font requests) - variable fonts cover every weight used below. */
@font-face { font-family: "Epilogue Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/static/fonts/epilogue-variable-latin.woff2) format("woff2-variations"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122; }
@font-face { font-family: "Epilogue Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/static/fonts/epilogue-variable-latin-ext.woff2) format("woff2-variations"); unicode-range: U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/static/fonts/inter-variable-latin.woff2) format("woff2-variations"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122; }
@font-face { font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/static/fonts/inter-variable-latin-ext.woff2) format("woff2-variations"); unicode-range: U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --font: "Inter Variable", "Segoe UI Variable Text", "Segoe UI Variable", Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Epilogue Variable", "Segoe UI Variable Display", "Segoe UI Variable", Inter, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, monospace;

  /* brand */
  --navy: #001E60; --navy-deep: #131E29; --teal: #387F97; --teal-2: #2D6679; --teal-glow: rgba(56,127,151,.35);
  /* --red/--red-2 are a functional danger/stop-action color, not an HPH identity color - left as-is intentionally */
  --red: #C0392B; --red-2: #a5301f;

  /* surfaces */
  --bg: #f3f5f9; --bg-grad: radial-gradient(1200px 500px at 15% -10%, rgba(56,127,151,.10), transparent 60%),
                             radial-gradient(900px 420px at 95% -5%, rgba(0,30,96,.10), transparent 60%);
  --surface: #ffffff; --surface-2: #f8fafc; --surface-3: #eef2f7; --hover: #f2f6fa; --selected: #e6f4f1;
  --border: rgba(16,30,54,.09); --border-2: rgba(16,30,54,.05); --border-strong: rgba(16,30,54,.16);

  /* ink */
  --ink: #142033; --ink-2: #3b4a5e; --muted: #687587; --faint: #98a3b3; --on-brand: #fff;
  --link: #1f7f73;

  /* semantic */
  --good: #2e7d4f; --good-bg: #e7f4ec; --good-ink: #1d5c38;
  --info: #3d6aa8; --info-bg: #e9effa; --info-ink: #284d80;
  --warn: #a8820a; --warn-bg: #f8f0d9; --warn-ink: #6b5205;
  --bad: #b0302a;  --bad-bg: #fbe8e6;  --bad-ink: #8a2420;
  --neutral: #7b8794; --neutral-bg: #eef1f5; --neutral-ink: #4a5563;
  --accent-bg: #e3f4f1; --accent-ink: #1a6d63;

  /* status (provider dashboard) */
  --s-active: var(--good); --s-process: var(--info); --s-action: var(--warn); --s-inelig: var(--bad); --s-other: var(--neutral);

  /* shape */
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 20px;
  --sh-1: 0 1px 2px rgba(16,30,54,.05), 0 1px 1px rgba(16,30,54,.03);
  --sh-2: 0 1px 2px rgba(16,30,54,.04), 0 8px 24px -6px rgba(16,30,54,.10);
  --sh-3: 0 2px 6px rgba(16,30,54,.06), 0 24px 48px -12px rgba(16,30,54,.22);
  --ring: 0 0 0 3px rgba(56,127,151,.28);

  --header-bg: linear-gradient(120deg, rgba(19,30,41,.94), rgba(0,30,96,.94) 55%, rgba(45,102,121,.94));
  --scrim: rgba(10,18,30,.42);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0c1118; --bg-grad: radial-gradient(1100px 500px at 10% -10%, rgba(56,127,151,.14), transparent 60%),
                            radial-gradient(900px 420px at 100% -10%, rgba(90,136,207,.12), transparent 60%);
  --surface: #141a22; --surface-2: #18202a; --surface-3: #1f2833; --hover: #1b2430; --selected: #16302d;
  --border: rgba(214,226,240,.09); --border-2: rgba(214,226,240,.05); --border-strong: rgba(214,226,240,.18);
  --ink: #e6edf5; --ink-2: #b9c5d3; --muted: #8b98a8; --faint: #5f6b7a; --link: #5cc9ba;
  --good: #3d9a66; --good-bg: rgba(61,154,102,.16); --good-ink: #8fd3ad;
  --info: #5a88cf; --info-bg: rgba(90,136,207,.16); --info-ink: #a9c4ee;
  --warn: #a59528; --warn-bg: rgba(165,149,40,.18); --warn-ink: #e0d07a;
  --bad: #dc5478;  --bad-bg: rgba(220,84,120,.16);  --bad-ink: #f3a3b8;
  --neutral: #7b8794; --neutral-bg: rgba(123,135,148,.16); --neutral-ink: #c0c9d4;
  --accent-bg: rgba(56,127,151,.16); --accent-ink: #7fd8cb;
  --sh-1: 0 1px 2px rgba(0,0,0,.35);
  --sh-2: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -8px rgba(0,0,0,.55);
  --sh-3: 0 4px 10px rgba(0,0,0,.45), 0 28px 60px -12px rgba(0,0,0,.7);
  --header-bg: linear-gradient(120deg, rgba(10,18,30,.9), rgba(20,38,62,.9) 55%, rgba(16,48,60,.9));
  --scrim: rgba(0,0,0,.55);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }  /* clip, not hidden: hidden makes body a scroll container and breaks sticky */
body {
  font-family: var(--font); font-size: 13.5px; line-height: 1.45; color: var(--ink);
  background: var(--bg-grad), var(--bg); background-attachment: fixed;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); font-size: .94em; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sp { flex: 1; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
::selection { background: rgba(56,127,151,.25); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- app header ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30; color: var(--on-brand);
  background: var(--header-bg); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.08); box-shadow: 0 8px 30px -12px rgba(8,16,28,.55);
}
.appbar-in { max-width: 1520px; margin: 0 auto; padding: 10px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none !important; color: inherit; margin-right: 6px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; padding: 5px; box-sizing: border-box;
  background: #F7F2EC; border: 1px solid rgba(0,30,96,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 2px 8px -2px rgba(0,30,96,.3);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-text { line-height: 1.1; }
.brand-text small { display: block; font-size: 9.5px; letter-spacing: 2.2px; text-transform: uppercase; opacity: .62; font-weight: 600; }
.brand-text b { font-family: var(--font-display); font-size: 16.5px; font-weight: 650; letter-spacing: -.2px; white-space: nowrap; }

.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); }
.tabs a { display: inline-flex; align-items: center; gap: 7px; color: rgba(255,255,255,.75); font-weight: 600; font-size: 12.5px;
  padding: 6px 13px; border-radius: 8px; text-decoration: none; transition: background .15s, color .15s; }
.tabs a svg { width: 15px; height: 15px; opacity: .85; }
.tabs a:hover { background: rgba(255,255,255,.09); color: #fff; }
.tabs a.on { background: #fff; color: var(--navy); box-shadow: 0 2px 8px -2px rgba(0,0,0,.35); }
:root[data-theme="dark"] .tabs a.on { background: rgba(255,255,255,.92); }

.hchip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.10); color: rgba(255,255,255,.92); white-space: nowrap; }
.hchip.mock { background: rgba(243,208,138,.18); border-color: rgba(243,208,138,.35); color: #f8dc9f; }
.hchip.live, .hchip.send { background: rgba(246,140,128,.18); border-color: rgba(246,140,128,.4); color: #ffc2ba; }
.hchip.drafts { background: rgba(127,216,203,.15); border-color: rgba(127,216,203,.35); color: #a8ebe1; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa5b1; display: inline-block; flex: none; }
.dot.on { background: #5fe3a1; box-shadow: 0 0 0 0 rgba(95,227,161,.6); animation: pulse 1.6s infinite; }
.dot.stall { background: #f3b54a; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(95,227,161,0); } 100% { box-shadow: 0 0 0 0 rgba(95,227,161,0); } }

.iconbtn { width: 32px; height: 32px; border-radius: 9px; display: inline-grid; place-items: center; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.07); color: #fff; transition: background .15s; }
.iconbtn:hover { background: rgba(255,255,255,.15); }
.iconbtn svg { width: 16px; height: 16px; }

/* ---------- layout ---------- */
.page { max-width: 1520px; margin: 0 auto; padding: 20px 24px 64px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; margin: 4px 0 16px; }
.page-head h1 { margin: 0; font-family: var(--font-display); font-size: 24px; font-weight: 650; letter-spacing: -.4px; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-2); padding: 16px 18px; margin-bottom: 16px; min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-h h2, .card h2 { margin: 0; font-family: var(--font-display); font-size: 15px; font-weight: 650; letter-spacing: -.1px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.card-h .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent-ink); flex: none; }
.card-h .ic svg { width: 15px; height: 15px; }
.card .sub, .sub { color: var(--muted); font-size: 12px; margin: 2px 0 0; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1);
  padding: 14px 16px 13px; min-width: 0; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.kpi::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--kpi-accent, transparent); opacity: .9; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .l { font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.kpi .badge-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--kpi-bg, var(--surface-3)); color: var(--kpi-ink, var(--ink-2)); }
.kpi .badge-ic svg { width: 16px; height: 16px; }
.kpi .v { font-family: var(--font-display); font-size: 28px; font-weight: 650; letter-spacing: -.6px; margin-top: 6px; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 3px; }
.kpi.good { --kpi-accent: var(--good); --kpi-bg: var(--good-bg); --kpi-ink: var(--good-ink); }
.kpi.info { --kpi-accent: var(--info); --kpi-bg: var(--info-bg); --kpi-ink: var(--info-ink); }
.kpi.warn { --kpi-accent: var(--warn); --kpi-bg: var(--warn-bg); --kpi-ink: var(--warn-ink); }
.kpi.bad  { --kpi-accent: var(--bad);  --kpi-bg: var(--bad-bg);  --kpi-ink: var(--bad-ink); }
.kpi.accent { --kpi-accent: var(--teal); --kpi-bg: var(--accent-bg); --kpi-ink: var(--accent-ink); }
.kpi.bad .v { color: var(--bad-ink); } .kpi.warn .v { color: var(--warn-ink); }
:root:not([data-theme="dark"]) .kpi.bad .v { color: var(--bad); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 650; padding: 1px 7px; border-radius: 999px; margin-left: 6px; vertical-align: 4px; }
.delta.up { color: var(--good-ink); background: var(--good-bg); } .delta.down { color: var(--bad-ink); background: var(--bad-bg); } .delta.flat { color: var(--muted); background: var(--surface-3); }
.spark { display: block; width: 100%; height: 30px; margin-top: 8px; }
.spark path.line { fill: none; stroke: var(--kpi-accent, var(--teal)); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark path.area { fill: var(--kpi-accent, var(--teal)); opacity: .1; }
.spark circle { fill: var(--kpi-accent, var(--teal)); stroke: var(--surface); stroke-width: 2; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 15px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 650; font-size: 12.5px; color: #fff; background: linear-gradient(180deg, #31b2a2, var(--teal) 60%, var(--teal-2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 4px 12px -4px var(--teal-glow); transition: filter .15s, transform .05s, box-shadow .15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.btn svg { width: 15px; height: 15px; }
.btn.ghost { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.14); box-shadow: none; }
.btn.ghost:hover { background: rgba(255,255,255,.16); }
.btn.subtle { background: var(--surface-3); color: var(--ink-2); border-color: var(--border); box-shadow: none; }
.btn.subtle:hover { background: var(--hover); filter: none; }
.btn.small { height: 28px; padding: 0 11px; font-size: 11.5px; border-radius: 8px; }
.btn.danger { background: linear-gradient(180deg, #d24a3b, var(--red) 60%, var(--red-2)); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 4px 14px -4px rgba(192,57,43,.6); }

/* ---------- inputs ---------- */
.field label { display: block; font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); font-weight: 650; margin: 0 0 6px; }
.control { position: relative; }
.control input, .control select {
  width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2);
  padding: 0 32px 0 12px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s; appearance: none; -webkit-appearance: none;
}
.control select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23687587' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
.control input::placeholder { color: var(--faint); }
.control input:hover, .control select:hover { border-color: var(--faint); }
.control input:focus, .control select:focus { border-color: var(--teal); box-shadow: var(--ring); background: var(--surface); }
.control.has-icon input { padding-left: 36px; }
.control .lead { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.control .clear { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: var(--surface-3); color: var(--ink-2); font-size: 13px; line-height: 22px; padding: 0; display: none; }
.control .clear.on { display: block; }
.control .clear:hover { background: var(--border-strong); }
kbd { font-family: var(--mono); font-size: 10.5px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; color: var(--muted); background: var(--surface); }

/* Settings area tabs (settings.html / users.html) */
.stabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 18px; }
.stabs a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent;
  color: var(--muted); font-weight: 600; font-size: 13px; text-decoration: none; }
.stabs a svg { width: 15px; height: 15px; }
.stabs a:hover { color: var(--ink); }
.stabs a.on { color: var(--accent-ink); border-bottom-color: var(--teal); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { appearance: none; -webkit-appearance: none; width: 32px; height: 18px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .2s; margin: 0; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch input:checked { background: var(--teal); }
.switch input:checked::after { transform: translateX(14px); }

/* ---------- segmented control ---------- */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--border); }
.seg button { border: 0; background: transparent; padding: 6px 13px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; transition: color .15s, background .15s, box-shadow .15s; }
.seg button svg { width: 14px; height: 14px; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1), 0 0 0 1px var(--border); }

/* ---------- chips / badges / pills ---------- */
.chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink-2); user-select: none; cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--faint); }
.chip .sw { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.chip .n { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip.on .n { color: inherit; opacity: .7; }

.b, .pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; line-height: 18px; }
.pill .sw, .b .sw { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.b.good, .pill.Active { color: var(--good-ink); background: var(--good-bg); }
.b.info, .pill.process { color: var(--info-ink); background: var(--info-bg); }
.b.warn, .pill.action { color: var(--warn-ink); background: var(--warn-bg); }
.b.bad, .pill.inelig { color: var(--bad-ink); background: var(--bad-bg); }
.b.mute, .pill.other { color: var(--neutral-ink); background: var(--neutral-bg); }
.b.teal { color: var(--accent-ink); background: var(--accent-bg); }
.pill.Active .sw { background: var(--s-active); } .pill.process .sw { background: var(--s-process); } .pill.action .sw { background: var(--s-action); }
.pill.inelig .sw { background: var(--s-inelig); } .pill.other .sw { background: var(--s-other); }
.cnt { display: inline-block; min-width: 24px; text-align: center; font-weight: 700; border-radius: 7px; padding: 1px 7px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.cnt.action { background: var(--warn-bg); color: var(--warn-ink); }
.cnt.zero { color: var(--faint); font-weight: 500; }
.chg { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 650; color: var(--accent-ink); background: var(--accent-bg); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.chg::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.8px; }
.t th { position: sticky; top: 0; z-index: 1; text-align: left; white-space: nowrap; padding: 10px 12px; font-size: 11px; font-weight: 650; letter-spacing: .4px;
  text-transform: uppercase; color: var(--muted); background: color-mix(in srgb, var(--surface-2) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--border-2); vertical-align: middle; font-variant-numeric: tabular-nums; }
.t tbody tr:last-child td { border-bottom: 0; }
.t .num { text-align: right; }
.t td.nw { white-space: nowrap; }
.t tr.click { transition: background .12s; }
.t tr.click:hover td { background: var(--hover); cursor: pointer; }
.t tr.sel td { background: var(--selected); }
.t tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--teal); }
.t .pv { font-weight: 650; color: var(--ink); }
.t .npi { color: var(--muted); font-size: 11.5px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; flex: none;
  color: var(--accent-ink); background: var(--accent-bg); letter-spacing: .3px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .nm { min-width: 0; }
.who .nm div:last-child { font-size: 11.5px; color: var(--muted); }
mark { background: rgba(250,204,21,.35); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- stacked bar (status mix) ---------- */
.stack { display: flex; gap: 2px; height: 12px; border-radius: 4px; }
.stack i { display: block; height: 100%; min-width: 3px; transition: flex-grow .5s cubic-bezier(.2,.8,.2,1); }
.stack i:first-child { border-radius: 4px 0 0 4px; } .stack i:last-child { border-radius: 0 4px 4px 0; } .stack i:only-child { border-radius: 4px; }
.stack.lg { height: 18px; } .stack.sm { height: 8px; width: 140px; }
.stack.sm i:first-child { border-radius: 3px 0 0 3px; } .stack.sm i:last-child { border-radius: 0 3px 3px 0; } .stack.sm i:only-child { border-radius: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend .sw { width: 9px; height: 9px; border-radius: 3px; }
.legend b { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 650; }

/* ---------- misc ---------- */
.banner { border-radius: var(--r); padding: 11px 14px; margin: 0 0 14px; font-weight: 600; display: flex; gap: 10px; align-items: flex-start; border: 1px solid; }
.banner svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.banner.held, .banner.stall { background: var(--warn-bg); color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.banner.bad, .banner.stopflag { background: var(--bad-bg); color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.banner ul { margin: 4px 0 0; padding-left: 18px; font-weight: 500; }
.empty { color: var(--muted); text-align: center; padding: 44px 16px; }
.empty .em-ic { width: 46px; height: 46px; border-radius: 14px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.empty .em-ic svg { width: 22px; height: 22px; }
.empty b { color: var(--ink); display: block; font-size: 14px; margin-bottom: 4px; }
.empty code, code.inline { font-family: var(--mono); background: var(--accent-bg); color: var(--accent-ink); padding: 3px 8px; border-radius: 6px; font-size: 12.5px; }

.skel { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 6px; color: transparent !important; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-rows { padding: 8px 12px; } .skel-rows div { height: 14px; margin: 14px 0; }

.tip { position: fixed; z-index: 90; pointer-events: none; background: #0f1722; color: #fff; border-radius: 10px; padding: 8px 11px; font-size: 12px;
  box-shadow: var(--sh-3); display: none; max-width: 300px; border: 1px solid rgba(255,255,255,.08); }
.tip b { font-variant-numeric: tabular-nums; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 95; display: none; max-width: 420px; padding: 11px 16px; border-radius: 12px;
  background: var(--navy); color: #fff; box-shadow: var(--sh-3); font-weight: 600; }
.toast.on { display: block; animation: rise .2s ease-out; } .toast.bad { background: var(--red); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- drawer / modal ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(3px); display: none; z-index: 60; }
.scrim.on { display: block; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(900px, 96vw); z-index: 70; display: flex; flex-direction: column;
  background: var(--bg); border-radius: var(--r-xl) 0 0 var(--r-xl); box-shadow: var(--sh-3); transform: translateX(104%); transition: transform .28s cubic-bezier(.2,.8,.2,1); overflow: hidden; }
.drawer.on { transform: none; }
.drawer .dh { padding: 18px 22px; color: #fff; background: var(--header-bg); display: flex; gap: 14px; align-items: center; }
.drawer .dh .avatar { width: 44px; height: 44px; font-size: 15px; background: rgba(255,255,255,.14); color: #fff; }
.drawer .dh h3 { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 650; letter-spacing: -.3px; }
.drawer .dh .meta { font-size: 12.5px; opacity: .78; margin-top: 2px; }
.drawer .db { overflow: auto; padding: 18px 22px 48px; }
.modal { position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; z-index: 80; padding: 24px; }
.modal.on { display: flex; animation: fade .15s; }
.modal .box { background: var(--surface); border-radius: var(--r-xl); width: min(1000px, 100%); height: min(88vh, 1000px); display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--sh-3); border: 1px solid var(--border); }
.modal .hd { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-start; }
.modal iframe { flex: 1; border: 0; width: 100%; background: #fff; }

.reveal { animation: rise .35s cubic-bezier(.2,.8,.2,1) both; }

/* icon sizing inside hydrated containers */
.control .lead { display: inline-grid; place-items: center; }
.control .lead svg { width: 16px; height: 16px; }
.hchip svg { width: 13px; height: 13px; opacity: .85; }
.rvp svg, .b svg { width: 13px; height: 13px; }
.chip svg { width: 14px; height: 14px; }

/* =====================================================================================================
   App shell v2: left sidebar + translucent top bar + command palette. Pages opt in with <body class="app">.
   ===================================================================================================== */
:root { --side-w: 248px; --side-w-min: 72px; --top-h: 60px; --bg-flat: #f5f6f8; --side-bg: #ffffff; --side-ink: var(--ink-2);
  --side-active: #eef6f4; --side-active-ink: #145c53; --topbar-bg: rgba(245,246,248,.78); }
:root[data-theme="dark"] { --bg-flat: #0b0f14; --side-bg: #0f141b; --side-active: rgba(56,127,151,.16); --side-active-ink: #8fe3d6;
  --topbar-bg: rgba(11,15,20,.72); }
body.app { background: var(--bg-flat); display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
body.app.collapsed { grid-template-columns: var(--side-w-min) minmax(0, 1fr); }
body.app .card { border-radius: 14px; box-shadow: 0 1px 2px rgba(16,30,54,.04); }
body.app .card:hover { box-shadow: 0 1px 2px rgba(16,30,54,.04), 0 6px 20px -10px rgba(16,30,54,.18); }
:root[data-theme="dark"] body.app .card { box-shadow: none; }
body.app .kpi { border-radius: 14px; box-shadow: none; }
body.app .kpi::after { display: none; }
body.app .kpi .v { font-size: 30px; letter-spacing: -.8px; }

/* sidebar */
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--side-bg); border-right: 1px solid var(--border);
  padding: 14px 12px; gap: 6px; overflow: hidden auto; z-index: 40; }
.side .sb-brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 14px; text-decoration: none !important; color: var(--ink); }
.side .sb-brand .brand-mark { width: 36px; height: 36px; }
.side .sb-brand b { display: block; font-family: var(--font-display); font-size: 15.5px; font-weight: 650; letter-spacing: -.2px; white-space: nowrap; }
.side .sb-brand small { display: block; font-size: 10px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--muted); font-weight: 600; white-space: nowrap; }
.side .sb-sec { font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 12px 10px 4px; white-space: nowrap; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: 10px; color: var(--side-ink); font-weight: 600;
  font-size: 13.2px; text-decoration: none; position: relative; white-space: nowrap; transition: background .12s, color .12s; }
.side nav a svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.side nav a:hover { background: var(--hover); color: var(--ink); }
.side nav a.on { background: var(--side-active); color: var(--side-active-ink); }
.side nav a.on::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--teal); }
.side nav a.on svg { opacity: 1; }
.side nav a .count { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface-3); border-radius: 999px; padding: 1px 8px; }
.side .sb-status { margin-top: auto; display: grid; gap: 8px; }
.side .env { border: 1px solid var(--border); border-radius: 12px; padding: 10px 11px; background: var(--surface-2); display: grid; gap: 7px; font-size: 12px; }
.side .env .row { display: flex; align-items: center; gap: 8px; justify-content: space-between; color: var(--muted); white-space: nowrap; }
.side .env .row b { color: var(--ink); font-weight: 650; }
.side .tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px; font-size: 10.5px; font-weight: 750; letter-spacing: .5px; }
.side .tag.mock { background: var(--warn-bg); color: var(--warn-ink); } .side .tag.live { background: var(--bad-bg); color: var(--bad-ink); }
.side .tag.drafts { background: var(--accent-bg); color: var(--accent-ink); } .side .tag.send { background: var(--bad-bg); color: var(--bad-ink); }
.side .runbox { border-radius: 12px; padding: 11px; display: grid; gap: 8px; font-size: 12px; background: var(--accent-bg); color: var(--accent-ink); }
.side .runbox.idle { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.side .runbox.stopflag { background: var(--bad-bg); color: var(--bad-ink); }
.side .runbox .rt { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.side .runbox .rd { font-size: 11.5px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .runbox .btn { height: 30px; width: 100%; }
.side .sb-foot { display: flex; gap: 6px; padding-top: 8px; border-top: 1px solid var(--border-2); }
.side .sb-foot button { flex: 1; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); display: inline-flex;
  align-items: center; justify-content: center; gap: 7px; font-size: 12px; font-weight: 600; }
.side .sb-foot button:hover { background: var(--hover); }
.side .sb-foot svg { width: 15px; height: 15px; }
body.app.collapsed .side .lbl, body.app.collapsed .side .sb-sec, body.app.collapsed .side .env, body.app.collapsed .side .sb-brand span:last-child,
body.app.collapsed .side nav a .count, body.app.collapsed .side .runbox .rd, body.app.collapsed .side .runbox .rlbl { display: none; }
body.app.collapsed .side nav a { justify-content: center; padding: 0; }
body.app.collapsed .side .sb-brand { justify-content: center; padding-left: 0; padding-right: 0; }
body.app.collapsed .side .sb-foot { flex-direction: column; }
body.app.collapsed .side .runbox { padding: 9px 6px; justify-items: center; }
@media (max-width: 900px) { body.app { grid-template-columns: var(--side-w-min) minmax(0, 1fr); }
  body.app .side .lbl, body.app .side .sb-sec, body.app .side .env, body.app .side .sb-brand span:last-child, body.app .side nav a .count, body.app .side .runbox .rd { display: none; }
  body.app .side nav a { justify-content: center; padding: 0; } }

/* top bar */
.shell-main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: var(--topbar-bg); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-bottom: 1px solid var(--border); }
.topbar .crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; min-width: 0; }
.topbar .crumbs b { color: var(--ink); font-weight: 650; font-size: 14px; }
.topbar .crumbs .sep { color: var(--faint); }
.cmdk-trigger { display: inline-flex; align-items: center; gap: 9px; height: 36px; width: min(420px, 34vw); padding: 0 8px 0 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--faint); font-size: 13px; cursor: pointer; margin-left: 12px; transition: border-color .15s, box-shadow .15s; }
.cmdk-trigger:hover { border-color: var(--faint); box-shadow: var(--sh-1); }
.cmdk-trigger svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.cmdk-trigger span { flex: 1; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.topbar .actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar .btn.ghost { background: var(--surface); color: var(--ink-2); border-color: var(--border-strong); box-shadow: none; }
.topbar .btn.ghost:hover { background: var(--hover); filter: none; }
body.app .page { max-width: 1480px; width: 100%; padding: 24px 28px 64px; }
body.app .page-head h1 { font-size: 27px; letter-spacing: -.6px; }

/* dropdown menu (export menus) */
.menu { position: fixed; z-index: 95; min-width: 260px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--sh-3);
  padding: 6px; display: none; animation: pop .14s ease-out; }
.menu.on { display: block; }
@keyframes pop { from { transform: translateY(-4px) scale(.98); opacity: 0; } }
.menu .mh { font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 8px 10px 4px; }
.menu a, .menu button.mi { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; border: 0; background: none;
  color: var(--ink); font-size: 13px; text-align: left; text-decoration: none !important; }
.menu a:hover, .menu button.mi:hover, .menu .sel { background: var(--hover); }
.menu a svg, .menu button.mi svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.menu .mt { flex: 1; min-width: 0; } .menu .mt small { display: block; color: var(--muted); font-size: 11.5px; }
.menu .fmt { font-size: 10.5px; font-weight: 750; letter-spacing: .4px; border-radius: 6px; padding: 2px 6px; background: var(--surface-3); color: var(--ink-2); }
.menu .fmt.xlsx { background: var(--good-bg); color: var(--good-ink); }
.menu hr { border: 0; border-top: 1px solid var(--border-2); margin: 5px 4px; }

/* command palette */
.cmdk { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; background: var(--scrim); backdrop-filter: blur(4px); }
.cmdk.on { display: flex; animation: fade .12s; }
.cmdk .panel { width: min(640px, 92vw); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--sh-3); overflow: hidden; animation: pop .16s ease-out; }
.cmdk .in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.cmdk .in svg { width: 18px; height: 18px; color: var(--muted); }
.cmdk input { flex: 1; height: 54px; border: 0; outline: none; background: transparent; font-size: 15.5px; color: var(--ink); }
.cmdk .list { max-height: 52vh; overflow: auto; padding: 6px; }
.cmdk .grp { font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 10px 12px 4px; }
.cmdk .it { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; cursor: pointer; color: var(--ink); font-size: 13.5px; }
.cmdk .it .ii { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); flex: none; }
.cmdk .it .ii svg { width: 16px; height: 16px; }
.cmdk .it .tx { flex: 1; min-width: 0; } .cmdk .it .tx small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cmdk .it.sel { background: var(--side-active); }
.cmdk .it.sel .ii { background: var(--teal); color: #fff; }
.cmdk .foot { display: flex; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); background: var(--surface-2); }
.cmdk .none { padding: 26px; text-align: center; color: var(--muted); }

/* density */
body.dense .t td { padding-top: 6px; padding-bottom: 6px; }
body.dense .t .avatar { width: 24px; height: 24px; font-size: 10px; }
body.dense .who .nm div:last-child { display: none; }
.side .runbox svg { width: 16px; height: 16px; flex: none; }
.side .runbox .btn svg { width: 14px; height: 14px; }
.topbar .b svg { width: 13px; height: 13px; }
.side nav a .count:empty { display: none; }

/* =====================================================================================================
   Web app: signed-in user block, dialogs, form helpers, auth pages (login / setup)
   ===================================================================================================== */
[hidden] { display: none !important; }
.side .sb-status { grid-template-columns: minmax(0, 1fr); }
.side .env .row b { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.side .sb-user { border-top: 1px solid var(--border-2); padding-top: 8px; }
.side .sb-me { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border-radius: 11px; border: 1px solid transparent;
  background: transparent; text-align: left; color: var(--ink); transition: background .12s, border-color .12s; }
.side .sb-me:hover { background: var(--hover); border-color: var(--border); }
.side .sb-me .avatar { width: 32px; height: 32px; font-size: 11.5px; background: linear-gradient(140deg, #3fc1b0, var(--teal) 45%, #1d6f84); color: #fff; }
.side .sb-me .me-tx { flex: 1; min-width: 0; line-height: 1.2; }
.side .sb-me .me-tx b { display: block; font-size: 12.8px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .sb-me .me-tx small { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: var(--muted); font-size: 11px; min-width: 0; }
.side .sb-me .me-tx .un { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .sb-me .b.role { padding: 0 7px; font-size: 10px; line-height: 16px; text-transform: uppercase; letter-spacing: .4px; }
.side .sb-me .me-chev svg { width: 14px; height: 14px; color: var(--faint); }
body.app.collapsed .side .sb-me { justify-content: center; padding: 6px 0; }
@media (max-width: 900px) { body.app .side .sb-me { justify-content: center; padding: 6px 0; } }
.b.role { text-transform: capitalize; }

/* small dialog (confirm, change password) */
.dlg { position: fixed; inset: 0; z-index: 110; display: none; align-items: center; justify-content: center; padding: 24px; background: var(--scrim); backdrop-filter: blur(4px); }
.dlg.on { display: flex; animation: fade .14s; }
.dlg-box { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--sh-3); overflow: hidden; animation: pop .16s ease-out; }
.dlg-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px 4px; }
.dlg-h h3 { margin: 0; font-family: var(--font-display); font-size: 16.5px; font-weight: 650; letter-spacing: -.2px; }
.dlg-h .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent-ink); flex: none; }
.dlg-h .ic svg { width: 16px; height: 16px; }
.dlg-b { padding: 10px 20px 4px; display: grid; gap: 12px; }
.dlg-p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.dlg-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; }
.dlg .control input { padding-right: 12px; }

/* form helpers */
.help { color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.4; }
.ferr { color: var(--bad-ink); font-size: 12px; font-weight: 600; margin-top: 5px; }
:root:not([data-theme="dark"]) .ferr { color: var(--bad); }
.ferr:empty { display: none; }
.field.bad .control input, .field.bad .control select, .field.bad .elist { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }
.ovr { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--warn-ink); margin-top: 6px; }
.ovr::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.ovr a { font-weight: 650; cursor: pointer; }
.control input:disabled, .control select:disabled { opacity: .7; cursor: not-allowed; }

/* email chip list */
.elist { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 38px; padding: 5px 8px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface-2); transition: border-color .15s, box-shadow .15s; }
.elist:focus-within { border-color: var(--teal); box-shadow: var(--ring); background: var(--surface); }
.elist .em { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 4px 0 10px; border-radius: 999px; background: var(--surface-3);
  border: 1px solid var(--border); font-size: 12.3px; font-weight: 600; color: var(--ink-2); max-width: 100%; }
.elist .em span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.elist .em button { width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); padding: 0; display: grid; place-items: center; }
.elist .em button:hover { background: var(--bad-bg); color: var(--bad-ink); }
.elist .em button svg { width: 12px; height: 12px; }
.elist input { flex: 1; min-width: 180px; height: 26px; border: 0; outline: none; background: transparent; }
.elist.ro { background: var(--surface-2); } .elist.ro .em { padding-right: 10px; }

/* auth pages: login + first-run setup */
body.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px 24px;
  background: radial-gradient(900px 520px at 12% 0%, rgba(56,127,151,.20), transparent 60%), radial-gradient(800px 520px at 100% 100%, rgba(0,30,96,.22), transparent 60%), var(--bg); }
:root[data-theme="dark"] body.auth { background: radial-gradient(900px 520px at 12% 0%, rgba(56,127,151,.18), transparent 60%), radial-gradient(800px 520px at 100% 100%, rgba(90,136,207,.14), transparent 60%), var(--bg-flat); }
.auth-card { width: min(410px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--sh-3); overflow: hidden; }
.auth-card.wide { width: min(480px, 100%); }
.auth-hd { padding: 26px 28px 22px; color: #fff; background: var(--header-bg); position: relative; overflow: hidden; }
.auth-hd::after { content: ""; position: absolute; right: -60px; top: -70px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(63,193,176,.45), transparent 65%); }
.auth-hd .brand { margin: 0; }
.auth-hd h1 { margin: 18px 0 2px; font-family: var(--font-display); font-size: 21px; font-weight: 650; letter-spacing: -.3px; position: relative; z-index: 1; }
.auth-hd p { margin: 0; font-size: 12.8px; opacity: .78; position: relative; z-index: 1; }
.auth-bd { padding: 22px 28px 26px; display: grid; gap: 14px; }
.auth-bd .control input { padding-right: 12px; }
.auth-bd .btn { height: 40px; width: 100%; font-size: 13.5px; margin-top: 4px; }
.auth-msg { border-radius: 10px; padding: 10px 12px; font-size: 12.8px; font-weight: 600; display: flex; gap: 8px; align-items: flex-start; }
.auth-msg svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.auth-msg.bad { background: var(--bad-bg); color: var(--bad-ink); } .auth-msg.good { background: var(--good-bg); color: var(--good-ink); }
.auth-msg.info { background: var(--info-bg); color: var(--info-ink); }
.auth-msg:empty { display: none; }
.auth-foot { margin-top: 18px; font-size: 11.5px; color: var(--muted); text-align: center; letter-spacing: .2px; }
.auth-foot button { border: 0; background: none; color: var(--muted); padding: 2px 6px; border-radius: 6px; display: inline-flex; vertical-align: middle; }
.auth-foot button svg { width: 14px; height: 14px; }
.pw-wrap { position: relative; }
.pw-wrap .reveal-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.pw-wrap .reveal-btn:hover { background: var(--surface-3); }
.pw-wrap .reveal-btn svg { width: 15px; height: 15px; }
.pw-wrap input { padding-right: 40px !important; }
