/* Google Sans Flex (OFL), self-hosted variable font: the one typeface for the whole product. */
@font-face { font-family: "Google Sans Flex"; font-style: normal; font-weight: 100 1000; font-stretch: 100%; font-display: swap;
  src: url("fonts/GoogleSansFlex-vietnamese.woff2") format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Google Sans Flex"; font-style: normal; font-weight: 100 1000; font-stretch: 100%; font-display: swap;
  src: url("fonts/GoogleSansFlex-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Google Sans Flex"; font-style: normal; font-weight: 100 1000; font-stretch: 100%; font-display: swap;
  src: url("fonts/GoogleSansFlex-latin.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; }

/* SiteGuard's kit: the one stylesheet of the admin console, of the user portal (which links
   user/assets/style.css after it) and of the browser extension's own pages (which link a copy of
   this file, kit.css, before their own sheets). The palette, the type scale, every control and the
   shell are declared here and nowhere else.
   After changing this file, copy it to the extension:
       node "SiteGuard-Browser Extensions/tools/sync-kit.mjs"
   (the extension's tests/kit-sync.test.mjs fails until the copy is made; the same tool copies the
   scripts in this folder that the extension shares). */

:root {
  /* Type scale: the one set of sizes, line heights and weights every page
     draws from (the user portal and the home page too). Headings and the
     page's figures first; body, small and caption text follow. */
  --fs-display: 36px; --lh-display: 1.1;    /* the page's one big number */
  --fs-figure: 26px;                         /* a card's figure */
  --fs-figure-sm: 22px;                      /* a smaller figure, a verdict */
  --fs-h1: 24px;      --lh-h1: 1.2;
  --fs-h2: 16px;      --lh-h2: 1.35;
  --fs-h3: 14px;      --lh-h3: 1.4;
  --fs-body: 14px;    --lh-body: 1.55;       /* reading text, inputs, tables */
  --fs-small: 13px;   --lh-small: 1.5;       /* labels, controls, notes */
  --fs-caption: 12px; --lh-caption: 1.45;    /* meta, subs, badges */
  --fs-micro: 11px;                          /* overlines, tags */
  --fw-h1: 700; --fw-h2: 700; --fw-h3: 600;
  /* Weights: four, and no others. Regular for reading, medium for a quiet emphasis, semibold for labels,
     controls and table headings, bold for titles and figures. */
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;
  /* Corners: 2 (a swatch, a thin bar), 4 (a tick box, a tag inside something), 6 (the inside of an 8),
     8 (a small control, a menu row), 10 (a control), 12 (a card), and the pill. */
  --r-2: 2px; --r-4: 4px; --r-6: 6px; --r-8: 8px; --r-10: 10px; --r-12: 12px; --r-pill: 999px;
  /* Controls: two heights. A field is always the tall one. */
  --ctl-h: 36px; --ctl-h-sm: 28px;
  /* Rhythm: 20 between a page's blocks, 12 between two things that belong together, 8 inside a group. */
  --gap-block: 20px; --gap-pair: 12px; --gap-in: 8px;
  --ls-h1: -.02em; --ls-h2: -.01em;
  /* Chips: one set of sizes for every pill. A badge says a state (20px,
     caption); a count is a small number (18px, micro); a chip is something
     to click or remove (26px, small); a pill is a figure's aside (24px). */
  --chip-h: 20px; --chip-px: 8px; --chip-fs: var(--fs-caption); --chip-fw: 600;
  --chip-h-lg: 26px; --chip-px-lg: 11px; --chip-fs-lg: var(--fs-small);
  --count-h: 18px; --pill-h: 24px;
  --switch-on: #14b8a6;
  color-scheme: light;
  --ink: #1d1d1f;
  --ink-soft: #3a3a3e;
  --muted: #6b6b73;
  --faint: #86868e;
  --line: #e4e4e8;
  --line-strong: #d2d2d8;
  --surface: #ffffff;
  --surface-soft: #f7f7f9;
  --canvas: #f2f2f5;
  /* The brand's teal (the extension's accent) under the --blue names the
     stylesheet grew up with: links, focus, the main series, the page's action. */
  --blue: #0c8178;
  --blue-hover: #0a6d65;
  --blue-ink: #0a6f68;
  --blue-soft: #e7f4f2;
  --blue-line: #c2e3de;
  --accent-bright: #14b8a6;
  --green: #1a7152;
  --green-soft: #eaf6f0;
  --green-line: #c8e3d4;
  --amber: #8f5305;
  --amber-soft: #fff5e3;
  --amber-line: #eed9ad;
  --red: #b0353a;
  --red-soft: #fdefed;
  --red-line: #efcdc8;
  --violet: #5f4596;
  --violet-soft: #f2eefa;
  /* Neutral badges and chips. */
  --chip: #efeff3;
  /* One accent per threat category, as in the extension. */
  --phishing: #9e5a0c;
  --phishing-soft: #fcf2e4;
  --malware: #ad3a3e;
  --malware-soft: #fcefef;
  --redirect: #3a6889;
  --redirect-soft: #edf3f8;
  --nsfw: #75598f;
  --nsfw-soft: #f4f0f8;
  --gambling: #6f6a10;
  --gambling-soft: #f6f5e2;
  --radius: 12px;
  --radius-md: 10px;
  --radius-sm: 8px;
  /* A panel's edge (a card, a tile, a table): a hairline and the faintest lift, no drawn border. The
     console and the portal both take it from here; the extension's options.css keeps the same values. */
  --shadow: 0 0 0 .5px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .03);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, .14);
  --font: "Google Sans Flex", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: var(--font);
  /* The accent under its own name (the portal's and the extension's pages say --accent). */
  --accent: var(--blue);
  --accent-soft: var(--blue-soft);
  --accent-line: var(--blue-line);
  --accent-ink: var(--blue-ink);
  --accent-hover: var(--blue-hover);
  /* Older names still used by page markup and page-level styles. */
  --bg: var(--canvas);
  --border: var(--line);
  --text: var(--ink);
  --brand: var(--blue);
  --brand-dark: var(--blue-hover);
  --danger: var(--red);
  --warn: var(--amber);
  --ok: var(--green);
}

/* ---- Base ------------------------------------------------------------------ */
* { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--font); font-size: var(--fs-body); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--blue-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: color-mix(in srgb, var(--accent-bright) 28%, transparent); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
h1, h2, h3, h4 { color: var(--ink); }
code, kbd, pre { font-family: var(--mono); }
code { overflow-wrap: anywhere; }   /* a long address or key breaks where it must, never runs out of its card */
/* A <small> is caption text wherever it sits (the browser's "smaller" gave 10.8px here and 11.7px there), and bold is one weight. */
small { font-size: var(--fs-caption); }
strong, b { font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--line); }
.skip-link { position: fixed; z-index: 100; top: 10px; left: 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--blue); color: #fff; transform: translateY(-160%); }
.skip-link:focus { transform: none; }

/* ---- Shell: sidebar + content ------------------------------------------------ */
/*
 * The sidebar is built like the browser extension's settings page (options.css):
 * a floating translucent panel beside the page, section labels in sentence
 * case, the current page a raised white pill, and the account at its foot with
 * a small menu. Its groups are native <details>/<summary> disclosures: the whole
 * heading is one target, and keyboard and screen-reader behaviour works without
 * JavaScript. Every destination, including a group's landing page, lives inside
 * the expanded list.
 */
:root {
  --sidebar: rgba(234, 234, 239, .82);
  --nav-current: var(--surface);
  --sidebar-w: 236px;
  --gutter: 12px;
  --hover: rgba(0, 0, 0, .04);
  --press: rgba(0, 0, 0, .07);
  --fill-strong: rgba(0, 0, 0, .065);   /* the track a row of tabs sits in */
  --seg-on: var(--surface);             /* the segment taken, where no pill is drawn (reduced motion): raised from the track in either theme */
  --pill-shadow: 0 0 0 .5px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .07), 0 1px .5px rgba(0, 0, 0, .03);
  --float-shadow: 0 0 0 .5px rgba(0, 0, 0, .07), 0 8px 28px -10px rgba(0, 0, 0, .12);
  --pop-shadow: 0 0 0 .5px rgba(0, 0, 0, .1), 0 6px 14px rgba(0, 0, 0, .07), 0 18px 40px -12px rgba(0, 0, 0, .2);
  /* Motion: one spring model, three tempers, for anything that moves or grows
     (colours and fades keep a plain ease). --spring settles with a 4% overshoot
     (a pill sliding, a panel opening); --spring-bounce overshoots 8% (a chevron
     turning, a menu growing out); --spring-pop overshoots 20%, for small things
     that arrive (an icon nudged, a tick, a dot, a count). */
  --spring: linear(0, 0.026, 0.091, 0.181, 0.285, 0.393, 0.499, 0.598, 0.688, 0.766, 0.833, 0.889, 0.933, 0.968, 0.995, 1.013, 1.026, 1.034, 1.038, 1.038, 1.037, 1.034, 1.031, 1.027, 1.023, 1.019, 1.015, 1.012, 1.009, 1.006, 1);
  --spring-bounce: linear(0, 0.057, 0.193, 0.365, 0.542, 0.703, 0.837, 0.939, 1.011, 1.055, 1.078, 1.084, 1.078, 1.067, 1.052, 1.038, 1.024, 1.013, 1.005, 0.999, 0.995, 0.993, 0.993, 0.993, 0.994, 0.996, 0.997, 0.998, 0.999, 1, 1);
  --spring-pop: linear(0, 0.09, 0.301, 0.559, 0.804, 0.999, 1.129, 1.193, 1.204, 1.176, 1.129, 1.076, 1.028, 0.991, 0.969, 0.959, 0.959, 0.966, 0.977, 0.987, 0.997, 1.003, 1.007, 1.009, 1.008, 1.006, 1.004, 1.002, 1, 0.999, 1);
  /* The raised neutral face (a fold's lid, a secondary button) for a page's own pressable card:
     at rest, lit under the pointer, sunk under the press. */
  --face: linear-gradient(180deg, #ffffff 0%, #f4f4f7 100%);
  --face-hover: linear-gradient(180deg, #ffffff 0%, #f9f9fb 100%);
  --face-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .05), 0 0 0 .5px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06);
  --face-shadow-hover: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .05), 0 0 0 .5px rgba(0, 0, 0, .17), 0 1px 2px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06);
  --face-shadow-press: inset 0 1px 3px rgba(0, 0, 0, .18), 0 0 0 .5px rgba(0, 0, 0, .14);
  /* The translucent pill that follows the pointer along the rows of a list
     sunk in a groove (a select's list, a level menu, a list of choices). */
  --groove-hover: rgba(255, 255, 255, .55);
  --groove-hover-ring: none;
}
/* The console's sidebar (.sidebar, its links in a <nav>) and the portal's (.settings-sidebar, .settings-nav)
   are one sidebar: every rule that gives it a colour, a face or a size names both, so neither can drift
   from the other. Only how each sits in its page (flex here, a grid in user/assets/style.css) is its own. */
.layout { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar, .settings-sidebar {
  position: sticky; z-index: 10; top: var(--gutter);
  display: flex; flex-direction: column;
  height: calc(100vh - var(--gutter) * 2); height: calc(100dvh - var(--gutter) * 2); margin: var(--gutter);
  padding: 18px 10px 12px; border-radius: 12px;
  background: var(--sidebar); box-shadow: var(--float-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
}
.sidebar { flex-shrink: 0; width: var(--sidebar-w); }
.sidebar .brand, .settings-sidebar .brand { display: flex; align-items: center; gap: 8px; padding: 0 8px 20px; color: inherit; text-decoration: none; }
.sidebar .brand:hover, .settings-sidebar .brand:hover { text-decoration: none; }
.sidebar .brand-logo { display: block; width: auto; height: 36px; }
.sidebar .brand-role { background: var(--hover); color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; height: var(--count-h); min-width: var(--count-h); padding: 0 6px; border-radius: 999px; font-size: var(--fs-micro); line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sidebar nav:where(:not(.lang-switch)), .settings-nav { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 2px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: none; }
.sidebar nav:where(:not(.lang-switch))::-webkit-scrollbar, .settings-nav::-webkit-scrollbar { display: none; }
.sidebar .nav-section-label, .nav-label { margin: 16px 10px 4px; color: var(--muted); font-size: var(--fs-caption); font-weight: 600; line-height: 1.5; }
.nav-label:first-child { margin-top: 0; }
.sidebar nav:where(:not(.lang-switch)) a, .settings-nav a,
.sidebar .nav-group > summary {
  display: flex; align-items: center; gap: 9px;
  min-height: 32px; padding: 5px 10px; border-radius: 8px;
  color: var(--ink-soft); font-size: var(--fs-body); font-weight: 500; text-decoration: none;
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.sidebar .nav-icon { width: 16px; height: 16px; flex: none; stroke-width: 1.7; opacity: .7; }
.settings-nav svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.settings-nav img { width: 16px; height: 16px; flex: none; opacity: .7; object-fit: contain; }
img.nav-icon { width: 16px; height: 16px; flex: none; display: inline-block; object-fit: contain; }
.card-link img { width: 14px; height: 14px; flex: none; }
.attention-icon img { width: 28px; height: 28px; object-fit: contain; }
.outcome-icon img { width: 16px; height: 16px; object-fit: contain; }
.sign-out-button img { width: 16px; height: 16px; display: block; object-fit: contain; }
.account-menu img { width: 15px; height: 15px; flex: none; object-fit: contain; }
.dv-icon img, .ac-glyph img, .ps-empty-icon img { width: 100%; height: 100%; object-fit: contain; }
.sidebar nav a:hover, .settings-nav a:hover,
.sidebar .nav-group > summary:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.sidebar nav a:active, .settings-nav a:active, .sidebar .nav-group > summary:active { background: var(--press); }
.sidebar nav a:focus-visible, .settings-nav a:focus-visible, .sidebar .nav-group > summary:focus-visible { outline-offset: -2px; }
/* The page you are on: a raised pill, the one white thing on the sidebar (a step lighter than it in the dark). */
.sidebar nav a.active, .settings-nav a.active, .settings-nav a[aria-current="page"] { background: var(--nav-current); box-shadow: var(--pill-shadow); color: var(--ink); font-weight: 600; }
.sidebar nav a.active .nav-icon, .settings-nav a.active svg, .settings-nav a[aria-current="page"] svg,
.sidebar .nav-group.current-section > summary .nav-icon { color: var(--accent); opacity: 1; }
.settings-nav a.active img, .settings-nav a[aria-current="page"] img { opacity: 1; }
.sidebar .nav-group { margin: 0; }
.sidebar .nav-group > summary { cursor: pointer; list-style: none; user-select: none; }
.sidebar .nav-group > summary::-webkit-details-marker { display: none; }
.sidebar .nav-group > summary::after {
  width: 6px; height: 6px; margin: 0 3px 0 auto; flex: none;
  border-right: 1.6px solid var(--faint); border-bottom: 1.6px solid var(--faint);
  content: ""; transform: rotate(-45deg); transition: transform .45s var(--spring);
}
.sidebar .nav-group[open] > summary::after { transform: translateY(-2px) rotate(45deg); }
.sidebar .nav-group.current-section > summary { color: var(--ink); font-weight: 600; }
.sidebar .nav-group-children { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 6px; padding-left: 25px; }
.sidebar .nav-group-children a { min-height: 30px; padding: 4px 10px; font-size: var(--fs-small); }
.nav-count { margin-left: auto; background: var(--amber-soft); color: var(--amber); font-variant-numeric: tabular-nums; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; height: var(--count-h); min-width: var(--count-h); padding: 0 6px; border-radius: 999px; font-size: var(--fs-micro); line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sidebar .nav-group > summary .nav-count { margin-right: 4px; }

/* The language switch (lib/i18n.php sg_lang_switch): Auto, EN, BM, 中文, each language named in
   itself, under the theme switch and as wide as it. It is a <nav> too, so the console menu's rules
   above leave it out (:where(:not(.lang-switch)), adding nothing to their weight): it keeps the
   kit's segments. */
.sidebar > .lang-switch, .settings-sidebar > .lang-switch { display: flex; flex: none; margin: 8px 2px 0; }
.sidebar > .lang-switch > a, .settings-sidebar > .lang-switch > a { flex: 1 1 auto; padding-inline: 6px; text-align: center; }

/* The account at the foot, with its menu opening above it. */
.sidebar-account { position: relative; display: flex; align-items: center; gap: 4px; margin-top: 10px; padding: 12px 4px 4px 10px; border-top: 1px solid var(--line); }
.sidebar-account > .account-card, .sidebar-account > div { min-width: 0; flex: 1; }
.sidebar-account > .account-card { justify-content: flex-start; }
/* Sign out, one click away beside the name (the name opens the rest). */
/* Signing out is a POST (admin/logout.php, user/logout.php): a small form round an icon button. */
.sign-out-form { display: flex; flex: none; margin: 0; }
.sign-out-button { display: grid; width: 30px; height: 30px; min-height: 0; flex: none; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; box-shadow: none; color: var(--muted); transition: background .15s, color .15s; }
.sign-out-button:hover, .sign-out-button:focus-visible { border: 0; background: var(--hover); color: var(--red); text-decoration: none; }
.sign-out-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar .account-card, .settings-sidebar .account-card { display: flex; max-width: 100%; min-height: 0; align-items: center; gap: 6px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--ink-soft); cursor: pointer; font: inherit; text-align: left; transition: color .15s; }
.sidebar .account-card:hover, .sidebar .account-card[aria-expanded="true"], .settings-sidebar .account-card:hover { border: 0; background: none; color: var(--ink); }
.sidebar .account-identity, .settings-sidebar .account-identity { display: flex; min-width: 0; flex-direction: column; line-height: 1.35; }
.sidebar .account-identity strong, .settings-sidebar .account-identity strong { overflow: hidden; color: inherit; font-size: var(--fs-small); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .account-identity span, .settings-sidebar .account-identity span { overflow: hidden; color: var(--muted); font-size: var(--fs-caption); font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .account-menu { position: absolute; z-index: 20; right: 0; bottom: calc(100% + 6px); left: 0; display: grid; gap: 1px; padding: 4px; border-radius: 10px; background: var(--surface-soft); box-shadow: var(--pop-shadow), inset 0 1px 2px rgba(0, 0, 0, .06); }
.sidebar .account-menu[hidden] { display: none; }
.sidebar .account-menu a { display: flex; align-items: center; gap: 9px; min-height: 30px; padding: 5px 9px; border-radius: 6px; color: var(--ink-soft); font-size: var(--fs-small); font-weight: 500; text-decoration: none; }
.sidebar .account-menu a { position: relative; z-index: 1; }
.sidebar .account-menu a:hover, .sidebar .account-menu a:focus-visible { background: none; color: var(--ink); outline: 0; text-decoration: none; }
.sidebar .account-menu .menu-signout:hover { color: var(--red); }
.sidebar .account-menu svg { width: 15px; height: 15px; flex: none; }
@keyframes sg-pop { from { opacity: 0; transform: translateY(-3px) scale(.98); } }
.nav-toggle, .nav-toggle-label { display: none; }

/* The page beside the sidebar: the same margins on the console (.main) and the portal (.options-main). */
.main, .options-main { min-width: 0; padding: 28px 32px 64px 24px; }
.main { flex: 1; }
/* The settings shell (.options-shell: the portal, and the extension's settings page): the sidebar's
   column and the page's. On a narrow window the sidebar turns into a bar across the top, its links in
   a row that scrolls, the theme switch down to its three icons. */
.options-shell { display: grid; grid-template-columns: calc(var(--sidebar-w) + var(--gutter) * 2) minmax(0, 1fr); min-height: 100vh; }
.options-main { width: 100%; }
.options-main:focus { outline: 0; }
.settings-sidebar .brand-logo { display: block; width: auto; height: 36px; }
@media (max-width: 860px) {
  .options-shell { display: block; }
  .settings-sidebar { top: var(--gutter); flex-flow: row wrap; align-items: center; gap: 8px; height: auto; padding: 7px 7px 7px 14px; }
  .settings-sidebar .brand { padding: 0 6px 0 0; }
  .settings-sidebar .brand-logo { height: 28px; }
  .settings-sidebar .nav-label { display: none; }
  .settings-nav { flex-direction: row; overflow-x: auto; }
  .settings-nav a { min-height: 30px; padding: 4px 10px; font-size: var(--fs-small); white-space: nowrap; }
  .settings-nav svg, .settings-nav img { display: none; }
  .settings-sidebar .sidebar-account { flex: none; margin: 0; padding: 0 6px 0 12px; border-top: 0; border-left: 1px solid var(--line); }
  .settings-sidebar .theme-switch { --tt-knob-x: 3px; flex: none; width: 96px; margin: 0; }
  .settings-sidebar .theme-switch button[data-theme-set] { justify-content: center; padding: 0; }
  .settings-sidebar .theme-switch button[data-theme-set] > span:not(.tt-icon) { display: none; }
  .settings-sidebar .account-card { white-space: nowrap; }
  .settings-sidebar .account-identity strong { max-width: 110px; }
  .settings-sidebar .account-identity span { display: none; }
  .options-main { padding: 24px 24px 64px; }
}
@media (max-width: 860px) {
  /* The console's Menu (below 900px) is for its own sidebar; the portal's bar keeps its row of pages
     until a phone, where it folds the same way (below). */
  .settings-sidebar .nav-toggle-label { display: none; }
}
@media (max-width: 560px) {
  .options-main { padding: 20px 16px 48px; }
  .settings-sidebar .brand { display: none; }
  /* A phone: the portal's bar is the brand and Menu; the pages, theme, language and account fold
     behind it as in the console. (The extension's settings page has no toggle and keeps its row.) */
  .settings-sidebar:has(> .nav-toggle) { flex-flow: column; align-items: stretch; gap: 0; max-height: calc(100dvh - var(--gutter) * 2); overflow-y: auto; padding: 8px 8px 8px 14px; border-radius: 12px; }
  .settings-sidebar:has(> .nav-toggle) .brand { display: flex; min-height: 34px; align-items: center; padding: 0 90px 0 0; }
  .settings-sidebar .nav-toggle-label {
    position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 6px;
    min-height: 32px; padding: 5px 11px; border-radius: 8px;
    background: var(--surface); box-shadow: var(--pill-shadow); color: var(--ink-soft); cursor: pointer; font-size: var(--fs-small); font-weight: 600;
  }
  .settings-sidebar .nav-toggle-label .nav-icon { width: 16px; height: 16px; }
  .settings-sidebar .nav-toggle { position: absolute; display: block; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
  .settings-sidebar:has(> .nav-toggle) > :is(.settings-nav, .theme-switch, .lang-switch, .sidebar-account) { display: none; }
  .settings-sidebar > .nav-toggle:checked ~ .settings-nav { display: flex; flex-direction: column; overflow: visible; margin: 10px 0 0 -6px; padding-top: 8px; border-top: 1px solid var(--line); }
  .settings-sidebar > .nav-toggle:checked ~ .settings-nav .nav-label { display: block; }
  .settings-sidebar > .nav-toggle:checked ~ .settings-nav :is(svg, img) { display: block; }
  .settings-sidebar > .nav-toggle:checked ~ .settings-nav a { min-height: 36px; font-size: var(--fs-body); white-space: normal; }
  .settings-sidebar > .nav-toggle:checked ~ .theme-switch { display: flex; width: auto; margin: 10px 0 0; }
  .settings-sidebar > .nav-toggle:checked ~ .theme-switch button[data-theme-set] > span:not(.tt-icon) { display: inline; }
  .settings-sidebar > .nav-toggle:checked ~ .lang-switch { display: flex; margin: 8px 0 0; }
  .settings-sidebar > .nav-toggle:checked ~ .sidebar-account { display: flex; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .settings-sidebar > .nav-toggle:checked ~ .sidebar-account .account-identity span { display: block; }
  body:has(.settings-sidebar > .nav-toggle:checked) { overflow: hidden; }
  .settings-sidebar .nav-toggle:focus-visible + .nav-toggle-label { outline: 2px solid var(--accent); outline-offset: 2px; }
}

/* ---- Page header --------------------------------------------------------------- */
/* Every page opens with <h1 class="page-title">Title <span class="sub">…</span>;
   the subtitle drops to its own line beneath the title and any badges. */
.page-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 var(--gap-block); color: var(--ink); font-size: var(--fs-h1); font-weight: var(--fw-h1); letter-spacing: var(--ls-h1); line-height: 1.25; }
.page-title .sub { flex: 1 0 100%; color: var(--muted); font-size: var(--fs-body); font-weight: 400; letter-spacing: 0; line-height: var(--lh-body); }
.page-title .badge { font-size: var(--chip-fs); letter-spacing: 0; }
/* A URL or hash in a title breaks rather than widening the page. */
.page-title .mono { min-width: 0; color: var(--ink-soft); font-size: var(--fs-h3); font-weight: 500; letter-spacing: 0; overflow-wrap: anywhere; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
/* Back link above a detail page's title: a small ghost pill with a chevron. */
.crumb { display: flex; margin: 0 0 var(--gap-pair); }
.crumb a { gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); transition: border-color .15s, background .15s, color .15s; font-weight: 600; display: inline-flex; align-items: center; min-height: var(--chip-h-lg); padding: 0 var(--chip-px-lg) 0 var(--chip-px-lg); border-radius: 999px; font-size: var(--chip-fs-lg); line-height: 1.2; white-space: nowrap; }
.crumb a::before { content: ""; width: 6px; height: 6px; border-bottom: 1.8px solid currentColor; border-left: 1.8px solid currentColor; transform: translateX(1px) rotate(45deg); transition: transform .4s var(--spring-bounce); }
.crumb a:hover { border-color: var(--blue-line); background: var(--blue-soft); color: var(--blue); text-decoration: none; }
.crumb a:hover::before { transform: translateX(-1px) rotate(45deg); }
.crumb a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.page-links { display: flex; flex-wrap: wrap; gap: 6px; margin: -8px 0 var(--gap-block); }
.page-links a { border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-weight: 600; display: inline-flex; align-items: center; min-height: var(--chip-h-lg); padding: 0 var(--chip-px-lg) 0 var(--chip-px-lg); border-radius: 999px; font-size: var(--chip-fs-lg); line-height: 1.2; white-space: nowrap; }
.page-links a:hover { border-color: var(--blue-line); background: var(--blue-soft); color: var(--blue); text-decoration: none; }

/* ---- Cards ---------------------------------------------------------------------- */
/* A panel on the page (a card, a tile, an item to act on, a table) has one face: the surface, a 12px corner
   and the hairline of --shadow. Its border is there but unseen, for a state to colour (the tile you are
   filtered to, an accented card) without the panel changing size. */
.card { margin-bottom: 20px; padding: 20px 22px; border: 1px solid transparent; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card h2 { margin: 0 0 14px; color: var(--ink); font-size: var(--fs-h2); font-weight: var(--fw-h2); letter-spacing: var(--ls-h2); line-height: var(--lh-h2); }
.card h2 small, .card h2 .sub { margin-left: 6px; color: var(--muted); font-size: var(--fs-small); font-weight: 400; letter-spacing: 0; text-transform: none; }
.card h3 { margin: 16px 0 8px; font-size: var(--fs-h3); font-weight: var(--fw-h3); line-height: var(--lh-h3); }
.card > :last-child { margin-bottom: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
/* "All domains →" style links in a card's header: a quiet pill whose arrow moves on hover. */
.card-link { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 12px; border: 1px solid var(--accent-line); border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink); font-size: var(--fs-small); font-weight: 600; line-height: 1.2; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s; }
.card-link svg { width: 14px; height: 14px; flex: none; transition: transform .4s var(--spring-pop); }
.card-link:hover { background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none; }
.card-link:hover svg { transform: translateX(2px); }
.card-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .card-link, .card-link svg { transition: none; } .card-link:hover svg { transform: none; } }
.card.is-accent { border-color: var(--blue-line); }   /* ringed, not edged */
/* Explaining text, in two tiers and no others.
   Help says what a card or a section is for: small text, muted, and never wider than reads well.
   A hint belongs to one control and sits under it: caption text, muted.
   The classes pages grew of their own (.as-help, .gs-help, .muted-note ...) are these. */
.help, .muted-note, .form-intro, .as-help, .gs-help, .lp-help, .rp-help, .sm-help, .dk-how { max-width: 92ch; color: var(--muted); font-size: var(--fs-small); font-weight: 400; line-height: 1.55; }
.help { margin: 0 0 12px; }
.card-head + :is(.help, .muted-note), h2 + .help { margin-top: -6px; }
.hint, .field-hint, .lab-tip, .tr-hint, .src-help, label > small, .field > small { color: var(--muted); font-size: var(--fs-caption); font-weight: 400; line-height: 1.5; }
.form-intro { margin: -4px 0 12px; }
/* Report review panel (report_view.php): a tinted verdict block, what it means
   for users, then one row of actions with the rarer ones behind ⋯. */
.rv-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.rv-head h2 { margin: 0; }
.rv-status { gap: 6px; font-weight: 600; display: inline-flex; align-items: center; height: var(--chip-h); padding: 0 var(--chip-px); border-radius: 999px; font-size: var(--chip-fs); line-height: 1; white-space: nowrap; }
.rv-status::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ""; }
.rv-status.is-open { background: var(--amber-soft); color: var(--amber); }
.rv-status.is-reviewed { background: var(--green-soft); color: var(--green); }
.rv-status.is-dismissed { background: var(--chip); color: var(--ink-soft); }
/* The verdict: a quiet block; its category is the value's colour and the dot before it, not an edge. */
.rv-verdict { --tone: var(--muted); --tone-soft: var(--surface-soft); padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-soft); }
.rv-verdict.tone-phishing { --tone: var(--phishing); --tone-soft: var(--phishing-soft); }
.rv-verdict.tone-malware { --tone: var(--malware); --tone-soft: var(--malware-soft); }
.rv-verdict.tone-redirect { --tone: var(--redirect); --tone-soft: var(--redirect-soft); }
.rv-verdict.tone-nsfw { --tone: var(--nsfw); --tone-soft: var(--nsfw-soft); }
.rv-verdict.tone-gambling { --tone: var(--gambling); --tone-soft: var(--gambling-soft); }
.rv-verdict.tone-safe { --tone: var(--green); --tone-soft: var(--green-soft); }
.rv-verdict.tone-spam, .rv-verdict.tone-other { --tone: #58585e; --tone-soft: #efeff3; }
.rv-verdict-label { color: var(--muted); font-size: var(--fs-caption); font-weight: 600 }
.rv-verdict-value { margin-top: 2px; color: var(--tone); font-size: var(--fs-figure-sm); font-weight: 700; letter-spacing: -.2px; line-height: 1.25; }
.rv-verdict-value:not(.is-empty)::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: var(--tone); vertical-align: .12em; }
.rv-verdict-value.is-empty { color: var(--muted); font-size: var(--fs-h2); font-weight: 600; }
.rv-verdict-meta { margin-top: 4px; color: var(--ink-soft); font-size: var(--fs-small); }
.rv-verdict-meta strong { font-weight: 600; }
.rv-lines { display: grid; gap: 10px; margin: 14px 0 0; padding: 0; color: var(--ink); font-size: var(--fs-small); line-height: 1.45; list-style: none; }
.rv-lines:empty { display: none; }
.rv-lines li { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.rv-lines li > span { min-width: 0; overflow-wrap: anywhere; }
.rv-lines svg { width: 18px; height: 18px; flex: none; margin-top: 0; color: var(--faint); }
.rv-lines img { width: 18px; height: 18px; flex: none; margin-top: 0; object-fit: contain; }
.rv-lines .is-on svg { color: var(--green); }
.rv-lines .is-off svg { color: var(--amber); }
.rv-sub { display: block; margin-top: 1px; color: var(--muted); font-size: var(--fs-caption); }
.rv-remarks { color: var(--ink-soft); white-space: pre-wrap; }
.rv-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
/* The main action takes the spare width, so the row never wraps the ⋯ onto a line of its own. */
.rv-actions > :first-child { flex: 1 1 auto; min-width: 0; }
.rv-actions > form:first-child button, .rv-actions > button:first-child { width: 100%; }
.rv-actions button { white-space: nowrap; }
.rv-actions .row-menu > summary { min-width: 40px; }
.check-row { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; }
.check-row input { flex: none; margin-top: 3px; }
.check-row small { display: block; margin-top: 2px; }
/* A heading that stands outside the cards, over a group of them: the same on every page, the portal's and the extension's too. */
.section-label, .rv-section { margin: var(--gap-block) 0 var(--gap-pair); color: var(--muted); font-size: var(--fs-small); font-weight: 600; letter-spacing: 0; line-height: 1.4; text-transform: none; }
.section-label:first-child { margin-top: 0; }

/* ---- Stats ------------------------------------------------------------------------ */
/* Figure tiles: the words on the left (.label, .value, .sub), and, when a
   tile has one, a small picture of the figure on the right (.stat-visual:
   sg_stat_gauge() or sg_stat_bars() in lib/ui.php) in the tile's colour
   (--c: blue, or amber / red / green for .warn / .block / .ok). */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; margin-bottom: 20px; }
.stats:has(.stat-visual) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }
/* The grid knows how many tiles it holds, so a row never ends in one lone tile:
   three always go across; five go across on a wide screen and 3 + 2 (the last two wider) on a narrower one;
   six are two rows of three; seven are 4 + 3; eight are two rows of four. */
.stats:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats:has(> :nth-child(5):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stats:has(> :nth-child(5):last-child) > * { grid-column: span 2; }
.stats:has(> :nth-child(5):last-child) > :nth-child(n + 4) { grid-column: span 3; }
@media (min-width: 1360px) {
  .stats:has(> :nth-child(5):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .stats:has(> :nth-child(5):last-child) > *, .stats:has(> :nth-child(5):last-child) > :nth-child(n + 4) { grid-column: auto; }
}
.stats:has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats:has(> :nth-child(7):last-child) { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.stats:has(> :nth-child(7):last-child) > * { grid-column: span 3; }
.stats:has(> :nth-child(7):last-child) > :nth-child(n + 5) { grid-column: span 4; }
.stats:has(> :nth-child(8):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* Narrower, an even count goes two across; five stay 3 + 2 and seven become 2 + 2 + 3, so no row is one tile. */
@media (max-width: 900px) {
  .stats:has(> :nth-child(n + 4):last-child):not(:has(> :nth-child(5):last-child, > :nth-child(7):last-child)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats:has(> :nth-child(n + 4):last-child):not(:has(> :nth-child(5):last-child, > :nth-child(7):last-child)) > * { grid-column: auto; }
  .stats:has(> :nth-child(7):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .stats:has(> :nth-child(7):last-child) > * { grid-column: span 3; }
  .stats:has(> :nth-child(7):last-child) > :nth-child(n + 5) { grid-column: span 2; }
}
@media (max-width: 560px) { .stats:has(> :nth-child(n + 3):last-child) { grid-template-columns: minmax(0, 1fr); } }
.stat { --c: var(--blue); position: relative; display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; align-content: start; column-gap: 14px;
        padding: 16px 18px; border: 1px solid transparent; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.stat > :not(.stat-visual) { grid-column: 1; min-width: 0; }
/* The label has the tile's full width; the picture sits beside the figure and its sub line. */
.stat:has(> .stat-visual) > .label { grid-column: 1 / -1; }
.stat > .stat-visual { grid-column: 2; grid-row: 2 / span 3; align-self: center; }
/* A tile too narrow for its picture beside the words (four across a 1024px window) puts the picture
   under them: side by side the ring squeezed the sub line to "Of 1 accou". The tile is a size
   container, so this follows the tile's own width wherever the grid puts it. */
.stat:has(> .stat-visual) { container-type: inline-size; }
@container (max-width: 160px) {
  .stat > .stat-visual { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 10px; }
}
.stat .label { color: var(--muted); font-size: var(--fs-small); font-weight: 600; letter-spacing: 0; text-transform: none; }
.stat .value { margin-top: 2px; overflow-wrap: break-word; color: var(--ink); font-size: var(--fs-figure); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .value a { color: inherit; }
.stat .value small { color: var(--muted); font-size: var(--fs-body); font-weight: 600; letter-spacing: 0; }
.stat .sub { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: var(--fs-caption); line-height: 1.35; }
/* (the note wraps to a second line beside the ring rather than being cut) */
/* A change pill takes a line of its own in a narrow tile ("Same" then "as last week"); the note under it still shows. */
.stat .sub:has(> .delta) { -webkit-line-clamp: 3; }
.stat.warn { --c: var(--amber); }
.stat.block { --c: var(--red); }
.stat.ok { --c: var(--green); }
.stat.warn .value { color: var(--amber); }
.stat.block .value { color: var(--red); }
.stat.ok .value { color: var(--green); }
a.stat { color: inherit; transition: border-color .15s, box-shadow .15s; }
a.stat:hover { border-color: var(--blue-line); text-decoration: none; }
/* The tile that is the list's current filter sits pressed in, the kit's way of saying "this one is on"
   (a field with focus, a held button): no coloured frame, which read as a bug on a page opened unfiltered. */
.stat[aria-current="true"] { border-color: var(--line); background: var(--surface-soft); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .08); }
:root[data-theme="dark"] .stat[aria-current="true"] { border-color: var(--line); background: rgba(0, 0, 0, .22); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .45); }
/* The period ("7 days") wraps as one piece; the space before it in the markup is its gap, so a wrapped one starts flush. */
.stat .label small { display: inline-block; white-space: nowrap; color: var(--faint); font-size: var(--fs-caption); font-weight: 500; }
.stat .sub .delta { margin-right: 4px; vertical-align: -5px; }
/* The pictures: a gauge (the ring charts' design) with a short figure inside,
   or a row of small bars, tallest wherever it falls, each named in a tooltip. */
.stat-gauge { --gauge: var(--c); position: relative; display: grid; width: 84px; height: 84px; flex: none; place-items: center; }
.stat-gauge .sg-gauge-ticks { display: none; }
.stat-gauge > span { position: relative; display: flex; flex-direction: column; align-items: center; color: var(--ink); font-size: var(--fs-h2); font-weight: 700; line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat-gauge small { margin-top: 4px; color: var(--muted); font-size: var(--fs-micro); font-weight: 600; }
.stat-bars { display: flex; width: 88px; height: 52px; flex: none; align-items: flex-end; gap: 3px; }
.stat-bars > span { min-width: 0; flex: 1; border-radius: 4px 4px 2px 2px; background: var(--c); opacity: .85; }
.stat-bars > span.is-zero { background: var(--line-strong); opacity: .6; }
.stat-bars > span:hover { opacity: 1; }

/* "Needs attention" tiles on the dashboard. */
.attention { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: var(--gap-block); }
.attention-item { display: flex; align-items: center; gap: 14px; padding: 12px 16px; min-height: 64px; border: 1px solid transparent; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: inherit; }
.attention-item:hover { border-color: var(--blue-line); text-decoration: none; }
/* The icon sits bare on the tile, no tinted box behind it; its colour carries the state. */
.attention-icon { display: grid; width: 30px; height: 30px; flex: none; place-items: center; color: var(--muted); }
.attention-icon svg { width: 28px; height: 28px; }
.attention-item.is-due .attention-icon { color: var(--amber); }
.attention-item.is-alert .attention-icon { color: var(--red); }
.attention-copy { min-width: 0; flex: 1; }
.attention-copy strong { display: block; color: var(--ink); font-size: var(--fs-figure); font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.attention-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-small); line-height: 1.3; }
.attention-item .go { width: 18px; height: 18px; color: var(--faint); }

/* Category totals as labelled bars — easier to compare than a ring of slices. */
.cat-bars { display: grid; gap: 12px; }
.cat-bars li { display: grid; grid-template-columns: 92px minmax(0, 1fr) 48px; align-items: center; gap: 10px; }
.cat-bar-track { height: 10px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); box-shadow: inset 0 0 0 1px var(--line); }
.cat-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--faint); }
.cat-bar-fill.phishing { background: #c77a23; }
.cat-bar-fill.malware { background: #c9484c; }
.cat-bar-fill.redirect { background: #4f87ad; }
.cat-bar-fill.nsfw { background: #9175ad; }
.cat-bar-fill.gambling { background: #a88a2f; }
.cat-bar-count { color: var(--ink); font-size: var(--fs-body); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

/* A short feed of recent items (latest user reports). */
.report-feed li { padding: 12px 0; border-top: 1px solid var(--line); }
.report-feed li:first-child { padding-top: 0; border-top: 0; }
.report-feed-head { display: flex; align-items: baseline; gap: 10px; }
.report-feed-subject { min-width: 0; overflow: hidden; color: var(--ink); font-size: var(--fs-body); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.report-feed-subject:hover { color: var(--blue-ink); }
.report-feed-time { flex: none; margin-left: auto; color: var(--muted); font-size: var(--fs-caption); }
.report-feed-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 3px 0 0; color: var(--muted); font-size: var(--fs-small); line-height: 1.45; overflow-wrap: anywhere; }
.report-feed-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; color: var(--muted); font-size: var(--fs-caption); }

/* ---- Tables ------------------------------------------------------------------------ */
.table-wrap { position: relative; margin-bottom: 20px; overflow-x: auto; border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--surface-soft); color: var(--muted); font-size: var(--fs-micro); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
tbody tr:hover { background: #fafafb; }
/* A figure with a line under it in one cell ("24" over "last 4d ago"): two facts about one thing in one
   column, where two columns would make the table wider than its card. */
td.cell-figure strong { display: block; font-weight: 600; }
td.cell-figure small { display: block; color: var(--muted); font-size: var(--fs-caption); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
/* A total row reads as figures, not as another header: body size, ink, a line above it. */
/* A comment the filter refuses, said under the field (user/assets/comment_filter.js and the extension's copy). */
.sg-comment-warning { margin-top: 6px; padding: 7px 10px; border-radius: var(--radius-sm); background: var(--red-soft); color: var(--red); font-size: var(--fs-caption); line-height: 1.45; }
tfoot th { border-top: 1px solid var(--line-strong); border-bottom: 0; background: none; color: var(--ink); font-size: var(--fs-body); font-weight: 600; letter-spacing: 0; text-transform: none; }
/* IP addresses: an address's flags, the worst three and a count of the rest. */
.ip-flags { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; }
.ip-flags .badge { margin: 0; }
.ip-flags-more { cursor: default; }
.ip-pending { color: var(--faint); font-size: var(--fs-micro); font-style: italic; }
td .mono, .mono { font-family: var(--mono); font-size: var(--fs-small); }
td.url { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A table sizes a column by what is in it, not by the cell's max-width: the address's own lines carry the
   limit, narrower on a narrower window, so the table fits at 1280 and the address ends in … (its title has it whole). */
td.url > :is(div, a, span) { display: block; max-width: clamp(180px, 18vw, 320px); overflow: hidden; text-overflow: ellipsis; }
td.note-cell { min-width: 200px; max-width: 300px; }
/* A row's buttons from the column's left edge: the column is as wide as its widest row, so a
   button every row has (Open) stands in one line down the table whether or not a row also has
   its menu (⋯). Aligned to the right, a row without the menu pushed its Open out of line. */
td.actions-cell { width: 1%; white-space: nowrap; text-align: left; }
td.actions-cell .btn-row { flex-wrap: nowrap; justify-content: flex-start; }
/* A card whose content runs edge to edge (a toolbar over a table that spans it). */
.card.is-flush { padding: 0; border: 0; }   /* its contents run to its edge: no unseen border to stop them a pixel short */
.card.is-flush > :is(.table-wrap, .table-scroll):not(:first-child) thead th { border-radius: 0; }   /* a heading row under the card's bar is a straight band */
/* A table inside a card, however the page wrapped it (in a .table-wrap, a .table-scroll, or not at all), sits one
   way: no box of its own inside the card's, and it bleeds 14px into the card's gutter on each side, so its
   header band has room past the text, which still lines up with the card's. (Standing alone on the page, a
   .table-wrap is the card itself and keeps its edge.) */
.card :is(.table-wrap, .table-scroll) { margin-bottom: 0; border: 0; border-radius: 0; box-shadow: none; }
.card:not(.is-flush) > :is(.table-wrap, .table-scroll) { margin-left: -14px; margin-right: -14px; }
/* (A bare table with a header band; one without is a list of facts and keeps the card's own edge.) */
.card:not(.is-flush) > table:has(> thead) { width: calc(100% + 28px); max-width: none; margin-left: -14px; margin-right: -14px; }
.card > table thead th:first-child { border-top-left-radius: var(--radius); }
.card > table thead th:last-child { border-top-right-radius: var(--radius); }
/* One level down, inside a plain fold or a view/edit wrapper (no box or padding of its own), the same. */
.card:not(.is-flush) > :is(details:not([class]), .es-view, div:not([class])) > :is(.table-wrap, .table-scroll) { margin-left: -14px; margin-right: -14px; }
/* A table inside a card that may need to scroll sideways on a narrow screen. */
/* Positioned, so a visually hidden label (.sr-only, absolute) inside a scrolled table
   stays in the box instead of widening the page. */
.table-scroll { position: relative; overflow-x: auto; }
.cell-sub { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-caption); }
.table-empty td, td.empty-cell { padding: 28px 14px; color: var(--muted); text-align: center; }

/* ---- Badges ------------------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: var(--chip-h); padding: 0 var(--chip-px); border-radius: 999px; background: var(--chip); color: var(--ink-soft); font-size: var(--chip-fs); font-weight: var(--chip-fw); line-height: 1; vertical-align: middle; white-space: nowrap; }
.badge.is-clip { display: inline-block; max-width: 100%; overflow: hidden; line-height: var(--chip-h); text-overflow: ellipsis; white-space: nowrap; }
.badge.clean, .badge.safe, .badge.ok { background: var(--green-soft); color: var(--green); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.block, .badge.danger, .badge.err { background: var(--red-soft); color: var(--red); }
.badge.reported { background: var(--violet-soft); color: var(--violet); }
.badge.auto { background: var(--blue-soft); color: var(--blue-ink); }
.badge.manual { background: #fbeff5; color: #963062; }
.badge.muted { background: var(--chip); color: var(--ink-soft); }
.badge.phishing { background: var(--phishing-soft); color: var(--phishing); }
.badge.malware { background: var(--malware-soft); color: var(--malware); }
.badge.redirect { background: var(--redirect-soft); color: var(--redirect); }
.badge.nsfw { background: var(--nsfw-soft); color: var(--nsfw); }
.badge.gambling { background: var(--gambling-soft); color: var(--gambling); }
.badge.spam, .badge.other { background: #efeff3; color: #58585e; }
.badge.tpl-strong { background: var(--red-soft); color: var(--red); }
.badge.tpl-maybe { background: var(--amber-soft); color: var(--amber); }
.badge-stack { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---- Forms ---------------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }   /* a wide child (a robot check) can't widen the form past its card */
.sg-captcha { min-width: 0; max-width: 100%; }
label { display: block; color: var(--ink-soft); font-size: var(--fs-small); font-weight: 600; }
label small { color: var(--muted); font-weight: 400; }
/* date/number are listed too: they sit next to text inputs in every filter bar
   and in the reviewer application, and without them the browser default box is
   a different height and border from the field beside it. */
input:not([type]), input[type=text], input[type=password], input[type=email], input[type=search],
input[type=url], input[type=date], input[type=number], textarea, select {
  width: 100%; min-height: 36px; margin-top: 5px; padding: 7px 10px; text-overflow: ellipsis;   /* a value or a placeholder longer than the field ends in … */
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font-family: inherit; font-size: var(--fs-body); font-weight: 400;
}
input:not([type=checkbox]):not([type=radio]), textarea { transition: border-color .15s, box-shadow .2s, background-color .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(20, 184, 166, .22); }
input::placeholder, textarea::placeholder { color: #8e8e95; }

/* ---- Select ------------------------------------------------------------------
   A select is a raised pill, in the toggle switch's and the segmented
   control's family: a soft white gradient with a highlight along its top and
   a shadow under it, the chevron plain at its right. Its shadow deepens a
   touch under the mouse, it presses down while held and springs back when
   let go, and the chevron flips over as it opens. In Chrome (base-select) the
   list is ours as well: a groove that grows out of the field with a spring,
   each option a row in it, the chosen one on a raised pill with a tick, and a
   translucent pill that slides between the rows under the mouse or the
   keyboard (select.js). The rows are styled as the select's own options (a
   pseudo-element's descendants cannot be selected). Elsewhere the list is
   the browser's own. Reduced
   motion: no movement, the list simply appears. */
/* What the chosen option means, under its select (select.js, an option's data-hint). */
.select-hint { display: block; margin: 6px 0 0; }
.select-hint[hidden] { display: none; }
/* The raised neutral face, a button's (--face, --face-shadow). No border: an input's edge is a
   border, but under a raised face a transparent one left a strip between the face's own light and
   shadow (drawn inside the border) and its outline, which read as a second plate under the select.
   The pixel the border took is padding instead: 36 high, the text where an input's is. */
select:not([multiple]):not([size]) {
  cursor: pointer; border-width: 0; padding: 8px 11px; line-height: 20px;
  background: var(--face); box-shadow: var(--face-shadow);
  transition: box-shadow .25s cubic-bezier(.3, .7, .2, 1), transform .35s var(--spring), background-color .15s;
}
select:not([multiple]):not([size]):not(:disabled):hover { background: var(--face-hover); box-shadow: var(--face-shadow-hover); }
select:not([multiple]):not([size]):not(:disabled):active { transform: scale(.98); box-shadow: var(--face-shadow-press); transition-duration: .1s, .08s, .15s; }
/* Keyboard focus is the ring every control has (a 3px wash of --accent-soft was all but invisible, and in dark it was gone). */
select:not([multiple]):not([size]):focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; box-shadow: var(--face-shadow); }
@supports (appearance: base-select) {
  select:not([multiple]):not([size]), ::picker(select) { appearance: base-select; }
  /* The chosen text is the browser's own box inside the select and cannot be told to clip, so it is
     let wrap (anywhere, so the first line fills) and the select is held to one line. That line is as
     tall as the select's inside (no padding above or below it), so a second line starts exactly where
     the select stops showing: nothing of it, not the top of a tall letter or a Chinese character, can
     peek in under the first. A strip of the select's own face fades the line's end out before the
     chevron, on a select that select.js has found to hold more than it shows (.is-clipped). */
  select:not([multiple]):not([size]) { display: inline-flex; align-items: flex-start; gap: 10px; height: var(--ctl-h); min-height: 0; max-height: var(--ctl-h); padding-top: 0; padding-right: 8px; padding-bottom: 0; line-height: var(--ctl-h); overflow: hidden; white-space: normal; word-break: break-all; }
  /* Never squeezed to its chevron: a floor everywhere, and in a table's cell (where a select's width is
     its own to take, and "100%" of a cell that is as wide as its select means nothing) the width of
     its choice, as select.js measured it (--sel-fit), up to a limit. */
  select:not([multiple]):not([size]) { min-width: 72px; }
  td select:not([multiple]):not([size]):not(.field > select) { width: auto; min-width: clamp(72px, var(--sel-fit, 96px), 240px); }
  select:not([multiple]):not([size]).is-clipped::after { content: ""; order: 1; flex: none; align-self: stretch; width: 28px; margin: 0 -28px 0 -10px; transform: translateX(-28px); background: inherit; -webkit-mask-image: linear-gradient(90deg, transparent, #000 85%); mask-image: linear-gradient(90deg, transparent, #000 85%); pointer-events: none; }
  /* The chevron at the right. */
  select:not([multiple]):not([size])::picker-icon {
    content: ""; order: 2; flex: none; width: 12px; height: 12px; margin-top: calc((1lh - 12px) / 2); margin-left: auto;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='%2356687a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
    transform: scaleY(1); transition: transform .4s var(--spring);
  }
  /* Opening, the chevron flips over (a mirror, so it never passes through a corner). */
  select:not([multiple]):not([size]):open::picker-icon { transform: scaleY(-1); }
  /* The list: a groove, grown out of the field. */
  ::picker(select) {
    box-sizing: border-box; min-width: anchor-size(width); margin: 6px 0; padding: 4px; border: 0; border-radius: 12px;
    background: linear-gradient(180deg, #e2e2e5 0%, #e8e8ee 100%); color: var(--ink);
    box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, .2), inset 0 -1px 1px rgba(255, 255, 255, .5), 0 1px 1px rgba(255, 255, 255, .85), 0 12px 32px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .08);
    transform-origin: top center; opacity: 1; transform: none;
    transition: opacity .16s, transform .5s var(--spring-bounce), display .5s allow-discrete, overlay .5s allow-discrete;
  }
  /* It grows out of the field with a visible spring; it closes quickly, without one. */
  ::picker(select):not(:popover-open) { opacity: 0; transform: translateY(-4px) scale(.97); transition-duration: .14s, .14s, .14s, .14s; transition-timing-function: ease, cubic-bezier(.4, 0, 1, 1); }
  @starting-style { ::picker(select):popover-open { opacity: 0; transform: translateY(-8px) scale(.9); } }
  select:not([multiple]):not([size]) option {
    position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 5px 10px; border-radius: 8px;
    background: transparent; color: var(--ink-soft); font-size: var(--fs-body); font-weight: 500; line-height: 20px; white-space: normal; word-break: normal; overflow-wrap: anywhere; cursor: pointer;
    transition: color .12s, transform .3s var(--spring);
  }
  select:not([multiple]):not([size]) option:hover, select:not([multiple]):not([size]) option:focus-visible { color: var(--ink); outline: none; }
  select:not([multiple]):not([size]) option:active { transform: scale(.98); transition-duration: .12s, .08s; }
  /* The chosen one is a raised pill. */
  select:not([multiple]):not([size]) option:checked {
    color: var(--ink); font-weight: 600;
    background: linear-gradient(180deg, #ffffff 0%, #f5f5f8 100%);
    box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .2), 0 2px 6px rgba(0, 0, 0, .08);
  }
  select:not([multiple]):not([size]) option::checkmark { order: 1; margin-left: auto; color: var(--accent); font-size: var(--fs-caption); }
  select:not([multiple]):not([size]) option:not(:checked)::checkmark { visibility: hidden; }
  select:not([multiple]):not([size]) option:disabled { color: var(--faint); cursor: default; }
  select:not([multiple]):not([size]) optgroup { padding: 4px 0; line-height: 20px; }
  select:not([multiple]):not([size]) optgroup::before, select:not([multiple]):not([size]) option[role=group] > legend { padding: 4px 10px 2px; color: var(--muted); font-size: var(--fs-caption); font-weight: 600; }
  /* The hover pill (select.js): translucent, sliding between the rows. */
  select:not([multiple]):not([size]) > .sel-hover { position: absolute; z-index: 0; top: 0; left: 0; width: 0; height: 0; border-radius: 8px; background: var(--groove-hover); box-shadow: var(--groove-hover-ring); opacity: 0; pointer-events: none; transition: transform .3s var(--spring), width .2s, height .2s, opacity .15s; }
  select:not([multiple]):not([size]) > .sel-hover.is-on { opacity: 1; }
}
:root[data-theme="dark"] select:not([multiple]):not([size])::picker-icon { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='%23c9d2dc' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px 12px no-repeat; }
/* Dark: the select's face is the tokens' dark face (above). */
:root[data-theme="dark"] ::picker(select) { background: linear-gradient(180deg, #19191b 0%, #212123 100%); box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, .55), inset 0 -1px 1px rgba(255, 255, 255, .06), 0 1px 1px rgba(255, 255, 255, .05), 0 12px 32px rgba(0, 0, 0, .55); }
:root[data-theme="dark"] select:not([multiple]):not([size]) option:checked { background: linear-gradient(180deg, #363639 0%, #2d2d30 100%); box-shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3); }
:root[data-theme="dark"] select:not([multiple]):not([size]) > .sel-hover { background: var(--groove-hover); box-shadow: var(--groove-hover-ring); }
@media (prefers-reduced-motion: reduce) {
  select, ::picker(select), select:not([multiple]):not([size]) option, select:not([multiple]):not([size]) > .sel-hover, select::picker-icon { transition: none !important; }
  select:hover, select:active, select:not([multiple]):not([size]) option:active { transform: none !important; }
}

/* The typing fade (input_fade.js) paints an input's own text transparent, and its
   placeholder would inherit that: the placeholder keeps its own colour. */
input::placeholder, textarea::placeholder { -webkit-text-fill-color: currentcolor; }
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox], input[type=radio] { accent-color: var(--check-on, var(--switch-on)); }
.field-hint { display: block; margin-top: 5px; }
/* A row of controls on one line (a toolbar; a search with its filters and its
   button): each sits on the row's centre line, so none carries the gap a field
   has under its label, and a select is as wide as its words. */
.ctl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ctl-row > :is(input, select, textarea, .search-field, .date-field, .num-field, .country-combo, .file-field) { margin-top: 0; }
.ctl-row > select { width: auto; }

/* ---- Buttons ----------------------------------------------------------------------------
   A button is a raised face, the same face as a select's trigger: the things
   you press stand out of the surface, the things you type into are set into
   it. A soft gradient, a hairline of light along the top, a shadow under.
   Under the pointer it comes up a touch and its shadow grows; under the press
   it goes down into the surface and springs back when let go. The page's own
   action wears the brand's teal; the rest (.ghost, a row's buttons) are the
   neutral face; a destructive one the red face. A component's own buttons
   (a class with a hyphen: the number keys, the calendar, the toasts...) keep
   their own faces.
   The settings pages (the extension's, and the portal's Privacy & reporting) write the same buttons
   as .button with .button-primary / .button-secondary / .button-danger / .button-small: those names
   are listed beside .btn, .ghost, .danger and .small in every rule here, so they are these faces and
   not a second set. */
button, .btn, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 15px; border: 0; border-radius: 10px;
  background: linear-gradient(180deg, var(--accent-bright) 0%, var(--accent) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 0 0 .5px rgba(8, 80, 72, .4), 0 1px 2px rgba(8, 80, 72, .3), 0 2px 6px rgba(8, 80, 72, .14); color: #fff;
  font-family: inherit; font-size: var(--fs-body); font-weight: 600; line-height: 1.3;
  cursor: pointer; text-decoration: none; white-space: nowrap; vertical-align: middle;
  transition: box-shadow .25s cubic-bezier(.3, .7, .2, 1), transform .35s var(--spring), filter .15s, color .15s, background-color .15s;
}
/* Under the pointer a face stays where it is and throws no longer shadow: it lights up a little (and press.js plumps it). Pressed, its light sinks. */
button:where(:not(.link):not(.ghost):not([class*="-"])):hover, .btn:where(:not(.ghost):not([class*="-"])):hover, .button:where(:not(.button-secondary):not(:disabled)):hover { color: #fff; text-decoration: none; filter: brightness(1.06); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 0 0 .5px rgba(8, 80, 72, .45), 0 1px 2px rgba(8, 80, 72, .3), 0 2px 6px rgba(8, 80, 72, .14); }
button:where(:not(.link):not([class*="-"]):not(:disabled)):active, .btn:where(:not([class*="-"]):not(:disabled)):active, .button:where(:not(:disabled)):active { filter: brightness(.95); transform: scale(var(--tap)); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .28), 0 0 0 .5px rgba(8, 80, 72, .45); transition-duration: .1s, .08s, .1s, .15s, .15s; }
button:focus-visible, .btn:focus-visible, .button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* A component's own button (a class with a hyphen: .menu-item, .num-key, .date-open, .copyable...) starts bare and draws its own face. */
button:where([class*="-"]:not(.btn):not(.ghost):not(.danger):not(.button):not(.is-busy)) { min-height: 0; padding: 0; border-radius: 0; background: none; box-shadow: none; color: inherit; font-weight: inherit; }
/* The neutral face. */
button.ghost, .btn.ghost, .button-secondary, td button:not(.ghost):not(.link):not(.menu-item), td .btn:not(.ghost) { background: linear-gradient(180deg, #ffffff 0%, #f4f4f7 100%); box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .05), 0 0 0 .5px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06); color: var(--ink-soft); }
td button:not(.ghost):not(.link):not(.menu-item), td .btn:not(.ghost) { color: var(--accent-ink); }
button.ghost:not(:disabled):hover, .btn.ghost:hover, .button-secondary:not(:disabled):hover, td button:not(.ghost):not(.link):not(.menu-item):not(:disabled):hover, td .btn:not(.ghost):hover { color: var(--ink); filter: none; background: linear-gradient(180deg, #ffffff 0%, #f9f9fb 100%); box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .05), 0 0 0 .5px rgba(0, 0, 0, .17), 0 1px 2px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06); }
td button:not(.ghost):not(.link):not(.menu-item):not(:disabled):hover, td .btn:not(.ghost):hover { color: var(--accent); }
button.ghost:not(:disabled):active, .btn.ghost:not(:disabled):active, .button-secondary:not(:disabled):active, td button:not(.ghost):not(.link):not(.menu-item):active, td .btn:not(.ghost):active { box-shadow: inset 0 1px 3px rgba(0, 0, 0, .18), 0 0 0 .5px rgba(0, 0, 0, .14); filter: none; }
/* The red face. */
button.danger, .btn.danger { background: linear-gradient(180deg, #e2655a 0%, var(--red) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 0 0 .5px rgba(120, 30, 24, .4), 0 1px 2px rgba(120, 30, 24, .3), 0 2px 6px rgba(120, 30, 24, .14); color: #fff; }
button.danger:hover, .btn.danger:hover { color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 0 0 .5px rgba(120, 30, 24, .45), 0 1px 2px rgba(120, 30, 24, .3), 0 2px 6px rgba(120, 30, 24, .14); }
button.ghost.danger, .btn.ghost.danger, .button-secondary.button-danger, td button.danger, td .btn.danger { background: linear-gradient(180deg, #ffffff 0%, #f4f4f7 100%); box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .05), 0 0 0 .5px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06); color: var(--red); }
button.ghost.danger:not(:disabled):hover, .btn.ghost.danger:hover, .button-secondary.button-danger:not(:disabled):hover, td button.danger:not(:disabled):hover, td .btn.danger:hover { color: var(--red); box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .05), 0 0 0 .5px rgba(0, 0, 0, .17), 0 1px 2px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06); }
button.small, .btn.small, .button-small { min-height: 28px; padding: 3px 11px; border-radius: 8px; font-size: var(--fs-small); }
.button-block { display: flex; width: 100%; }   /* one that fills its row */
button:disabled, .btn.disabled { cursor: not-allowed; opacity: .55; filter: none; transform: none; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .14); }
button.link { min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--blue-ink); font-weight: 600; }
button.link:hover { background: none; box-shadow: none; filter: none; transform: none; color: var(--blue-hover); text-decoration: underline; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* The press (press.js). A raised face is soft: under the pointer it plumps a
   little where it is; pressed, it squashes, shorter and a touch wider; let go,
   it springs back past its shape and settles. press.js moves `scale` on a real
   spring; which faces have it is said here, with --jelly (0 none, 1 a
   button's; registered, so what is inside a face does not inherit it). A page
   or the extension gives a face of its own the press with `--jelly: 1`.
   Without press.js, or with reduced motion, the press is the small --tap
   scale each :active rule here carries. */
@property --jelly { syntax: "<number>"; inherits: false; initial-value: 0; }
:root { --tap: .97; }
:root.sg-press { --tap: 1; }
button:where(:not([class*="-"])), button:where(.ghost, .danger), .btn, .button,
.num-key, .date-presets button, .date-nav, a.pager-arrow, .sg-totop, .file-key, .card-link, .empty-action,
a.stat, a.outcome, a.kpi, a.attention-item, a.ov-tile, a.uo-tile, a.pn-kpi, a.shared-ip-card, a.dom-chip, a.au-pill, .au-tog, label.choice, label.ln-kind,
:is(.page-links a, .crumb a, .filter-chip, a.pp-chip, .cand-list label, .ln-toc a, .cf-chip, .dk-filters .chip, .au-chip, .rt-chip, .src-chip, .sv-chip, .kw-chip, .vq-chip a, .cp-chip) { --jelly: 1; }
/* Not these: a link written as a button, anything switched off, and the segments, whose pill has its own hand feel. */
button.link, :is(button, .btn, .button, .num-key, .date-nav):disabled, .btn.disabled, .pager-arrow.disabled, [aria-disabled="true"],
:is(.seg, .page-tabs, .view-switch, .rt-tablist, .theme-switch) :is(a, button, label) { --jelly: 0; }
:root[data-theme="dark"] button.ghost, :root[data-theme="dark"] .btn.ghost, :root[data-theme="dark"] .button-secondary, :root[data-theme="dark"] td button:not(.ghost):not(.link):not(.menu-item), :root[data-theme="dark"] td .btn:not(.ghost), :root[data-theme="dark"] button.ghost.danger, :root[data-theme="dark"] .btn.ghost.danger, :root[data-theme="dark"] td button.danger, :root[data-theme="dark"] td .btn.danger { border-color: rgba(255, 255, 255, .09); background: linear-gradient(180deg, #363639 0%, #2d2d30 100%); box-shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3); }
:root[data-theme="dark"] button.ghost:not(:disabled):hover, :root[data-theme="dark"] .btn.ghost:hover, :root[data-theme="dark"] .button-secondary:not(:disabled):hover, :root[data-theme="dark"] td button:not(.ghost):not(.link):not(.menu-item):not(:disabled):hover, :root[data-theme="dark"] td .btn:not(.ghost):hover, :root[data-theme="dark"] button.ghost.danger:not(:disabled):hover, :root[data-theme="dark"] .btn.ghost.danger:hover { border-color: rgba(255, 255, 255, .14); background: linear-gradient(180deg, #3d3d41 0%, #333337 100%); box-shadow: 0 0 0 .5px rgba(255, 255, 255, .08), 0 1px 2px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3); }
:root[data-theme="dark"] button.ghost:not(:disabled):active, :root[data-theme="dark"] .btn.ghost:not(:disabled):active, :root[data-theme="dark"] .button-secondary:not(:disabled):active, :root[data-theme="dark"] td button:not(.ghost):not(.link):not(.menu-item):active { border-color: rgba(255, 255, 255, .07); box-shadow: 0 1px 1px rgba(0, 0, 0, .5); }
:root[data-theme="dark"] button:disabled, :root[data-theme="dark"] .btn.disabled { box-shadow: 0 0 0 .5px rgba(0, 0, 0, .4); }
/* Dark: the red is a vivid one, not the pastel the text red turns. */
:root[data-theme="dark"] button.ghost.danger, :root[data-theme="dark"] .btn.ghost.danger, :root[data-theme="dark"] .button-secondary.button-danger, :root[data-theme="dark"] td button.danger, :root[data-theme="dark"] td .btn.danger, :root[data-theme="dark"] button.ghost.danger:hover, :root[data-theme="dark"] .btn.ghost.danger:hover, :root[data-theme="dark"] .button-secondary.button-danger:not(:disabled):hover { color: #ff5a4f; }
:root[data-theme="dark"] button.danger:not(.ghost), :root[data-theme="dark"] .btn.danger:not(.ghost) { background: linear-gradient(180deg, #ff6b61 0%, #e03a31 100%); color: #fff; }
@media (prefers-reduced-motion: reduce) { button, .btn, .button { transition: color .15s, background-color .15s; } button:where(:not(.link):not([class*="-"])):hover, .btn:where(:not([class*="-"])):hover, button.ghost:hover, .button:hover, .button:active { transform: none; } }
/* Rows of a table come in one after the other, the first twenty; the rest are
   there at once. A flash drops in from above with a little spring. Tiles and
   cards that are links lift under the mouse. */
@keyframes sg-row-in { from { opacity: 0; transform: translateY(4px); } }
tbody tr { animation: sg-row-in .45s var(--spring) backwards; }   /* backwards, not both: a row left with a transform would hold its menu (position: fixed) to itself */
tbody tr:nth-child(2) { animation-delay: 36ms; }
tbody tr:nth-child(3) { animation-delay: 54ms; }
tbody tr:nth-child(4) { animation-delay: 72ms; }
tbody tr:nth-child(5) { animation-delay: 90ms; }
tbody tr:nth-child(6) { animation-delay: 108ms; }
tbody tr:nth-child(7) { animation-delay: 126ms; }
tbody tr:nth-child(8) { animation-delay: 144ms; }
tbody tr:nth-child(9) { animation-delay: 162ms; }
tbody tr:nth-child(10) { animation-delay: 180ms; }
tbody tr:nth-child(11) { animation-delay: 198ms; }
tbody tr:nth-child(12) { animation-delay: 216ms; }
tbody tr:nth-child(13) { animation-delay: 234ms; }
tbody tr:nth-child(14) { animation-delay: 252ms; }
tbody tr:nth-child(15) { animation-delay: 270ms; }
tbody tr:nth-child(16) { animation-delay: 288ms; }
tbody tr:nth-child(17) { animation-delay: 306ms; }
tbody tr:nth-child(18) { animation-delay: 324ms; }
tbody tr:nth-child(19) { animation-delay: 342ms; }
tbody tr:nth-child(20) { animation-delay: 360ms; }
@keyframes sg-flash-in { from { opacity: 0; transform: translateY(-10px); } }
.flash { animation: sg-flash-in .45s var(--spring) both; }
a.stat, .outcome { transition: transform .25s var(--spring), border-color .15s, box-shadow .2s; }
a.stat:active, a.outcome:active { transform: scale(var(--tap)); transition-duration: .08s; }
@media (prefers-reduced-motion: reduce) {
  button, .btn, a.stat, .kpi, .outcome { transition: background-color .15s, border-color .15s, color .15s; transform: none !important; }
  tbody tr, .flash { animation: none; }
}


/* ---- Filter bars ------------------------------------------------------------------------ */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
/* A row where some field carries a note or a slider under its input lines up on its labels, not its bottoms, so the inputs sit level rather than stepping down. */
.filters:has(> .field > small), .filters:has(> .field .slider) { align-items: flex-start; }
.filters:has(> .field > small) > .filter-actions, .filters:has(> .field .slider) > .filter-actions { align-self: flex-start; margin-top: calc(var(--fs-caption) * 1.4 + 4px); }
.card > .filters:last-child, form.card .filters { margin-bottom: 0; }
/* A filter form is a grid: every field a column of the same width and as many columns as fit, so fields line up
   from one row to the next and none keeps a width of its own that leaves a row ragged. A row that is not full
   spreads over the width (auto-fit); the folded "more filters" keep the columns' width instead (auto-fill), so
   they sit under the row above. The search is the wide one: two columns, more in a form of only three or four
   things (where it takes what the others leave), and one in a form whose six things just fill a row.
   This is every .filters that does not save: in a GET form (or being one), or in no form at all (a list
   filtered on the page).
   A form that saves is not a filter form and keeps the free row above. */
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)) { --search-span: 2; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; }
.filters-more :is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)) { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):has(> :nth-child(3):last-child) { --search-span: 4; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):has(> :nth-child(4):last-child) { --search-span: 3; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):has(> :nth-child(6):last-child):not(:has(> [hidden], > .filter-actions > [hidden])) { --search-span: 1; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):has(> .grow ~ .grow) { --search-span: 2; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)) > * { min-width: 0 !important; max-width: none !important; width: auto !important; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)) > .field:is(.grow, :has(input[type=search], input[name="q"])) { grid-column: span var(--search-span); }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)) > .field :is(input, select, .search-field, .date-field, .num-field, .country-combo) { width: 100% !important; min-width: 0 !important; max-width: none !important; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)) > .filter-actions { justify-self: start; }
/* Buttons a script has put away (a list that filters as it is typed) leave no empty column behind. */
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)) > .filter-actions:not(:has(> :not([hidden]))) { display: none; }
@media (max-width: 760px) { :is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)) { --search-span: 2 !important; } }
@media (max-width: 400px) { :is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)) { --search-span: 1 !important; } }
/* How many tracks, and how wide the search: worked out, not guessed. The bar's card measures itself (a
   container), which tells the bar how many 160px tracks fit (--cols); the bar counts its own cells (--n).
   The field that can grow (the search, or the first field where there is none) then takes exactly the
   tracks that make the last row full: 1 + (cols - n mod cols) mod cols. So at any width every row ends
   at the bar's right edge and the Filter button is never left on a row of its own. Without container
   queries or mod() the rules above stand. */
.card:has(> .filters), form:has(> .filters) { container: filters / inline-size; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):not(.filters-more *) { --cols: 1; --n: 1; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):has(> :nth-child(2):last-child) { --n: 2; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):has(> :nth-child(3):last-child) { --n: 3; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):has(> :nth-child(4):last-child) { --n: 4; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):has(> :nth-child(5):last-child) { --n: 5; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):has(> :nth-child(6):last-child) { --n: 6; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):has(> :nth-child(7):last-child) { --n: 7; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):has(> :nth-child(8):last-child) { --n: 8; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):has(> :nth-child(9):last-child) { --n: 9; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):has(> :nth-child(10):last-child) { --n: 10; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):has(> :nth-child(11):last-child) { --n: 11; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):has(> :nth-child(12):last-child) { --n: 12; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):has(> :nth-child(13):last-child) { --n: 13; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):has(> :nth-child(14):last-child) { --n: 14; }
:is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):has(> .grow ~ .grow) { --n-extra: 1; }
@container filters (min-width: 332px) { :is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):not(.filters-more *) { --cols: 2; } }
@container filters (min-width: 504px) { :is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):not(.filters-more *) { --cols: 3; } }
@container filters (min-width: 676px) { :is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):not(.filters-more *) { --cols: 4; } }
@container filters (min-width: 848px) { :is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):not(.filters-more *) { --cols: 5; } }
@container filters (min-width: 1020px) { :is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):not(.filters-more *) { --cols: 6; } }
@container filters (min-width: 1192px) { :is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):not(.filters-more *) { --cols: 7; } }
@container filters (min-width: 1364px) { :is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):not(.filters-more *) { --cols: 8; } }
@supports (width: calc(1px * mod(5, 3))) {
  @container filters (min-width: 0) {
    :is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):not(.filters-more *) { --slack: calc(1 + mod(var(--cols) - mod(var(--n) + var(--n-extra, 0), var(--cols)), var(--cols))); grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-flow: dense; }   /* dense: a wide search that will not fit beside what came before it does not leave a hole */
    :is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):not(.filters-more *) > .field:is(.grow, :has(input[type=search], input[name="q"])) { grid-column: span var(--slack); }
    :is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):not(.filters-more *) > .field:is(.grow, :has(input[type=search], input[name="q"])) ~ .field:is(.grow, :has(input[type=search], input[name="q"])) { grid-column: span min(2, var(--cols)); }
    :is(form:not([method="post" i]) .filters, form.filters:not([method="post" i]), .filters:not(form, form .filters)):not(.filters-more *):not(:has(> .field:is(.grow, :has(input[type=search], input[name="q"])))) > :first-child { grid-column: span var(--slack); }
  }
}
.filters .field { display: flex; min-width: 150px; flex-direction: column; }
.filters .field label { color: var(--muted); font-size: var(--fs-caption); font-weight: 600; letter-spacing: 0; text-transform: none; }
.filters .field.grow { min-width: 220px; flex: 1; }
.filters .filter-actions { display: flex; align-items: center; gap: 8px; padding-bottom: 1px; }
/* A card that is only a filter bar is tighter; a form with a heading is a card like any other. */
form.card:has(> .filters):not(:has(> h2)) { padding: 16px 18px; }
/* Less-used filters fold away; the summary says how many are in use. The
   bar below the primary fields holds that toggle on the left and the Filter /
   Reset buttons on the right, so the buttons never wrap onto a line alone. */
.filters-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 12px; }
.filters-bar .filters-more { min-width: 0; flex: 1; }
.filters-more { width: 100%; }
.filters-more > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; color: var(--blue); cursor: pointer; font-size: var(--fs-small); font-weight: 600; list-style: none; }
.filters-more > summary::-webkit-details-marker { display: none; }
.filters-more > summary::before { content: "+"; font-weight: 700; }
.filters-more[open] > summary::before { content: "−"; }
.filters-more > .filters { margin: 12px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); }

/* ---- Pagination -------------------------------------------------------------------------- */
/* Pagers (sg_pager()): the summary on the left, then an arrow, the page
   numbers in a groove (a .seg, whose pill slides to the page taken), and an
   arrow. The arrows light up under the pointer and give under the press (press.js). */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.pager-summary { margin-right: auto; color: var(--muted); font-size: var(--fs-small); }
.pager-arrow { display: inline-grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink-soft); transition: border-color .15s, background .15s, color .15s, transform .4s var(--spring), box-shadow .15s; }
.pager-arrow svg { width: 15px; height: 15px; }
a.pager-arrow:hover { border-color: var(--blue-line); background: var(--blue-soft); color: var(--blue); text-decoration: none; }
a.pager-arrow:active { transform: scale(var(--tap)); transition-duration: .08s; }
.pager-arrow.disabled { opacity: .4; }
.pager-pages { overflow: visible; }
.pager-pages a { min-width: 30px; padding: 4px 8px; text-align: center; font-variant-numeric: tabular-nums; }
.pager-gap { align-self: center; padding: 0 2px; color: var(--faint); font-size: var(--fs-small); }
@media (prefers-reduced-motion: reduce) { .pager-arrow { transition: none; } }

/* ---- Messages ------------------------------------------------------------------------------ */
.flash { margin-bottom: 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--ink-soft); font-size: var(--fs-body); }
.flash.ok { border-color: var(--green-line); background: var(--green-soft); color: var(--green); }
.flash.err { border-color: var(--red-line); background: var(--red-soft); color: var(--red); }
.flash.warn { border-color: var(--amber-line); background: var(--amber-soft); color: var(--amber); }
.flash.info { border-color: var(--blue-line); background: var(--blue-soft); color: var(--blue-ink); }
.callout { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--ink-soft); font-size: var(--fs-small); }
.callout.warn { border-left-color: var(--amber); background: var(--amber-soft); color: #6b3f04; }
.callout.info { border-left-color: var(--blue); background: var(--blue-soft); color: var(--blue-ink); }
.callout.danger { border-left-color: var(--red); background: var(--red-soft); color: #8a2a2e; }
.empty { padding: 28px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); color: var(--muted); text-align: center; }
/* One line at the top of a detail page saying where the item stands. */
.status-banner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0 0 20px; padding: 12px 16px; border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius-sm); background: var(--surface); }
.status-banner strong { font-size: var(--fs-h3); }
.status-banner span { color: var(--ink-soft); font-size: var(--fs-body); }
.status-banner.ok { border-color: var(--green-line); border-left-color: var(--green); background: var(--green-soft); }
.status-banner.ok strong { color: var(--green); }
.status-banner.warn { border-color: var(--amber-line); border-left-color: var(--amber); background: var(--amber-soft); }
.status-banner.warn strong { color: var(--amber); }
.status-banner.danger { border-color: var(--red-line); border-left-color: var(--red); background: var(--red-soft); }
.status-banner.danger strong { color: var(--red); }
.status-banner.muted { border-left-color: var(--faint); }
/* A banner that carries more than its line: the summary is the line, and what it opens is the rest. A form on the right of the line is its action. */
.status-banner > form { margin-left: auto; }
details.status-banner { display: block; }
details.status-banner > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; cursor: pointer; list-style: none; }
details.status-banner > summary::-webkit-details-marker { display: none; }
details.status-banner > summary::after { margin-left: auto; align-self: center; color: var(--muted); font-size: var(--fs-caption); content: "▾"; transition: transform .45s var(--spring-bounce); }
details.status-banner:not([open]) > summary::after { transform: rotate(-90deg); }
details.status-banner > summary > form { margin-left: 0; }
.status-banner-body { margin-top: 8px; color: var(--ink-soft); font-size: var(--fs-small); }
.status-banner-body p { margin: 0 0 6px; }

/* ---- Login page ----------------------------------------------------------------------------- */
.center-card { max-width: 380px; margin: 80px auto; }
.center-card .card { padding: 26px; }
.center-card h1 { margin: 0 0 18px; font-size: var(--fs-figure-sm); text-align: center; }
.center-card .brand-dot { display: block; width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 12px; background: var(--blue); }

/* ---- Detail layouts ------------------------------------------------------------------------- */
/* Two equal columns, e.g. a pair of short forms. */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.grid-2 > .card { margin-bottom: 20px; }
@media (max-width: 1080px) { .grid-2 { grid-template-columns: minmax(0, 1fr); gap: 0; } }
/* A tile per item, for short lists that need actions per item. */
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 14px; }
.device-tile { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.device-tile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.device-tile-head strong { display: block; font-size: var(--fs-h3); }
.device-tile dl.kv { margin: 0; }
.rename-row { display: flex; align-items: center; gap: 6px; }
.rename-row input { min-height: 30px; margin: 0; padding: 4px 9px; font-size: var(--fs-small); }
.ml-auto { margin-left: auto !important; }
/* Content-sized tracks on purpose: a wide table in the main column takes room
   from the side column instead of scrolling inside its card. */
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1080px) { .split { grid-template-columns: minmax(0, 1fr); } }
/* Columns, and the cards stacked in them, may shrink below their widest content,
   so one wide control can't widen the page. */
.split > *, .split > * > .card { min-width: 0; }
/* A side column with nothing in it (its cards are all conditional) gives its room back. */
.split:not(:has(> :last-child > *)) { grid-template-columns: minmax(0, 1fr); }
/* Label/value lists: no rules between rows, the spacing and the muted label do the separating. */
dl.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px 20px; margin: 0; font-size: var(--fs-body); line-height: 1.5; }
dl.kv > dt, dl.kv > dd { margin: 0; padding: 0; }
dl.kv > dt { color: var(--muted); font-size: var(--fs-small); line-height: 20px; }
dl.kv > dd { min-width: 0; word-break: break-word; }
dl.kv .mono { font-size: var(--fs-small); }
dl.kv .kv-sub, .kv-sub { color: var(--muted); font-size: var(--fs-caption); }
dl.kv dd > .kv-sub:not(span) { margin-top: 2px; }
@media (max-width: 560px) { dl.kv { grid-template-columns: minmax(0, 1fr); gap: 0; } dl.kv > dd { margin-bottom: 12px; } dl.kv > dd:last-child { margin-bottom: 0; } }
.chart-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 1080px) { .chart-row { grid-template-columns: minmax(0, 1fr); } }
canvas { max-width: 100%; }
.chart-box { position: relative; height: 260px; }

/* ---- Dashboard charts (index.php, drawn by assets/charts.js) -------------------- */
/* Series colours, checked for colour-blind separation. The accent carries the
   current period, a grey dashed line the one before; amber and red are the
   warn and block outcomes everywhere. */
:root {
  --series-1: var(--accent);
  --series-prev: #a1a1ab;
  --series-clean: #2f9a6e;
  --series-warn: #d4922a;
  --series-block: #c2383e;
  --series-report: #7c63c4;
}
.dash-filter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: var(--gap-block) 0 var(--gap-pair); }
.dash-filter .section-label { margin: 0; }
/* A bar wider than its row (long labels, big counts, a phone) scrolls inside itself. */
/* A row of choices (.seg), and the same row as a page's tabs under its title (.page-tabs): one track, one pill.
   A segment is a link (a page), a button (a view of this one: aria-pressed,
   or aria-selected on a tab) or a radio button in a label (a choice in a
   form); the three look and move alike. */
.seg, .page-tabs { display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; gap: 2px; padding: 2px; border-radius: 10px; background: var(--fill-strong); }
/* A row too long for its place scrolls, with no scrollbar to say so: its edges fade where there is more
   to scroll to. The fade follows the scroll (a scroll-driven animation of two lengths), and a row that
   fits has no scroll timeline, so no fade. */
@property --seg-fade-l { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --seg-fade-r { syntax: "<length>"; inherits: false; initial-value: 0px; }
@keyframes sg-seg-fade { from { --seg-fade-l: 0px; --seg-fade-r: 28px; } to { --seg-fade-l: 28px; --seg-fade-r: 0px; } }
@supports (animation-timeline: scroll()) {
  .seg, .page-tabs { animation: sg-seg-fade linear both; animation-timeline: scroll(self inline); -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--seg-fade-l), #000 calc(100% - var(--seg-fade-r)), transparent); mask-image: linear-gradient(90deg, transparent, #000 var(--seg-fade-l), #000 calc(100% - var(--seg-fade-r)), transparent); }
}
.seg::-webkit-scrollbar, .page-tabs::-webkit-scrollbar { display: none; }
.seg[hidden] { display: none; }
.page-tabs { display: flex; width: fit-content; margin: calc(var(--gap-in) - var(--gap-block)) 0 var(--gap-block); }
.seg a, .page-tabs a, .seg > button, .seg > label > span { flex: none; padding: 4px 12px; border-radius: 8px; color: var(--ink-soft); font-size: var(--fs-small); font-weight: 600; line-height: 1.5; text-decoration: none; white-space: nowrap; }
.seg > button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 0; border: 0; background: none; box-shadow: none; }
.seg > button:is(:hover, :active) { filter: none; transform: none; box-shadow: none; }
.seg > label { position: relative; display: block; flex: none; margin: 0; color: inherit; font-size: inherit; font-weight: inherit; cursor: pointer; }
.seg > label > span { display: block; }
/* The radio itself lies unseen over its segment, so the keyboard and the form have it. */
.seg > label > input[type=radio] { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; min-width: 0; min-height: 0; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; background: none; box-shadow: none; opacity: 0; cursor: pointer; }
.seg > label:has(> input:disabled) { opacity: .45; cursor: not-allowed; }
.seg > label > input:disabled { cursor: not-allowed; }
.seg > label > input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg a:hover, .page-tabs a:hover, .seg > button:not(:disabled):hover, .seg > label:not(:has(> input:disabled)):hover > span { background: var(--hover); text-decoration: none; }
.seg a[aria-current], .page-tabs a[aria-current], .seg > button:is([aria-pressed="true"], [aria-selected="true"]), .seg > label > input:checked + span { background: var(--seg-on); box-shadow: var(--pill-shadow); color: var(--ink); }
/* A row that fills its place (a narrow panel's filter): the segments share the width, each as wide as its words ask and no narrower than its longest. */
/* A row that fills its place (a narrow panel's filter): the segments share the
   width, each as wide as its words ask. Where they cannot all have that, the
   words wrap at their spaces, on lines set closer than a paragraph's. */
.seg.is-fill { display: flex; }
/* A row that fills its place gives each segment its words' width and an equal share of what is left,
   so the gaps between the answers are even (equal cells left "Safe" adrift in a wide one and pressed
   "Uncertain" to the edge), as the language switch's are. */
.seg.is-fill > :is(a, button, label) { display: flex; flex: 1 1 auto; min-width: 0; }
.seg.is-fill > :is(a, button), .seg.is-fill > label > span { display: flex; flex: 1 1 auto; align-items: center; justify-content: center; min-height: calc(1.5em + 8px); padding-inline: 6px; line-height: 1.25; text-align: center; white-space: normal; }
.seg > :is(a, button, label)[hidden] { display: none; }
/* With seg.js (.has-pill): the row is a groove, in the toggle switch's style,
   and one raised pill (.seg-pill) slides between the segments. Held and
   dragged it lifts (.is-lifted) and settles again when let go; the pill's
   movement is seg.js's, the rest is here. A segment's words darken as the
   pill comes over them (--near, 0 to 1, from seg.js). Across a page load the
   pill slides from where it was (view-transition-name, set by seg.js). */
:is(.seg, .page-tabs, .view-switch, .rt-tablist).has-pill {
  position: relative; isolation: isolate;
  background: linear-gradient(180deg, #dedee2 0%, #e6e6eb 100%);
  box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, .2), inset 0 -1px 1px rgba(255, 255, 255, .5), 0 1px 1px rgba(255, 255, 255, .85);
  transition: box-shadow .2s;
}
:is(.seg, .page-tabs, .view-switch, .rt-tablist).has-pill.is-pressed { box-shadow: inset 0 2px 4px rgba(0, 0, 0, .28), inset 0 -1px 1px rgba(255, 255, 255, .4), 0 1px 1px rgba(255, 255, 255, .85); }
.seg-pill {
  position: absolute; top: 0; left: 0; z-index: 0; height: 24px; border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f5f8 100%);
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .2), 0 2px 6px rgba(0, 0, 0, .08);
  transform-origin: center; pointer-events: none;
  transition: box-shadow .25s cubic-bezier(.3, .7, .2, 1);
}
.is-lifted .seg-pill { box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .06), 0 4px 10px rgba(0, 0, 0, .22), 0 10px 24px rgba(0, 0, 0, .14); }
:is(.seg, .page-tabs, .view-switch, .rt-tablist).has-pill > :is(a, button), .sgo .page-tabs.has-pill > a, .seg.has-pill > label > span { position: relative; z-index: 1; background: transparent !important; box-shadow: none !important; color: color-mix(in oklab, var(--ink-soft), var(--ink) calc(var(--near, 0) * 100%)); cursor: pointer; transition: color .15s; }
.seg.has-pill > label { z-index: 1; }
:is(.seg, .page-tabs).has-pill > a[aria-current], .sgo .page-tabs.has-pill > a[aria-current], .card .view-switch.has-pill > button[aria-pressed="true"], .seg.has-pill > button:is([aria-pressed="true"], [aria-selected="true"]), .rt-tablist.has-pill > button[aria-selected="true"], .seg.has-pill > label > input:checked + span { color: var(--ink); }
:is(.seg, .page-tabs, .view-switch, .rt-tablist).has-pill.is-live > :is(a, button), .seg.has-pill.is-live > label > span { transition: none; }
/* A question not answered yet: the pill is a round bead resting in the middle
   of the row, between the answers (seg.js sizes and moves it); under the
   pointer it grows into the segment there, and a tap or a drag answers. */
.has-pill > .seg-pill { transition: box-shadow .25s cubic-bezier(.3, .7, .2, 1), opacity .18s; }
/* A question not answered yet has no pill: the first answer brings it up under that segment. */
.has-pill.is-unset > .seg-pill { opacity: 0; }
.rt-tablist.has-pill > button { border-bottom-color: transparent !important; }
:is(.seg, .page-tabs, .view-switch, .rt-tablist).has-pill.is-pressed { cursor: grabbing; }
::view-transition-group(*) { animation-duration: .45s; animation-timing-function: var(--spring); }
:root.theme-switching .seg-pill { view-transition-name: none !important; }
@media (prefers-reduced-motion: reduce) { .seg-pill { transition: none; } }

.dash-hero { padding: 20px 22px; }
.dash-hero-top { display: grid; grid-template-columns: minmax(200px, 250px) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.dash-hero-figure { display: flex; flex-direction: column; min-width: 0; }
.hero-value { margin: auto 0 8px; padding-top: 8px; color: var(--ink); font-size: var(--fs-display); font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.hero-delta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--muted); font-size: var(--fs-small); }
.delta { gap: 3px; font-weight: 600; display: inline-flex; align-items: center; height: var(--pill-h); padding: 0 10px; border-radius: 999px; font-size: var(--fs-small); line-height: 1; white-space: nowrap; }
.delta span { font-size: var(--fs-micro); line-height: 1; }
.delta.is-good { background: var(--green-soft); color: var(--green); }
.delta.is-bad { background: var(--red-soft); color: var(--red); }
.delta.is-flat { background: var(--surface-soft); color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 16px 0 0; padding: 0; color: var(--ink-soft); font-size: var(--fs-small); list-style: none; }
.card-head .legend { margin: 0; }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.key { width: 16px; flex: none; border-top: 2px solid var(--c); }
.key.dashed { border-top-style: dashed; }
.key.box { align-self: center; width: 10px; height: 10px; border: 0; border-radius: 4px; background: var(--c); }
.dash-hero-chart { min-width: 0; }

.outcomes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.outcome { --c: var(--series-1); display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-left: 12px; border-left: 1px solid var(--line); color: inherit; }   /* its colour is its icon's and its bar's, not an edge */
.outcome:hover { text-decoration: none; }
.outcome:hover strong { color: var(--accent-ink); }
.outcome.is-clean { --c: var(--series-clean); }
.outcome.is-warn { --c: var(--series-warn); }
.outcome.is-block { --c: var(--series-block); }
.outcome.is-report { --c: var(--series-report); }
.outcome-head { display: flex; align-items: center; gap: 8px; }
.outcome-head strong { color: var(--ink); font-size: var(--fs-figure-sm); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.outcome-icon { display: grid; width: 16px; height: 16px; place-items: center; color: var(--c); }
.outcome-icon svg { width: 16px; height: 16px; }
.outcome-label { color: var(--muted); font-size: var(--fs-small); }
.outcome-share { color: var(--faint); }
.outcome-bar { display: block; height: 6px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
.outcome-bar span { display: block; height: 100%; border-radius: 999px; background: var(--c); }
/* Drawing in (reveal.js): bars grow from the left or up from the floor, the
   spark's end dot pops from its centre. */
.outcome-bar > span, .surface-bar, .conf-meter-fill, .host-bar-track > span, .cat-bar-fill, .spv-bar > span, .spv-bar > .is-dest,
.conf-split, .sf-calc-bar > span, .calc-stack, .sg-prog-fill, .rep-bar, .sf-cat-fill, .mk-track > span { transform-origin: left center; }
.stat-bars > span, .daily-fill, .au-bar-fill, .rp-bar, .rv-bar { transform-origin: center bottom; }
.spark-dot.is-popped { transform-box: fill-box; transform-origin: 50% 50%; }

.card-figure { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.card-figure strong { color: var(--ink); font-size: var(--fs-figure); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.card-head > div > h2 { margin: 0; }
/* A title with its note under it takes the room that is left, and the note wraps there: the switch or
   button beside it stays on the title's line instead of dropping under a long note. */
.card-head > div:first-child:has(> h2) { flex: 1 1 240px; min-width: 0; }
.chart-area { min-width: 0; }
.chart-row > .card { display: flex; flex-direction: column; }
.chart-row > .card > .chart-area { flex: 1; }
.chart-row.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1080px) { .chart-row.even { grid-template-columns: minmax(0, 1fr); } }
.legend-top { margin: -4px 0 4px; }
.key.dot { width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--c); }

/* Top flagged hosts: each host's flags as a bar, its blocked part in red. */
.host-bar-track { display: block; width: 100%; height: 6px; overflow: hidden; border-radius: 4px; background: var(--surface-soft); }
.host-bar-track > span { position: relative; display: block; height: 100%; overflow: hidden; border-radius: 4px; background: var(--series-warn); }
.host-bar-track i { position: absolute; inset: 0 auto 0 0; background: var(--series-block); }

.host-list { display: flex; flex: 1 1 auto; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.host-list li { display: grid; flex: 1 1 auto; align-content: center; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.host-list li:first-child { padding-top: 0; border-top: 0; }
.host-list-top { display: flex; align-items: baseline; gap: 12px; }
.host-list-name { min-width: 0; overflow: hidden; color: var(--ink); font-size: var(--fs-body); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.host-list-name:hover { color: var(--blue-ink); }
.host-list-n { margin-left: auto; font-size: var(--fs-body); font-weight: 600; font-variant-numeric: tabular-nums; }
.host-list-meta { display: flex; gap: 14px; color: var(--muted); font-size: var(--fs-caption); }
.host-list-meta a { margin-left: auto; }

/* Dashboard: "Top flagged hosts" beside "Latest user reports". Both cards take
   the height of the taller one; the hosts table spreads its rows over that
   height (cells centred) and the legend sits on the card's bottom edge. */
.dash-pair { align-items: stretch; }
.dash-pair > .card { display: flex; flex-direction: column; }
.host-card-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-caption); }
.host-card-note { margin-left: auto; color: var(--faint); }

/* phone_number_view.php: the number, then what users see, the verdict, details. */
.pv-head { margin: 0 0 20px; }
.pv-number { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0; color: var(--ink); font-size: var(--fs-figure); font-weight: 700; letter-spacing: -.02em; }
.pv-number .mono { font-size: var(--fs-figure); font-weight: 700; }
.pv-number .badge { font-size: var(--fs-small); letter-spacing: 0; }
.pv-tags, .pv-said { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.pv-said { margin: -4px 0 14px; }
.pv-tag { gap: 5px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-weight: 600; display: inline-flex; align-items: center; min-height: var(--chip-h-lg); padding: 0 var(--chip-px-lg) 0 var(--chip-px-lg); border-radius: 999px; font-size: var(--chip-fs-lg); line-height: 1.2; white-space: nowrap; }
.pv-tag b { color: var(--ink); }
.pv-tag.is-ok { border-color: var(--green-line); background: var(--green-soft); color: var(--green); }
.pv-tag.is-warn { border-color: var(--amber-line); background: var(--amber-soft); color: var(--amber); }
/* Tags: one report's suggestions, and the admin's pick of what users see. */
.pv-entry-tags { margin: 0 0 6px; }
#tags-form .pv-tag { cursor: pointer; }
#tags-form .pv-tag input { margin: 0; }
.pv-card-name { color: var(--ink); }
.pv-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 10px 0 0; color: var(--muted); font-size: var(--fs-small); }
.pv-meta b { color: var(--ink-soft); font-weight: 600; }
.pv-preview-box { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--tone-soft, var(--surface-soft)); font-size: var(--fs-small); }
.pv-tone-scam { --tone: var(--red); --tone-soft: var(--red-soft); }
.pv-tone-reported { --tone: var(--amber); --tone-soft: var(--amber-soft); }
.pv-tone-safe { --tone: var(--green); --tone-soft: var(--green-soft); }
.pv-preview-verdict { display: block; color: var(--ink); font-size: var(--fs-body); font-weight: 600; }
.pv-preview-box p { margin: 6px 0 0; color: var(--ink-soft); }
.pv-address { white-space: pre-line; }
.pv-edit { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.pv-delete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-small); }

/* Semak Mule readings on phone_number_view.php. */
.pv-change { margin-top: 6px; color: var(--muted); font-size: var(--fs-caption); font-weight: 600; }
.pv-change.is-up { color: var(--red); }
.pv-history { margin-top: 4px; }
.pv-history-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; }
.pv-history-head h3 { margin: 0; font-size: var(--fs-body); font-weight: 600; }
.pv-history-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.pv-chart[hidden] { display: none; }
.pv-none-yet { margin: 0; color: var(--muted); font-size: var(--fs-small); }

.kpi-sub { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-small); }

/* Country flags: the dashboard's own images (icons/flags/, sg_country_flag_html()). */
.flag-icon, .ip-flag-img { display: inline-block; width: 20px; height: 15px; flex: none; object-fit: contain; vertical-align: -2px; }
.flag-icon.is-emoji { width: auto; height: auto; }

/* A value that copies itself when clicked (sg_copyable()). */
.copyable { position: relative; display: inline-flex; min-height: 0; max-width: 100%; align-items: center; gap: 6px; margin: -2px -6px; padding: 2px 6px; border: 0; border-radius: 6px; background: none; box-shadow: none; color: inherit; cursor: copy; font: inherit; letter-spacing: inherit; text-align: left; }
.copyable-text { min-width: 0; overflow-wrap: anywhere; }
.copyable:hover, .copyable:focus-visible { background: var(--accent-soft); color: inherit; }
.copyable svg, .copyable img { width: .72em; height: .72em; flex: none; color: var(--accent); opacity: 0; transition: opacity .15s; }
.copyable img { object-fit: contain; }
.copyable:hover .copyable-icon, .copyable:focus-visible .copyable-icon { opacity: 1; }
.copyable-done { display: none; }
.copyable.is-copied .copyable-icon { display: none; }
.copyable.is-copied .copyable-done { display: block; opacity: 1; color: var(--green); }
.copyable::after { position: absolute; bottom: calc(100% + 6px); left: 50%; padding: 3px 8px; border-radius: 6px; background: var(--ink); color: #fff; content: "Copied"; font: 600 12px/1.4 var(--font); letter-spacing: 0; opacity: 0; pointer-events: none; transform: translate(-50%, 3px) scale(.92); transition: opacity .15s, transform .4s var(--spring-pop); white-space: nowrap; }
.copyable.is-copied::after { opacity: 1; transform: translate(-50%, 0); }

/* Chart / Table switch at a chart card's top right. */
.view-switch { display: inline-flex; flex: none; gap: 2px; padding: 2px; border-radius: 8px; background: var(--fill-strong); }
.view-switch[hidden] { display: none; }
.card .view-switch button { min-height: 0; padding: 3px 11px; border: 0; border-radius: 6px; background: none; box-shadow: none; color: var(--ink-soft); font-size: var(--fs-small); font-weight: 600; }
.card .view-switch button:hover { background: var(--hover); color: var(--ink); }
.card .view-switch button[aria-pressed="true"] { background: var(--seg-on); box-shadow: var(--pill-shadow); color: var(--ink); }
.card-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
[data-view="chart"] [data-chart-table], [data-view="table"] [data-view-part="chart"] { display: none; }
.chart-table { min-width: 0; }
.chart-table .table-scroll { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.dash-hero .chart-table .table-scroll { max-height: 230px; }
.chart-table table { font-size: var(--fs-small); }
.chart-table th { position: sticky; top: 0; z-index: 1; background: var(--surface-soft); white-space: nowrap; }
.chart-table th, .chart-table td { padding: 7px 12px; white-space: nowrap; }
.card[data-view="table"] .chart-table { flex: 1; }

/* The charts themselves. */
.sgc { position: relative; min-width: 0; touch-action: pan-y; }
.sgc svg { display: block; overflow: visible; }
/* Drawing in (charts.js): hidden until on screen, then columns rise from the
   baseline, dots pop from their centre, and the pen runs ahead of a line. */
.sgc-pending svg { visibility: hidden; }
.sgc-bar { transform-box: fill-box; transform-origin: 50% 100%; }
.sgc-pop { transform-box: fill-box; transform-origin: 50% 50%; }
.sgc-pen { stroke: var(--surface); stroke-width: 2; filter: drop-shadow(0 0 3px rgba(0, 0, 0, .35)); }
.sgc svg:focus { outline: 0; }
.sgc svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.sgc-grid line { stroke: #ebebef; stroke-width: 1; shape-rendering: crispEdges; }
.sgc-grid text { fill: var(--faint); font-size: var(--fs-micro); font-variant-numeric: tabular-nums; }
/* The crosshair, its dots and the tooltip glide between days; the first move
   after a rest just lands (.sgc-idle). */
.sgc-cross { stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 2 3; transition: transform .14s cubic-bezier(.3, .7, .2, 1); }
.sgc-dot { stroke: var(--surface); stroke-width: 2; transition: transform .14s cubic-bezier(.3, .7, .2, 1); }
.sgc-idle .sgc-cross, .sgc-idle .sgc-dot, .sgc-idle .sgc-tip { transition: none; }
.sgc-ref { stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 4 4; opacity: .55; }
.sgc-ref-label { fill: var(--muted); font-size: var(--fs-micro); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.sgc-tip { position: absolute; z-index: 5; min-width: 150px; padding: 9px 11px; border-radius: 10px; background: var(--surface); box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .14); pointer-events: none; white-space: nowrap; transition: left .14s cubic-bezier(.3, .7, .2, 1), top .14s cubic-bezier(.3, .7, .2, 1); }
.sgc-tip-date { margin-bottom: 5px; color: var(--ink); font-size: var(--fs-caption); font-weight: 600; }
.sgc-tip-row { display: flex; align-items: center; gap: 7px; font-size: var(--fs-small); line-height: 1.7; }
.sgc-tip-row strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.sgc-tip-name { color: var(--muted); }
.sgc-slice { stroke: var(--surface); stroke-width: 2; transition: opacity .15s; }
.sgc-donut svg:hover .sgc-slice:not(:hover) { opacity: .45; }
.sgc-leader { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.sgc-label { fill: var(--ink-soft); font-size: var(--fs-caption); }
.sgc-label-pct { fill: var(--ink); font-size: var(--fs-caption); font-weight: 600; font-variant-numeric: tabular-nums; }
.sgc-col-hit { fill: transparent; }
.sgc-col.is-on .sgc-col-hit { fill: rgba(0, 0, 0, .05); }
.sgc-col path { transition: opacity .15s; }
.sgc-zero { fill: var(--line-strong); }
.sgc-cap { fill: var(--ink); font-size: var(--fs-caption); font-weight: 600; font-variant-numeric: tabular-nums; }
.sgc-tip-note { margin-top: 3px; color: var(--muted); font-size: var(--fs-caption); }
.sgc-spark { display: block; overflow: visible; }
.sgc-key.box { width: 10px; height: 10px; border: 0; border-radius: 4px; }
.sgc-empty { stroke: var(--surface-soft); }
.sgc-donut-total { fill: var(--ink); font-size: var(--fs-figure); font-weight: 700; letter-spacing: -.02em; }
.sgc-donut-label { fill: var(--muted); font-size: var(--fs-caption); }

@media (max-width: 900px) {
  .dash-hero-top { grid-template-columns: minmax(0, 1fr); }
  .hero-value { padding-top: 14px; }
  .outcomes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .dash-hero { padding: 18px 16px 14px; }
  .outcomes { padding: 14px 12px; gap: 16px 10px; }
}
/* Technical sections of a detail page, folded under one heading. */
.more-details { margin-bottom: var(--gap-block); }
/* A disclosure inside a card ("Raw JSON", "All submitted choices"): a quiet summary line with the
   kit's chevron, the content a step under it. accordion.js springs it open. */
/* A reviewer's marks on a screenshot: the boxes they drew, numbered in the
   order drawn. user/review_tasks.php draws them live; the admin report page
   shows them back on each marked screenshot (lib/report_captures.php). */
.review-marks { display: flex; flex-wrap: wrap; gap: var(--gap-pair); margin-top: var(--gap-in); }
.review-mark { position: relative; display: block; width: 260px; max-width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); line-height: 0; }
.review-mark > img { display: block; width: 100%; height: auto; }
.mark-box { position: absolute; z-index: 2; box-sizing: border-box; border: 2px solid #f59e0b; border-radius: 3px; background: rgba(245, 158, 11, .15); pointer-events: none; }
.mark-box > b { position: absolute; top: -1px; left: -1px; padding: 0 5px; border-radius: 2px 0 4px 0; background: #f59e0b; color: #111; font-size: var(--fs-micro); font-weight: 700; line-height: 16px; }
.sub-fold > summary { display: inline-flex; align-items: center; gap: 6px; color: var(--blue-ink); cursor: pointer; font-size: var(--fs-small); font-weight: 600; list-style: none; }
.sub-fold > summary::-webkit-details-marker { display: none; }
.sub-fold > summary::after, .hit-card > summary::after { content: ""; flex: none; width: 12px; height: 12px; background: currentColor; color: var(--faint); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; transition: transform .45s var(--spring-bounce); }
.doc-words { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); max-height: 320px; overflow: auto; overflow-wrap: anywhere; }
.sub-fold:not([open]) > summary::after { transform: rotate(-90deg); }
.sub-fold > summary + * { margin-top: var(--gap-in); }
/* One YARA rule that fired: its name and tags on the summary, the patterns it matched in a small
   table under it. The report page and a saved scan show the same card. */
.hit-card { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: var(--fs-small); }
* + .hit-card { margin-top: var(--gap-in); }
.hit-card > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; cursor: pointer; list-style: none; }
.hit-card > summary::-webkit-details-marker { display: none; }
.hit-card > summary::after { margin-left: auto; }
.hit-card:not([open]) > summary::after { transform: rotate(-90deg); }
.hit-card-desc { margin-top: 6px; color: var(--ink-soft); font-size: var(--fs-caption); }
.hit-strings { margin-top: var(--gap-in); font-size: var(--fs-micro); table-layout: fixed; }
/* The same columns in every card, so a page of them reads down one line. */
.hit-strings th:nth-child(1) { width: 22%; }
.hit-strings th:nth-child(2) { width: 9%; }
.hit-strings th:nth-child(4) { width: 18%; }
.hit-strings td { overflow-wrap: anywhere; }
/* A report's navigation flow (lib/render_extras.php, both dashboards): the hops as numbered steps on one
   line, then the page's own signals, each the same quiet block. How serious one is, its badge says. */
.nav-host { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--chip); color: var(--ink); font-family: var(--mono); font-size: var(--fs-caption); font-weight: 600; overflow-wrap: anywhere; }
.nav-url { margin-top: 3px; color: var(--muted); font-size: var(--fs-micro); overflow-wrap: anywhere; }
.nav-code { margin-top: 6px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--ink-soft); font-family: var(--mono); font-size: var(--fs-micro); overflow-wrap: anywhere; }
.nav-block .nav-code { background: var(--surface); }
.nav-block-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: var(--fs-small); }
.nav-block { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-soft); }
.nav-block + .nav-block, .nav-note + .nav-block { margin-top: var(--gap-in); }
.nav-items > .nav-block + .nav-block { margin-top: 0; }   /* the list's gap spaces them */
.nav-note { margin: 0 0 var(--gap-pair); font-size: var(--fs-caption); }
.nav-note-text { margin: 6px 0 0; color: var(--muted); font-size: var(--fs-caption); line-height: 1.5; }
.nav-steps { position: relative; margin: var(--gap-pair) 0 0; padding: 0; list-style: none; }
.nav-step { position: relative; display: flex; gap: 12px; padding: 0 0 var(--gap-pair); }
.nav-step:last-child { padding-bottom: 0; }
/* The line from one step to the next, behind the numbers. */
.nav-step:not(:last-child)::before { content: ""; position: absolute; top: 24px; bottom: 0; left: 11px; width: 2px; border-radius: 1px; background: var(--line); }
.nav-step-n { display: grid; flex: none; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: var(--chip); color: var(--ink-soft); font-size: var(--fs-micro); font-weight: 700; }
.nav-step.is-crossed .nav-step-n { background: var(--red-soft); color: var(--red); }
.nav-step-body { flex: 1; min-width: 0; padding-top: 1px; }
.nav-sum { margin: var(--gap-pair) 0 0; color: var(--muted); font-size: var(--fs-caption); }
.nav-page { margin-top: var(--gap-block); padding-top: var(--gap-block); border-top: 1px solid var(--line); }
.nav-page > .section-label { margin-top: 0; }
.nav-sub { margin: var(--gap-pair) 0 var(--gap-in); color: var(--ink); font-size: var(--fs-small); font-weight: 600; }
.nav-sub small { color: var(--muted); font-weight: 400; }
.nav-items { display: grid; gap: var(--gap-in); margin: 0; padding: 0; list-style: none; }
.nav-items.is-quiet .nav-host { background: transparent; color: var(--muted); padding-inline: 0; }
.nav-cat { margin-top: var(--gap-in); }
.nav-cat-name { color: var(--ink); font-size: var(--fs-caption); font-weight: 600; }
.nav-list { margin: 4px 0 0; padding-left: 18px; font-size: var(--fs-caption); line-height: 1.5; }
.nav-list li + li { margin-top: 2px; }
/* Response headers: the status, which security headers are there, then every header. */
.hdr-status { display: flex; align-items: center; gap: 8px; margin-bottom: var(--gap-in); }
.hdr-security { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--gap-pair); }
.hdr-table { font-size: var(--fs-caption); }
.hdr-table td { padding: 6px 12px; }
.hdr-table td:first-child { width: 1%; padding-right: var(--gap-block); }
.hdr-value { overflow-wrap: anywhere; white-space: pre-wrap; }
.hit-strings th, .hit-strings td { padding: 4px 8px; }
/* A choice drawn as a card: a radio (or a checkbox) and its words, the chosen one ringed in the
   accent. Account settings' captcha modes, the reported URL's candidates, a scan verdict's scope. */
.choices { display: grid; gap: var(--gap-in); }
/* The answer cards. A settings card's rows of answers (.card-row.choice, a radio in a list) keep the list's look:
   a card drawn round each row there sat a frame inside a frame, its dividers cut short. */
.choice:not(.card-row) { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-weight: 400; cursor: pointer; transition: border-color .15s, box-shadow .2s, background-color .15s; }
.choice:not(.card-row):hover { border-color: var(--line-strong); }
.choice:not(.card-row):has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent); }
.choice:not(.card-row):has(input:disabled) { opacity: .55; cursor: not-allowed; }
.choice > input { flex: none; margin: 2px 0 0; }
.choice > span { display: grid; gap: 2px; min-width: 0; }
.choice b, .choice strong { font-weight: 600; }
.choice small { color: var(--muted); font-size: var(--fs-caption); font-weight: 400; line-height: 1.5; }
/* The two YARA scan pages: which time this URL has been scanned, and how its matches moved. */
.ys-ver { display: inline-flex; align-items: center; height: var(--chip-h); padding: 0 var(--chip-px); margin-left: 6px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-ink); font-size: var(--chip-fs); font-weight: 600; vertical-align: middle; }
.ys-diff { font-weight: 600; }
.ys-diff.is-up { color: #b45309; }
.ys-diff.is-down { color: #15803d; }
.ys-diff.is-same { color: var(--muted); }
:root[data-theme="dark"] .ys-diff.is-up { color: var(--amber); }
:root[data-theme="dark"] .ys-diff.is-down { color: var(--green); }
.more-details[open] > summary { margin-bottom: var(--gap-pair); }
.more-details > summary { display: flex; align-items: center; gap: 8px; margin-bottom: 0; padding: 12px 16px; border: 1px solid transparent; border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; font-size: var(--fs-body); font-weight: 600; list-style: none; box-shadow: var(--shadow); }
.more-details > summary::-webkit-details-marker { display: none; }
.more-details > summary small { color: var(--muted); font-size: var(--fs-small); font-weight: 400; }
.more-details > summary::after { display: inline-block; margin-left: auto; color: var(--faint); content: "▾"; transition: transform .5s var(--spring-bounce), color .15s; }
.more-details[open] > summary::after { transform: rotate(180deg); color: var(--ink-soft); }
.more-details:not([open]) > summary::after { transform: rotate(-90deg); }

/* Reported message text, shown as sent. */
.message-body { max-height: 420px; margin: 0; padding: 12px 14px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--ink); font: 13px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; }
/* A submitted screenshot with its caption. */
.shot-figure { margin: 0 0 12px; }
.shot-figure a { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); line-height: 0; }
.shot-figure img { display: block; width: 100%; height: auto; }
.shot-figure figcaption { margin-top: 5px; color: var(--muted); font-size: var(--fs-caption); }

/* ---- Findings block -------------------------------------------------------------------------- */
/* The user's report page (user/report_view.php) keeps the plain list. */
.findings .cat-block { margin-bottom: 14px; }
.findings .cat-block h4 { margin: 0 0 6px; font-size: var(--fs-body); font-weight: 600; }
.findings .finding { margin-bottom: 6px; padding: 8px 11px; border-radius: var(--radius-sm); background: var(--surface-soft); font-size: var(--fs-small); }
.findings .finding .detail { display: block; margin-top: 2px; color: var(--muted); font-family: var(--mono); font-size: var(--fs-caption); overflow-wrap: anywhere; }
.findings .finding.scope-page { border-left-color: var(--red); }
.findings .finding.scope-link { border-left-color: var(--amber); }
/* Findings on report_view.php (partials/scan_findings.php), in the extension's
   side-panel design: verdict with a "this page" ring, confidence per category,
   "How it's calculated", then the findings grouped by category. */
.sf { --sf-low: #c7860f; --sf-medium: #d9822b; }
.sf-status { --tone: var(--accent); --tone-soft: var(--accent-soft); --tone-line: var(--accent-line); overflow: hidden; border: 1px solid var(--tone-line); border-radius: var(--radius); background: var(--tone-soft); }
.sf-status[data-tone="warning"] { --tone: var(--amber); --tone-soft: var(--amber-soft); --tone-line: var(--amber-line); }
.sf-status[data-tone="danger"] { --tone: var(--red); --tone-soft: var(--red-soft); --tone-line: var(--red-line); }
.sf-status[data-tone="success"] { --tone: var(--green); --tone-soft: var(--green-soft); --tone-line: var(--green-line); }
.sf-main { display: flex; align-items: flex-start; gap: 16px; padding: 16px; }
.sf-ring { --ring: var(--green); display: grid; flex: none; justify-items: center; gap: 4px; }
.sf-ring[data-level="low"] { --ring: var(--sf-low); }
.sf-ring[data-level="medium"] { --ring: var(--sf-medium); }
.sf-ring[data-level="high"] { --ring: var(--red); }
.sf-ring-dial { --gauge: var(--ring); position: relative; width: 84px; height: 84px; }
.sf-ring-value { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; line-height: 1.05; text-align: center; }
.sf-ring-value strong { color: var(--ink); font-size: var(--fs-figure-sm); font-weight: 700; letter-spacing: -.02em; }
.sf-ring-value small { margin-top: 2px; color: var(--ring); font-size: var(--fs-micro); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.sf-ring-safe { width: 24px; height: 24px; color: var(--ring); }
.sf-ring-caption { color: var(--muted); font-size: var(--fs-caption); font-weight: 600 }
.sf-verdict { min-width: 0; flex: 1; }
.sf-label { margin: 2px 0 2px; color: var(--tone); font-size: var(--fs-micro); font-weight: 700; letter-spacing: .07em; }
.sf-verdict h3 { margin: 0; font-size: var(--fs-h2); font-weight: 700; }
.sf-desc { margin: 3px 0 8px; color: var(--ink-soft); font-size: var(--fs-small); }
.sf-counts { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 0; color: var(--muted); font-size: var(--fs-small); }
.sf-counts strong { color: var(--ink); font-weight: 600; }
.sf-counts > span:first-child strong { color: var(--tone); }

.sf-conf { display: grid; gap: 9px; padding: 13px 16px 10px; border-top: 1px solid var(--tone-line); background: var(--surface); }
.sf-conf-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; margin: 0; color: var(--muted); font-size: var(--fs-caption); }
.sf-conf-head strong { color: var(--ink); font-weight: 600; }
.sf-cats { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sf-cats li { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 40px; gap: 10px; align-items: center; }
.sf-cat-name { display: flex; min-width: 0; align-items: center; gap: 7px; color: var(--ink); font-size: var(--fs-small); font-weight: 600; }
.sf-cat-name i { width: 9px; height: 9px; flex: none; border-radius: 4px; background: var(--category-accent); }
.sf-cat-name > span { min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
.sf-cat-name small { display: block; color: var(--muted); font-size: var(--fs-micro); font-weight: 500; }
.sf-cat-track { height: 8px; overflow: hidden; border-radius: 4px; background: var(--canvas); }
.sf-cat-fill { display: block; height: 100%; border-radius: 4px; background: var(--category-accent); }
.sf-cat-fill.is-linked { background: repeating-linear-gradient(135deg, var(--category-accent) 0 3px, var(--category-soft) 3px 6px); }
.sf-cat-value { color: var(--ink); font-size: var(--fs-small); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.sf-conf-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.sf-legend { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--fs-caption); }
.sf-legend i { width: 16px; height: 7px; border-radius: 4px; background: repeating-linear-gradient(135deg, var(--muted) 0 3px, #d7d7dc 3px 6px); }
.sf .sf-how { min-height: 0; margin-left: auto; padding: 4px 8px; border: 0; border-radius: 6px; background: none; box-shadow: none; color: var(--accent); font-size: var(--fs-small); font-weight: 600; }
.sf .sf-how:hover, .sf .sf-how[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }

.sf-calc { display: grid; gap: 12px; padding: 13px 16px 15px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.sf-calc[hidden] { display: none; }
/* The score's tabs are the kit's segments (.seg, seg.js), as wide as their words. */
.sf-calc-tabs { justify-self: start; }
.sf-calc-body { --calc: var(--category-accent, var(--red)); display: grid; gap: 10px; }
.sf-calc-body[hidden] { display: none; }
.sf-calc-body[data-level="none"] { --calc: var(--green); }
.sf-calc-body[data-level="low"] { --calc: var(--sf-low); }
.sf-calc-body[data-level="medium"] { --calc: var(--sf-medium); }
.sf-calc-body[data-level="high"] { --calc: var(--red); }
.sf-calc-title { display: none; margin: 0; font-size: var(--fs-small); font-weight: 600; }
.sf-calc[data-sf-calc]:not(.js) .sf-calc-title { display: block; }
.sf-calc-rows { display: grid; gap: 7px; }
.sf-calc-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 40px 34px; gap: 9px; align-items: center; font-size: var(--fs-caption); }
.sf-calc-source { min-width: 0; line-height: 1.25; }
.sf-calc-source strong { display: block; overflow: hidden; color: var(--ink); font-size: var(--fs-small); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.sf-calc-source small { color: var(--muted); font-size: var(--fs-micro); }
.sf-calc-bar { position: relative; height: 8px; border-radius: 4px; background: var(--line); }
.sf-calc-bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 4px; }
.sf-calc-bar .base { background: color-mix(in srgb, var(--calc) 28%, white); }
.sf-calc-bar .weight { background: var(--calc); }
.sf-calc-weight { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.sf-calc-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.sf-calc-total { display: grid; gap: 6px; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.sf-calc-total-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0; color: var(--muted); font-size: var(--fs-caption); }
.sf-calc-total-head strong { color: var(--ink); font-size: var(--fs-h2); font-weight: 700; }
.sf-calc-stack { display: flex; gap: 2px; height: 12px; overflow: hidden; border-radius: 4px; background: var(--line); }
.sf-calc-stack span { flex: none; height: 100%; background: var(--calc); }
.sf-calc-stack span:nth-child(even) { background: color-mix(in srgb, var(--calc) 62%, white); }
.sf-calc-formula { margin: 0; color: var(--ink-soft); font: var(--fs-micro)/1.5 var(--mono); overflow-wrap: anywhere; }
.sf-calc-formula sup { font-size: .75em; }
.sf-calc-note { margin: 0; color: var(--muted); font-size: var(--fs-caption); line-height: 1.55; }

.sf-groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 16px; }   /* minmax: a group never grows past the card to fit a long word */
/* A fold: a card that opens (details.fold > summary), folded by accordion.js.
   Its head is a raised lid (the neutral face, rounded) lying on a soft bed
   that holds what it opens to. The lid lights up under the pointer and gives
   under the press (press.js); its chevron (.fold-chevron, the animated
   chevron) turns over on the fold's spring. One component for every card that
   opens: the report view's finding categories, and in the extension's side
   panel the findings by category and the Tools. A page sets only what goes in
   the head and in the bed. */
.fold { border-radius: var(--radius); background: var(--surface-soft); box-shadow: var(--shadow); }
.fold.is-folding { overflow: hidden; }
.fold > summary { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--radius); color: inherit; cursor: pointer; list-style: none; user-select: none; -webkit-user-select: none;
  background: linear-gradient(180deg, #ffffff 0%, #f4f4f7 100%); box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .05), 0 0 0 .5px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06);
  transition: box-shadow .25s cubic-bezier(.3, .7, .2, 1); --jelly: 1; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary:hover { background: linear-gradient(180deg, #ffffff 0%, #f9f9fb 100%); box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .05), 0 0 0 .5px rgba(0, 0, 0, .17), 0 1px 2px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06); }
.fold > summary:active { box-shadow: inset 0 1px 3px rgba(0, 0, 0, .18), 0 0 0 .5px rgba(0, 0, 0, .14); transition-duration: .1s; }
.fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fold-chevron { display: grid; flex: none; width: 20px; height: 20px; margin-left: auto; place-items: center; transition: transform .5s var(--spring-bounce); }
img.fold-chevron { object-fit: contain; }
.fold[open] > summary .fold-chevron { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .fold-chevron, .fold > summary { transition: none; } }
:root[data-theme="dark"] .fold > summary { background: linear-gradient(180deg, #363639 0%, #2d2d30 100%); box-shadow: 0 0 0 .5px rgba(255, 255, 255, .09), 0 1px 2px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3); }
:root[data-theme="dark"] .fold > summary:hover { background: linear-gradient(180deg, #3d3d41 0%, #333337 100%); box-shadow: 0 0 0 .5px rgba(255, 255, 255, .14), 0 1px 2px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3); }
:root[data-theme="dark"] .fold > summary:active { box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6); }

/* A fold's row: a card in a fold's bed that opens in turn (a finding, a
   certificate's details): white on the bed, its own row lit under the pointer
   and giving under the press, what it opens to under a hairline. */
.fold-row { min-width: 0; overflow: clip; border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); }
.fold-row > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 9px 11px; color: inherit; cursor: pointer; list-style: none; user-select: none; -webkit-user-select: none; transition: background-color .15s; --jelly: 1; }
.fold-row > summary::-webkit-details-marker { display: none; }
.fold-row > summary:hover { background: var(--hover); }
.fold-row > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fold-row > summary + * { border-top: 1px solid var(--line); }
.fold-row > summary > .fold-chevron { width: 16px; height: 16px; }
.fold-row[open] > summary > .fold-chevron { transform: rotate(180deg); }

/* Addresses in a fold (Scan a URL: the hops of a redirect chain, the links on
   a page): the fold's head says how many and where; in its bed each address is
   a white row card with its number, the address, what is known of it (badges,
   a quiet note) and its action on the right, wrapping on a narrow screen. */
.url-fold { margin-top: var(--gap-pair); }
.url-fold-text { display: grid; min-width: 0; flex: 1; }
.url-fold-text strong { color: var(--ink); font-size: var(--fs-small); font-weight: 600; }
.url-fold-text small { color: var(--muted); font-size: var(--fs-caption); overflow-wrap: anywhere; }
.url-fold-icon { flex: none; width: 18px; height: 18px; color: var(--ink-soft); }
.url-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 0; padding: 8px; list-style: none; }
.url-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; padding: 7px 8px 7px 12px; border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); font-size: var(--fs-small); }
.url-row-n { flex: none; min-width: 1.4em; color: var(--muted); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }
.url-row-url { flex: 0 1 auto; min-width: 0; color: var(--ink); font: 500 var(--fs-small)/1.4 var(--mono); overflow-wrap: anywhere; }
.url-row-note { min-width: 0; color: var(--muted); font-size: var(--fs-caption); overflow-wrap: anywhere; }
.url-row-code { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.url-row-end { display: inline-flex; flex: none; align-items: center; gap: 6px; margin: 0 0 0 auto; }
.url-row-end > form { margin: 0; }

/* The report view's finding categories: folds (above); here only what is in them. */
.sf-group { --category-accent: var(--muted); --category-soft: var(--surface-soft); }
.sf-group-head { gap: 10px; }
.sf-group-mark { width: 12px; height: 12px; flex: none; margin: 0 6px 0 4px; border-radius: 50%; background: var(--category-accent); }   /* the category's colour, plain: no tile around it */
.sf-group-text { display: grid; min-width: 0; flex: 1; }
.sf-group-text strong { color: var(--ink); font-size: var(--fs-body); font-weight: 600; }
.sf-group-text small { color: var(--muted); font-size: var(--fs-caption); }
.sf-group-text small b { color: var(--red); font-weight: 600; }
.sf-group-score { color: var(--ink); font-size: var(--fs-small); font-weight: 700; font-variant-numeric: tabular-nums; }
.sf-group-about { margin: 0; padding: 12px 14px 4px; color: var(--ink-soft); font-size: var(--fs-small); line-height: 1.55; }
/* The findings of a category: each a card of its own on a soft bed under the
   category's words (the extension's side panel draws them the same). */
/* A group's rows, one block in the fold (so the fold's contents arrive together, as the side panel's do). */
.sf-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 8px; }
.sf-finding > summary { gap: 4px 9px; }
.sf-sev { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--category-accent); }
.sf-sev[data-level="medium"] { opacity: .55; }
.sf-sev[data-level="low"] { background: none; box-shadow: inset 0 0 0 1.5px var(--category-accent); opacity: .6; }
.sf-title { min-width: 0; flex: 1 1 200px; color: var(--ink); font-size: var(--fs-small); font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.sf-title.is-host { font: 500 var(--fs-small)/1.4 var(--mono); }
.sf-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.sf-tag { background: var(--canvas); color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; height: var(--chip-h); padding: 0 var(--chip-px); border-radius: 999px; font-size: var(--chip-fs); line-height: 1; white-space: nowrap; }
.sf-tag.scope-page { background: var(--red-soft); color: var(--red); }
.sf-tag.sf-weight { background: var(--category-soft); color: var(--category-ink, var(--ink-soft)); font-variant-numeric: tabular-nums; }
.sf-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 11px; padding: 10px 12px 14px; }
/* One site's findings, one after another under its row: each its reason, where it links and how it was found. */
.sf-signal { display: grid; grid-template-columns: minmax(0, 1fr); gap: 11px; min-width: 0; }
.sf-signal + .sf-signal { padding-top: 12px; border-top: 1px solid var(--line); }
.sf-reason { margin: 0; color: var(--ink); font-size: var(--fs-small); overflow-wrap: anywhere; }   /* a quoted query string has no spaces to break at */
.sf-url { margin: 0; color: var(--ink-soft); font-size: var(--fs-caption); overflow-wrap: anywhere; }
.sf-evidence-label { margin: 0 0 5px; color: var(--muted); font-size: var(--fs-caption); font-weight: 600 }
.sf-evidence { max-height: 240px; margin: 0; overflow: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-soft); font: 12px/1.6 var(--mono); overflow-wrap: anywhere; white-space: pre-wrap; }
.sf-origin { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 10px; margin: 0; font-size: var(--fs-small); }
.sf-origin dt { color: var(--muted); }
.sf-origin dd { margin: 0; color: var(--ink-soft); overflow-wrap: anywhere; }
.sf-origin code { color: var(--muted); font-size: var(--fs-caption); }
.sf-w { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sf-w i { display: inline-block; width: 48px; height: 6px; border-radius: 4px; background: linear-gradient(90deg, var(--category-accent) var(--w), var(--line) var(--w)); }
.sf-origin-note { margin: 0; color: var(--muted); font-size: var(--fs-caption); }
.sf-footnote, .sf-empty { margin: 12px 0 0; color: var(--muted); font-size: var(--fs-small); line-height: 1.55; }
@media (max-width: 640px) {
  .sf-main { flex-direction: column; align-items: center; text-align: center; }
  .sf-counts { justify-content: center; }
  .sf-cats li { grid-template-columns: minmax(0, 1fr) 40px; }
  .sf-cat-track { grid-column: 1 / -1; grid-row: 2; }
  .sf-calc-row { grid-template-columns: minmax(0, 1fr) 70px 36px 30px; }
  .sf-body { padding-left: 14px; }
  .sf-origin { grid-template-columns: minmax(0, 1fr); }
}

/*
 * Country picker
 * --------------------------------------------------------------------------
 * A multi-country allowlist built from checkboxes plus a hidden CSV field, so
 * the POST contract stays a comma-separated code list and the control degrades
 * to a plain text input when scripting is off. Selected countries are also
 * shown as removable chips: with ~250 rows in the list, the chips are the only
 * place an admin can see the whole selection at a glance.
 */
.country-picker { margin-top: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.country-picker.is-inactive { opacity: .55; }
.cp-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; border-bottom: 1px solid var(--border); }
.cp-head .cp-search { flex: 1 1 200px; min-width: 160px; margin-top: 0; }
.cp-head .cp-region-filter { flex: 0 1 190px; margin-top: 0; }
.cp-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.cp-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border-bottom: 1px solid var(--border); background: var(--surface-soft); }
.cp-chip { gap: 6px; background: var(--blue-soft); color: var(--blue-ink); font-weight: 600; display: inline-flex; align-items: center; min-height: var(--chip-h-lg); padding: 0 4px 0 var(--chip-px-lg); border-radius: 999px; font-size: var(--chip-fs-lg); line-height: 1.2; white-space: nowrap; }
.cp-chip.is-unknown { background: var(--red-soft); color: var(--red); }
.cp-chip button {
  all: unset; display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%;
  color: inherit; cursor: pointer; font-size: var(--fs-small); line-height: 1;
}
.cp-chip button:hover { background: rgba(255, 255, 255, .7); }
.cp-empty { color: var(--muted); font-size: var(--fs-caption); }

.cp-list { max-height: 300px; overflow-y: auto; padding: 4px 10px 10px; }
.cp-region { margin-top: 8px; }
.cp-region[hidden] { display: none; }
.cp-region-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: var(--fs-caption); font-weight: 600;
}
.cp-region-head .cp-region-toggle { margin-left: auto; }
.cp-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 2px 10px; padding-top: 4px; }
.cp-option {
  display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 6px;
  cursor: pointer; font-size: var(--fs-small); font-weight: 400;
}
.cp-option:hover { background: var(--surface-soft); }
.cp-option input { width: auto; margin: 0; }
.cp-option .cp-code { margin-left: auto; color: var(--muted); font-size: var(--fs-micro); font-variant-numeric: tabular-nums; }
.cp-option[hidden] { display: none; }
.cp-foot { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--border); color: var(--muted); font-size: var(--fs-caption); }
.cp-foot .cp-warn { color: var(--danger); font-weight: 600; }
.cp-no-match { padding: 10px 0; color: var(--muted); font-size: var(--fs-small); }

/*
 * Searchable single-country combobox
 * --------------------------------------------------------------------------
 * Built by partials/country_combo.php on top of a plain <select>, which stays
 * in the form and keeps holding the value. These rules only style the text
 * input and the filtered list that replace the dropdown visually.
 *
 * The control reads as a search box: a magnifier while searching, the chosen
 * flag at rest, and the stored code as a badge on the right so it is visible
 * without being buried in the middle of the country name.
 */
.country-combo { position: relative; margin-top: 4px; }
.country-combo .cc-control {
  display: flex; align-items: center; gap: 6px; padding: 0 5px 0 9px;
  border: 1px solid transparent; border-radius: 10px; background: rgba(0, 0, 0, .06); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
  transition: border-color .15s, box-shadow .2s, background-color .15s;
}
/* Typed into, so a groove like every text field; the input inside it is bare (the groove is the control's, not a second one within). */
.country-combo .cc-control:hover { border-color: var(--line); background: rgba(0, 0, 0, .04); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .07); }
.country-combo .cc-control:focus-within { border-color: rgba(0, 0, 0, .06); background: rgba(0, 0, 0, .075); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .16); }
:root[data-theme="dark"] .country-combo .cc-control { background: rgba(0, 0, 0, .28); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5); }
:root[data-theme="dark"] .country-combo .cc-control:hover { border-color: var(--line); background: rgba(0, 0, 0, .2); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4); }
:root[data-theme="dark"] .country-combo .cc-control:focus-within { border-color: transparent; background: rgba(0, 0, 0, .34); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .6); }
.country-combo .cc-control :is(.cc-input, .cc-input:hover, .cc-input:focus) { border: 0 !important; background: transparent !important; box-shadow: none !important; }
.country-combo .cc-lead { display: grid; width: 20px; flex: 0 0 auto; place-items: center; color: var(--muted); line-height: 1; }
.country-combo .cc-lead.has-flag { font-size: var(--fs-h3); }
.country-combo .cc-input {
  min-width: 0; flex: 1; margin: 0; padding: 8px 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--text); font-family: inherit; font-size: var(--fs-body);
}
.country-combo .cc-input::placeholder { color: #8e8e95; }
.country-combo .cc-input:focus { border: 0; outline: none; box-shadow: none; }
.country-combo .cc-badge { flex: 0 0 auto; background: var(--blue-soft); color: var(--blue-ink); letter-spacing: .3px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; height: var(--count-h); min-width: var(--count-h); padding: 0 6px; border-radius: 999px; font-size: var(--fs-micro); line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.country-combo .cc-badge[hidden] { display: none; }
.country-combo .cc-btn {
  all: unset; display: grid; width: 22px; height: 22px; flex: 0 0 auto; place-items: center; border-radius: 6px;
  color: var(--muted); cursor: pointer; font-size: var(--fs-body); line-height: 1;
}
.country-combo .cc-btn:hover { background: var(--surface-soft); color: var(--text); }
.country-combo .cc-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.country-combo .cc-btn[hidden] { display: none; }

.cc-pop {
  position: absolute; z-index: 30; top: calc(100% + 5px); right: 0; left: 0;
  min-width: 240px; overflow: hidden; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); box-shadow: var(--shadow-lg);
}
.cc-pop[hidden] { display: none; }
.cc-list { max-height: 268px; margin: 0; padding: 4px; overflow-y: auto; list-style: none; }
.cc-group {
  position: sticky; top: 0; z-index: 1; margin: 2px 0; padding: 5px 8px 4px; border-bottom: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: var(--fs-caption); font-weight: 600;
}
.cc-group[hidden] { display: none; }
.cc-option {
  display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 9px;
  padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: var(--fs-small);
}
.cc-option[hidden] { display: none; }
.cc-option:hover, .cc-option.is-active { background: var(--blue-soft); }
.cc-option.is-active { background: var(--accent-soft, var(--blue-soft)); }
.cc-opt-flag { display: inline-flex; font-size: var(--fs-body); line-height: 1; }
.cc-flag-img { display: block; width: 20px; height: 15px; object-fit: contain; }
.cc-opt-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-opt-code { color: var(--muted); font-size: var(--fs-micro); font-weight: 600; letter-spacing: .3px; }
.cc-option[aria-selected=true] .cc-opt-name { font-weight: 600; }
.cc-option[aria-selected=true] .cc-opt-code { color: var(--brand); }
.cc-option[aria-selected=true] .cc-opt-code::after { content: ' ✓'; }
.cc-hit { padding: 0 1px; border-radius: 2px; background: #fde68a; color: inherit; }
.cc-empty { padding: 10px 8px; color: var(--muted); font-size: var(--fs-small); }
.cc-empty[hidden] { display: none; }
.cc-foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 7px 10px; border-top: 1px solid var(--border); background: var(--surface-soft);
  color: var(--muted); font-size: var(--fs-micro);
}
.cc-foot .cc-keys { white-space: nowrap; }
@media (max-width: 540px) { .cc-foot .cc-keys { display: none; } }
/* A list without flags (shortener services) drops the flag column. */
.cc-no-flags .cc-option { grid-template-columns: minmax(0, 1fr) auto; }
.cc-no-flags .cc-opt-flag { display: none; }
/* The typing fade wraps the search input in .sg-tf; the wrap, not the input, is
   then the flex item, so it is the one that takes the free width. */
.country-combo .cc-control > .sg-tf { flex: 1 1 0; width: auto; }

/* ---- Settings rows ---------------------------------------------------------------------------------
   A settings page (the portal's Privacy & reporting, .rp; every page of the extension's settings,
   .settings-page): a header, groups of rows in one card each with hairlines between the rows, round
   choices, switches, a line of help under a group, removable chips, and a quiet column of notes
   beside it. One definition for both; a page's own sheet lays the page out and adds what only it has.
   (:where: these weigh one class, so a page's own rule for the same element, and a tile's for its
   .label, still win.) */
:root { --row-x: 16px; }   /* a row's inset */
@media (max-width: 560px) { :root { --row-x: 14px; } }
:where(.rp, .settings-page) { --divider-x: var(--row-x); }
:where(.rp, .settings-page) .page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
:where(.rp, .settings-page) .page-header > div { max-width: 620px; }
:where(.rp, .settings-page) .page-header h1 { margin: 0; color: var(--ink); font-size: var(--fs-h1); font-weight: var(--fw-h1); letter-spacing: var(--ls-h1); line-height: 1.25; }   /* the page title's type */
:where(.rp, .settings-page) .page-header p { margin: 4px 0 0; color: var(--muted); font-size: var(--fs-body); line-height: var(--lh-body); }
:where(.rp, .settings-page) .status { display: inline-flex; flex: none; align-items: center; gap: 6px; min-height: 22px; color: var(--green); font-size: var(--fs-small); font-weight: 600; }
:where(.rp, .settings-page) .status::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
:where(.rp, .settings-page) .status[data-tone="error"] { color: var(--red); }
:where(.rp, .settings-page) .page-body { min-width: 0; }
:where(.rp, .settings-page) .page-aside { position: sticky; top: 40px; display: grid; gap: 28px; min-width: 0; }
:where(.rp, .settings-page) .group-heading { margin: 0 0 8px var(--row-x); color: var(--muted); font-size: var(--fs-small); font-weight: 600; }
:where(.rp, .settings-page) .group-card + .group-heading, :where(.rp, .settings-page) .group-note + .group-heading, :where(.rp, .settings-page) .clean-skip { margin-top: 28px; }
:where(.rp, .settings-page) .clean-skip .group-heading { margin-top: 0; }
:where(.rp, .settings-page) .group-note { margin: 8px var(--row-x) 0; color: var(--muted); font-size: var(--fs-small); line-height: 1.5; }
:where(.rp, .settings-page) .group-note code, :where(.rp, .settings-page) .site-legend code { font-family: var(--mono); font-size: var(--fs-caption); }
:where(.rp, .settings-page) .group-card { position: relative; margin: 0; padding: 0; border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
:where(.rp, .settings-page) .group-card.is-off { opacity: .55; }
:where(.rp, .settings-page) .card-row { position: relative; display: flex; align-items: center; gap: 14px; min-height: 52px; margin: 0; padding: 12px var(--row-x); }
:where(.rp, .settings-page) .card-row + .card-row::before { position: absolute; top: 0; right: 0; left: var(--divider-x, var(--row-x)); height: 1px; background: var(--line); content: ""; }
:where(.rp, .settings-page) .choice-list { --divider-x: 46px; }
:where(.rp, .settings-page) .label { display: block; color: var(--ink); font-size: var(--fs-body); font-weight: 600; letter-spacing: -.005em; }
:where(.rp, .settings-page) .desc { display: block; margin-top: 1px; color: var(--muted); font-size: var(--fs-small); font-weight: 400; line-height: 1.45; }
:where(.rp, .settings-page) .choice { align-items: flex-start; cursor: pointer; }
:where(.rp, .settings-page) .choice input { flex: none; margin: 2px 0 0; }   /* the kit's radio, level with the first line */
:where(.rp, .settings-page) .choice:hover .label { color: var(--ink); }
:where(.rp, .settings-page) .switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; cursor: pointer; }
:where(.rp, .settings-page) .log-scope { justify-content: space-between; }
:where(.rp, .settings-page) .log-why { display: grid; gap: 10px; background: var(--surface-soft); }
:where(.rp, .settings-page) .log-why[hidden] { display: none; }
:where(.rp, .settings-page) .log-why-field { display: grid; gap: 6px; }
:where(.rp, .settings-page) .log-why-field .muted { color: var(--muted); font-weight: 400; }
:where(.rp, .settings-page) .log-why textarea { min-height: 56px; }
:where(.rp, .settings-page) .log-why-check { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-soft); font-size: var(--fs-small); font-weight: 400; line-height: 1.5; }
:where(.rp, .settings-page) .log-why-check input { margin-top: 2px; }
:where(.rp, .settings-page) .log-why-actions { display: flex; gap: 8px; }
:where(.rp, .settings-page) .stats-sync-row { flex-wrap: wrap; justify-content: space-between; gap: 10px; }
:where(.rp, .settings-page) .text-button { min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; color: var(--muted); font-size: var(--fs-small); font-weight: 600; cursor: pointer; }
:where(.rp, .settings-page) .text-button:hover { background: none; color: var(--red); }
:where(.rp, .settings-page) .site-add { flex-wrap: wrap; gap: 8px; }
:where(.rp, .settings-page) .site-list { container-type: inline-size; }
:where(.rp, .settings-page) .site-add .site-host { flex: 3 1 200px; min-width: 0; }
/* In a narrow card the address has the row to itself (its placeholder was cut to "yourbank.com or a full addre…"). */
@container (max-width: 700px) { :where(.rp, .settings-page) .site-add .site-host { flex-basis: 100%; } }
:where(.rp, .settings-page) .site-add .site-match { flex: 0 1 auto; width: auto; min-width: 0; }
:where(.rp, .settings-page) .site-add .site-path { flex: 1 1 110px; min-width: 0; }
:where(.rp, .settings-page) .site-add .button { flex: none; }
:where(.rp, .settings-page) .site-preview { margin: -6px var(--row-x) 10px; color: var(--muted); font-size: var(--fs-small); }
:where(.rp, .settings-page) .site-preview:empty { display: none; }
:where(.rp, .settings-page) .site-preview b { color: var(--ink); font-family: var(--mono); font-size: var(--fs-caption); font-weight: 600; }
:where(.rp, .settings-page) .skip-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
:where(.rp, .settings-page) .skip-empty { color: var(--muted); font-size: var(--fs-small); }
:where(.rp, .settings-page) .skip-chip { gap: 2px; background: var(--fill-strong); color: var(--ink-soft); font-family: var(--mono); font-weight: 600; display: inline-flex; align-items: center; min-height: var(--chip-h-lg); padding: 0 2px 0 var(--chip-px-lg); border-radius: 999px; font-size: var(--chip-fs-lg); line-height: 1.2; white-space: nowrap; }
:where(.rp, .settings-page) .skip-chip .chip-sub, :where(.rp, .settings-page) .skip-chip .chip-path { color: var(--muted); }
:where(.rp, .settings-page) .skip-chip form { display: contents; }
:where(.rp, .settings-page) .skip-chip button { display: inline-grid; width: 20px; height: 20px; min-height: 0; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; box-shadow: none; color: var(--faint); cursor: pointer; }
:where(.rp, .settings-page) .skip-chip button:hover, :where(.rp, .settings-page) .skip-chip button:focus-visible { background: var(--hover); color: var(--red); }
:where(.rp, .settings-page) .skip-chip button svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
:where(.rp, .settings-page) .skip-chip.is-new { box-shadow: 0 0 0 2px var(--accent-soft); color: var(--ink); }
/* A site list, grouped by what the sites are (search engines, chats and email, social and video,
   the rest): each group a row saying what it holds, opening to its sites in even columns. Thirty-six
   sites as one heap of chips read as a mess. A list with one group is just its sites. */
:where(.rp, .settings-page) .site-chips-row { display: block; min-height: 0; padding: 0; }
:where(.rp, .settings-page) .site-chips-row > .site-chips { display: block; }
:where(.rp, .settings-page) .site-group + .site-group { border-top: 1px solid var(--line); }
:where(.rp, .settings-page) .site-group > summary { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px var(--row-x); cursor: pointer; list-style: none; }
:where(.rp, .settings-page) .site-group > summary::-webkit-details-marker { display: none; }
:where(.rp, .settings-page) .site-group > summary::after { width: 12px; height: 12px; flex: none; background: var(--faint); content: "";
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
  transform: rotate(-90deg); transition: transform .45s var(--spring-bounce); }
:where(.rp, .settings-page) .site-group[open] > summary::after { transform: none; }
:where(.rp, .settings-page) .site-group > summary:hover .site-group-name { color: var(--ink); }
:where(.rp, .settings-page) .site-group-name { flex: none; color: var(--ink); font-size: var(--fs-body); font-weight: 600; }
:where(.rp, .settings-page) .site-group-peek { flex: 1 1 auto; min-width: 0; overflow: hidden; color: var(--muted); font-size: var(--fs-small); text-overflow: ellipsis; white-space: nowrap; transition: opacity .2s; }
:where(.rp, .settings-page) .site-group[open] .site-group-peek { opacity: 0; }
:where(.rp, .settings-page) .site-group-n { display: inline-grid; min-width: var(--count-h); height: var(--count-h); flex: none; place-items: center; padding: 0 6px; box-sizing: border-box; border-radius: 999px; background: var(--fill-strong); color: var(--ink-soft); font-size: var(--fs-micro); font-weight: 700; font-variant-numeric: tabular-nums; }
:where(.rp, .settings-page) .site-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 10px; margin: 0; padding: 0 calc(var(--row-x) - 10px) 12px; list-style: none; }
:where(.rp, .settings-page) .site-chips > .site-items { padding-top: 12px; }
:where(.rp, .settings-page) .site-chips > .skip-empty { margin: 0; padding: 14px var(--row-x); }
:where(.rp, .settings-page) .site-item { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 32px; min-width: 0; padding: 0 4px 0 10px; border-radius: 8px; color: var(--ink-soft); font-size: var(--fs-small); transition: background-color .15s; }
:where(.rp, .settings-page) .site-item:hover { background: var(--hover); }
:where(.rp, .settings-page) .site-item-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:where(.rp, .settings-page) .site-item .chip-sub, :where(.rp, .settings-page) .site-item .chip-path { color: var(--muted); }
:where(.rp, .settings-page) .site-item form { display: contents; }
:where(.rp, .settings-page) .site-item button { display: inline-grid; width: 24px; height: 24px; flex: none; min-height: 0; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; box-shadow: none; color: var(--faint); cursor: pointer; opacity: 0; transition: opacity .15s, background-color .15s, color .15s; }
:where(.rp, .settings-page) .site-item:hover button, :where(.rp, .settings-page) .site-item button:focus-visible { opacity: 1; }
:where(.rp, .settings-page) .site-item button:hover, :where(.rp, .settings-page) .site-item button:focus-visible { background: var(--hover); color: var(--red); }
:where(.rp, .settings-page) .site-item button svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (hover: none) { :where(.rp, .settings-page) .site-item button { opacity: 1; } }
/* A site just added is lit for a moment where it landed. */
:where(.rp, .settings-page) .site-item.is-new { animation: site-new 1.6s ease-out; }
@keyframes site-new { 0%, 40% { background: var(--accent-soft); color: var(--ink); } }
@media (prefers-reduced-motion: reduce) { :where(.rp, .settings-page) .site-item.is-new { animation: none; } :where(.rp, .settings-page) .site-group > summary::after { transition: none; } }
:where(.rp, .settings-page) .site-foot { min-height: 40px; }
:where(.rp, .settings-page) .aside-section { display: grid; gap: 12px; }
:where(.rp, .settings-page) .aside-title { margin: 0; color: var(--muted); font-size: var(--fs-small); font-weight: 600; }
:where(.rp, .settings-page) .aside-text { margin: 0; color: var(--muted); font-size: var(--fs-small); line-height: 1.55; }
:where(.rp, .settings-page) .aside-text strong { color: var(--ink); font-weight: 600; }

/* ---- Utilities -------------------------------------------------------------------------------- */
/* Small, single-purpose classes that replace repeated inline style attributes. */
/* Utilities say one thing and mean it: a class put on an element to set its colour, size or margin wins over the component's own rule, as the style attribute it replaces did. */
.text-muted { color: var(--muted) !important; }
.text-faint { color: var(--faint) !important; }
.text-body { color: var(--ink-soft) !important; }
.text-ok { color: var(--green) !important; }
.text-warn { color: var(--amber) !important; }
.text-danger { color: var(--red) !important; }
.text-brand { color: var(--blue) !important; }
.text-2xs { font-size: var(--fs-micro) !important; }
.text-xs { font-size: var(--fs-caption) !important; }
.text-sm { font-size: var(--fs-small) !important; }
.text-md { font-size: var(--fs-body) !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.fw-normal { font-weight: 400 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-medium { font-weight: 500 !important; }
.fw-bold { font-weight: 700 !important; }
.text-ink { color: var(--ink) !important; }
.d-block { display: block !important; }
.p-0 { padding: 0 !important; }
.w-100 { width: 100% !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-4 { margin-bottom: 16px !important; }
.nowrap { white-space: nowrap !important; }
.pre-wrap { white-space: pre-wrap !important; }
.break-all { word-break: break-all !important; }
.break-any { overflow-wrap: anywhere !important; }
.truncate { display: block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-inline { display: inline !important; }
.d-inline-flex { display: inline-flex !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.d-block { display: block !important; }
.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 12px !important; }
.mt-4 { margin-top: 16px !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 12px !important; }
.ml-1 { margin-left: 4px; }
.ml-2 { margin-left: 8px; }
.hstack { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vstack { display: flex; flex-direction: column; gap: 8px; }
.sep-top { border-top: 1px solid var(--line); }
.plain-list { margin: 0; padding: 0; list-style: none; }

/* ---- Section tabs --------------------------------------------------------------- */
/* A row of tabs across the pages of one section (partials/yara_nav.php). */
.subnav { display: flex; gap: 4px; margin: -6px 0 var(--gap-block); overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.subnav a { flex: none; margin-bottom: -1px; padding: 8px 12px 9px; border-bottom: 2px solid transparent; color: var(--muted); font-size: var(--fs-body); font-weight: 600; white-space: nowrap; }
.subnav a:hover { border-bottom-color: var(--line-strong); color: var(--ink); text-decoration: none; }
.subnav a.on { border-bottom-color: var(--blue); color: var(--blue); }

/* ---- Row menus ------------------------------------------------------------------ */
/* <details class="row-menu"> holding a row's rarer actions behind a "⋯" button.
   The list is fixed-positioned by partials/footer.php so a scrolling table
   can't clip it. */
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { min-width: 32px; list-style: none; font-size: var(--fs-h2); letter-spacing: 1px; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu[open] > summary { border-color: var(--blue-line); background: var(--blue-soft); color: var(--blue); }
.row-menu-list { position: fixed; z-index: 30; display: flex; min-width: 180px; flex-direction: column; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); box-shadow: var(--pop-shadow), inset 0 1px 2px rgba(0, 0, 0, .06); }
.row-menu-list form { margin: 0; }
.row-menu-list form:has(.is-danger) { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.row-menu-list .menu-item, td .row-menu-list button.menu-item { display: flex; width: 100%; min-height: 32px; justify-content: flex-start; padding: 6px 10px; border: 0; border-radius: 6px; background: none; color: var(--ink); font-size: var(--fs-small); font-weight: 500; text-decoration: none; }
.row-menu-list .menu-item, td .row-menu-list button.menu-item { position: relative; z-index: 1; box-shadow: none; filter: none; transform: none; transition: color .15s; }
.row-menu-list .menu-item:hover, td .row-menu-list button.menu-item:hover { background: none; color: var(--ink); text-decoration: none; }
.row-menu-list .menu-item.is-danger, td .row-menu-list button.menu-item.is-danger { color: var(--red); }
.row-menu-list .menu-item.is-danger:hover, td .row-menu-list button.menu-item.is-danger:hover { background: none; color: var(--red); }

/* ---- Dialogs ------------------------------------------------------------------ */
/* <dialog class="modal"> opened by [data-open-dialog] (see partials/footer.php):
   a header with the title and a close button, a scrolling body, and a footer
   holding the form's buttons. */
dialog.modal { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg); color: var(--ink); }
dialog.modal.wide { width: min(980px, calc(100vw - 32px)); }
dialog.modal.narrow { width: min(520px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(0, 0, 0, .45); }
dialog.modal[open] { display: flex; flex-direction: column; }
.modal > form { display: flex; min-height: 0; flex: 1; flex-direction: column; margin: 0; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: var(--fs-h2); font-weight: 700; }
.modal-head p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-small); }
.modal-close { display: grid; width: 32px; height: 32px; min-height: 0; flex: none; place-items: center; margin-left: auto; padding: 0; border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); font-size: 20px; line-height: 1; }
.modal-close:hover { border: 0; background: var(--surface-soft); color: var(--ink); }
.modal-body { display: grid; gap: 14px; padding: 18px 22px; overflow-y: auto; }
.modal-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--line); background: var(--surface-soft); border-radius: 0 0 var(--radius) var(--radius); }
.modal-foot .hint { margin-right: auto; color: var(--muted); font-size: var(--fs-small); }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 14px; }
@media (max-width: 640px) { .field-row { grid-template-columns: minmax(0, 1fr); } }
textarea.code { min-height: 240px; font-family: var(--mono); font-size: var(--fs-small); line-height: 1.55; tab-size: 4; white-space: pre; }
.field-group { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.field-group > legend { padding: 0 6px; color: var(--muted); font-size: var(--fs-caption); font-weight: 600 }

/* ---- YARA: templates and the rule-writing guide --------------------------------- */
.tpl-picker-label { margin-bottom: 6px; color: var(--ink-soft); font-size: var(--fs-small); font-weight: 600; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
button.tpl-card { display: flex; min-height: 0; flex-direction: column; align-items: stretch; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font-weight: 400; text-align: left; white-space: normal; }
button.tpl-card:hover { border-color: var(--blue-line); background: var(--blue-soft); color: var(--ink); }
button.tpl-card[aria-pressed=true] { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.tpl-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-body); }
.tpl-card-blurb { color: var(--muted); font-size: var(--fs-caption); line-height: 1.4; }
.yara-guide { border: 1px solid var(--blue-line); border-radius: var(--radius-md); background: var(--blue-soft); }
.yara-guide > summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--blue-ink); cursor: pointer; font-size: var(--fs-body); font-weight: 600; list-style: none; }
.yara-guide > summary::-webkit-details-marker { display: none; }
.yara-guide > summary::before { content: "?"; display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; background: var(--blue); color: #fff; font-size: var(--fs-caption); font-weight: 700; }
.yara-guide > summary::after { margin-left: auto; color: var(--blue-ink); content: "▾"; transition: transform .45s var(--spring-bounce); }
.yara-guide:not([open]) > summary::after { transform: rotate(-90deg); }
.yara-guide-body { padding: 0 14px 14px; color: var(--ink-soft); font-size: var(--fs-small); }
.yara-guide-body p { margin: 0 0 10px; }
.yara-guide-body h4 { margin: 12px 0 6px; color: var(--ink); font-size: var(--fs-small); }
.yara-guide-body h4 small { color: var(--muted); font-weight: 400; }
.yara-guide-body ul { margin: 0; padding-left: 18px; }
.yara-guide-body li + li { margin-top: 3px; }
.yara-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; }
@media (max-width: 720px) { .yara-guide-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- Rule workbench (admin/partials/yara_workbench.php) ---------------------------------- */
.rule-lab { margin: 10px 0 0; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.rule-lab > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; padding: 10px 14px; color: var(--ink); cursor: pointer; font-size: var(--fs-small); font-weight: 600; list-style: none; }
.rule-lab > summary::-webkit-details-marker { display: none; }
.rule-lab > summary::before { content: "\25b8"; margin-right: 2px; color: var(--muted); transition: transform .45s var(--spring-bounce); }
.rule-lab[open] > summary::before { transform: rotate(90deg); }
.rule-lab .lab-hint { color: var(--muted); font-size: var(--fs-caption); font-weight: 400; }
.rule-lab-body { padding: 0 14px 14px; }
.lab-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lab-status { color: var(--muted); font-size: var(--fs-caption); }
.lab-field { display: block; margin-top: 10px; }
.lab-field textarea { margin-top: 4px; min-height: 0; }
.lab-results { margin-top: 10px; display: grid; gap: 8px; }
.lab-results[hidden] { display: none; }
.lab-compile { font-size: var(--fs-small); }
.lab-compile.ok strong { color: var(--green); }
.lab-compile.bad strong { color: var(--red); }
.lab-compile .lab-muted { color: var(--muted); }
.lab-errtext, .lab-readable { margin: 0; padding: 8px 10px; border-radius: var(--radius-sm); background: #242426; color: #ffd9d4; font-family: var(--mono); font-size: var(--fs-caption); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow: auto; }
.lab-readable { background: #242426; color: #e4e4ea; }
.lab-err { padding: 8px 10px; border: 1px solid var(--red-line); border-radius: var(--radius-sm); background: var(--red-soft); color: var(--red); font-size: var(--fs-small); }
.lab-matchhead { color: var(--ink-soft); font-size: var(--fs-small); font-weight: 600; }
.lab-match { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.lab-match-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lab-match-name { font-family: var(--mono); font-size: var(--fs-small); font-weight: 600; }
.lab-match-str { margin-top: 3px; font-size: var(--fs-caption); }
.lab-match-str code { color: var(--muted); }
.lab-match-text { font-family: var(--mono); color: var(--ink-soft); }
.lab-disguise { padding: 8px 10px; border: 1px solid var(--violet); border-radius: var(--radius-sm); background: var(--violet-soft); color: var(--ink-soft); font-size: var(--fs-caption); line-height: 1.5; }
.lab-regex { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.lab-regex-head { color: var(--ink); font-size: var(--fs-small); font-weight: 600; }
.lab-regex-head small { color: var(--muted); font-weight: 400; }
.lab-regex .lab-row { margin-top: 6px; }
.lab-slash { color: var(--muted); font-family: var(--mono); font-size: var(--fs-body); }
.lab-regex input[data-lab-regex] { flex: 1; min-width: 160px; margin: 0; }
.lab-regex input.is-bad { border-color: var(--red); }
.lab-flag { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: var(--fs-caption); white-space: nowrap; }
.lab-regex-count { color: var(--muted); font-size: var(--fs-caption); white-space: nowrap; }
.lab-regex-preview { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-family: var(--mono); font-size: var(--fs-caption); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 200px; overflow: auto; }
.lab-regex-preview[hidden] { display: none; }
.lab-mark { padding: 0 1px; border-radius: 2px; background: #fde68a; color: #242426; }
.lab-muted { color: var(--muted); }
.lab-tip { margin: 6px 0 0; }
:root[data-theme="dark"] .lab-mark { background: #b78a00; color: #fff; }
/* ---- Host-label regex helper (admin/partials/host_regex_helper.php) ------------- */
.rx-helper .rule-lab-body { display: grid; gap: 12px; }
.rx-build-head { color: var(--ink); font-size: var(--fs-small); font-weight: 600; }
.rx-build-head small { color: var(--muted); font-weight: 400; }
.rx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 12px; margin-top: 6px; }
.rx-grid .rx-wide { grid-column: 1 / -1; }
.rx-cell[hidden] { display: none; }
.rx-cell input, .rx-cell select { margin-top: 4px; }
.rx-helper .lab-row input.rx-pattern { flex: 1; min-width: 200px; margin: 6px 0 0; }
.rx-helper .lab-row .btn { margin-top: 6px; }
.rx-helper textarea[data-rx-samples] { margin-top: 6px; min-height: 0; }
.rx-verdict { margin-top: 6px; font-size: var(--fs-small); line-height: 1.5; color: var(--ink-soft); overflow-wrap: anywhere; }
.rx-verdict:empty { display: none; }
.rx-verdict.ok strong { color: var(--green); }
.rx-verdict.bad { padding: 8px 10px; border: 1px solid var(--red-line); border-radius: var(--radius-sm); background: var(--red-soft); color: var(--red); }
.rx-verdict code { padding: 0 4px; border-radius: 4px; background: var(--chip); }
.rx-warn { margin-top: 4px; padding: 6px 10px; border: 1px solid var(--amber-line); border-radius: var(--radius-sm); background: var(--amber-soft); color: var(--amber); }
.rx-results { display: grid; gap: 2px; margin: 6px 0 0; padding: 0; list-style: none; font-size: var(--fs-small); }
.rx-results[hidden] { display: none; }
.rx-results li { display: flex; align-items: baseline; gap: 8px; padding: 3px 8px; border-radius: 6px; }
.rx-results li.hit { background: var(--green-soft); }
.rx-results li .mono { overflow-wrap: anywhere; }
.rx-mark { flex: none; width: 1em; font-weight: 700; }
.rx-results li.hit .rx-mark { color: var(--green); }
.rx-results li.miss .rx-mark, .rx-why { color: var(--muted); }
.rx-why { margin-left: auto; flex: none; font-size: var(--fs-caption); }
.rx-cheat .yara-guide-grid { color: var(--ink-soft); font-size: var(--fs-small); }
.rx-cheat code { white-space: nowrap; }
.yara-anatomy { margin: 0; padding: 12px 14px; overflow-x: auto; border-radius: var(--radius-sm); background: #242426; color: #e4e4ea; font-size: var(--fs-caption); line-height: 1.55; }
.yara-anatomy b { color: #ffd88a; font-weight: 600; }
.yara-anatomy .c { color: #a2a2ac; }
table.yara-ref { font-size: var(--fs-small); background: var(--surface); border: 1px solid var(--blue-line); border-radius: var(--radius-sm); border-collapse: separate; border-spacing: 0; overflow: hidden; }
table.yara-ref td { padding: 5px 9px; border-bottom: 1px solid var(--line); }
table.yara-ref tr:last-child td { border-bottom: 0; }
table.yara-ref td:first-child { width: 42%; white-space: nowrap; }
table.yara-ref code { font-size: var(--fs-caption); }

/* ---- Narrow screens --------------------------------------------------------------------------- */
/* Below 900px the sidebar becomes a floating top bar, as in the extension;
   its links fold behind a Menu toggle instead of pushing the page content a
   screen further down. */
@media (max-width: 900px) {
  .layout { display: block; }
  /* dvh: on a phone 100vh reaches under the browser's own bars, which put the
     account and Sign out below the screen when the menu was open. */
  .sidebar { z-index: 20; width: auto; height: auto; max-height: calc(100vh - var(--gutter) * 2); max-height: calc(100dvh - var(--gutter) * 2); padding: 8px 8px 8px 14px; border-radius: 12px; }
  .sidebar .brand { min-height: 34px; padding: 0 90px 0 0; }
  .sidebar .brand-logo { height: 28px; }
  .nav-toggle-label {
    position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 6px;
    min-height: 32px; padding: 5px 11px; border-radius: 8px;
    background: var(--surface); box-shadow: var(--pill-shadow); color: var(--ink-soft); cursor: pointer; font-size: var(--fs-small); font-weight: 600;
  }
  .nav-toggle-label .nav-icon { width: 16px; height: 16px; }
  /* Visually hidden but still focusable, so the menu opens from the keyboard. */
  .nav-toggle { position: absolute; display: block; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
  .sidebar nav, .sidebar .sidebar-account { display: none; }
  .sidebar > .nav-toggle:checked ~ nav:where(:not(.lang-switch)) { display: flex; margin: 10px 0 0 -6px; padding-top: 8px; border-top: 1px solid var(--line); }
  .nav-toggle:checked ~ .sidebar-account { display: flex; flex: none; }
  .sidebar .theme-switch, .sidebar > .lang-switch { display: none; }
  .nav-toggle:checked ~ .theme-switch, .sidebar > .nav-toggle:checked ~ .lang-switch { display: flex; flex: none; }
  /* The open menu is the screen: the page behind it doesn't scroll away. */
  body:has(.nav-toggle:checked) { overflow: hidden; }
  .nav-toggle:focus-visible + .nav-toggle-label { outline: 2px solid var(--accent); outline-offset: 2px; }
  .main { padding: 20px 16px 40px; }
  .page-title { font-size: calc(var(--fs-h1) * .875); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---- Community reputation: weighted Safe / Unsafe bars ---------------------------- */
/* Rendered by partials/reputation_bar.php. Green grows from the left with the
   weighted safe share, red fills the rest; ticks mark the policy thresholds. */
.rep-bar { position: relative; display: flex; width: 100%; min-width: 90px; height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); box-shadow: inset 0 0 0 1px var(--line); }
.rep-bar.lg { height: 28px; border-radius: var(--radius-sm); }
.rep-bar > span { display: flex; align-items: center; min-width: 0; overflow: hidden; color: #fff; font-size: var(--fs-caption); font-weight: 700; white-space: nowrap; }
.rep-bar-safe { justify-content: flex-start; padding-left: 0; background: var(--green); }
.rep-bar-unsafe { justify-content: flex-end; background: var(--red); }
.rep-bar.lg .rep-bar-safe { padding-left: 10px; }
.rep-bar.lg .rep-bar-unsafe { padding-right: 10px; }
.rep-bar + .rep-bar { margin-top: 2px; }
.rep-bar-safe + .rep-bar-unsafe { border-left: 2px solid var(--surface); }
.rep-bar-tick { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed rgba(255, 255, 255, .85); }
.rep-bar.is-empty { background: repeating-linear-gradient(135deg, var(--surface-soft) 0 6px, var(--line) 6px 7px); }
.rep-scale { position: relative; height: 18px; margin-top: 4px; color: var(--muted); font-size: var(--fs-caption); }
.rep-scale span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.rep-scale span.at-start { left: 0; transform: none; }
.rep-scale span.at-end { left: 100%; transform: translateX(-100%); }
.rep-split { display: flex; white-space: nowrap; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }
.rep-split .s { color: var(--green); font-weight: 600; }
.rep-split .u { color: var(--red); font-weight: 600; }
.rep-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 10px; color: var(--muted); font-size: var(--fs-caption); }
.rep-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 2px; vertical-align: -1px; }
table.rep-weights td, table.rep-weights th { font-variant-numeric: tabular-nums; }
table.rep-weights .rep-bar { min-width: 120px; }

/* ---------- Scan confidence (lib/yara_confidence.php) ---------- */
.conf-meter { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.conf-meter-track { width: 72px; height: 8px; overflow: hidden; border-radius: 999px; background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green-line); }
.conf-meter-fill { display: block; height: 100%; border-radius: 999px; background: var(--faint); }
.conf-meter-value { min-width: 34px; color: var(--ink); font-size: var(--fs-small); font-weight: 600; font-variant-numeric: tabular-nums; }
.conf-high .conf-meter-fill, .conf-split .conf-high { background: var(--red); }
.conf-medium .conf-meter-fill, .conf-split .conf-medium { background: #d9822b; }
.conf-low .conf-meter-fill, .conf-split .conf-low { background: #d4a72c; }
.conf-none .conf-meter-value { color: var(--green); }

.conf-card { display: grid; grid-template-columns: minmax(180px, 220px) minmax(0, 1fr); gap: 18px 28px; }
.conf-score { display: flex; flex-direction: column; gap: 4px; }
.conf-score-value { font-size: var(--fs-display); font-weight: 700; letter-spacing: -1px; line-height: 1; font-variant-numeric: tabular-nums; }
.conf-score-value small { font-size: var(--fs-h3); font-weight: 600; letter-spacing: 0; color: var(--muted); }
.conf-score.conf-high .conf-score-value { color: var(--red); }
.conf-score.conf-medium .conf-score-value { color: var(--amber); }
.conf-score.conf-low .conf-score-value { color: #9a7412; }
.conf-score.conf-none .conf-score-value { color: var(--green); }
.conf-score-label { color: var(--ink); font-weight: 600; }
.conf-score-sub { color: var(--muted); font-size: var(--fs-small); }
.conf-section-title { margin: 0 0 8px; color: var(--muted); font-size: var(--fs-caption); font-weight: 600 }
.conf-split { display: flex; height: 16px; overflow: hidden; border-radius: 999px; background: var(--green); }
.conf-split > span { display: block; height: 100%; }
.conf-split .conf-safe { background: var(--green); }
.conf-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 18px; color: var(--ink-soft); font-size: var(--fs-small); }
.conf-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 4px; vertical-align: -1px; }
.conf-rules { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.conf-rules th { padding: 6px 8px; color: var(--muted); font-size: var(--fs-caption); font-weight: 600; text-align: left; }
.conf-rules td { padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.conf-rules .num { text-align: right; font-variant-numeric: tabular-nums; }
.conf-how { margin-top: var(--gap-pair); color: var(--ink-soft); font-size: var(--fs-small); }
.conf-how ol { margin: 8px 0 4px; padding-left: 20px; }
.conf-how li { margin: 3px 0; }
@media (max-width: 760px) { .conf-card { grid-template-columns: minmax(0, 1fr); } }

/* ---- Link check accuracy (Shortened links, link check page) ---------------------- */
.acc { min-width: 84px; }
.acc .rep-bar { min-width: 0; margin: 4px 0 3px; }
.acc-line { white-space: nowrap; font-size: var(--fs-small); }
.acc-pct { font-weight: 700; font-variant-numeric: tabular-nums; }
.acc-word, .acc-count { color: var(--muted); }
.acc-count { font-size: var(--fs-caption); }
.acc-good .acc-pct { color: var(--green); }
.acc-mixed .acc-pct { color: var(--amber); }
.acc-bad .acc-pct { color: var(--red); }
.acc-none { color: var(--faint); }
p.acc-none { margin: 0; font-size: var(--fs-small); }
.acc-lg .acc-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.acc-lg .acc-pct { font-size: var(--fs-figure); letter-spacing: -.4px; line-height: 1; }
.acc-lg .acc-word { font-size: var(--fs-small); }
.acc-lg .rep-bar { margin: 0; }
.acc-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; color: var(--ink-soft); font-size: var(--fs-small); }
.acc-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 2px; vertical-align: 0; }
.acc-legend .k-yes { background: var(--green); }
.acc-legend .k-no { background: var(--red); }

/* Vote moderation actions (partials/vote_moderation.php). A fixed width keeps
   the column steady whether a row shows Approve / Reject / ⋯ or one Change menu. */
/* As wide as its buttons and against the cell's right edge: the menu (⋯) every vote has ends in one line, whether or not the row also has Approve and Reject. */
.vote-actions { display: flex; width: max-content; align-items: center; justify-content: flex-end; gap: 6px; margin-left: auto; }
.vote-actions > form { margin: 0; }
.row-menu.labelled > summary { min-width: 0; gap: 6px; font-size: var(--fs-small); letter-spacing: 0; }
.row-menu.labelled .caret { width: 5px; height: 5px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.row-menu-list .menu-sep { margin: 4px 0; border: 0; border-top: 1px solid var(--line); }
/* Manage menus (host labels): a caption over a group of items, a tick on the
   item that holds now, and a note on the label the sources would promote with. */
.row-menu-list .menu-head { padding: 6px 10px 3px; color: var(--muted); font-size: var(--fs-caption); font-weight: 600 }
.row-menu-list .mi-tick { margin-left: auto; padding-left: 10px; color: var(--green); font-weight: 700; }
.row-menu-list .mi-src { margin-left: auto; padding-left: 10px; color: var(--muted); font-size: var(--fs-micro); font-weight: 400; }

/* Dated thread of changes, newest first (user status history). */
.timeline { margin: 0; padding: 0 0 0 16px; list-style: none; border-left: 2px solid var(--line); }
.timeline > li { position: relative; padding: 0 0 16px 14px; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before { position: absolute; top: 5px; left: -23px; width: 9px; height: 9px; border: 2px solid var(--line-strong); border-radius: 50%; background: var(--surface); content: ""; }
.timeline-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-small); }
.timeline-meta { margin-top: 3px; color: var(--muted); font-size: var(--fs-caption); }
.timeline-body { margin-top: 5px; font-size: var(--fs-small); line-height: 1.6; }

/* ---- View / edit sections (System configuration) -----------------------------------------
   A section shows its saved values (.es-view) until Edit opens its form
   (.es-edit); the script is in partials/footer.php. */
.es-section { scroll-margin-top: 16px; transition: box-shadow .15s, border-color .15s; }
/* The form: its parts one under another with a pair's gap between them, so a field and the
   switch that goes with it never touch; the buttons a block's gap below. A part's own margins
   are the stack's, not its own. */
.es-edit { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap-pair); }
.es-edit > * { margin-block: 0; }
/* A form that only carries hidden fields (one per table row, its inputs tied to it by form=) is no part of the stack. */
.es-edit > form:not(:has(:not(input[type=hidden]))) { display: none; }
.es-section:not(.is-editing) .es-edit { display: none; }
.es-section.is-editing .es-view,
.es-section.is-editing [data-es-open] { display: none; }
.es-section.is-editing { border-color: var(--blue-line); box-shadow: 0 0 0 3px var(--blue-soft); }
/* The label column is as wide as the longest label on any settings page, so every card's values start at one line. */
.es-dl { display: grid; grid-template-columns: minmax(190px, max-content) minmax(0, 1fr); gap: 8px 28px; margin: 0; font-size: var(--fs-small); }
.es-dl dt { color: var(--muted); font-weight: 600; }
.es-dl dd { margin: 0; overflow-wrap: anywhere; }
.es-empty { color: var(--muted); font-style: italic; }
.es-actions { margin-top: calc(var(--gap-block) - var(--gap-pair)); padding-top: 12px; border-top: 1px solid var(--line); }
.es-edit > .es-actions { margin-top: calc(var(--gap-block) - var(--gap-pair)); }
/* A form card whose fields stack on the same gaps as the settings' edit forms. */
.form-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap-pair); }
.form-stack > *, .card.form-stack > h2 { margin-block: 0; }
.form-stack > :is(.btn-row, .form-actions):last-child { margin-top: calc(var(--gap-block) - var(--gap-pair)); }
.es-error { margin: 0 0 12px; }
@media (max-width: 640px) {
  .es-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .es-dl dd { margin-bottom: 8px; }
}

/* ---- Overview card (Devices, Domains, IP addresses) ---------------------------------------
   One card in three panels: a total with a 14-day sparkline | a split bar with a
   tile per part | a side panel (ring, rows or a ranked list). Markup and helpers:
   admin/partials/overview.php. Every figure is a link to the filtered list. */
.ov { --ov-cols: minmax(240px, 1fr) minmax(0, 1.8fr) minmax(220px, .95fr);
      display: grid; grid-template-columns: var(--ov-cols); gap: 0; padding: 0; overflow: hidden; }
.ov > * { position: relative; min-width: 0; padding: 18px 20px; }
.ov > * + * { border-left: 1px solid var(--line); }
.ov a { color: inherit; text-decoration: none; }
.ov a:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.ov-label { color: var(--muted); font-size: var(--fs-caption); font-weight: 600 }
.ov-muted { color: var(--muted); font-size: var(--fs-caption); }
.ov-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ov-chip { background: var(--surface-soft); color: var(--ink-soft); font-weight: 600; display: inline-flex; align-items: center; height: var(--chip-h); padding: 0 var(--chip-px); border-radius: 999px; font-size: var(--chip-fs); line-height: 1; white-space: nowrap; }
.ov-chip.is-up, .ov-chip.is-ok { background: var(--green-soft); color: var(--green); }
.ov-chip.is-warn { background: var(--amber-soft); color: var(--amber); }
.ov-chip.is-bad { background: var(--red-soft); color: var(--red); }
/* A panel that is itself a link: a soft hover. No ring for the current one: the unfiltered
   total is current whenever nothing is filtered, so a ring drew a coloured frame round it
   (cut to three sides by the card's corners) on every visit. Its label says "· filtered". */
a.ov-total, a.ov-side { transition: background .15s; }
a.ov-total:hover, a.ov-side:hover { background: var(--surface-soft); }

/* Total + sparkline */
.ov-total { display: flex; flex-direction: column; }
.ov-big { margin: 6px 0; color: var(--ink); font-size: var(--fs-display); font-weight: 700; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.ov-big small { margin-left: 6px; color: var(--muted); font-size: var(--fs-small); font-weight: 500; letter-spacing: 0; }
.ov-new { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ov-spark { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; align-items: end; height: 54px; margin-top: auto; padding-top: 14px; }
.ov-spark-col { position: relative; display: block; height: 100%; border-radius: 999px;
                background: repeating-linear-gradient(135deg, transparent 0 3px, rgba(0, 0, 0, .035) 3px 4px), var(--surface-soft); }
.ov-spark-col:nth-child(8) { margin-left: 4px; }
/* Flat fills: this period, the period before, and today in the full blue. */
.ov-spark-fill { position: absolute; right: 0; bottom: 0; left: 0; height: var(--h); border-radius: 999px; background: #8fd0c6;
                 transform-origin: bottom; animation: ov-rise .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 30ms); }
.ov-spark-col.is-prev .ov-spark-fill { background: #d5ebe7; }
.ov-spark-col.is-today .ov-spark-fill { background: var(--blue); }
.ov-spark:hover .ov-spark-fill { opacity: .5; }
.ov-spark .ov-spark-col:hover .ov-spark-fill { background: var(--blue); opacity: 1; }
.ov-tip { position: absolute; z-index: 6; bottom: calc(100% + 6px); left: 50%; display: none; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px;
          background: var(--surface); box-shadow: var(--shadow-lg); color: var(--ink-soft); font-size: var(--fs-caption); white-space: nowrap; transform: translateX(-50%); pointer-events: none; }
.ov-tip b { color: var(--blue); }
.ov-spark-col:hover .ov-tip { display: block; }
.ov-spark-col:first-child .ov-tip { left: 0; transform: none; }
.ov-spark-col:last-child .ov-tip { right: 0; left: auto; transform: none; }
.ov-axis { display: flex; justify-content: space-between; margin-top: 5px; color: var(--faint); font-size: var(--fs-micro); font-weight: 600; }
@keyframes ov-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Split bar + tiles. Tones are shared by the bar, the tiles' dots and the rows. */
.ov-mid { display: flex; flex-direction: column; gap: 12px; }
.ov-bar { display: flex; height: 10px; gap: 3px; overflow: hidden; border-radius: 999px; }
.ov-bar > span { min-width: 6px; border-radius: 999px; }
.ov-bar .is-green { background: #3aa57a; } .ov-bar .is-amber { background: #e0a23a; } .ov-bar .is-red { background: #d0575c; }
.ov-bar .is-blue { background: var(--accent); } .ov-bar .is-violet { background: #8a6cc4; } .ov-bar .is-grey { background: var(--line-strong); }
.ov-bar .is-empty { flex: 1; background: repeating-linear-gradient(135deg, transparent 0 3px, rgba(0, 0, 0, .05) 3px 4px), var(--surface-soft); }
/* The tiles take the rest of the panel's height, so they reach the bottom of the card
   when a side panel (a sparkline, a ring) is taller than the bar and the tiles. */
.ov-tiles { display: grid; flex: 1; grid-template-columns: repeat(var(--tiles, 3), minmax(0, 1fr)); gap: 10px; }
.ov-tile { --c: var(--blue); display: flex; min-width: 0; flex-direction: column; gap: 8px; container-type: inline-size; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md);
           transition: border-color .15s, background .15s; }
.ov-tile.is-green { --c: var(--green); } .ov-tile.is-amber { --c: #c07a12; } .ov-tile.is-red { --c: var(--red); }
.ov-tile.is-violet { --c: var(--violet); } .ov-tile.is-grey { --c: var(--faint); }
a.ov-tile:hover { border-color: var(--c); background: var(--surface-soft); }
.ov-tile.is-current { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.ov-tile.is-static { background: var(--surface-soft); }
.ov-tile-top { display: flex; min-width: 0; align-items: center; gap: 8px; color: var(--ink-soft); font-size: var(--fs-body); font-weight: 600; line-height: 1.25; }
/* The tile's icon on a badge washed in its tone, so the verdict reads before the word. */
/* The tile's picture bare in its colour (an icon on a tinted square read as made by a machine). */
.ov-tile-icon { display: grid; width: 22px; height: 22px; flex: none; place-items: center; color: var(--c); }
.ov-tile-icon :is(img, svg) { width: 22px; height: 22px; object-fit: contain; }
.ov-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--c, var(--blue)); }
.ov-tile-n { display: flex; align-items: baseline; gap: 8px; color: var(--ink); font-size: var(--fs-figure); letter-spacing: -.02em; line-height: 1.15; font-weight: 700; font-variant-numeric: tabular-nums; }
/* The share sits at the far end of the count's line, in the tile's tone, over the bar drawn to it. */
.ov-tile-n small { margin-left: auto; color: var(--c); font-size: var(--fs-h2); font-weight: 700; letter-spacing: 0; }
.ov-tile-bar { display: block; height: 6px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--c) 16%, transparent); }
.ov-tile-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--c); }
.ov-tile:not(.is-zero):is(.is-amber, .is-red, .is-violet) .ov-tile-n { color: var(--c); }
.ov-tile.is-zero .ov-tile-n { color: var(--faint); }
.ov-tile.is-zero .ov-tile-n small { color: var(--faint); }
/* A narrow tile keeps the count and its share on one line, a size smaller. */
@container (max-width: 109px) {
  .ov-tile-n { gap: 6px; font-size: var(--fs-figure-sm); }
  .ov-tile-n small { font-size: var(--fs-small); }
}
.ov-tile-note { display: -webkit-box; margin-top: auto; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: var(--muted); font-size: var(--fs-small); line-height: 1.4; }

/* Side panel: a ring over a few rows, or a ranked list. */
.ov-side { display: flex; flex-direction: column; gap: 10px; }
.ov-ring { --gauge: var(--green); position: relative; display: grid; width: 92px; height: 92px; flex: none; align-self: center; place-items: center; }
.ov-ring.is-blue { --gauge: var(--blue); }
.ov-ring.is-amber { --gauge: #c07a12; }
.ov-ring.is-red { --gauge: var(--red); }
.ov-ring > span { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ov-ring b { color: var(--ink); font-size: var(--fs-figure-sm); font-variant-numeric: tabular-nums; line-height: 1.1; }
.ov-ring small { color: var(--muted); font-size: var(--fs-micro); }
.ov-rows { display: grid; gap: 2px; }
.ov-row { --c: var(--blue); position: relative; isolation: isolate; display: flex; min-height: 30px; align-items: center; gap: 8px; padding: 4px 8px; overflow: hidden;
          border-radius: 8px; font-size: var(--fs-small); transition: background .12s; }
.ov-row.is-green { --c: var(--green); } .ov-row.is-amber { --c: #c07a12; } .ov-row.is-red { --c: var(--red); } .ov-row.is-grey { --c: var(--faint); }
.ov-row:hover { background: var(--surface-soft); }
.ov-row.is-current { box-shadow: inset 0 0 0 1.5px var(--blue); }
/* A ranked row: its share drawn behind it, as in the audit log's lists. */
.ov-row.has-share::before { position: absolute; z-index: -1; inset: 0 auto 0 0; width: max(var(--w), 3px); border-radius: 8px; background: var(--blue-soft);
                            content: ""; }
.ov-row-name { min-width: 0; flex: 1; overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.ov-row-n { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.ov-row .flag-icon { width: 18px; height: auto; flex: none; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
/* A note that belongs to the block above it: a small step under it (8px), whatever that block's own margin. */
.ov-note { max-width: 92ch; margin: calc(8px - var(--gap-block)) 2px var(--gap-block); color: var(--muted); font-size: var(--fs-caption); line-height: 1.5; }
.ov-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-caption); }

@media (prefers-reduced-motion: reduce) { .ov-spark-fill { animation: none; } }
@media (max-width: 1150px) {
  .ov { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ov > .ov-mid { grid-column: 1 / -1; grid-row: 2; border-top: 1px solid var(--line); border-left: 0; }
}
@media (max-width: 640px) {
  .ov { grid-template-columns: minmax(0, 1fr); }
  .ov > * + * { border-top: 1px solid var(--line); border-left: 0; }
  .ov > .ov-mid { grid-row: auto; }
  .ov-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- Change password (password.php) ---------------------------------------------------- */
.pw-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; max-width: 860px; }
@media (min-width: 1100px) { .pw-layout { grid-template-columns: minmax(0, 1fr) 320px; } }
.pw-layout > .card { margin-bottom: 0; }
.pw-layout .form-intro { margin: 0; }
.pw-mismatch { color: var(--red); }
.pw-caps { margin-top: -6px; color: var(--amber); }
.pw-caps[hidden], .pw-mismatch[hidden] { display: none; }

/* ---- Toggle switch -------------------------------------------------------------------
   One shared switch style for every single-setting checkbox: the box renders as a track
   with a raised knob, and `assets/toggle.js` adds drag + spring. Opt-in by placing the
   checkbox inside .as-check / .rp-check / label.check / .log-why-check, or by adding
   .sg-toggle (or .switch, the settings pages' name for it) directly on the input. `th.check` (bulk-select in tables) stays untouched
   because we only match on `label.check`. The native checkbox is still the source of
   truth for forms and keyboard; the drag just moves the knob and flips its state.
   --knob-x drives horizontal travel, --knob-w the press-and-release stretch; toggle.js
   adds --knob-pull (the lean towards a nearby mouse) and --knob-sx / --knob-sy (the
   squash with speed) while the knob is in its hands (.is-live), and colours the
   track by which side the knob is on (.is-on-side). */
.as-check input[type=checkbox],
.rp-check input[type=checkbox],
label.check input[type=checkbox],
.log-why-check input[type=checkbox],
input[type=checkbox]:is(.sg-toggle, .switch) {
  appearance: none; -webkit-appearance: none; position: relative; flex: none;
  width: 2.9em; height: 1.5em; margin: 0; padding: 0; font-size: var(--fs-h2);
  border-radius: 999px; cursor: pointer; touch-action: pan-y;
  background-color: #e2e2e5;
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, .32),
    inset 0 -1px 1px rgba(255, 255, 255, .18),
    0 1px 1px rgba(255, 255, 255, .9);
  transition: background-color .4s cubic-bezier(.25, .9, .3, 1), box-shadow .4s ease;
  --knob-x: 0em;
  --knob-w: 1.25em;
}
.as-check input[type=checkbox]:checked,
.rp-check input[type=checkbox]:checked,
label.check input[type=checkbox]:checked,
.log-why-check input[type=checkbox]:checked,
input[type=checkbox]:is(.sg-toggle, .switch):checked {
  background-color: var(--switch-on);
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, .35),
    inset 0 -1px 1px rgba(255, 255, 255, .14),
    0 1px 1px rgba(255, 255, 255, .9);
  --knob-x: 1.1em; --knob-w: 1.55em;
}
.as-check input[type=checkbox]::before,
.rp-check input[type=checkbox]::before,
label.check input[type=checkbox]::before,
.log-why-check input[type=checkbox]::before,
input[type=checkbox]:is(.sg-toggle, .switch)::before {
  content: ""; position: absolute; top: .125em; left: .125em;
  width: var(--knob-w); height: 1.25em; border-radius: 999px;
  background: linear-gradient(to bottom, #ffffff, #e6e6ec);
  box-shadow:
    inset 0 -0.0625em 0.0625em 0.125em rgba(0, 0, 0, .1),
    inset 0 -0.125em 0.0625em rgba(0, 0, 0, .18),
    inset 0 0.1875em 0.0625em rgba(255, 255, 255, .55),
    0 0.125em 0.1875em rgba(0, 0, 0, .32);
  transform: translateX(calc(var(--knob-x) + var(--knob-pull, 0px))) scale(var(--knob-sx, 1), var(--knob-sy, 1));
  transition: transform .42s cubic-bezier(.34, 1.46, .5, 1),
              width .34s cubic-bezier(.4, 1.3, .55, 1);
}
/* In toggle.js's hands the knob goes where it is put, and the track shows the
   side it is on. */
.as-check input[type=checkbox].is-live::before,
.rp-check input[type=checkbox].is-live::before,
label.check input[type=checkbox].is-live::before,
.log-why-check input[type=checkbox].is-live::before,
input[type=checkbox]:is(.sg-toggle, .switch).is-live::before { transition: width .34s cubic-bezier(.4, 1.3, .55, 1); }
.as-check input[type=checkbox].is-live:not(.is-on-side),
.rp-check input[type=checkbox].is-live:not(.is-on-side),
label.check input[type=checkbox].is-live:not(.is-on-side),
.log-why-check input[type=checkbox].is-live:not(.is-on-side),
input[type=checkbox]:is(.sg-toggle, .switch).is-live:not(.is-on-side) { background-color: #e2e2e5; }
.as-check input[type=checkbox].is-live.is-on-side,
.rp-check input[type=checkbox].is-live.is-on-side,
label.check input[type=checkbox].is-live.is-on-side,
.log-why-check input[type=checkbox].is-live.is-on-side,
input[type=checkbox]:is(.sg-toggle, .switch).is-live.is-on-side { background-color: var(--switch-on); }
/* Press-stretch: knob widens into the empty half of the track while held still.
   A real drag drops the stretch and tracks the pointer at rest width. */
.as-check input[type=checkbox].is-pressing:not(.is-dragging),
.rp-check input[type=checkbox].is-pressing:not(.is-dragging),
label.check input[type=checkbox].is-pressing:not(.is-dragging),
.log-why-check input[type=checkbox].is-pressing:not(.is-dragging),
input[type=checkbox]:is(.sg-toggle, .switch).is-pressing:not(.is-dragging) { --knob-w: 1.4em; }
.as-check input[type=checkbox].is-pressing:not(.is-dragging):checked,
.rp-check input[type=checkbox].is-pressing:not(.is-dragging):checked,
label.check input[type=checkbox].is-pressing:not(.is-dragging):checked,
.log-why-check input[type=checkbox].is-pressing:not(.is-dragging):checked,
input[type=checkbox]:is(.sg-toggle, .switch).is-pressing:not(.is-dragging):checked { --knob-w: 1.65em; --knob-x: 1em; }
.as-check input[type=checkbox].is-dragging::before,
.rp-check input[type=checkbox].is-dragging::before,
label.check input[type=checkbox].is-dragging::before,
.log-why-check input[type=checkbox].is-dragging::before,
input[type=checkbox]:is(.sg-toggle, .switch).is-dragging::before { transition: none; }
.as-check input[type=checkbox]:focus-visible,
.rp-check input[type=checkbox]:focus-visible,
label.check input[type=checkbox]:focus-visible,
.log-why-check input[type=checkbox]:focus-visible,
input[type=checkbox]:is(.sg-toggle, .switch):focus-visible { outline: 2px solid var(--switch-on); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .as-check input[type=checkbox], .rp-check input[type=checkbox],
  label.check input[type=checkbox], .log-why-check input[type=checkbox],
  input[type=checkbox]:is(.sg-toggle, .switch),
  .as-check input[type=checkbox]::before, .rp-check input[type=checkbox]::before,
  label.check input[type=checkbox]::before, .log-why-check input[type=checkbox]::before,
  input[type=checkbox]:is(.sg-toggle, .switch)::before { transition: none; }
}

/* ---- Typing fade --------------------------------------------------------------------
   Each new character fades in from .12em below as the user types; prior characters are
   left alone. The native <input> is still what the browser sees — it just paints its
   text transparent while the mirror span draws the visible letters. `assets/input_fade.js`
   wraps every eligible input with .sg-tf and attaches the renderer; this file paints
   only, and the wrap is a no-op if the input already lives inside a .sg-tf. Opt out of
   the whole thing on an input with data-sg-type-fade="off", or on a container by giving
   it .sg-type-fade-skip. */
/* The wrap takes the width of the slot the input used to sit in (block within a form
   row, flex item in a toolbar) so the mirror lines up with the input underneath. */
.sg-tf { position: relative; display: block; width: 100%; min-width: 0; }
.sg-tf.sg-tf--inline { display: inline-flex; width: auto; }
.sg-tf > input,
.sg-tf > textarea {
  color: transparent;
  caret-color: var(--ink, #1d1d1f);
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}
.sg-tf > input::selection,
.sg-tf > textarea::selection { background: rgba(12, 129, 120, .22); color: transparent; }
/* Mirror base. font / padding / line-height are copied from the host at mount
   (and on resize) so transparent native text and visible mirror text line up pixel-for-pixel.
   The single-line mirror vertically centres (inputs); the multiline mirror pins text
   to the top-left and wraps (textareas). */
/* Single-line input mirror: text sits on one line, vertically centred. The flex
   centre works because the mirror never wraps — the input's text doesn't either. */
.sg-tf__mirror {
  position: absolute; left: 0; right: 0; top: 0; bottom: 0;
  display: flex; align-items: center;
  margin: 0;
  pointer-events: none;
  overflow: hidden;
  color: var(--ink, #1d1d1f);
  white-space: pre;
}
/* Multiline (textarea) mirror: text flows top-down and must wrap exactly like
   the textarea does, so the mirror is a plain block with pre-wrap, not a flex
   container (flex items don't participate in line wrapping). */
.sg-tf.sg-tf--multiline .sg-tf__mirror {
  display: block;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.sg-tf__mirror .sg-tf__char { display: inline-block; transform-origin: 50% 80%; animation: sg-tf-rise .5s var(--spring) both; }
.sg-tf__mirror .sg-tf__char.is-settled { animation: none !important; opacity: 1; transform: none; }
.sg-tf__mirror .sg-tf__paste { animation: sg-tf-paste .42s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes sg-tf-paste { from { opacity: 0; filter: blur(4px); } }
/* Each typed character lands with a spring: in from below, a touch large, settling. */
@keyframes sg-tf-rise {
  0%   { opacity: 0; transform: translateY(.3em) scale(1.3); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .sg-tf__mirror .sg-tf__char { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* ---- Theme switch (lib/theme.php, user/assets/theme.js) ------------------------ */
/* Light / Auto / Dark in one sliding pill, at the foot of the sidebar above the
   account: styled by user/assets/theme_switch.css.

   Switching themes. While it switches, element transitions are off so colours
   change in one step under the page-wide animation (all but the switch's own,
   whose knob slides inside the new theme); a picked theme grows in a
   circle (theme.js animates the new snapshot), the device's change keeps the view
   transition's cross-fade, and with no view transitions colours fade. */
:root.theme-switching :not(.theme-switch, .theme-switch *), :root.theme-switching :not(.theme-switch *)::before, :root.theme-switching :not(.theme-switch *)::after { transition: none !important; }
:root.theme-reveal::view-transition-old(root),
:root.theme-reveal::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
:root.theme-fading, :root.theme-fading :not(.theme-switch, .theme-switch *), :root.theme-fading :not(.theme-switch *)::before, :root.theme-fading :not(.theme-switch *)::after {
  transition: background-color .3s ease, color .3s ease, border-color .3s ease, fill .3s ease, stroke .3s ease, box-shadow .3s ease !important;
}

/* Moving between pages of the site cross-fades, and the sidebar stays where it
   is (cross-document view transitions; browsers without them just load the
   page). The sidebar is left out of a theme switch's transition so the switch's
   circle covers it too. Reduced motion: no animation. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
::view-transition-group(root) { animation-duration: .18s; }
::view-transition-group(sg-sidebar) { animation-duration: .18s; }
.sidebar, .settings-sidebar { view-transition-name: sg-sidebar; }
:root.theme-switching :is(.sidebar, .settings-sidebar) { view-transition-name: none; }
/* The current entry's white pill slides from the page left to the page
   opened, with a little spring, while the sidebar round it cross-fades. */
.sidebar nav a.active, .settings-nav a.active { view-transition-name: sg-nav-active; }
:root.theme-switching :is(.sidebar nav a.active, .settings-nav a.active) { view-transition-name: none; }
::view-transition-group(sg-nav-active) { animation-duration: .45s; animation-timing-function: var(--spring); }
::view-transition-old(sg-nav-active) { animation-duration: .12s; }
::view-transition-new(sg-nav-active) { animation-duration: .2s; }
/* The hover pill (nav.js): one translucent pill gliding between the entries
   under the mouse, behind them. */
.sidebar nav, .settings-nav { position: relative; }
.nav-hover-pill { position: absolute; top: 0; left: 0; z-index: 0; width: 0; height: 0; border-radius: 8px; background: var(--hover); opacity: 0; pointer-events: none; transform-origin: center; transition: opacity .15s; }
.nav-hover-pill.is-on { opacity: 1; }
.sidebar nav.has-hover-pill > :not(.nav-hover-pill), .settings-nav.has-hover-pill > :not(.nav-hover-pill) { position: relative; }
.sidebar nav.has-hover-pill a:hover:not(.active), .sidebar nav.has-hover-pill .nav-group > summary:hover, .settings-nav.has-hover-pill a:hover:not(.active) { background: transparent; }

/* ---- Dark mode --------------------------------------------------------------- */
/* theme.js sets data-theme="dark" on <html> when Dark is picked, or Auto and the
   device is dark. The same tokens with dark values, then the few rules above
   that hard-code a light colour. Text tokens keep 4.5:1 on --surface; --blue
   and --red stay mid-tone because they also fill buttons under white text,
   and links use --blue-ink. The user portal (user/assets/style.css) sets its
   own neutral, teal-accented values over these. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --switch-on: #2dd4bf;
  --ink: #ececf1;
  --ink-soft: #c9c9d1;
  --muted: #9e9ea8;
  --faint: #75757f;
  --line: #2f2f35;
  --line-strong: #3e3e46;
  --surface: #1c1c1f;
  --surface-soft: #232327;
  --canvas: #131315;
  --blue: #118a7f;
  --blue-hover: #149a8e;
  --blue-ink: #5fd0c3;
  --blue-soft: #10302c;
  --blue-line: #1d4f49;
  --accent-bright: #2dd4bf;
  --green: #5cd096;
  --green-soft: #12291f;
  --green-line: #1f4a36;
  --amber: #e8b45a;
  --amber-soft: #2d2210;
  --amber-line: #5a4219;
  --red: #f28b8e;
  --red-soft: #321a1b;
  --red-line: #5c2a2c;
  --violet: #c3a6e0;
  --violet-soft: #261d30;
  --chip: #2a2a2f;
  --phishing: #f0a65a;
  --phishing-soft: #2e1f10;
  --malware: #f28b8e;
  --malware-soft: #321a1b;
  --redirect: #84b6dc;
  --redirect-soft: #142431;
  --nsfw: #c3a6e0;
  --nsfw-soft: #261d30;
  --gambling: #cfd06a;
  --gambling-soft: #25250f;
  --shadow: 0 0 0 .5px rgba(255, 255, 255, .08), 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, .5);
  --sidebar: rgba(32, 32, 36, .82);
  --nav-current: var(--surface-soft);
  --hover: rgba(255, 255, 255, .05);
  --press: rgba(255, 255, 255, .09);
  --fill-strong: rgba(255, 255, 255, .08);
  --seg-on: rgba(255, 255, 255, .1);   /* over the track's own tint, so it is the lighter of the two on any panel */
  --pill-shadow: 0 0 0 .5px rgba(255, 255, 255, .1), 0 1px 2px rgba(0, 0, 0, .4);
  --float-shadow: 0 0 0 .5px rgba(255, 255, 255, .08), 0 8px 28px -10px rgba(0, 0, 0, .6);
  --pop-shadow: 0 0 0 .5px rgba(255, 255, 255, .1), 0 6px 14px rgba(0, 0, 0, .35), 0 18px 40px -12px rgba(0, 0, 0, .6);
  --face: linear-gradient(180deg, #363639 0%, #2d2d30 100%);
  --face-hover: linear-gradient(180deg, #3d3d41 0%, #333337 100%);
  --face-shadow: 0 0 0 .5px rgba(255, 255, 255, .09), 0 1px 2px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3);
  --face-shadow-hover: 0 0 0 .5px rgba(255, 255, 255, .14), 0 1px 2px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3);
  --face-shadow-press: inset 0 1px 3px rgba(0, 0, 0, .6);
  --groove-hover: rgba(255, 255, 255, .11);
  --groove-hover-ring: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
/* The animated icons (assets/icons/animated/*.gif) are one dark navy shape on
   transparency, drawn for light pages; on a dark page they all but vanish. The
   filter turns every drawn pixel into one near-white grey (brightness(0) makes the
   shape black, invert() then lifts it), keeping the transparency and the
   animation, so no second set of gifs is needed. Brighter where the text is too:
   the current page and a hovered link. */
:root[data-theme="dark"] img[src*="icons/animated/"] { filter: brightness(0) invert(.94); }
:root[data-theme="dark"] :is(a, button, summary):is(:hover, :focus-visible, .active, [aria-current="page"]) img[src*="icons/animated/"] { filter: brightness(0) invert(1); }
:root[data-theme="dark"] img[src*="logo-landscape.png"] { content: url("logo-landscape-dark.png"); }
:root[data-theme="dark"] .rv-verdict:is(.tone-spam, .tone-other) { --tone: #b2b2bb; --tone-soft: #2a2a2f; }
:root[data-theme="dark"] tbody tr:hover { background: #212125; }
:root[data-theme="dark"] .badge.manual { background: #33192a; color: #f0a3c8; }
:root[data-theme="dark"] .badge:is(.spam, .other) { background: #2a2a2f; color: #b2b2bb; }
:root[data-theme="dark"] :is(input, textarea, select)::placeholder { color: var(--muted); }
:root[data-theme="dark"] :is(button.danger, .btn.danger) { border-color: #b23b3f; background: #b23b3f; }
:root[data-theme="dark"] :is(button.danger, .btn.danger):hover { border-color: #c4474b; background: #c4474b; }
:root[data-theme="dark"] .callout.warn { color: var(--amber); }
:root[data-theme="dark"] .callout.danger { color: var(--red); }
:root[data-theme="dark"] :is(.seg, .page-tabs, .view-switch, .rt-tablist).has-pill { background: linear-gradient(180deg, #19191b 0%, #212123 100%); box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, .55), inset 0 -1px 1px rgba(255, 255, 255, .06), 0 1px 1px rgba(255, 255, 255, .05); }
:root[data-theme="dark"] .seg-pill { background: linear-gradient(180deg, #363639 0%, #2d2d30 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 -1px 0 rgba(0, 0, 0, .3), 0 1px 2px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3); }
:root[data-theme="dark"] .is-lifted .seg-pill { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 4px 10px rgba(0, 0, 0, .55), 0 10px 24px rgba(0, 0, 0, .4); }
:root[data-theme="dark"] .copyable::after { color: var(--canvas); }
:root[data-theme="dark"] .sgc-grid line { stroke: var(--line); }
:root[data-theme="dark"] .sgc-tip { box-shadow: 0 0 0 1px var(--line-strong), 0 8px 24px rgba(0, 0, 0, .5); }
:root[data-theme="dark"] .sgc-col.is-on .sgc-col-hit { fill: rgba(255, 255, 255, .05); }
:root[data-theme="dark"] .sf-legend i { background: repeating-linear-gradient(135deg, var(--muted) 0 3px, var(--line-strong) 3px 6px); }
:root[data-theme="dark"] .cp-chip button:hover { background: rgba(255, 255, 255, .12); }
:root[data-theme="dark"] .cc-hit { background: #5a4219; }
:root[data-theme="dark"] dialog.modal::backdrop { background: rgba(0, 0, 0, .6); }
:root[data-theme="dark"] .yara-anatomy { background: #121214; box-shadow: inset 0 0 0 1px var(--line); }
:root[data-theme="dark"] .rep-bar > span { color: #131315; }
:root[data-theme="dark"] .rep-bar-tick { border-left-color: rgba(20, 20, 21, .85); }
:root[data-theme="dark"] .conf-score.conf-low .conf-score-value { color: #dcbd6a; }
:root[data-theme="dark"] .ov-spark-col,
:root[data-theme="dark"] .ov-bar .is-empty { background: repeating-linear-gradient(135deg, transparent 0 3px, rgba(255, 255, 255, .04) 3px 4px), var(--surface-soft); }
:root[data-theme="dark"] .ov-spark-fill { background: #1f7a70; }
:root[data-theme="dark"] .ov-spark-col.is-prev .ov-spark-fill { background: #243d39; }
:root[data-theme="dark"] .ov-spark-col.is-today .ov-spark-fill { background: var(--blue); }
:root[data-theme="dark"] .ov-tip b { color: var(--blue-ink); }
:root[data-theme="dark"] :is(.ov-tile, .ov-ring, .ov-row).is-amber { --c: var(--amber); }
:root[data-theme="dark"] .ov-row .flag-icon { box-shadow: 0 0 0 1px rgba(255, 255, 255, .1); }
/* The toggle switch: a dark track without the light rim, and a softer knob. On and
   off are separate rules so the :checked fill still wins. */
:root[data-theme="dark"] :is(.as-check input[type=checkbox], .rp-check input[type=checkbox], label.check input[type=checkbox], .log-why-check input[type=checkbox], input[type=checkbox]:is(.sg-toggle, .switch)) {
  background-color: var(--line-strong);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, .5), inset 0 -1px 1px rgba(255, 255, 255, .05);
}
:root[data-theme="dark"] :is(.as-check input[type=checkbox], .rp-check input[type=checkbox], label.check input[type=checkbox], .log-why-check input[type=checkbox], input[type=checkbox]:is(.sg-toggle, .switch)):checked { background-color: var(--switch-on); }
:root[data-theme="dark"] :is(.as-check input[type=checkbox], .rp-check input[type=checkbox], label.check input[type=checkbox], .log-why-check input[type=checkbox], input[type=checkbox]:is(.sg-toggle, .switch))::before {
  background: linear-gradient(to bottom, #ececf1, #c9c9d1);
  box-shadow: inset 0 -0.125em 0.0625em rgba(0, 0, 0, .18), 0 0.125em 0.1875em rgba(0, 0, 0, .5);
}
:root[data-theme="dark"] .sg-tf > :is(input, textarea)::selection { background: rgba(143, 180, 245, .3); }

/* "Read a picture…" under a message box (assets/image_text.js). */
.it-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; }
.it-bar .it-status { color: var(--muted); font-size: var(--fs-caption); }

/* Icons lean in on hover; admin/assets/icon_hover.js replays the gif with it. */
.sidebar nav a img, .settings-nav a img, .sidebar .nav-group > summary img, .account-menu img,
.sign-out-button img, .card-link img, .lh-icon img { transition: transform .45s var(--spring-pop); }
.sidebar nav a:hover img, .settings-nav a:hover img, .sidebar .nav-group > summary:hover img,
.sidebar nav a:focus-visible img, .settings-nav a:focus-visible img, .account-menu a:hover img,
.sign-out-button:hover img, .lh-card:hover .lh-icon img { transform: scale(1.14); }
.card-link:hover img { transform: translateX(2px) scale(1.08); }
@media (prefers-reduced-motion: reduce) {
  .sidebar nav a img, .settings-nav a img, .sidebar .nav-group > summary img, .account-menu img,
  .sign-out-button img, .card-link img, .lh-icon img { transition: none; }
  .sidebar nav a:hover img, .settings-nav a:hover img, .sidebar .nav-group > summary:hover img,
  .sidebar nav a:focus-visible img, .settings-nav a:focus-visible img, .account-menu a:hover img,
  .sign-out-button:hover img, .lh-card:hover .lh-icon img, .card-link:hover img { transform: none; }
}


/* ---- The ring chart (sgRing: admin/assets/ring.js, and ring_chart.js in the
   extension; the same rules are in both stylesheets, keep them in step) ---- */
.sg-ring-wrap { display: grid; flex: 1; place-items: center; min-width: 0; min-height: 0; }
.sg-ring { display: block; width: 100%; height: auto; max-height: 340px; overflow: visible; font-family: inherit; }
/* Drawing in (ring.js): hidden until on screen; knots and dot-slices pop from their centre. */
.sg-ring-pending .sg-ring { visibility: hidden; }
.sg-ring-knot, .sg-ring-arc { transform-box: fill-box; transform-origin: 50% 50%; }
.sg-ring-halo { fill: none; stroke: var(--line); stroke-width: 1; }
.sg-ring-ticks { fill: none; stroke: var(--line-strong); stroke-width: 1; opacity: .7; }
.sg-ring-track { fill: none; stroke: var(--line); }
.sg-ring-seg { cursor: default; outline: none; }
.sg-ring-seg.is-link { cursor: pointer; }
.sg-ring-arc { fill: none; stroke-linecap: round; transition: opacity .15s, stroke-width .15s; }
/* Five cool colours in rank order, the brand's teal first, each unlike its
   neighbours (the last wraps round to the first); lighter ones in dark mode. */
.sg-ring-shade-0 { stroke: #0e9488; }
.sg-ring-shade-1 { stroke: #7448d4; }
.sg-ring-shade-2 { stroke: #3fa7e6; }
.sg-ring-shade-3 { stroke: #b1408f; }
.sg-ring-shade-4 { stroke: #2457c5; }
.sg-ring-shade-other { stroke: #d6dfeb; }
.sg-ring-lead { fill: none; stroke: var(--ink-soft); stroke-width: 1; opacity: .55; transition: opacity .15s; }
.sg-ring-knot { fill: var(--ink-soft); opacity: .7; }
.sg-ring-name { fill: var(--ink); font-size: var(--fs-small); font-weight: 600; }
.sg-ring-meta { fill: var(--muted); font-size: var(--fs-caption); }
.sg-ring-pct { fill: var(--ink); font-size: var(--fs-small); font-weight: 700; font-variant-numeric: tabular-nums; }
.sg-ring-flag { font-size: var(--fs-micro); }
.sg-ring-seg.is-danger .sg-ring-flag { fill: var(--red); }
.sg-ring-seg.is-warn .sg-ring-flag { fill: var(--amber); }
.sg-ring-seg > *:not(title) { transition: opacity .15s; }
.sg-ring:has(.sg-ring-seg:hover, .sg-ring-seg:focus-visible) .sg-ring-seg:not(:hover):not(:focus-visible) > *:not(title) { opacity: .28; }
.sg-ring-seg:hover .sg-ring-arc, .sg-ring-seg:focus-visible .sg-ring-arc, .sg-ring-seg.is-current .sg-ring-arc { stroke-width: calc(var(--sg-ring-sw, 22px) + 4px); }
.sg-ring-seg:hover .sg-ring-lead, .sg-ring-seg:focus-visible .sg-ring-lead { opacity: 1; }
.sg-ring-seg:focus-visible .sg-ring-name { text-decoration: underline; }
.sg-ring-seg.is-current .sg-ring-name { fill: var(--blue, var(--accent)); }
.sg-ring-value { fill: var(--ink); font-size: var(--fs-figure); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sg-ring-caption { fill: var(--muted); font-size: var(--fs-caption); }
:root[data-theme="dark"] .sg-ring-shade-0 { stroke: #3cc4b6; }
:root[data-theme="dark"] .sg-ring-shade-1 { stroke: #ad8ff7; }
:root[data-theme="dark"] .sg-ring-shade-2 { stroke: #93d3f8; }
:root[data-theme="dark"] .sg-ring-shade-3 { stroke: #e483c6; }
:root[data-theme="dark"] .sg-ring-shade-4 { stroke: #79a6f7; }
:root[data-theme="dark"] .sg-ring-shade-other { stroke: var(--line-strong); }

/* ---- Small gauges (sg_gauge_svg, lib/ui.php): the ring charts' design for one
   share, under a figure. The extension's page ring has the same rules
   (extension.css): keep them in step. A ring sets --gauge, and --gauge-rest
   when the rest means something. ---- */
.sg-gauge { --gauge-rest-default: #d6dfeb; position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sg-gauge-halo { fill: none; stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sg-gauge-ticks { fill: none; stroke: var(--line-strong); stroke-width: 1; opacity: .7; vector-effect: non-scaling-stroke; }
.sg-gauge-rest, .sg-gauge-fill { fill: none; stroke-width: 8; stroke-linecap: round; }
.sg-gauge-rest { stroke: var(--gauge-rest, var(--gauge-rest-default)); }
.sg-gauge-fill { stroke: var(--gauge, var(--accent)); }
:root[data-theme="dark"] .sg-gauge { --gauge-rest-default: var(--line-strong); }

/* No rubber-banding past the ends of the page (the Mac's elastic scroll): the page stops where it ends. */
html, body { overscroll-behavior: none; }

/* The controls that are moved by hand (segmented controls, tabs, the menus'
   entries, the theme switch) are not text to select or links to drag out. */
:is(.seg, .page-tabs, .view-switch, .rt-tablist, .theme-switch, .sidebar nav, .settings-nav) :is(a, button, label, summary, img, svg), .seg-pill { user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }

/* Keyboard focus shows on everything that can take it, in one ring; pointer
   focus does not. Controls with a ring of their own keep it. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Dialogs open and close with the same motion: up and in with a spring, down
   and out on closing (a transition on display and overlay, so the closing is
   seen), their backdrop fading with them. */
/* Opening it rises from a little smaller and springs past its size before it settles (8px and 98%
   with the gentle spring overshot by a third of a pixel: nothing anyone could see); closing it goes
   quickly, with no bounce. */
dialog.modal {
  opacity: 0; transform: translateY(6px) scale(.97);
  transition: opacity .14s, transform .16s cubic-bezier(.4, 0, 1, 1), display .2s allow-discrete, overlay .2s allow-discrete;
}
dialog.modal[open] { opacity: 1; transform: none; transition: opacity .18s, transform .55s var(--spring-bounce), display .55s allow-discrete, overlay .55s allow-discrete; }
@starting-style { dialog.modal[open] { opacity: 0; transform: translateY(16px) scale(.9); } }
dialog.modal::backdrop { opacity: 0; transition: opacity .25s, display .4s allow-discrete, overlay .4s allow-discrete; }
dialog.modal[open]::backdrop { opacity: 1; }
@starting-style { dialog.modal[open]::backdrop { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { dialog.modal, dialog.modal::backdrop { transition: none; } }

/* A table wider than its box shows a soft edge where more of it waits:
   two shadows that the content covers as it scrolls under them. */
.table-wrap, .table-scroll {
  background:
    linear-gradient(90deg, var(--surface) 40%, rgba(255, 255, 255, 0)) left / 32px 100% no-repeat local,
    linear-gradient(270deg, var(--surface) 40%, rgba(255, 255, 255, 0)) right / 32px 100% no-repeat local,
    linear-gradient(90deg, rgba(0, 0, 0, .14), rgba(0, 0, 0, 0)) left / 12px 100% no-repeat scroll,
    linear-gradient(270deg, rgba(0, 0, 0, .14), rgba(0, 0, 0, 0)) right / 12px 100% no-repeat scroll,
    var(--surface);
}
:root[data-theme="dark"] .table-wrap, :root[data-theme="dark"] .table-scroll {
  background:
    linear-gradient(90deg, var(--surface) 40%, rgba(0, 0, 0, 0)) left / 32px 100% no-repeat local,
    linear-gradient(270deg, var(--surface) 40%, rgba(0, 0, 0, 0)) right / 32px 100% no-repeat local,
    linear-gradient(90deg, rgba(0, 0, 0, .5), rgba(0, 0, 0, 0)) left / 12px 100% no-repeat scroll,
    linear-gradient(270deg, rgba(0, 0, 0, .5), rgba(0, 0, 0, 0)) right / 12px 100% no-repeat scroll,
    var(--surface);
}

/* Their header tint and row hover are translucent, so the edges show through. */
.table-wrap th, .table-scroll th { background: rgba(0, 0, 0, .035); }
.table-wrap tbody tr:hover, .table-scroll tbody tr:hover { background: rgba(0, 0, 0, .02); }
:root[data-theme="dark"] .table-wrap th, :root[data-theme="dark"] .table-scroll th { background: rgba(255, 255, 255, .03); }
:root[data-theme="dark"] .table-wrap tbody tr:hover, :root[data-theme="dark"] .table-scroll tbody tr:hover { background: rgba(255, 255, 255, .025); }

/* Tooltips (tooltip.js): one dark pill that pops up over the element under
   the pointer, pointing at it, and springs into place. */
.sg-tip { position: fixed; left: 0; top: 0; z-index: 1200; box-sizing: border-box; max-width: 300px; padding: 6px 10px; border-radius: 8px; background: #2d2d31; color: #fff; font-size: var(--fs-caption); font-weight: 500; line-height: 1.4; letter-spacing: 0; text-align: left; box-shadow: 0 6px 18px rgba(0, 0, 0, .22); pointer-events: none; overflow-wrap: anywhere; white-space: pre-line; opacity: 0; visibility: hidden; transform: translateY(5px) scale(.94); transform-origin: var(--tip-ax, 50%) 100%; transition: opacity .12s, visibility 0s .3s, transform .3s; }
.sg-tip.is-below { transform: translateY(-5px) scale(.94); transform-origin: var(--tip-ax, 50%) 0; }
.sg-tip.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity .14s, visibility 0s, transform .45s var(--spring-bounce); }
.sg-tip-arrow { position: absolute; bottom: -4px; width: 8px; height: 8px; margin-left: -4px; border-radius: 2px; background: inherit; transform: rotate(45deg); }
.sg-tip.is-below .sg-tip-arrow { bottom: auto; top: -4px; }
:root[data-theme="dark"] .sg-tip { background: #ebebef; color: #1d1d1f; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
@media (prefers-reduced-motion: reduce) { .sg-tip, .sg-tip.is-on { transition: opacity .12s, visibility 0s; transform: none; } }

/* Toasts (toast.js): notices in the corner, newest at the bottom. Each drops
   in with a spring, drains a thin line along its edge for the time it has
   left, holds while hovered, and can be thrown out to the right. */
.sg-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 1100; display: flex; flex-direction: column; align-items: stretch; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.sg-toast { position: relative; box-sizing: border-box; display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; padding: 11px 10px 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 10px 30px rgba(0, 0, 0, .16), 0 1px 3px rgba(0, 0, 0, .08); color: var(--ink); font-size: var(--fs-small); font-weight: 500; line-height: 1.45; text-align: left; pointer-events: auto; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; opacity: 0; transform: translateY(18px) scale(.95); transition: opacity .18s, transform .55s var(--spring-bounce), height .35s cubic-bezier(.4, 0, .2, 1), margin-top .35s cubic-bezier(.4, 0, .2, 1); }
.sg-toast.is-in { opacity: 1; transform: none; }
.sg-toast.is-dragging { transition: none; cursor: grabbing; }
.sg-toast.is-out { opacity: 0; transform: translateY(8px) scale(.96); pointer-events: none; transition: opacity .2s, transform .25s, height .35s cubic-bezier(.4, 0, .2, 1) .08s, margin-top .35s cubic-bezier(.4, 0, .2, 1) .08s; }
.sg-toast.is-out.is-flung { transform: translateX(var(--fling, 320px)); transition: opacity .3s, transform .32s cubic-bezier(.2, .6, .4, 1), height .35s cubic-bezier(.4, 0, .2, 1) .1s, margin-top .35s cubic-bezier(.4, 0, .2, 1) .1s; }
.sg-toast-icon { display: grid; flex: none; width: 20px; height: 20px; margin-top: 1px; place-items: center; }
.sg-toast-icon svg { width: 18px; height: 18px; }
.sg-toast.is-ok .sg-toast-icon { color: var(--green, #1a7f4b); }
.sg-toast.is-err .sg-toast-icon { color: var(--red, #c0392b); }
.sg-toast.is-warn .sg-toast-icon { color: var(--amber, #a86a00); }
.sg-toast.is-info .sg-toast-icon { color: var(--blue); }
.sg-toast-body { min-width: 0; flex: 1; padding-top: 2px; overflow-wrap: anywhere; }
.sg-toast-body a { color: var(--blue, var(--accent)); font-weight: 600; }
.sg-toast-action { display: block; width: fit-content; min-height: 0; margin: 6px 0 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--blue, var(--accent)); font: inherit; font-weight: 600; cursor: pointer; }
.sg-toast-action:hover { background: none; text-decoration: underline; transform: none; }
.sg-toast-close { display: grid; flex: none; width: 24px; height: 24px; min-height: 0; margin: -2px 0 0; padding: 0; place-items: center; border: 0; border-radius: 6px; background: none; box-shadow: none; color: var(--muted); cursor: pointer; }
.sg-toast-close:hover { background: var(--hover, rgba(0, 0, 0, .06)); color: var(--ink); transform: none; box-shadow: none; }
.sg-toast-close svg { width: 13px; height: 13px; }
.sg-toast-life { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; opacity: .45; transform-origin: 0 50%; animation: sg-toast-life var(--life, 5s) linear forwards; }
.sg-toast.is-ok .sg-toast-life { background: var(--green, #1a7f4b); }
.sg-toast.is-err .sg-toast-life { background: var(--red, #c0392b); }
.sg-toast.is-warn .sg-toast-life { background: var(--amber, #a86a00); }
.sg-toast.is-info .sg-toast-life { background: var(--blue); }
.sg-toast.is-held .sg-toast-life { animation-play-state: paused; }
@keyframes sg-toast-life { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 600px) { .sg-toasts { right: 12px; bottom: 12px; left: 12px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .sg-toast, .sg-toast.is-in, .sg-toast.is-out, .sg-toast.is-out.is-flung { transform: none; transition: opacity .15s, height .2s, margin-top .2s; } }

/* Empty lists (sg_empty(), sg_empty_row()): an icon in a soft square, what is
   not there, why or what to do, and a link that does it. The older .empty
   paragraphs and empty table cells get the same look through ::before. */
.empty-state { display: grid; justify-items: center; gap: 3px; padding: 30px 16px 32px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); text-align: center; }
.empty-state .empty-icon { box-sizing: border-box; display: grid; width: 32px; height: 32px; margin-bottom: 6px; place-items: center; color: var(--muted); animation: sg-empty-bob 4s ease-in-out infinite; }
.empty-state .empty-icon > :is(img, svg) { display: block; width: 28px; height: 28px; object-fit: contain; opacity: .7; }
.empty-title { margin: 0; color: var(--ink); font-size: var(--fs-body); font-weight: 600; }
.empty-hint { margin: 0; max-width: 44em; color: var(--muted); font-size: var(--fs-small); }
.empty-action { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; margin-top: 10px; padding: 4px 13px; border: 1px solid var(--blue-line); border-radius: 999px; background: var(--surface); color: var(--blue); font-size: var(--fs-small); font-weight: 600; text-decoration: none; transition: background .15s, transform .25s; }
.empty-action:hover { background: var(--blue-soft); text-decoration: none; }
.empty-action:active { transform: scale(.97); }
td > .empty-state, .table-empty .empty-state { border: 0; padding: 24px 16px 28px; }
.table-empty td, td.empty-cell, .empty, td.pp-empty, td.pn-empty, td.rw-empty { padding: 28px 16px 30px; color: var(--muted); font-size: var(--fs-small); text-align: center; }
.table-empty td::before, td.empty-cell::before, .empty::before, td.pp-empty::before, td.pn-empty::before, td.rw-empty::before { content: ""; display: block; width: 40px; height: 40px; margin: 0 auto 8px; border-radius: 12px; background: var(--surface-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b8794' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") center / 22px no-repeat; animation: sg-empty-bob 4s ease-in-out infinite; }
.table-empty td:has(> .empty-state) { padding: 0; }
.table-empty td:has(> .empty-state)::before { display: none; }
@keyframes sg-empty-bob { 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .empty-state .empty-icon, .table-empty td::before, td.empty-cell::before, .empty::before, td.pp-empty::before, td.pn-empty::before, td.rw-empty::before { animation: none; } }

/* Skeletons: the shape of what is loading, shimmering, where a "Loading..."
   line used to be. .skeleton paints any element as a bar of its own size,
   its text kept but unseen; .skeleton-list draws three rows. */
.skeleton, .skeleton-list > i { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--surface-soft) 0 30%, color-mix(in srgb, var(--surface-soft), var(--ink) 7%) 50%, var(--surface-soft) 70% 100%) 0 0 / 220% 100%; color: transparent !important; pointer-events: none; user-select: none; animation: sg-shimmer 1.5s linear infinite; }
.skeleton > * { visibility: hidden; }
.skeleton-list { display: grid; gap: 10px; padding: 14px var(--row-x, 16px); }
.skeleton-list > i { height: 14px; width: 92%; }
.skeleton-list > i:nth-child(2) { width: 68%; }
.skeleton-list > i:nth-child(3) { width: 44%; }
@keyframes sg-shimmer { to { background-position: -220% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton, .skeleton-list > i { animation: none; background-size: 100% 100%; } }

/* A state badge may carry a dot (.badge.dot); a live one breathes (.is-live). */
.badge.dot::before, .rv-status::before { width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; content: ""; }
.badge.dot { gap: 6px; }
.badge.is-live::before, .rv-status.is-live::before { animation: sg-dot-breathe 1.6s ease-in-out infinite; }
@keyframes sg-dot-breathe { 50% { opacity: .35; transform: scale(.7); } }

/* What a list is narrowed to, each filter removable on its own (domains,
   shortlinks, YARA scans...). */
.filter-chip { display: inline-flex; align-items: center; gap: 6px; min-height: var(--chip-h-lg); padding: 0 4px 0 var(--chip-px-lg); border: 1px solid var(--blue-line); border-radius: 999px; background: var(--blue-soft); color: var(--blue-ink); font-size: var(--chip-fs-lg); font-weight: 600; line-height: 1.2; white-space: nowrap; }
.filter-chip .x { display: inline-grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; color: var(--blue-ink); font-size: var(--fs-h3); line-height: 1; transition: background .15s, transform .4s var(--spring-pop); }
.filter-chip .x:hover { background: var(--blue-line); text-decoration: none; transform: scale(1.1); }

/* A chip that does something darkens its edge under the pointer and gives
   under the press, like the buttons (press.js). */
:is(.page-links a, .crumb a, .filter-chip, a.pp-chip, .cand-list label, .ln-toc a, .cf-chip, .dk-filters .chip, .au-chip, .rt-chip, .src-chip, .sv-chip, .kw-chip, .vq-chip a, .cp-chip) { transition: transform .4s var(--spring), box-shadow .15s, background .15s, border-color .15s, color .15s; }
:is(.page-links a, .crumb a, .filter-chip, a.pp-chip, .cand-list label, .ln-toc a, .cf-chip, .dk-filters .chip, .au-chip, .rt-chip, .src-chip, .sv-chip, .kw-chip, .cp-chip):active { transform: scale(var(--tap)); transition-duration: .08s; }
@media (prefers-reduced-motion: reduce) { :is(.page-links a, .crumb a, .filter-chip, a.pp-chip, .cand-list label, .ln-toc a, .cf-chip, .dk-filters .chip, .au-chip, .rt-chip, .src-chip, .sv-chip, .kw-chip, .cp-chip), .filter-chip .x { transition: none; } .badge.is-live::before, .rv-status.is-live::before { animation: none; } }

/* Tables (table.js). A table that fits its box lets the page scroll under its
   header, which sticks and casts a shadow once rows are under it; a wide one
   (.is-wide) keeps its scroll box and edge shadows. Every header sorts: the
   arrow turns with the direction and the rows glide into their new order. */
.table-wrap:not(.is-wide), .table-scroll:not(.is-wide):not(.chart-table *) { overflow: visible; }
.table-wrap:not(.is-wide) thead th, .table-scroll:not(.is-wide):not(.chart-table *) thead th { position: sticky; top: var(--sticky-top, 0px); z-index: 2; background: linear-gradient(rgba(0, 0, 0, .035), rgba(0, 0, 0, .035)), var(--surface); }
:root[data-theme="dark"] .table-wrap:not(.is-wide) thead th, :root[data-theme="dark"] .table-scroll:not(.is-wide) thead th { background: linear-gradient(rgba(255, 255, 255, .03), rgba(255, 255, 255, .03)), var(--surface); }
.table-wrap:not(.is-wide) thead th:first-child, .table-scroll thead th:first-child { border-top-left-radius: var(--radius); }
.table-wrap:not(.is-wide) thead th:last-child, .table-scroll thead th:last-child { border-top-right-radius: var(--radius); }
thead th { transition: box-shadow .2s; }
thead.is-stuck th { box-shadow: 0 1px 0 var(--line), 0 6px 14px -8px rgba(0, 0, 0, .35); }
:root[data-theme="dark"] thead.is-stuck th { box-shadow: 0 1px 0 var(--line), 0 6px 14px -8px rgba(0, 0, 0, .7); }
th.is-sortable { cursor: pointer; user-select: none; -webkit-user-select: none; transition: color .15s, box-shadow .2s; }
th.is-sortable:hover, th.is-sortable:focus-visible { color: var(--ink); }
th.is-sortable:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
th.is-sortable[data-sort] { color: var(--ink); }
.sort-mark { display: inline-grid; width: 14px; height: 14px; margin-left: 4px; place-items: center; vertical-align: -3px; color: var(--faint); opacity: 0; transform: translateY(-2px) scale(.8); transition: opacity .15s, transform .45s var(--spring), color .15s; }
.sort-mark svg { width: 12px; height: 12px; }
th.is-sortable:hover .sort-mark, th.is-sortable:focus-visible .sort-mark { opacity: .7; transform: none; }
th.is-sortable[data-sort] .sort-mark { opacity: 1; color: var(--blue); transform: none; }
th.is-sortable[data-sort="desc"] .sort-mark { transform: rotate(180deg); }
th.is-sortable[data-sort="asc"] .sort-mark { transform: rotate(0deg); }
tbody.is-sorted tr { animation: none; }

/* A row's actions sit back until the row is under the pointer or holds the
   focus, then come forward with a spring; with no mouse they stay forward. */
@media (hover: hover) and (pointer: fine) {
  td.actions-cell .btn-row, td .row-menu > summary { opacity: .85; transform: translateX(2px); transition: opacity .18s, transform .45s var(--spring); }
  tbody tr:hover td.actions-cell .btn-row, tbody tr:focus-within td.actions-cell .btn-row, tbody tr:hover td .row-menu > summary, tbody tr:focus-within td .row-menu > summary, td .row-menu[open] > summary { opacity: 1; transform: none; }
}

/* Back to top (totop.js). */
.sg-totop { position: fixed; right: 16px; bottom: 16px; z-index: 1050; display: grid; width: 40px; height: 40px; min-height: 0; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); box-shadow: 0 6px 18px rgba(0, 0, 0, .14), 0 1px 2px rgba(0, 0, 0, .08); color: var(--ink-soft); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(12px) scale(.6); transition: opacity .15s, visibility 0s .4s, transform .45s var(--spring), background .15s, color .15s, box-shadow .15s; }
.sg-totop svg { width: 18px; height: 18px; }
.sg-totop.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity .15s, visibility 0s, transform .55s var(--spring-bounce), background .15s, color .15s, box-shadow .15s; }
.sg-totop:hover { border-color: var(--blue-line); color: var(--blue); }
.sg-totop:active { transform: scale(var(--tap)); transition-duration: .08s; }
body:has(.sg-totop.is-on) .sg-toasts { bottom: 68px; }
.sg-toasts { transition: bottom .35s var(--spring); }
@media (prefers-reduced-motion: reduce) { .sg-totop, .sg-totop.is-on, .sort-mark, .sg-toasts, td.actions-cell .btn-row, td .row-menu > summary { transition: none; transform: none; } }

/* Forms (form.js). A field's label answers its focus; a field that failed the
   check shakes and says why under itself; a sent button turns a ring; a
   password has an eye and, when new, a meter; a textarea counts down. */
.field:has(input:focus-visible, textarea:focus-visible, select:focus-visible) > label, .pw-field:has(input:focus-visible) > label { color: var(--blue); }
label { transition: color .15s; }
input:not([type=checkbox]):not([type=radio]), textarea, select { transition: border-color .15s, box-shadow .35s var(--spring), background-color .15s; }
input.is-invalid, textarea.is-invalid, select.is-invalid { border-color: var(--red); }
input.is-invalid:focus, textarea.is-invalid:focus, select.is-invalid:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
/* A select has no border to turn red (its face is a raised one): a red ring round the face instead. */
select:not([multiple]):not([size]).is-invalid { box-shadow: var(--face-shadow), 0 0 0 1.5px var(--red); }
select:not([multiple]):not([size]).is-invalid:focus { box-shadow: var(--face-shadow), 0 0 0 1.5px var(--red), 0 0 0 4px var(--red-soft); }
.field-error { display: flex; align-items: flex-start; gap: 5px; margin-top: 6px; color: var(--red); font-size: var(--fs-caption); font-weight: 500; line-height: 1.45; animation: sg-rise-in .45s var(--spring) both; }
/* An alert mark before the words, in their colour. */
.field-error::before { flex: none; width: 13px; height: 13px; margin-top: 2px; background: currentColor; content: "";
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5h.01'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5h.01'/%3E%3C/svg%3E") center / contain no-repeat; }
.is-shaking { animation: sg-shake .4s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes sg-shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); } }
@keyframes sg-rise-in { from { opacity: 0; transform: translateY(-3px); } }
button.is-busy, .btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.menu-item.is-busy, td .row-menu-list button.menu-item.is-busy { color: var(--muted) !important; }
.menu-item.is-busy::after, td .row-menu-list button.menu-item.is-busy::after { right: 10px; left: auto; width: 13px; height: 13px; margin: -7px 0 0; border-color: var(--line-strong); border-top-color: var(--accent); }
button.is-busy::after, .btn.is-busy::after { content: ""; position: absolute; top: 50%; left: 50%; width: 15px; height: 15px; margin: -8px 0 0 -8px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: sg-spin .8s linear infinite; }
button.ghost.is-busy::after, .btn.ghost.is-busy::after, button.link.is-busy::after, td button.is-busy::after { border-color: var(--line-strong); border-top-color: var(--blue); }
@keyframes sg-spin { to { transform: rotate(360deg); } }
.pw-field-wrap { position: relative; display: block; }
.pw-field-wrap > input { padding-right: 40px; }
.pw-field-wrap > input { text-overflow: clip; }
/* The eye (password.js): a bare icon button inside the field's right end, on
   the middle of the box (--pw-shift allows for the space the page leaves above
   the field). Its icon is the animated one; it gives under the press like every
   face (press.js). */
.pw-field-eye { position: absolute; top: 50%; right: 4px; display: grid; width: 30px; height: 30px; min-height: 0; margin: 0; padding: 0; place-items: center; border: 0; border-radius: 8px; background: none; box-shadow: none; color: var(--muted); cursor: pointer; transform: translateY(calc(-50% + var(--pw-shift, 2.5px))); transition: background-color .15s, color .15s; --jelly: 1; }
.pw-field-eye:hover { background: var(--hover); color: var(--ink); box-shadow: none; filter: none; transform: translateY(calc(-50% + var(--pw-shift, 2.5px))); }
.pw-field-eye:active { transform: translateY(calc(-50% + var(--pw-shift, 2.5px))) scale(var(--tap)); }
.pw-field-eye :is(svg, img) { width: 18px; height: 18px; pointer-events: none; }
.pw-field-eye img { opacity: .62; transition: opacity .15s; }
.pw-field-eye:is(:hover, :focus-visible, .is-open) img { opacity: 1; }
.pw-meter { display: flex; align-items: center; gap: 10px; height: 0; margin-top: 0; overflow: hidden; opacity: 0; transition: height .3s var(--spring), margin-top .3s, opacity .2s; }
.pw-meter.is-on { height: 16px; margin-top: 7px; opacity: 1; }
.pw-meter-bars { display: grid; flex: 1; grid-template-columns: repeat(4, 1fr); gap: 4px; max-width: 220px; }
.pw-meter-bars i { display: block; height: 4px; border-radius: 999px; background: var(--line); transform-origin: 0 50%; transition: background .25s, transform .45s var(--spring); transform: scaleX(1); }
.pw-meter-word { color: var(--muted); font-size: var(--fs-caption); font-weight: 600; min-width: 42px; }
.pw-meter[data-level="1"] i:nth-child(-n+1), .pw-meter[data-level="2"] i:nth-child(-n+2), .pw-meter[data-level="3"] i:nth-child(-n+3), .pw-meter[data-level="4"] i { animation: sg-bar-pop .45s var(--spring) both; }
.pw-meter[data-level="1"] i:nth-child(-n+1) { background: var(--red); }
.pw-meter[data-level="2"] i:nth-child(-n+2) { background: var(--amber); }
.pw-meter[data-level="3"] i:nth-child(-n+3) { background: #4c9a5a; }
.pw-meter[data-level="4"] i { background: var(--green); }
.pw-meter[data-level="1"] .pw-meter-word { color: var(--red); }
.pw-meter[data-level="2"] .pw-meter-word { color: var(--amber); }
.pw-meter[data-level="3"] .pw-meter-word, .pw-meter[data-level="4"] .pw-meter-word { color: var(--green); }
@keyframes sg-bar-pop { from { transform: scaleX(.2); } }
textarea { resize: vertical; overflow-y: auto; }
/* The count of a textarea with a limit (form.js): under the box's right corner, in the room
   that follows a field, not a line of its own. It shows from 80% of the limit, so a line kept
   for it would be a blank under every notes box that is never near its limit. */
.field-count { position: absolute; top: calc(100% + 3px); right: 2px; color: var(--faint); font-size: var(--fs-caption); line-height: 1.4; font-variant-numeric: tabular-nums; pointer-events: none; opacity: 0; transition: opacity .2s, color .2s; }
.field-count.is-on { opacity: 1; color: var(--muted); }
.field-count.is-full { color: var(--red); }
@media (prefers-reduced-motion: reduce) { .is-shaking, .field-error, .pw-meter-bars i { animation: none; } .pw-meter, .pw-meter-bars i, input, textarea, select { transition: none; } }
/* Checkboxes and radios: the same hand feel as the switches. A recessed
   square (or disc) in the surface; pressed, it gives; checked, it fills and
   comes forward with a spring, the tick drawing itself in from the left (a
   radio's dot springs up from nothing). The ones a page hides behind its
   own card or chip (opacity 0) keep their page's look. */
:where(input[type=checkbox], input[type=radio]):not(.switch, .sg-toggle, .nav-toggle, .as-check *, .rp-check *, label.check *, .log-why-check *) { -webkit-appearance: none; appearance: none; box-sizing: border-box; display: inline-grid; flex: none; width: 18px; min-width: 18px; height: 18px; min-height: 18px; max-height: 18px; margin: 0 .5em 0 0; place-items: center; vertical-align: -4px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface-soft); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .14), inset 0 0 0 1px rgba(255, 255, 255, .45); color: #fff; cursor: pointer; transition: background-color .18s, border-color .18s, box-shadow .2s, transform .4s var(--spring); }
:where(input[type=radio]):not(.switch, .sg-toggle, .nav-toggle, .as-check *, .rp-check *, label.check *, .log-why-check *) { border-radius: 50%; }
:where(input[type=checkbox], input[type=radio]):not(.switch, .sg-toggle, .nav-toggle, .as-check *, .rp-check *, label.check *, .log-why-check *):hover { border-color: var(--check-on, var(--switch-on)); background: var(--surface); }
:where(input[type=checkbox], input[type=radio]):not(.switch, .sg-toggle, .nav-toggle, .as-check *, .rp-check *, label.check *, .log-why-check *):active { transform: scale(.88); transition-duration: .08s; }
:where(input[type=checkbox], input[type=radio]):not(.switch, .sg-toggle, .nav-toggle, .as-check *, .rp-check *, label.check *, .log-why-check *):checked, :where(input[type=checkbox]):not(.switch, .sg-toggle, .nav-toggle, .as-check *, .rp-check *, label.check *, .log-why-check *):indeterminate { border-color: var(--check-on, var(--switch-on)); background: var(--check-on, var(--switch-on)); box-shadow: 0 1px 2px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .28); animation: sg-check-pop .5s var(--spring); }
:where(input[type=checkbox], input[type=radio]):not(.switch, .sg-toggle, .nav-toggle, .as-check *, .rp-check *, label.check *, .log-why-check *):focus-visible { outline: 2px solid var(--check-on, var(--switch-on)); outline-offset: 2px; }
:where(input[type=checkbox], input[type=radio]):not(.switch, .sg-toggle, .nav-toggle, .as-check *, .rp-check *, label.check *, .log-why-check *):disabled { opacity: .45; cursor: not-allowed; }
:where(input[type=checkbox], input[type=radio]):not(.switch, .sg-toggle, .nav-toggle, .as-check *, .rp-check *, label.check *, .log-why-check *)::before { content: ""; display: block; width: 11px; height: 11px; background: currentColor; }
:where(input[type=checkbox]):not(.switch, .sg-toggle, .nav-toggle, .as-check *, .rp-check *, label.check *, .log-why-check *)::before { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; clip-path: inset(0 100% 0 0); opacity: 0; transition: clip-path .32s cubic-bezier(.4, 0, .2, 1) .08s, opacity 0s .08s; }
:where(input[type=checkbox]):not(.switch, .sg-toggle, .nav-toggle, .as-check *, .rp-check *, label.check *, .log-why-check *):checked::before { clip-path: inset(0 0 0 0); opacity: 1; }
:where(input[type=checkbox]):not(.switch, .sg-toggle, .nav-toggle, .as-check *, .rp-check *, label.check *, .log-why-check *):indeterminate::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E"); clip-path: inset(0 0 0 0); opacity: 1; }
:where(input[type=radio]):not(.switch, .sg-toggle, .nav-toggle, .as-check *, .rp-check *, label.check *, .log-why-check *)::before { width: 8px; height: 8px; border-radius: 50%; transform: scale(0); transition: transform .45s var(--spring); }
:where(input[type=radio]):not(.switch, .sg-toggle, .nav-toggle, .as-check *, .rp-check *, label.check *, .log-why-check *):checked::before { transform: scale(1); }
@keyframes sg-check-pop { 0% { transform: scale(.85); } 55% { transform: scale(1.1); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { :where(input[type=checkbox], input[type=radio]):not(.switch, .sg-toggle, .nav-toggle, .as-check *, .rp-check *, label.check *, .log-why-check *), :where(input[type=checkbox], input[type=radio]):not(.switch, .sg-toggle, .nav-toggle, .as-check *, .rp-check *, label.check *, .log-why-check *)::before { transition: none; animation: none; } }

/* Disclosures (accordion.js): while one folds, its box is clipped; the +/−
   of a filters fold pops as it swaps. */
details.is-folding { overflow: hidden; }
.filters-more > summary::before { display: inline-block; transition: transform .45s var(--spring-bounce); }
.filters-more[open] > summary::before { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .sidebar .nav-group > summary::after, .more-details > summary::after, .filters-more > summary::before { transition: none; } }

/* Menus (menu.js): a grooved list in which one raised pill slides between
   the items under the pointer or the focus; under a destructive item it
   blushes. The menu itself springs open from its button. */
.row-menu-list, .sidebar .account-menu { position: fixed; }
.sidebar .account-menu { position: absolute; }
.menu-pill { position: absolute; z-index: 0; top: 0; left: 0; width: 0; height: 0; border-radius: 8px; background: var(--surface); box-shadow: var(--pill-shadow, 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 1px rgba(0, 0, 0, .05)); opacity: 0; pointer-events: none; transition: opacity .15s, background .2s; }
.menu-pill.is-on { opacity: 1; }
.row-menu-list:has(.is-danger:hover, .is-danger:focus-visible) .menu-pill { background: var(--red-soft); }
.sidebar .account-menu:has(.menu-signout:hover) .menu-pill { background: var(--red-soft); }
:root[data-theme="dark"] .menu-pill { background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .06); }
@media (prefers-reduced-motion: reduce) { .menu-pill { display: none; } .row-menu-list .menu-item:hover, td .row-menu-list button.menu-item:hover, .sidebar .account-menu a:hover { background: var(--hover); } }

/* Number fields (number.js): a − and a + at the right end of the input, in a
   groove recessed into it like the switch's track. At rest the two keys are
   just marks in the groove; under the pointer one comes up as a small raised
   pill, and under the press it goes down again, into the groove. The key at
   its bound fades. The groove takes no colour from the focus ring. */
.num-field { position: relative; display: block; }
.num-field > input[type=number] { padding-right: 72px; -moz-appearance: textfield; appearance: textfield; }
.num-field > input[type=number]::-webkit-outer-spin-button, .num-field > input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num-field.is-tight > input[type=number] { padding-right: 10px; }
.num-field.is-tight .num-keys { display: none; }
.date-field.is-tight > input[type=date] { padding-right: 10px; }
.date-field.is-tight .date-open { display: none; }
.search-field.is-tight .search-kbd { display: none !important; }
.num-keys { position: absolute; top: 50%; right: 5px; display: inline-flex; gap: 1px; padding: 2px; border-radius: 8px; background: rgba(0, 0, 0, .07); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .14), inset 0 0 0 1px rgba(0, 0, 0, .04); transform: translateY(calc(-50% + 2.5px)); }
.num-key { display: grid; width: 26px; height: 22px; min-height: 0; margin: 0; padding: 0; place-items: center; border: 0; border-radius: 6px; background: transparent; box-shadow: none; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, transform .4s var(--spring), box-shadow .15s; }
.num-key svg { width: 12px; height: 12px; }
.num-key:hover:not(:disabled) { background: linear-gradient(180deg, #ffffff 0%, #f5f5f8 100%); box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .2), 0 2px 5px rgba(0, 0, 0, .08); color: var(--ink); }
.num-key:active:not(:disabled), .num-key.is-held:not(:disabled) { background: var(--press, rgba(0, 0, 0, .08)); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18); color: var(--ink); transform: scale(var(--tap)); transition-duration: .08s; }
.num-key:disabled { opacity: .3; cursor: default; }
:root[data-theme="dark"] .num-keys { background: rgba(0, 0, 0, .28); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .04); }
:root[data-theme="dark"] .num-key { color: var(--muted); }
:root[data-theme="dark"] .num-key:hover:not(:disabled) { background: linear-gradient(180deg, #3b3b40 0%, #303034 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 -1px 0 rgba(0, 0, 0, .3), 0 1px 2px rgba(0, 0, 0, .5); color: var(--ink); }
:root[data-theme="dark"] .num-key:active:not(:disabled), :root[data-theme="dark"] .num-key.is-held:not(:disabled) { background: rgba(0, 0, 0, .35); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6); }
@media (prefers-reduced-motion: reduce) { .num-key { transition: none; } }

/* Date fields (date.js): the browser's calendar icon gives way to the page's
   own button, and the popover under the field is a grooved month: today
   ringed, the chosen day a raised pill, the days between a range's ends
   shaded, one translucent pill sliding under the pointer. */
.date-field { position: relative; display: block; }
.date-field > input[type=date] { padding-right: 38px; }
.date-field > input[type=date]::-webkit-calendar-picker-indicator { display: none; -webkit-appearance: none; }
.date-open { position: absolute; top: 50%; right: 5px; display: grid; width: 28px; height: 26px; min-height: 0; margin: 0; padding: 0; place-items: center; border: 0; border-radius: 6px; background: transparent; box-shadow: none; color: var(--muted); cursor: pointer; transform: translateY(calc(-50% + 2.5px)); transition: background .15s, color .15s, transform .35s var(--spring); }
.date-open svg { width: 15px; height: 15px; }
.date-open:hover, .date-field.is-open .date-open { background: var(--hover); color: var(--ink); box-shadow: none; transform: translateY(calc(-50% + 2.5px)); }
.date-open:active { transform: translateY(calc(-50% + 2.5px)) scale(.9); }
.date-pop { position: fixed; z-index: 1150; display: none; width: 284px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--pop-shadow); color: var(--ink); user-select: none; -webkit-user-select: none; }
.date-pop.is-on { display: block; }
.date-presets { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.date-presets button { min-height: 24px; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: none; color: var(--ink-soft); font-size: var(--fs-caption); font-weight: 600; transition: background .15s, border-color .15s, color .15s, transform .35s var(--spring); }
.date-presets button:hover { border-color: var(--blue-line); background: var(--blue-soft); color: var(--blue); box-shadow: none; }
.date-presets button:active { transform: scale(var(--tap)); }
.date-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
/* The title is a key: the month steps out to the year's months, the year to a page of years. */
.date-title { display: inline-flex; align-items: center; gap: 3px; min-height: 28px; padding: 2px 6px 2px 9px; border-radius: 8px; color: var(--ink); font-size: var(--fs-small); font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; transition: background .15s, color .15s, transform .35s var(--spring); }
.date-title svg { width: 13px; height: 13px; color: var(--muted); transition: transform .3s var(--spring); }
.date-title:hover { background: var(--hover); color: var(--ink); }
.date-title:active { transform: scale(var(--tap)); transition-duration: .08s; }
.date-title.is-top { padding-right: 9px; cursor: default; }
.date-title.is-top, .date-title.is-top:hover { background: none; transform: none; }
.date-title.is-top svg { display: none; }
.date-title:focus-visible { outline: 2px solid var(--blue); outline-offset: 0; }
.date-nav { display: grid; width: 28px; height: 28px; min-height: 0; margin: 0; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: none; color: var(--ink-soft); transition: background .15s, border-color .15s, color .15s, transform .35s var(--spring); }
.date-nav svg { width: 14px; height: 14px; }
.date-nav:hover { border-color: var(--blue-line); background: var(--blue-soft); color: var(--blue); box-shadow: none; }
.date-nav:active { transform: scale(var(--tap)); transition-duration: .08s; }
.date-days { display: grid; grid-template-columns: repeat(7, 1fr); margin: 0 2px 2px; color: var(--faint); font-size: var(--fs-micro); font-weight: 600; letter-spacing: .05em; text-align: center; text-transform: uppercase; }
.date-grid-wrap { position: relative; overflow: hidden; padding: 3px; border-radius: 10px; background: rgba(0, 0, 0, .05); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); }
.date-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.date-day { position: relative; z-index: 1; display: grid; height: 32px; min-height: 0; margin: 0; padding: 0; place-items: center; border: 0; border-radius: 8px; background: transparent; box-shadow: none; color: var(--ink); font-size: var(--fs-small); font-weight: 500; font-variant-numeric: tabular-nums; transition: color .15s, transform .3s var(--spring); }
.date-day:hover { background: transparent; color: var(--ink); box-shadow: none; transform: none; }
.date-day:active { transform: scale(.92); }
.date-day.is-out { color: var(--faint); }
.date-day:disabled { opacity: .3; cursor: default; }
.date-day.is-today { box-shadow: inset 0 0 0 1.5px var(--blue-line); color: var(--blue); font-weight: 600; }
.date-day.in-range { background: var(--blue-soft); border-radius: 0; }
.date-day.in-range.is-start { border-radius: 8px 0 0 8px; }
.date-day.in-range.is-end { border-radius: var(--radius-sm); }
.date-day.in-range.is-start.is-end { border-radius: 8px; }
.date-day.is-selected, .date-day.is-selected:hover { background: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .25); border-radius: 8px; }
.date-day:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
/* The year's months, three across, and a page of years, four across: as tall as a month of days. */
.date-grid.is-months { grid-template-columns: repeat(3, 1fr); }
.date-grid.is-months .date-day { height: calc((6 * 32px + 2px) / 4); }
.date-grid.is-years { grid-template-columns: repeat(4, 1fr); }
.date-pill { position: absolute; z-index: 0; top: 0; left: 0; width: 0; height: 0; border-radius: 8px; background: var(--surface); box-shadow: var(--pill-shadow, 0 1px 2px rgba(0, 0, 0, .12)); opacity: 0; pointer-events: none; transition: opacity .15s; }
.date-pill.is-on { opacity: 1; }
:root[data-theme="dark"] .date-grid-wrap { background: rgba(0, 0, 0, .25); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .45); }
:root[data-theme="dark"] .date-pill { background: var(--surface-soft); box-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .06); }
:root[data-theme="dark"] .date-day.is-selected, :root[data-theme="dark"] .date-day.is-selected:hover { color: #fff; }
@media (prefers-reduced-motion: reduce) { .date-open, .date-nav, .date-title, .date-day, .date-presets button { transition: none; } .date-pill { display: none; } .date-day:hover { background: var(--hover); } }

/* Sliders (slider.js). At rest a slider is a bar: a groove with the fill run
   up to the value and nothing on it. Bring the pointer near and a knob comes
   out of the end of the fill -- a raised disc, the switch's knob -- and the
   bar swells a touch; press, and slider.js widens the knob into a pill (its
   width grows, its height holds, so it never turns into an ellipse), drags it on a spring
   and lets it bounce back, a bubble over it saying the value. The range
   input is in the page but unseen, for the form and the keyboard. */
.slider { position: relative; display: block; height: 22px; margin: 18px 0 2px; touch-action: pan-y; cursor: pointer; }
.slider > input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.slider-track { position: absolute; top: 50%; right: 0; left: 0; height: 4px; overflow: hidden; border-radius: 999px; background: rgba(0, 0, 0, .1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .16); transform: translateY(-50%); transition: height .35s var(--spring); }
.slider.is-near .slider-track, .slider.is-held .slider-track { height: 5px; }
.slider-fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 999px; background: var(--blue); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22); }
.slider-knob { position: absolute; top: 50%; left: 0; width: 10px; height: 10px; border-radius: 999px; background: linear-gradient(180deg, #ffffff 0%, #f0f0f4 100%); box-shadow: 0 0 0 1px rgba(0, 0, 0, .14), 0 1px 2px rgba(0, 0, 0, .25), 0 3px 8px rgba(0, 0, 0, .14), inset 0 1px 0 #fff; opacity: 0; will-change: transform, width, height; pointer-events: none; transition: opacity .18s, box-shadow .2s; }
.slider.is-near .slider-knob, .slider.is-held .slider-knob, .slider.is-keyed .slider-knob { opacity: 1; }
.slider.is-held .slider-knob { box-shadow: 0 0 0 1px rgba(0, 0, 0, .16), 0 2px 4px rgba(0, 0, 0, .3), 0 8px 18px rgba(0, 0, 0, .22), inset 0 1px 0 #fff; }
.slider:has(input:focus-visible) .slider-knob { opacity: 1; box-shadow: 0 0 0 3px rgba(12, 129, 120, .3), 0 1px 2px rgba(0, 0, 0, .25), inset 0 1px 0 #fff; }
.slider-bubble { position: absolute; bottom: calc(100% - 2px); left: 0; padding: 3px 8px; border-radius: 8px; background: #2d2d31; color: #fff; font-size: var(--fs-caption); font-weight: 600; line-height: 1.3; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s, scale .4s var(--spring), translate .4s var(--spring); translate: 0 6px; scale: .9; transform-origin: 50% 100%; font-variant-numeric: tabular-nums; }
.slider-bubble::after { content: ""; position: absolute; top: 100%; left: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 2px; background: inherit; transform: rotate(45deg); }
.slider.is-held .slider-bubble, .slider.is-keyed .slider-bubble { opacity: 1; translate: 0 0; scale: 1; }
:root[data-theme="dark"] .slider-track { background: rgba(0, 0, 0, .35); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .55); }
:root[data-theme="dark"] .slider-knob { background: linear-gradient(180deg, #525257 0%, #3c3c40 100%); box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 1px 2px rgba(0, 0, 0, .5), 0 3px 8px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .16); }
:root[data-theme="dark"] .slider.is-held .slider-knob { box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 2px 4px rgba(0, 0, 0, .6), 0 8px 18px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .16); }
:root[data-theme="dark"] .slider-bubble { background: #ebebef; color: #1d1d1f; }
@media (prefers-reduced-motion: reduce) { .slider-track, .slider-bubble { transition: opacity .15s; translate: 0 0; scale: 1; } }

/* Search fields (search.js). The pill is the wrapper's: a groove set into
   the surface, the input inside it transparent (so the typing mirror,
   .sg-tf, can wrap the input without the pill moving). Under the pointer
   the groove lightens; with the focus it sinks a little deeper, the
   magnifier (the page's gif) draws itself in and steps right, the
   placeholder steps aside. Text brings a clear cross
   (a gif) that brightens under the pointer and gives under the press. While
   empty and unfocused a small key shows the "/" that reaches the field; it
   goes down when pressed. */
/* The input's own top margin moves to the pill, so the pill is the input's box exactly. */
.search-field { position: relative; display: block; margin-top: 5px; border-radius: 999px; background: rgba(0, 0, 0, .06); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); transition: background-color .2s, box-shadow .45s var(--spring); }
.search-field input { margin-top: 0; padding-left: 34px; padding-right: 36px; border-radius: 999px; border-color: transparent !important; background: transparent !important; box-shadow: none !important; -webkit-appearance: none; appearance: none; caret-color: var(--blue); }
.search-field input::-webkit-search-cancel-button, .search-field input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.search-field input::placeholder { color: var(--muted); transition: opacity .2s, translate .4s var(--spring); }
.search-field:hover:not(:focus-within) { background: rgba(0, 0, 0, .04); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .07), 0 0 0 1px var(--line); }
.search-field:focus-within { background: rgba(0, 0, 0, .075); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .16), inset 0 0 0 1px rgba(0, 0, 0, .05); }
.search-field:focus-within input::placeholder { opacity: .55; translate: 3px 0; }
.search-ico { position: absolute; z-index: 1; top: calc(50% + 2px); left: 11px; display: grid; width: 16px; height: 16px; place-items: center; pointer-events: none; opacity: .7; transform: translateY(-50%); transition: transform .45s var(--spring), opacity .15s; }
.search-ico img, .search-ico svg { width: 16px; height: 16px; object-fit: contain; }
.search-field:hover .search-ico { opacity: 1; }
.search-field:focus-within .search-ico { opacity: 1; transform: translate(3px, -50%) scale(1.1) rotate(-8deg); }
.search-clear { position: absolute; z-index: 1; top: calc(50% + .5px); right: 7px; display: grid; width: 26px; height: 26px; min-height: 0; margin: 0; padding: 0; place-items: center; cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(-50%) scale(.4) rotate(-90deg); transition: opacity .15s, transform .45s var(--spring); }
.search-field .search-clear, .search-field .search-clear:hover, .search-field .search-clear:active, .search-field .search-clear:focus-visible { border: 0 !important; background: transparent !important; box-shadow: none !important; }
.search-clear img, .search-clear svg { width: 22px; height: 22px; object-fit: contain; opacity: .55; transition: opacity .15s; }
.search-field.has-text .search-clear { opacity: 1; pointer-events: auto; transform: translateY(-50%) scale(1) rotate(0); }
.search-field.has-text .search-clear:hover { transform: translateY(-50%) scale(1.15); }
.search-field.has-text .search-clear:hover img, .search-field.has-text .search-clear:hover svg { opacity: 1; }
.search-field.has-text .search-clear:active { transform: translateY(-50%) scale(.8); transition-duration: .08s; }
.search-kbd { position: absolute; z-index: 1; top: 50%; right: 10px; display: none; min-width: 20px; height: 19px; padding: 0 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; background: linear-gradient(180deg, #ffffff 0%, #f5f5f8 100%); color: var(--muted); font-family: inherit; font-size: var(--fs-micro); font-weight: 700; line-height: 16px; text-align: center; pointer-events: none; transform: translateY(-50%); }
.sg-has-kbd .search-field:not(.has-text):not(:focus-within) .search-kbd { display: block; }
/* In a card's head the search takes the room it is given, up to a comfortable width. */
.card-head .search-field { flex: 1 1 280px; max-width: 460px; }
.card-head .search-field input { width: 100%; }
mark.sg-hl { display: inline-block; padding: 0 1px; border-radius: 4px; background: var(--amber-soft); box-shadow: 0 0 0 1px var(--amber-line); color: inherit; animation: sg-hl-in .5s var(--spring) both; }
@keyframes sg-hl-in { from { transform: scale(1.18); background: var(--amber-line); } }
:root[data-theme="dark"] .search-field { background: rgba(0, 0, 0, .28); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5); }
:root[data-theme="dark"] .search-field:hover:not(:focus-within) { background: rgba(0, 0, 0, .2); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4), 0 0 0 1px var(--line); }
:root[data-theme="dark"] .search-field:focus-within { background: rgba(0, 0, 0, .38); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .04); }
:root[data-theme="dark"] .search-ico img, :root[data-theme="dark"] .search-clear img { filter: invert(.85) hue-rotate(180deg); }
:root[data-theme="dark"] .search-kbd { background: linear-gradient(180deg, #3b3b40 0%, #303034 100%); border-color: #1f1f22; color: var(--ink-soft); }
:root[data-theme="dark"] mark.sg-hl { background: rgba(217, 160, 36, .22); box-shadow: 0 0 0 1px rgba(217, 160, 36, .35); }
@media (prefers-reduced-motion: reduce) { .search-field, .search-ico, .search-clear, .search-field input::placeholder { transition: none; } mark.sg-hl { animation: none; } }

/* ---- Text fields ----------------------------------------------------------
   The things you type into are set into the surface, the things you press
   (buttons, selects, switches) stand out of it. A text field is a groove with
   soft corners: under the pointer it lightens and shows its edge; with the
   focus it sinks a little deeper, the caret and its label turn blue, and the
   placeholder steps aside; a field that failed its check blushes; a disabled
   one is shallow and quiet. The search field is the same groove as a pill. */
:is(input:not([type]), input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=date], input[type=number], textarea) { border: 1px solid transparent; border-radius: 10px; background: rgba(0, 0, 0, .06); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); color: var(--ink); caret-color: var(--blue); transition: background-color .2s, border-color .2s, box-shadow .45s var(--spring); }
:is(input:not([type]), input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=date], input[type=number], textarea):hover:not(:focus):not(:disabled):not([readonly]) { background: rgba(0, 0, 0, .04); border-color: var(--line); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .07); }
:is(input:not([type]), input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=date], input[type=number], textarea):focus { background: rgba(0, 0, 0, .075); border-color: rgba(0, 0, 0, .06); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .16); outline: none; }
:is(input, textarea)::placeholder { color: var(--muted); transition: opacity .2s, translate .4s var(--spring); }
:is(input, textarea):focus::placeholder { opacity: .55; translate: 3px 0; }
:is(input, textarea).is-invalid { box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06), inset 0 0 0 1px color-mix(in srgb, var(--red) 70%, transparent); border-color: transparent; }
:is(input, textarea).is-invalid:focus { box-shadow: inset 0 0 0 1px var(--red), 0 0 0 3px color-mix(in srgb, var(--red) 16%, transparent); }
:is(input, textarea):disabled, :is(input, textarea)[readonly] { background: rgba(0, 0, 0, .035); box-shadow: none; color: var(--muted); }
:is(input, textarea):disabled { cursor: not-allowed; }
/* A number field's keys are a raised step out of the groove's floor. */
.num-keys { background: linear-gradient(180deg, #ffffff 0%, #f5f5f8 100%); box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .16); }
.num-key:hover:not(:disabled) { background: rgba(0, 0, 0, .06); box-shadow: none; transform: none; }
.num-key:active:not(:disabled), .num-key.is-held:not(:disabled) { background: rgba(0, 0, 0, .1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18); transform: scale(var(--tap)); }
:root[data-theme="dark"] :is(input:not([type]), input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=date], input[type=number], textarea) { background: rgba(0, 0, 0, .28); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5); }
:root[data-theme="dark"] :is(input:not([type]), input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=date], input[type=number], textarea):hover:not(:focus):not(:disabled):not([readonly]) { background: rgba(0, 0, 0, .2); border-color: var(--line); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4); }
:root[data-theme="dark"] :is(input:not([type]), input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=date], input[type=number], textarea):focus { background: rgba(0, 0, 0, .38); border-color: rgba(255, 255, 255, .05); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .6); }
:root[data-theme="dark"] :is(input, textarea):disabled, :root[data-theme="dark"] :is(input, textarea)[readonly] { background: rgba(0, 0, 0, .18); box-shadow: none; }
:root[data-theme="dark"] :is(input, textarea).is-invalid { box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4), inset 0 0 0 1px rgba(240, 110, 100, .55); }
:root[data-theme="dark"] :is(input, textarea).is-invalid:focus { box-shadow: inset 0 2px 4px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(240, 110, 100, .9), 0 0 0 3px rgba(240, 110, 100, .16); }
/* A box that must be ticked and isn't: ringed in red. */
input[type=checkbox].is-invalid { outline: 1.5px solid var(--red); outline-offset: 1px; }
:root[data-theme="dark"] .num-keys { background: linear-gradient(180deg, #3b3b40 0%, #303034 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 -1px 0 rgba(0, 0, 0, .3), 0 1px 2px rgba(0, 0, 0, .5); }
:root[data-theme="dark"] .num-key:hover:not(:disabled) { background: rgba(255, 255, 255, .08); box-shadow: none; }
:root[data-theme="dark"] .num-key:active:not(:disabled), :root[data-theme="dark"] .num-key.is-held:not(:disabled) { background: rgba(0, 0, 0, .35); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6); }
@media (prefers-reduced-motion: reduce) { :is(input, textarea), :is(input, textarea)::placeholder { transition: none; } }


/* The hidden attribute always wins: a select the country picker has replaced must not come back through the select kit. */
[hidden] { display: none !important; }

/* ---- File fields (file.js) ----------------------------------------------------
   Dropped into, so a groove like the text fields; the key that opens the picker
   is the raised neutral face. The input lies over the whole field, unseen, so a
   click or a drop anywhere on it is the input's. Without file.js the browser's
   own button wears the same face. */
input[type=file] { max-width: 100%; color: var(--ink-soft); font-size: var(--fs-small); }
input[type=file]::file-selector-button { min-height: 30px; margin-right: 10px; padding: 4px 12px; border: 0; border-radius: 10px; background: linear-gradient(180deg, #ffffff 0%, #f4f4f7 100%); box-shadow: inset 0 1px 0 #fff, 0 0 0 .5px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .16); color: var(--ink-soft); font: inherit; font-weight: 600; cursor: pointer; }
:root[data-theme="dark"] input[type=file]::file-selector-button { background: linear-gradient(180deg, #363639 0%, #2d2d30 100%); box-shadow: 0 1px 2px rgba(0, 0, 0, .5); color: var(--ink); }
.file-field { position: relative; display: flex; box-sizing: border-box; width: 100%; max-width: 560px; min-height: 46px; align-items: center; gap: 12px; margin-top: 5px; padding: 6px 8px 6px 6px; border: 1px solid transparent; border-radius: 12px; background: rgba(0, 0, 0, .06); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); cursor: pointer; transition: border-color .15s, box-shadow .2s, background-color .15s; }
.file-field > input[type=file] { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.file-field > input[type=file]::file-selector-button { cursor: pointer; }
.file-field:hover { border-color: var(--line); background: rgba(0, 0, 0, .04); }
.file-field:focus-within { border-color: rgba(0, 0, 0, .06); background: rgba(0, 0, 0, .075); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .16); }
.file-field:has(> input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-key { display: inline-flex; min-height: 32px; flex: none; align-items: center; gap: 7px; padding: 0 13px 0 10px; border-radius: 10px; background: linear-gradient(180deg, #ffffff 0%, #f4f4f7 100%); box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .05), 0 0 0 .5px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06); color: var(--ink-soft); font-size: var(--fs-small); font-weight: 600; white-space: nowrap; transition: transform .35s var(--spring), box-shadow .2s, color .15s; }
.file-key :is(img, svg) { width: 16px; height: 16px; flex: none; object-fit: contain; }
.file-field:hover .file-key { color: var(--ink); box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .05), 0 0 0 .5px rgba(0, 0, 0, .17), 0 1px 2px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06); }
.file-field:active .file-key { transform: scale(var(--tap)); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .28), 0 0 0 .5px rgba(0, 0, 0, .14); transition-duration: .08s; }
.file-text { display: flex; min-width: 0; flex: 1; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.file-name { min-width: 0; overflow: hidden; color: var(--muted); font-size: var(--fs-body); text-overflow: ellipsis; white-space: nowrap; }
.file-meta { flex: none; color: var(--muted); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }
.file-meta:empty { display: none; }
.file-field.has-file .file-name { color: var(--ink); font-weight: 600; }
.file-clear, button.file-clear { position: relative; z-index: 2; display: none; width: 26px; height: 26px; min-height: 0; flex: none; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; box-shadow: none; color: var(--muted); cursor: pointer; transition: transform .35s var(--spring), opacity .15s; opacity: .7; }
.file-field.has-file .file-clear { display: grid; }
.file-clear :is(img, svg) { width: 18px; height: 18px; }
.file-clear:hover, button.file-clear:hover { background: none; box-shadow: none; filter: none; opacity: 1; transform: scale(1.12); }
.file-clear:active, button.file-clear:active { transform: scale(.9); box-shadow: none; }
/* A file held over the field. */
.file-field.is-over { border-color: var(--accent); background: var(--accent-soft, rgba(20, 184, 166, .12)); box-shadow: inset 0 0 0 1px var(--accent), inset 0 2px 5px rgba(12, 129, 120, .18); }
.file-field.is-over .file-key { transform: scale(1.05); }
.file-field.is-over .file-name { color: var(--accent-ink, var(--accent)); }
.file-field.is-disabled { opacity: .5; cursor: not-allowed; }
.file-field.is-disabled > input[type=file] { cursor: not-allowed; }
:root[data-theme="dark"] .file-field { background: rgba(0, 0, 0, .28); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5); }
:root[data-theme="dark"] .file-field:hover { border-color: var(--line); background: rgba(0, 0, 0, .2); }
:root[data-theme="dark"] .file-field:focus-within { border-color: transparent; background: rgba(0, 0, 0, .34); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .6); }
:root[data-theme="dark"] .file-key { background: linear-gradient(180deg, #363639 0%, #2d2d30 100%); box-shadow: 0 0 0 .5px rgba(255, 255, 255, .09), 0 1px 2px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3); color: var(--ink); }
:root[data-theme="dark"] .file-field:hover .file-key { background: linear-gradient(180deg, #3d3d41 0%, #333337 100%); box-shadow: 0 0 0 .5px rgba(255, 255, 255, .14), 0 1px 2px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3); }
:root[data-theme="dark"] .file-field:active .file-key { box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6); }
:root[data-theme="dark"] .file-field.is-over { border-color: var(--accent-bright); background: rgba(45, 212, 191, .1); box-shadow: inset 0 0 0 1px var(--accent-bright), inset 0 2px 5px rgba(0, 0, 0, .45); }
:root[data-theme="dark"] .file-clear img { filter: invert(.85) hue-rotate(180deg); }
/* A label's own words sit above the field it wraps. */
label > .file-field { margin-top: 5px; font-weight: 400; }
@media (prefers-reduced-motion: reduce) { .file-key, .file-clear { transition: none; } .file-field:hover .file-key, .file-field.is-over .file-key { transform: none; } }

/* A sort mark takes no room of its own, so it can never wrap under a heading and make the header row two lines tall. */
.sort-mark { width: 0; margin-left: 0; justify-items: start; overflow: visible; }
.sort-mark svg { margin-left: 4px; }
th.num .sort-mark svg { margin-left: 3px; }
/* A column's heading is one line: wrapped under itself it made the whole header row two lines tall, with the other headings stranded at its top. */
thead th { white-space: nowrap; }

/* ---- Notices: one box -----------------------------------------------------------
   A flash after an action, a callout in a form, a banner on a page and a folded
   guide were four designs (a thick left bar here, square corners there). They
   are one box in four tones; what differs is only what is inside. */
.flash, .callout, .status-banner, .yara-guide { padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); color: var(--ink-soft); font-size: var(--fs-small); line-height: 1.5; }
.yara-guide { padding: 0; }
.yara-guide > summary { font-size: var(--fs-small); }
:is(.flash, .callout, .status-banner).ok { border-color: var(--green-line); background: var(--green-soft); }
:is(.flash, .callout, .status-banner).warn { border-color: var(--amber-line); background: var(--amber-soft); }
:is(.flash, .callout, .status-banner):is(.danger, .err) { border-color: var(--red-line); background: var(--red-soft); }
:is(.flash, .callout, .status-banner).info, .yara-guide { border-color: var(--blue-line); background: var(--blue-soft); }
.callout.warn, .flash.warn { color: var(--amber); }
.callout.danger, .flash.err { color: var(--red); }
.status-banner strong { font-size: var(--fs-small); }
.status-banner span { font-size: var(--fs-small); }
/* On the page itself (not inside a card or a form) a notice is a block like any other. */
:is(main, .main, .options-main) > :is(.flash, .callout, .status-banner, .yara-guide) { margin: 0 0 var(--gap-block); margin-bottom: var(--gap-block) !important; }
/* Two notices one after the other belong together: a pair's gap between them, the block's after the last. (A margin utility a page put on a notice does not change this.) */
:is(main, .main, .options-main) > :is(.flash, .callout, .status-banner, .yara-guide):has(+ :is(.flash, .callout, .status-banner, .yara-guide)) { margin-bottom: var(--gap-pair) !important; }

/* ---- Groups inside a card ---------------------------------------------------------
   A set of fields that belong together (a provider's keys, a pool of choices): a soft
   panel with its heading inside, at the top. A legend floated is laid out as the
   fieldset's first block rather than on its border, which is how the heading gets
   inside without changing the markup. */
fieldset:is(.as-provider, .as-pool, .field-group) { min-width: 0; margin: 0; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
fieldset:is(.as-provider, .as-pool, .field-group) > legend { float: left; width: 100%; margin: 0 0 10px; padding: 0; color: var(--ink); font-size: var(--fs-body); font-weight: 600; letter-spacing: 0; text-transform: none; }
fieldset:is(.as-provider, .as-pool, .field-group) > legend + * { clear: both; }
fieldset:is(.as-provider, .as-pool, .field-group) > legend small { color: var(--muted); font-size: var(--fs-caption); font-weight: 400; }

/* A long form's last row, on the page under its cards: the button, and beside it what to know before pressing it. */
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 var(--gap-block); }
.form-foot .hint { max-width: 78ch; }
/* A table's own bar on the page, above it: how many rows, and what can be done with them all. */
.table-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 var(--gap-pair); }
.table-bar > :is(h2, .table-bar-title) { margin: 0; color: var(--muted); font-size: var(--fs-small); font-weight: 600; letter-spacing: 0; }

/* ---- A tick box with its line -----------------------------------------------------
   The box, then what ticking it does: a line of words, and under them (a <small>) what
   it means in full. One rule for every page; a page adds only what is its own. */
.check-line { display: flex; align-items: flex-start; gap: 9px; margin: 0; color: var(--ink); font-size: var(--fs-body); font-weight: 500; line-height: 1.45; cursor: pointer; }
.check-line > input { flex: none; margin: 1px 0 0; }
.check-line > span { min-width: 0; }
.check-line b, .check-line strong { font-weight: 600; }
.check-line small { display: block; max-width: 78ch; margin-top: 2px; color: var(--muted); font-size: var(--fs-caption); font-weight: 400; line-height: 1.5; }
.card > .check-line:not(:first-child) { padding-top: 14px; border-top: 1px solid var(--line); }
/* A switch that goes with a field ("Remove the saved key" under the key): inside the field, a step below its box. */
.field > :is(input, select, textarea, .num-field, .date-field, .search-field, .sg-tf, .pw-field-wrap) ~ :is(.check-line, .as-check) { margin-top: var(--gap-in); }

/* An animated icon that no rule has sized is the size of the text beside it, never the gif's own 256px. (:where: any rule that does size an icon wins.) */
:where(img[src*="icons/animated/"]) { width: 1.15em; height: 1.15em; flex: none; object-fit: contain; }

/* ---------- Page preview (lib/page_preview.php) ---------- */
/* The scanned page's screenshot, its width capped and its height shown in full. */
/* The screenshot is the whole page: a tall one scrolls inside the frame. */
.sg-preview-frame { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden auto; max-height: 80vh; background: var(--surface-soft); min-height: 120px; display: grid; place-items: start center; }
.sg-preview-frame a { display: block; width: 100%; }
.sg-preview-frame img { display: block; width: 100%; height: auto; }
.sg-preview-wait { margin: 0; padding: 40px 16px; color: var(--muted); }
.sg-preview-note { margin: 10px 0; }
.sg-preview-browser { display: flex; align-items: baseline; gap: 8px; margin: 0 0 var(--gap-pair); color: var(--ink-soft); font-size: var(--fs-caption); }
.sg-preview-browser .mono { margin-left: 4px; overflow-wrap: anywhere; }
.sg-preview-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); transform: translateY(-1px); }
.sg-preview-browser.is-ok .sg-preview-dot { background: var(--ok); }
.sg-preview-browser.is-off .sg-preview-dot { background: var(--danger); }
.sg-preview-steps { display: grid; gap: 10px; width: 100%; margin: 0; padding: 20px 24px; list-style: none; font-size: var(--fs-small); line-height: 1.4; justify-self: stretch; align-self: start; }
.sg-step { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; }
.sg-step-icon { display: grid; place-items: center; width: 20px; height: 20px; }
.sg-step.is-done .sg-step-icon { color: var(--ok); }
.sg-step.is-failed .sg-step-icon { color: var(--danger); }
.sg-step.is-mark .sg-step-icon { color: var(--warn); }
.sg-step-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.sg-step-label { color: var(--ink); overflow-wrap: anywhere; }
.sg-step.is-now .sg-step-label { font-weight: 600; }
.sg-step.is-failed .sg-step-label { color: var(--danger); font-weight: 600; }
.sg-step-time { color: var(--muted); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }
.sg-step-note { margin-top: 2px; color: var(--muted); font-size: var(--fs-caption); overflow-wrap: anywhere; }
.sg-step-total { padding-left: 30px; color: var(--muted); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }
.sg-step-spin { width: 14px; height: 14px; border: 2px dotted var(--accent); border-radius: 50%; animation: sg-step-spin 1.2s linear infinite; }
@keyframes sg-step-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sg-step-spin { animation: none; } }
