/*
  Revenge Bot panel, v3 design. Started from design/v3/mockup.html: keep
  the two in step when changing the look.

  Three styles (data-style on <html>: meridian2, the default; bulwark;
  original, the base tokens) and four colour themes (data-theme light or
  dark, plus data-palette aero or crimson on top of one of them; no
  data-theme follows the system). data-density="compact" tightens rows.

  Fonts are self-hosted (latin only, SIL Open Font License, see
  fonts/LICENSE.txt). A browser only downloads a font a page actually
  uses, so each style loads just its own.
*/
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-display: optional; font-weight: 200 800; src: url(fonts/atkinson-next.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: "Atkinson Hyperlegible Mono"; font-style: normal; font-display: optional; font-weight: 200 800; src: url(fonts/atkinson-mono.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: "Instrument Sans"; font-style: normal; font-display: optional; font-weight: 400 700; src: url(fonts/instrument-sans.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: "Sora"; font-style: normal; font-display: optional; font-weight: 100 800; src: url(fonts/sora.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: "JetBrains Mono"; font-style: normal; font-display: optional; font-weight: 100 800; src: url(fonts/jetbrains-mono.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: "IBM Plex Sans"; font-style: normal; font-display: optional; font-weight: 300; src: url(fonts/plex-sans-300.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: "IBM Plex Sans"; font-style: normal; font-display: optional; font-weight: 400; src: url(fonts/plex-sans-400.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: "IBM Plex Sans"; font-style: normal; font-display: optional; font-weight: 500; src: url(fonts/plex-sans-500.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: "IBM Plex Sans"; font-style: normal; font-display: optional; font-weight: 600; src: url(fonts/plex-sans-600.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: "IBM Plex Mono"; font-style: normal; font-display: optional; font-weight: 400; src: url(fonts/plex-mono-400.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: "IBM Plex Mono"; font-style: normal; font-display: optional; font-weight: 500; src: url(fonts/plex-mono-500.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; }
:root {
  color-scheme: light;
  /* Warm day */
  --bg: #fffdf7;
  --bg-grad: radial-gradient(900px 420px at 88% -120px, rgba(255, 200, 60, .30), transparent 70%),
             linear-gradient(180deg, #e7f2fb 0, #f6f9f8 300px, #fffdf7 640px);
  --surface: #ffffff;
  --surface-2: #fdf7e6;
  --surface-3: #f4efe2;
  --glass: rgba(255, 255, 255, .72);
  --line: rgba(110, 85, 20, .13);
  --line-strong: rgba(110, 85, 20, .24);
  --text: #1b2330;
  --muted: #5d6877;
  --faint: #79838f;
  --accent: #f5c33b;          /* fills: buttons, selection, active nav */
  --on-accent: #2a1f00;
  --accent-ink: #1f6aa8;      /* links and interactive text: the sky */
  --accent-soft: rgba(245, 195, 59, .22);
  --focus: #1f6aa8;
  --bad: #c42f3c;
  --warn: #9a5d00;
  --ok: #1c7f55;
  --info: #2b6fc2;
  --violet: #7044c4;
  --shadow: 0 1px 2px rgba(70, 50, 0, .05), 0 14px 34px -18px rgba(90, 65, 0, .22);
  --shadow-pop: 0 2px 6px rgba(70, 50, 0, .08), 0 24px 60px -20px rgba(90, 65, 0, .35);

  --font-ui: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Sora", "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-xl: 22px; --r-lg: 16px; --r-md: 11px; --r-sm: 7px;
  --gap: 20px; --pad: 22px; --row: 40px; --fs: 14px;
  --side: 248px;
  --accent-fill: var(--accent);
  --r-pill: 99px; --r-avatar: 50%; --r-avatar-lg: 24px;
  --w-h1: 650; --w-head: 600; --w-semi: 600; --w-bold: 700; --w-med: 500; --w-num: 600;
  --h1-size: 1.85rem; --h2-size: 1.02rem; --h1-track: -.015em; --h2-track: -.015em; --head-case: none; --h1-case: none;
  --btn-case: none; --btn-track: 0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #050c17;
    --bg-grad: radial-gradient(1100px 520px at 10% -160px, rgba(38, 140, 190, .28), transparent 70%),
               radial-gradient(800px 500px at 100% 100%, rgba(20, 70, 140, .22), transparent 70%),
               linear-gradient(180deg, #08162a 0, #050c17 700px);
    --surface: #0c1a2c;
    --surface-2: #10233a;
    --surface-3: #152c47;
    --glass: rgba(9, 22, 39, .72);
    --line: rgba(130, 185, 255, .10);
    --line-strong: rgba(130, 185, 255, .20);
    --text: #e4eef9;
    --muted: #8ea4bc;
    --faint: #607891;
    --accent: #4fd3ec;
    --on-accent: #022230;
    --accent-ink: #72dcf2;
    --accent-soft: rgba(79, 211, 236, .14);
    --focus: #72dcf2;
    --bad: #ff6f7d;
    --warn: #f3b74f;
    --ok: #4fd6a2;
    --info: #7ea8ff;
    --violet: #b294ff;
    --shadow: 0 1px 0 rgba(255, 255, 255, .035) inset, 0 18px 40px -22px rgba(0, 0, 0, .75);
    --shadow-pop: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 30px 70px -20px rgba(0, 0, 0, .85);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050c17;
  --bg-grad: radial-gradient(1100px 520px at 10% -160px, rgba(38, 140, 190, .28), transparent 70%),
             radial-gradient(800px 500px at 100% 100%, rgba(20, 70, 140, .22), transparent 70%),
             linear-gradient(180deg, #08162a 0, #050c17 700px);
  --surface: #0c1a2c;
  --surface-2: #10233a;
  --surface-3: #152c47;
  --glass: rgba(9, 22, 39, .72);
  --line: rgba(130, 185, 255, .10);
  --line-strong: rgba(130, 185, 255, .20);
  --text: #e4eef9;
  --muted: #8ea4bc;
  --faint: #607891;
  --accent: #4fd3ec;
  --on-accent: #022230;
  --accent-ink: #72dcf2;
  --accent-soft: rgba(79, 211, 236, .14);
  --focus: #72dcf2;
  --bad: #ff6f7d;
  --warn: #f3b74f;
  --ok: #4fd6a2;
  --info: #7ea8ff;
  --violet: #b294ff;
  --shadow: 0 1px 0 rgba(255, 255, 255, .035) inset, 0 18px 40px -22px rgba(0, 0, 0, .75);
  --shadow-pop: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 30px 70px -20px rgba(0, 0, 0, .85);
}
:root[data-density="compact"] { --gap: 12px; --pad: 16px; --row: 32px; --fs: 13px; }

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--bg); background-image: var(--bg-grad); background-attachment: fixed;
  color: var(--text); font: var(--fs)/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased; font-feature-settings: "ss01", "cv11";
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
b, strong { font-weight: var(--w-semi); }
code, .mono { font-family: var(--font-mono); font-size: .86em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .88em; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.015em; text-wrap: balance; margin: 0; }
h1 { font-size: var(--h1-size); font-weight: var(--w-h1); text-transform: var(--h1-case); letter-spacing: var(--h1-track); }
h2 { font-size: var(--h2-size); font-weight: var(--w-head); text-transform: var(--head-case); letter-spacing: var(--h2-track); }
h3 { font-size: .9rem; font-weight: var(--w-semi); }
.eyebrow { font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: var(--w-semi); }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.app.rail { --side: 76px; }
.sidebar {
  position: sticky; top: 0; height: 100vh; align-self: start;
  display: flex; flex-direction: column; gap: 6px;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 14px 16px max(14px, env(safe-area-inset-left, 0px));
  /* Glass without the blur: nothing scrolls under the sidebar (it sits beside
     the content, over the fixed page background), so a blur would cost paint
     time on every frame and show nothing. */
  background: var(--glass);
  border-right: 1px solid var(--line); z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: var(--r-md); flex: none; display: grid; place-items: center;
  background: var(--brand-fill, linear-gradient(150deg, var(--accent), color-mix(in srgb, var(--accent) 45%, var(--info)))); color: var(--on-accent); box-shadow: var(--shadow); }
.brand-mark svg { width: 20px; height: 20px; }
.brand b { font-family: var(--font-display); font-weight: var(--w-semi); font-size: 1.02rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; gap: 2px; }
.brand-txt .by { display: flex; align-items: center; gap: 6px; font-size: .7rem; color: var(--muted); white-space: nowrap; }
.brand-txt .by[hidden] { display: none; }
.brand-mark.has-img { background: none; box-shadow: none; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-mark .mono { font-family: var(--font-display); font-weight: var(--w-semi); font-size: .86rem; letter-spacing: .02em; }
.top-brand { display: none; }
.top-brand .brand-mark { width: 30px; height: 30px; }
.brand .ver { font-size: .66rem; padding: 1px 6px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); color: var(--muted); font-weight: var(--w-semi); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .sep { height: 1px; background: var(--line); margin: 10px 8px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r-md);
  color: var(--muted); font-weight: var(--w-med); white-space: nowrap; position: relative;
}
.nav a:hover { background: var(--accent-soft); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.nav a[aria-current="page"] svg { color: var(--accent-ink); }
.nav .count { margin-left: auto; font-size: .72rem; font-weight: var(--w-semi); padding: 1px 7px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.me-card .who { min-width: 0; line-height: 1.25; }
.me-card .who small { color: var(--muted); }
.app.rail .brand-txt, .app.rail .nav span, .app.rail .nav .count, .app.rail .me-card .who { display: none; }
.app.rail .nav a { justify-content: center; }
.app.rail .me-card { justify-content: center; padding: 8px; }

.avatar { width: 32px; height: 32px; border-radius: var(--r-avatar); flex: none; display: grid; place-items: center; font-weight: var(--w-semi); font-size: .8rem;
  color: #fff; background: var(--av, #4a6b8a); }
.avatar.lg { width: 76px; height: 76px; font-size: 1.6rem; border-radius: var(--r-avatar-lg); box-shadow: var(--shadow-pop); }
.avatar.sm { width: 24px; height: 24px; font-size: .62rem; }

.main { min-width: 0; overflow-x: clip; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 96px max(16px, env(safe-area-inset-left, 0px)); }
.main-inner { max-width: 1380px; margin: 0 auto; padding-inline: clamp(0px, 2vw, 24px); }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 12px; padding: 14px 0; margin-bottom: 8px;
}
/* The bar's backdrop paints the page's own background (same colour, same fixed gradient) across the whole
   main column, so content scrolls cleanly under it instead of showing through; a hairline appears once scrolled. */
.topbar::before { content: ""; position: absolute; inset: 0 -100vw; background: var(--bg); background-image: var(--bg-grad); background-attachment: fixed; z-index: -1; pointer-events: none; transition: box-shadow .15s; }
.scrolled .topbar::before { box-shadow: 0 1px 0 var(--line); }
.crumbs { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .9em; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs b { color: var(--text); font-weight: var(--w-semi); }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 10px; width: min(380px, 40vw); padding: 8px 12px;
  border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); color: var(--muted); box-shadow: var(--shadow); cursor: text;
}
.search span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd { font-family: var(--font-mono); font-size: .72rem; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-strong); color: var(--muted); background: var(--surface-2); }
.iconbtn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; box-shadow: var(--shadow); flex: none; }
.iconbtn:hover { color: var(--text); border-color: var(--line-strong); }
.menu-btn { display: none; }

.seg { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); gap: 2px; }
.seg button { border: 0; background: none; padding: 4px 10px; border-radius: var(--r-pill); color: var(--muted); cursor: pointer; font-size: .8rem; font-weight: var(--w-semi); display: inline-flex; align-items: center; gap: 6px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg svg.i { width: 15px; height: 15px; }

/* ---------- Primitives ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow); padding: var(--pad); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head .sub { color: var(--muted); font-size: .86em; }
.card-head .end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.btn { text-transform: var(--btn-case); letter-spacing: var(--btn-track); display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-weight: var(--w-semi); font-size: .9em; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent-ink); text-decoration: none; }
.btn.primary { background: var(--accent-fill); color: var(--on-accent); border-color: transparent; box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.sm { height: 30px; padding: 0 11px; font-size: .82em; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn svg.i { width: 16px; height: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: var(--r-pill); font-size: .76rem; font-weight: var(--w-semi); white-space: nowrap;
  color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c, var(--muted)) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c, var(--muted)) 26%, transparent); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.c-bad { --c: var(--bad); } .c-warn { --c: var(--warn); } .c-ok { --c: var(--ok); } .c-info { --c: var(--info); } .c-violet { --c: var(--violet); } .c-mute { --c: var(--muted); } .c-accent { --c: var(--accent-ink); }
.id { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.list { list-style: none; margin: 0; padding: 0; }
.dotx { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--muted)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.dotx.ok { --c: var(--ok); } .dotx.muted { --c: var(--faint); }
.row-line { border-top: 1px solid var(--line); }

/* ---------- Sanctions table ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: var(--gap); }
.field { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line-strong); color: var(--muted); min-width: 0; }
.field input, .field select { border: 0; background: none; color: var(--text); font: inherit; outline: none; min-width: 0; }
.field input { width: 220px; max-width: 100%; }
.field:focus-within { border-color: var(--focus); }
.dtable { width: 100%; border-collapse: collapse; }
.dtable th { text-align: left; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: var(--w-bold); padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.dtable th.r, .dtable td.r { text-align: right; }
.dtable td { padding: 0 12px; height: var(--row); border-bottom: 1px solid var(--line); white-space: nowrap; }
.dtable tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.dtable td.reason { white-space: normal; min-width: 240px; max-width: 360px; color: var(--muted); }
.who { display: flex; align-items: center; gap: 10px; }
.bar-left { height: 4px; width: 80px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 8px; }
.bar-left i { display: block; height: 100%; background: var(--c, var(--warn)); }
.table-foot { display: flex; justify-content: space-between; align-items: center; padding: 14px var(--pad) 2px; color: var(--muted); font-size: .86em; flex-wrap: wrap; gap: 8px; }

.placeholder { display: grid; place-items: center; text-align: center; padding: 80px 20px; gap: 10px; }
.placeholder p { max-width: 46ch; color: var(--muted); margin: 0; }

.view[hidden] { display: none !important; }
.scrim { display: none; }




/* Theme swatches in the sidebar */
.themes { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.themes .tlabel { font-size: .74rem; color: var(--muted); display: flex; justify-content: space-between; }
.themes .tlabel b { color: var(--text); font-weight: var(--w-semi); }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.swatches button { aspect-ratio: 1; max-width: 100%; border-radius: var(--r-sm); border: 1px solid var(--line-strong); cursor: pointer; padding: 0; background: var(--sw); }
.swatches button[aria-pressed="true"] { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.swatches button { position: relative; }
.swatches button.locked { opacity: .55; }
.swatches button.locked::after { content: ""; position: absolute; inset: 0; margin: auto; width: 15px; height: 15px; border-radius: 50%;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23778' stroke-width='2.6' stroke-linecap='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 018 0v3'/%3E%3C/svg%3E") center / 10px no-repeat;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.tnote { margin: 0; font-size: .74rem; color: var(--muted); line-height: 1.4; }
.tnote[hidden] { display: none; }
.prem-tag { display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 7px; border-radius: var(--r-pill); font-size: .66rem; font-weight: var(--w-semi); letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent-ink) 40%, transparent); background: var(--accent-soft); white-space: nowrap; }
.prem-tag svg.i { width: 11px; height: 11px; }
.prem-card { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid color-mix(in srgb, var(--accent-ink) 35%, transparent); background: var(--accent-soft); }
.prem-card[hidden] { display: none; }
.prem-card .ic { width: 36px; height: 36px; flex: none; border-radius: var(--r-md); display: grid; place-items: center; background: var(--surface); color: var(--accent-ink); border: 1px solid var(--line); }
.prem-card p { margin: 2px 0 0; color: var(--muted); font-size: .9em; }
.prem-card .btn { margin-top: 10px; }
.switch:disabled { cursor: not-allowed; opacity: .6; }
.plan-page { max-width: 760px; }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.plan-col h2 { display: flex; align-items: center; gap: 8px; }
.plan-col ul { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.plan-col li { display: flex; gap: 10px; align-items: flex-start; }
.plan-col li svg.i { color: var(--ok); margin-top: 2px; }
.plan-col.current { outline: 2px solid var(--accent-ink); outline-offset: -1px; }
.style-pick .grp { display: flex; align-items: center; gap: 8px; }
.style-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.style-opt { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; text-align: left; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer; min-width: 0; font: inherit; }
.style-opt[aria-pressed="true"] { outline: 2px solid var(--accent-ink); outline-offset: 1px; border-color: transparent; }
.style-opt:disabled { cursor: not-allowed; opacity: .6; }
.style-opt .so-top { display: flex; width: 100%; justify-content: space-between; align-items: flex-start; gap: 8px; }
.style-opt .so-sample { width: 64px; height: 44px; border: 1px solid var(--line-strong); background: var(--surface-2); display: grid; place-items: center; font-size: 1.15rem; color: var(--text); overflow: hidden; position: relative; }
.style-opt .so-sample.band::before { content: ""; position: absolute; inset: 0 0 auto; height: 11px; background: var(--surface-3); border-bottom: 1px solid var(--line-strong); }
.style-opt .so-sample.rule::before { content: ""; position: absolute; left: 6px; right: 6px; top: 10px; height: 1px; background: var(--line-strong); }
.style-opt b { font-weight: var(--w-semi); }
.style-opt small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
@media (max-width: 560px) { .style-opts { grid-template-columns: minmax(0, 1fr); } .style-opt { flex-direction: row; align-items: center; } .style-opt .so-top { width: auto; } }
.style-pick .div { width: 1px; align-self: stretch; background: var(--line); }
.app.rail .themes { display: none; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: var(--gap); overflow-x: auto; scrollbar-width: thin; overscroll-behavior-x: contain; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: var(--w-semi); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--text); border-color: var(--accent); }
.tabs a .n { font-size: .72rem; color: var(--muted); background: var(--surface-2); border-radius: var(--r-pill); padding: 0 7px; border: 1px solid var(--line); }
/* The Customise button sits beside the tab bar (not in it), so it shows in every style. */
.tabs-row { display: flex; align-items: center; gap: 12px; margin-bottom: var(--gap); }
.tabs-row > .tabs { margin-bottom: 0; flex: 1 1 auto; min-width: 0; }
.tabs-row > .end { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.tabs-row > .end:empty { display: none; }

/* =====================================================================
   Style directions. Each one only redefines shape, type and weight
   tokens (plus a few card rules), so both colour themes keep working.
   ===================================================================== */


/* A. Bulwark — institutional. Hairline-ruled panels, 2px corners, no
   shadows, IBM Plex at light weights, small-caps section labels. */
:root[data-style="bulwark"] {
  --font-ui: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-display: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r-xl: 2px; --r-lg: 2px; --r-md: 2px; --r-sm: 1px; --r-pill: 2px; --r-avatar: 2px; --r-avatar-lg: 2px;
  --w-h1: 300; --w-head: 500; --w-semi: 500; --w-bold: 600; --w-med: 400; --w-num: 300;
  --h1-size: 2rem; --h2-size: .72rem; --h1-track: -.01em; --h2-track: .14em; --head-case: uppercase;
  --shadow: none;
}
[data-style="bulwark"] .card { border-color: var(--line-strong); }
[data-style="bulwark"] .card-head { margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) var(--pad); padding: 12px var(--pad); border-bottom: 1px solid var(--line); }
[data-style="bulwark"] .card-head h2 { color: var(--muted); }
[data-style="bulwark"] .tabs a[aria-current="page"] { border-bottom-width: 1px; box-shadow: inset 0 -1px 0 var(--accent); }
[data-style="bulwark"] .nav a[aria-current="page"] { box-shadow: inset 2px 0 0 var(--accent); border: 1px solid var(--line); }
[data-style="bulwark"] .sidebar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); }

/* B. Meridian 2.0 — operations console. 4px corners, panels with a header
   band, boxed tabs. Atkinson Hyperlegible Next / Mono, whose letters are
   drawn to be told apart (p/q, b/d, l/I/1, 0/O), at light display weights. */
:root[data-style="meridian2"] {
  --font-ui: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Atkinson Hyperlegible Mono", ui-monospace, Menlo, Consolas, monospace;
  --r-xl: 5px; --r-lg: 4px; --r-md: 4px; --r-sm: 3px; --r-pill: 4px; --r-avatar: 4px; --r-avatar-lg: 6px;
  --w-h1: 300; --w-head: 500; --w-semi: 600; --w-bold: 600; --w-med: 400; --w-num: 300;
  --h1-size: 2.3rem; --h2-size: .9rem; --h1-track: -.02em; --h2-track: 0; --head-case: none;
}
[data-style="meridian2"] .card-head { margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) var(--pad); padding: 10px var(--pad); background: var(--surface-2); border-bottom: 1px solid var(--line); border-radius: var(--r-xl) var(--r-xl) 0 0; }
[data-style="meridian2"] .stat .v, [data-style="meridian2"] .kpi .v { font-size: 2.5rem; letter-spacing: -.03em; }
[data-style="meridian2"] .tabs { gap: 0; border: 1px solid var(--line); border-radius: var(--r-md); padding: 3px; background: var(--surface-2); width: max-content; max-width: 100%; }
[data-style="meridian2"] .tabs a { border: 0; margin: 0; padding: 7px 14px; border-radius: 3px; font-weight: 500; }
[data-style="meridian2"] .tabs a[aria-current="page"] { background: var(--surface); box-shadow: var(--shadow); }
[data-style="meridian2"] .tabs-row > .tabs { flex: 0 1 auto; }
[data-style="meridian2"] .nav a[aria-current="page"] { box-shadow: inset 2px 0 0 var(--accent), var(--shadow); }
[data-style="meridian2"] .person-head h1 { font-size: 2.6rem; }



/* Card grids (Summary, Dashboard); before the responsive rules, which narrow them. */
.modules { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); grid-auto-flow: row dense; align-items: start; }
.packed.packed { row-gap: 0; grid-auto-rows: 1px; align-items: start; }
.module { grid-column: span var(--span, 6); position: relative; }
.module[data-size="xs"] { --span: 3; } .module[data-size="s"] { --span: 4; } .module[data-size="m"] { --span: 6; } .module[data-size="l"] { --span: 8; } .module[data-size="w"] { --span: 9; } .module[data-size="xl"] { --span: 12; }
.module .edit-bar { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .tl-layout { grid-template-columns: minmax(0, 1fr); }
  .inspector { position: static; }
  .module[data-size="xs"], .module[data-size="s"] { --span: 6; } .module[data-size="l"], .module[data-size="w"] { --span: 12; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-grid { grid-template-columns: minmax(0, 1fr); }
  .plan-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app, .app.rail { grid-template-columns: minmax(0, 1fr); --side: 264px; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--side); transform: translateX(-105%); transition: transform .25s ease; box-shadow: var(--shadow-pop); background: var(--surface); }
  .app.open .sidebar { transform: none; }
  .app.open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 10, 25, .35); z-index: 25; }
  .app.rail .brand-txt, .app.rail .nav span, .app.rail .nav .count, .app.rail .me-card .who, .app.rail .themes { display: revert; }
  .menu-btn { display: inline-grid; }
  .top-brand { display: inline-flex; }
  .rail-btn { display: none; }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .modules { grid-template-columns: minmax(0, 1fr); }
  .module, .module[data-size] { grid-column: 1 / -1; }
  .search { width: auto; flex: 1; min-width: 0; }
  .search kbd { display: none; }
}
@media (max-width: 560px) {
  h1 { font-size: 1.5rem; }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .pres-row { grid-template-columns: 88px minmax(0, 1fr) 54px; }
  .person-head { gap: 14px; }
  .avatar.lg { width: 60px; height: 60px; border-radius: var(--r-avatar-lg); font-size: 1.3rem; }
  .crumbs { display: none; }
  .tabs-row > .end { display: none; }
  .field input { width: 140px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
/* ================= Full mockup: shared bits ================= */
.stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.stack-s { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--gap); align-items: start; }
@media (max-width: 1180px) { .grid-main { grid-template-columns: minmax(0, 1fr); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.p0 { padding: 0; }
.p0 > .card-head { margin: 0; padding: 14px var(--pad); }
[data-style="meridian2"] .p0 > .card-head { margin: 0; }
.select { height: 38px; padding: 0 10px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: .92rem; max-width: 100%; min-width: 0; }
.select.sm { height: 32px; font-size: .85rem; }
.input { width: 100%; height: 42px; padding: 0 12px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 1rem; }
.input:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.input[aria-invalid="true"] { border-color: var(--bad); }
.input.sm { height: 34px; font-size: .9rem; }
textarea.input { height: auto; padding: 10px 12px; line-height: 1.45; resize: vertical; }
.input.short { width: 96px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.check small { display: block; color: var(--muted); }
input[type="checkbox"] { accent-color: var(--accent); }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 4px; font-size: .72rem; font-weight: var(--w-semi); color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; vertical-align: 1px; }
.sec-title { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: var(--w-bold); margin: 6px 0 10px; }
.note-line { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: .9em; }
.note-line svg.i { flex: none; margin-top: 2px; color: var(--accent-ink); }
.note-line b { color: var(--text); }
.banner { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--r-xl); border: 1px solid color-mix(in srgb, var(--c, var(--warn)) 45%, transparent); background: color-mix(in srgb, var(--c, var(--warn)) 10%, var(--surface)); margin-bottom: var(--gap); }
.banner .ic { width: 38px; height: 38px; border-radius: var(--r-md); display: grid; place-items: center; color: var(--c, var(--warn)); background: var(--surface); border: 1px solid var(--line); flex: none; }
.banner > div { flex: 1; min-width: 220px; }
.banner p { margin: 2px 0 0; color: var(--muted); font-size: .9em; }
.empty { padding: 26px 12px; color: var(--muted); text-align: center; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 12px var(--pad); color: var(--muted); font-size: .86em; flex-wrap: wrap; }
.dtable td.wrap { white-space: normal; }
.dtable td .sub, .cell-sub { display: block; font-size: .8em; color: var(--muted); white-space: normal; }
/* Topbar scope picker */
.scope { position: relative; }
.sidebar .net-switch { margin: 0 12px 10px; }
.sidebar .net-switch > summary { width: 100%; }
.sidebar .net-switch .scope-name { display: block; overflow: hidden; text-overflow: ellipsis; flex: 1; text-align: left; }
.sidebar .net-switch .menu { left: 0; right: auto; width: 100%; min-width: 220px; }
.scope > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); font-weight: var(--w-semi); font-size: .86rem; white-space: nowrap; }
.scope > summary::-webkit-details-marker { display: none; }
.scope .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 260px; padding: 6px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-pop); }
.scope .menu button, .scope .menu a { display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: .9rem; text-align: left; cursor: pointer; }
.scope .menu button:hover, .scope .menu a:hover { background: var(--surface-2); text-decoration: none; }
.scope .menu button[aria-pressed="true"] { background: var(--accent-soft); }
.scope .menu .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.scope .menu small { color: var(--muted); margin-left: auto; }
@media (max-width: 760px) { .scope .scope-name, .topbar .live span { display: none; } }

/* Settings layout */
.set-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.set-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; }
.set-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-md); color: var(--muted); font-weight: var(--w-semi); font-size: .9rem; }
.set-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.set-nav a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); border: 1px solid var(--line); }
.set-nav .prem-tag { margin-left: auto; }
.set-nav .grp { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: var(--w-bold); padding: 14px 12px 4px; }
.set-nav .grp:first-child { padding-top: 0; }
@media (max-width: 960px) {
  .set-layout { grid-template-columns: minmax(0, 1fr); }
  .set-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
  .set-nav .grp { display: none; }
  .set-nav a { white-space: nowrap; flex: none; }
}
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 12px 24px; padding: 16px 0; border-top: 1px solid var(--line); align-items: center; }
.set-row:first-of-type { border-top: 0; padding-top: 4px; }
.set-row > :first-child b { display: block; font-weight: var(--w-semi); }
.set-row > :first-child p { margin: 3px 0 0; color: var(--muted); font-size: .87em; }
.set-row .ctl { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; min-width: 0; }
.set-row .ctl .select { width: 100%; }
@media (max-width: 760px) { .set-row { grid-template-columns: minmax(0, 1fr); } .set-row .ctl { justify-content: flex-start; } }
.set-row.off > div:first-child { opacity: .7; }
.switch.sm { width: 40px; height: 24px; }
.switch.sm::after { width: 16px; height: 16px; }
.switch.sm[aria-checked="true"]::after { transform: translateX(16px); }
.matrix th.rot { writing-mode: vertical-rl; transform: rotate(180deg); height: 120px; padding: 10px 6px; text-align: left; vertical-align: bottom; }
.matrix td.c { text-align: center; padding: 0 6px; }
.matrix td:first-child, .matrix th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.matrix tbody tr:hover td:first-child { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.role-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--c); margin-right: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .tag { height: 28px; font-size: .84rem; padding: 0 4px 0 10px; color: var(--text); }
.chips .tag button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 0 5px; }

/* Dialog */
dialog.confirm { border: 1px solid var(--line-strong); border-radius: var(--r-xl); padding: 24px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); width: min(440px, calc(100% - 32px)); }
dialog.confirm::backdrop { background: rgba(5, 10, 20, .45); backdrop-filter: blur(2px); }
dialog.confirm h2 { margin: 0 0 8px; font-size: 1.2rem; }
dialog.confirm p { color: var(--muted); margin: 0 0 18px; }
dialog.confirm .row { justify-content: flex-end; }

/* Discord IDs copy on click */
.id { cursor: copy; transition: background .15s, border-color .15s, color .15s; }
.id:hover { border-color: var(--line-strong); color: var(--text); }
.id:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.id.copied { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--text); }
/* Long reasons: two lines, then "…" and a More/Less toggle; full text on hover */
.dtable td.reason .rtext { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.dtable td.reason .rtext.open { display: block; -webkit-line-clamp: unset; }
.rwrap { display: flex; align-items: flex-end; gap: 8px; }
.rwrap .rtext { flex: 1; min-width: 0; }
.rwrap .rmore { flex: none; margin: 0; }
/* Tables with reasons: every row is tall enough for a two-line reason, so rows match */
#latest td.reason .rtext { -webkit-line-clamp: 1; }
.dtable:has(td.reason) td { height: calc(var(--row) + 36px); padding-top: 10px; padding-bottom: 10px; box-sizing: border-box; }
.rmore { border: 0; background: none; padding: 0; margin-top: 2px; font: inherit; font-size: .78rem; font-weight: var(--w-semi); color: var(--accent-ink); cursor: pointer; }
.rmore:hover { text-decoration: underline; }
/* Addable filters: a pill per filter you added, each with its own remove button */
.fchips { display: contents; }
.fpill { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 4px 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); font-size: .88rem; min-width: 0; max-width: 100%; }
.fpill:focus-within { border-color: var(--focus); }
.fpill .fl { color: var(--muted); white-space: nowrap; }
.fpill select, .fpill input { border: 0; background: none; color: var(--text); font: inherit; font-weight: var(--w-semi); outline: none; min-width: 0; max-width: 190px; }
.fpill input[type=date] { width: 8.6em; }
.fpill .fx { flex: none; border: 0; background: none; width: 28px; height: 28px; border-radius: 50%; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; display: grid; place-items: center; }
.fpill .fx:hover { background: var(--surface-2); color: var(--text); }
.fpill .fx:focus-visible { outline: 2px solid var(--focus); }
.addf > summary.btn { width: auto; height: 38px; display: inline-flex; color: var(--text); }
.addf .menu { left: 0; right: auto; top: 44px; }
.addf .menu button small { color: var(--muted); margin-left: 6px; }
/* Sortable table headers */
.dtable th .sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; }
.dtable th .sort:hover { color: var(--text); }
.dtable th .sort:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.dtable th .sort .arr { width: 12px; height: 12px; opacity: 0; transition: opacity .15s, transform .15s; }
.dtable th .sort:hover .arr { opacity: .5; }
.dtable th[aria-sort] { color: var(--text); }
.dtable th[aria-sort] .arr { opacity: 1; }
.dtable th[aria-sort="ascending"] .arr { transform: rotate(180deg); }
.seg button .n { font-size: .72rem; opacity: .75; }
.sort-pick { display: none; }
@media (max-width: 760px) { .sort-pick { display: inline-flex; } }
/* Tabs that don't fit scroll sideways: a thin scrollbar, the mouse wheel,
   and a fade on whichever edge has more tabs past it. */
.tabs.more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.tabs.more-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); }
.tabs.more-l.more-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
/* Scrollbars follow the theme: a thumb tinted from the theme's own text
   colour on a clear track, turning to the link colour while held. */
:root { --sb: color-mix(in srgb, var(--muted) 42%, transparent); --sb-hot: color-mix(in srgb, var(--accent-ink) 70%, transparent); scrollbar-color: var(--sb) transparent; }
.tbl-scroll, .tabs, .msgs, dialog { scrollbar-width: thin; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sb); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:active { background-color: var(--sb-hot); }
.tbl-scroll::-webkit-scrollbar, .tabs::-webkit-scrollbar { height: 10px; }
/* Table paging: entries per page, where you are, numbered pages */
.pgr .per { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.pgr .per select { width: auto; height: 30px; padding-top: 0; padding-bottom: 0; font-size: .86rem; }
.pgr .rng { margin-right: auto; }
.pgr .rng span + span:not(:empty)::before { content: " · "; }
.pages { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pages .btn { min-width: 32px; justify-content: center; }
.pages .btn.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.pages .gap { padding: 0 4px; color: var(--muted); }
.au-count b { font-size: 1.05em; }
/* A name with tags after it: one line, even gaps */
.nline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 20px; }
.nline .tag { margin: 0; }

/* =====================================================================
   The real panel's own bits (not in the mockup): forms that stand in
   for the mockup's buttons, the toast stack, the footer.
   ===================================================================== */
form.seg, form.themes, form.menu { margin: 0; }
.search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; padding: 0; outline: none; }
.search input::placeholder { color: var(--muted); }
.search:focus-within { border-color: var(--focus); }
.scope > summary svg.i:last-child { width: 12px; height: 12px; }
.me-card[aria-current="page"] { border-color: var(--line-strong); }
img.avatar { object-fit: cover; }
.toasts { position: fixed; z-index: 60; left: 50%; top: calc(18px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100% - 32px); }
.toasts .toast { position: static; transform: none; margin: 0; max-width: 100%; transition: opacity .4s, translate .4s; }
.toast.bad { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.toast.bad svg { color: var(--bad); }
.toast.gone { opacity: 0; translate: 0 -8px; }
.foot { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; padding: 32px 0 calc(24px + env(safe-area-inset-bottom, 0px)); color: var(--faint); font-size: .8rem; }
.foot p { margin: 0; }
input.check { width: 20px; height: 20px; margin: 0; accent-color: var(--accent-ink); }
select.input { padding-right: 8px; }
.card-head + .set-row { border-top: 0; padding-top: 4px; }
.banner.bad { --c: var(--bad); text-align: left; }
.banner.good { --c: var(--good); }
.empty-page { max-width: 560px; margin: 8vh auto 0; text-align: center; padding: 34px 28px; }
.empty-page h1 { font-size: 1.5rem; }
.row.center { justify-content: center; }

/* ---------- Shared by several pages ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 8px 0 22px; }
.page-head .end { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card-menu { position: relative; }
.card-menu > summary { list-style: none; cursor: pointer; width: 30px; height: 30px; border-radius: var(--r-md); display: grid; place-items: center; color: var(--muted); }
.card-menu > summary::-webkit-details-marker { display: none; }
.card-menu > summary:hover { background: var(--surface-3); color: var(--text); }
.card-menu .menu { position: absolute; right: 0; top: 34px; z-index: 30; width: 220px; padding: 6px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-pop); text-transform: none; letter-spacing: 0; }
.card-menu .menu button { display: block; width: 100%; padding: 8px 10px; border: 0; background: none; text-align: left; color: var(--text); font: inherit; font-size: .88rem; border-radius: 6px; cursor: pointer; }
.card-menu .menu button:hover { background: var(--surface-2); }
.card-menu .menu p { margin: 4px 10px 8px; color: var(--muted); font-size: .8rem; }
.mk { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--c); background: var(--surface); }
.mk.solid { background: var(--c); }
.mk.diamond { border-radius: 2px; transform: rotate(45deg) scale(.86); background: var(--c); }
.evtitle { display: flex; align-items: center; gap: 10px; }
.evtitle b { font-weight: var(--w-semi); }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: var(--w-semi); color: var(--muted); white-space: nowrap; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.quick button { height: 28px; padding: 0 10px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-size: .8rem; cursor: pointer; }
.quick button:hover { border-color: var(--accent-ink); }
.quick button[aria-pressed="true"] { border-color: var(--accent-ink); background: var(--accent-soft); }
.fields-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form { display: flex; flex-direction: column; gap: 26px; }
.form .lbl { display: block; font-weight: var(--w-semi); margin-bottom: 8px; }
.form .lbl small { font-weight: var(--w-med); color: var(--muted); margin-left: 6px; }
.help { color: var(--muted); font-size: .86em; margin: 6px 0 0; }
.field-row { display: flex; justify-content: space-between; gap: 12px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 18px; border-top: 1px solid var(--line); }
.form-actions .grow { flex: 1; }
.form .swatches { grid-template-columns: repeat(5, 46px); }
[hidden] { display: none !important; }
.select.wide { width: 100%; }
.updated { margin: 12px 0 0; font-size: .76rem; color: var(--faint); }
.live-offer { margin-right: 6px; }
.iconbtn.sm { width: 30px; height: 30px; }
label.mini { display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--muted); }
.form.tight { gap: 14px; }
.sec-row { display: flex; align-items: center; gap: 12px; margin: var(--gap) 0 12px; flex-wrap: wrap; }
.sec-row h2 { margin: 0; font-size: 1.05rem; }
.sec-row .end { margin-left: auto; }
.switch { flex: none; position: relative; width: 48px; height: 28px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface-3); cursor: pointer; padding: 0; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: var(--r-pill); background: var(--muted); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s, background .15s; }
.switch[aria-checked="true"] { background: var(--accent-fill); border-color: transparent; }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--surface); }
.switch-state { font-size: .8rem; font-weight: var(--w-semi); color: var(--muted); margin-top: 4px; text-align: center; }
.card-head { flex-wrap: wrap; row-gap: 4px; } .card-head h2 { flex: none; max-width: 100%; }
.card.p0 > .updated.pad { margin: 0; padding: 12px var(--pad); border-top: 1px solid var(--line); }
.dtable td .bar-left { display: block; margin: 0 0 6px; }
.dtable td.wrap { min-width: 180px; }
.who > span { min-width: 0; overflow-wrap: anywhere; }
.dtable td .sub.id { width: max-content; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.field input[type="date"] { width: auto; }
.card.p0 > .pager { border-top: 1px solid var(--line); }
.dtable td.wrap { padding-top: 9px; padding-bottom: 9px; }
/* Pick lists: a column of dropdowns with × and + (panel.js) */
.pick-list { display: flex; flex-direction: column; gap: 6px; }
.pick-row { display: flex; gap: 6px; align-items: center; }
.pick-row .select { flex: 1; min-width: 0; }
.pick-list > template + .pick-btn, .pick-list > .pick-btn:only-child { align-self: flex-start; }
.note-line.bad { --nl: var(--bad); } .note-line.ok { --nl: var(--ok); }
.note-line.bad, .note-line.ok { border-color: color-mix(in srgb, var(--nl) 40%, transparent); background: color-mix(in srgb, var(--nl) 8%, var(--surface)); }
.note-line.bad svg.i, .note-line.ok svg.i { color: var(--nl); }
.card-head h2 .n { font-size: .8em; color: var(--muted); font-weight: 400; margin-left: 4px; }
details.fold { border-top: 1px solid var(--line); }
details.fold > summary { list-style: none; cursor: pointer; padding: 14px 0; display: flex; align-items: center; gap: 10px; font-weight: var(--w-semi); }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
details.fold[open] > summary::after { transform: rotate(225deg); }
details.fold > .fold-body { padding: 0 0 18px; }
.staff-tag { display: inline-flex; align-items: center; gap: 4px; height: 19px; padding: 0 6px; border-radius: 4px; font-family: var(--font-mono); font-size: .7rem; color: var(--accent-ink); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent-ink) 30%, transparent); white-space: nowrap; }

/* Saved reasons under a reason box (Settings → Reasons). */
.quick{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.quick button{height:28px;padding:0 10px;border-radius:var(--r-pill);border:1px solid var(--line);background:var(--surface-2);color:var(--text);font:inherit;font-size:.8rem;cursor:pointer;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.quick button:hover{border-color:var(--accent-ink)}

/* Arranging cards (Customise on the Dashboard and a person's Summary).
   The grid being arranged has .editing; panel.js adds each card's bar. */
.editing > .module { outline: 2px dashed var(--line-strong); outline-offset: 4px; cursor: grab; }
.editing > .module.drag-over { outline-color: var(--accent-ink); }
.editing > .module > .edit-bar { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 2px; margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) 12px; padding: 6px 10px; border-bottom: 1px dashed var(--line-strong); border-radius: var(--r-xl) var(--r-xl) 0 0; background: var(--surface-2); }
/* In styles whose card head runs to the card's edge, the head sits right under the bar. */
[data-style] .editing > .module > .edit-bar + .card-head { margin-top: -12px; border-top-left-radius: 0; border-top-right-radius: 0; }
.edit-bar button { border: 0; background: none; color: var(--muted); padding: 3px 8px; border-radius: var(--r-pill); cursor: pointer; font: inherit; font-size: .74rem; font-weight: var(--w-bold); line-height: 1.4; }
.edit-bar button:hover, .edit-bar button[aria-pressed="true"] { background: var(--accent-soft); color: var(--text); }
.edit-bar .i { width: 14px; height: 14px; vertical-align: -2px; }
.edit-bar .sep { width: 1px; height: 14px; margin: 0 4px; background: var(--line-strong); }
.edit-bar .sep:first-of-type { margin-right: auto; background: none; }
.tray { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: var(--gap); border-radius: var(--r-lg); border: 1px dashed var(--line-strong); background: var(--surface-2); }
.tray[hidden] { display: none; }
.tray .grow { flex: 1 1 260px; }
.tray .hidden-cards { display: flex; gap: 6px; flex-wrap: wrap; }
.tray .hidden-cards:empty { display: none; }
[data-customise][aria-pressed="true"] { border-color: var(--accent-ink); }
/* Sanctions: the time left beside its bar, as in the design. */
.dtable td.ends { white-space: nowrap; }
.dtable td.ends .bar-left { display: inline-block; margin: 0 10px 0 0; width: 44px; }
.dtable .who .nm { max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A seg made of links (pages that switch by address, so it works without
   JavaScript). */
.seg a { padding: 4px 12px; border-radius: var(--r-pill); color: var(--muted); font-size: .8rem; font-weight: var(--w-semi); text-decoration: none; display: inline-flex; align-items: center; }
.seg a:hover { color: var(--text); }
.seg a[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
/* Number tiles at the top of a list (Directory). */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.tile { padding: 18px 20px; }
.tile .eyebrow { margin: 0 0 6px; }
.tile .v { font-size: 2rem; font-weight: var(--w-semi); line-height: 1.1; margin: 0; letter-spacing: -.01em; }
.tile .sub { margin: 6px 0 0; color: var(--muted); font-size: .84rem; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.filters .seg { align-self: center; }

/* Rows that open a page (Cases, Sanctions, Directory) do so from a click on
   empty space; over text the pointer stays a text cursor, for selecting. */
:is(tr, li).link[data-href] { cursor: pointer; }
:is(tr, li).link[data-href].on-text { cursor: auto; }
:is(tr, li).link[data-href] :is(a, button, summary, label) { cursor: pointer; }
.dtable tbody tr.link[data-href]:hover td, .same li.link:hover { background: color-mix(in srgb, var(--accent-soft) 30%, transparent); }
td.id-cell { cursor: copy; }

/* Going from page to page keeps the old page on screen until the new one is
   drawn, then cross-fades quickly, instead of a cut through a half-drawn
   page. Browsers without view transitions just change page as before. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .12s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* Your settings: a zone that isn't in the list. */
.tz-other { margin-top: 6px; }
.tz-other summary { list-style: none; cursor: pointer; }
.tz-other summary::-webkit-details-marker { display: none; }
.tz-other .input { margin-top: 6px; }

/* Operator console */
.op-suspend > summary { list-style: none; }
.op-suspend > summary::-webkit-details-marker { display: none; }
.op-suspend[open] > form { margin-top: 8px; min-width: 240px; }
