/* S4K Entertainment portal: the one stylesheet for every page.
   Served by the app at /static/site.css because the Content-Security-Policy
   (default-src 'self') blocks inline styles. System fonts only.

   Colours: five accents (emerald, cyan, magenta, indigo, silver) x two modes
   (dark, light). The server renders <html data-accent="..."> (silver by
   default) and, when the visitor chose a mode, data-theme="dark" or "light";
   with no choice the device setting decides. Every colour is a custom
   property defined in the palette below; components use only the variables.
   Every text colour meets WCAG AA in all 10 combinations.

   Border and tint tokens, so each part can have its own strength:
     --line       general dividers (sidebar, tables, key lists, swatches)
     --line-bar   the header bar's bottom border
     --line-card  cards, tiles and the phone menu
     --line-pill  unselected pills and outlined buttons
     --field-line text inputs (a boundary that carries meaning: at least 3:1)
     --chosen-*   the selected pill (light: solid accent, white text) */

/* --- palette: accents ------------------------------------------------------------ */
/* --acc-deep-l: the light-mode header title, about 15 to 20% darker than --acc-l. */

:root {
  /* silver is the default when there is no data-accent */
  --acc-d: #e5e7eb;  --acc-rgb-d: 229, 231, 235;  --acc-l: #374151;  --acc-rgb-l: 55, 65, 81;  --btn-text-d: #0a0a0b;
  --acc-deep-l: #1e293b;
}

[data-accent="emerald"] { --acc-d: #10b981; --acc-rgb-d: 16, 185, 129;  --acc-l: #047857; --acc-rgb-l: 4, 120, 87;   --btn-text-d: #02231a; --acc-deep-l: #065f46; }
[data-accent="cyan"]    { --acc-d: #22d3ee; --acc-rgb-d: 34, 211, 238;  --acc-l: #0e7490; --acc-rgb-l: 14, 116, 144; --btn-text-d: #032229; --acc-deep-l: #155e75; }
/* magenta: dark button text, because white on #ec4899 is only 3.5:1 (fails AA); #2a0a1a is about 5.2:1 */
[data-accent="magenta"] { --acc-d: #ec4899; --acc-rgb-d: 236, 72, 153;  --acc-l: #be185d; --acc-rgb-l: 190, 24, 93;  --btn-text-d: #2a0a1a; --acc-deep-l: #9d174d; }
[data-accent="indigo"]  { --acc-d: #818cf8; --acc-rgb-d: 129, 140, 248; --acc-l: #4338ca; --acc-rgb-l: 67, 56, 202;  --btn-text-d: #0e0f2a; --acc-deep-l: #3730a3; }
[data-accent="silver"]  { --acc-d: #e5e7eb; --acc-rgb-d: 229, 231, 235; --acc-l: #374151; --acc-rgb-l: 55, 65, 81;   --btn-text-d: #0a0a0b; --acc-deep-l: #1e293b; }

/* --- palette: dark mode (the default) ------------------------------------------------ */

:root {
  color-scheme: dark;
  --page-bg: radial-gradient(ellipse 80% 280px at 50% 0%, rgba(var(--acc-rgb-d), 0.45), transparent 72%), #0a0a0b;
  --page-fallback: #0a0a0b;
  --accent: var(--acc-d);
  --brand: var(--acc-d);
  --brand-glow: 0 0 16px rgba(var(--acc-rgb-d), 0.55);
  --glow: rgba(var(--acc-rgb-d), 0.45);
  --line: rgba(var(--acc-rgb-d), 0.32);
  --line-bar: rgba(var(--acc-rgb-d), 0.35);
  --line-card: rgba(var(--acc-rgb-d), 0.42);
  --line-pill: rgba(var(--acc-rgb-d), 0.35);
  --field-line: rgba(var(--acc-rgb-d), 0.75);
  --chosen-bg: rgba(var(--acc-rgb-d), 0.18);
  --chosen-text: var(--text);
  --chosen-check: var(--acc-d);
  --active-text: var(--acc-d);
  --danger: #ff7b72;  /* errors: 7.0:1 on the dark tile, 7.9:1 on the page */
  /* Bridge consent box: a soft yellow, the same in every accent (text 12.9:1 on its background). */
  --consent-bg: #2a2410;
  --consent-line: #a16207;
  --consent-text: #fde68a;
  /* Bridge timeline and workflow chart, palette B (G8): done soft white with a tick, the current step in the
     chosen accent with a soft glow, next grey (dashed on chart nodes). --yes is the guide's green "Yes". */
  --step-done: #e4e4e7;
  --step-current: var(--acc-d);
  --step-current-ring: rgba(var(--acc-rgb-d), 0.35);
  --step-current-bg: rgba(var(--acc-rgb-d), 0.12);
  --step-upcoming: #52525b;
  --yes: #22c55e;
  --yes-bg: rgba(34, 197, 94, 0.13);  /* G24.2: behind the full use tick */
  /* G16: the requester's Bridge tracker and other status colours: green done, yellow waiting, red stopped, grey to
     come; amber marks the rows that differ in a comparison. */
  --track-ok: #22c55e;
  --track-ok-mark: #06210f;
  --track-wait: #f59e0b;
  --track-wait-text: #fcd34d;
  --track-wait-bg: rgba(245, 158, 11, 0.15);
  --track-bad: #b42318;
  --track-bad-mark: #ffffff;
  --track-next: #52525b;
  --track-line: #3f3f46;
  --diff-bg: rgba(245, 158, 11, 0.08);
  /* G18: Handler metrics, one fixed colour per Ticket Handler (by account), and the greys of the open slices: light
     grey assigned, dark grey nobody assigned, the darkest the rest of the team's tickets on a handler's donut. */
  --hm-0: #ec4899;
  --hm-1: #818cf8;
  --hm-2: #22c55e;
  --hm-3: #f59e0b;
  --hm-4: #06b6d4;
  --hm-5: #a855f7;
  --hm-6: #f97316;
  --hm-7: #14b8a6;
  --hm-other: #d4d4d8;
  --hm-open: #71717a;
  --hm-unassigned: #3f3f46;
  --hm-rest: #2a2a30;
  /* G7: Approve and Deny fills (white text), and the newly resolved green on My requests. */
  --approve-bg: #15803d;
  --approve-hover: #166534;
  --deny-bg: #b42318;
  --deny-hover: #912018;
  --on-fill: #ffffff;
  --approve-tint: rgba(34, 197, 94, 0.08);
  --deny-tint: rgba(255, 123, 114, 0.08);
  --fresh-line: #22c55e;
  --fresh-bg: rgba(34, 197, 94, 0.12);
  /* Who sees a text (G6): amber for the requester, purple (the current-step colour) for admins only; the red box
     behind "Why it was rejected". */
  --vis-requester: #fbbf24;
  --vis-admin: #c4b5fd;
  --danger-bg: rgba(255, 123, 114, 0.1);
  /* Static IP sheet: in use / free address boxes and ticked / blank check glows (glows only, never fills). */
  --ip-used-line: rgba(34, 197, 94, 0.75);
  --ip-used-glow: 0 0 8px rgba(34, 197, 94, 0.45);
  --ip-free-line: rgba(239, 68, 68, 0.75);
  --ip-free-glow: 0 0 8px rgba(239, 68, 68, 0.45);
  --check-pass: #16a34a;  /* G10: a ticked check, solid, with a white tick */
  --check-fail: #f87171;  /* G10: a blank check, an empty box with this border */
  --check-tick: #ffffff;
  --email-bg: #ffffff;  /* G11: an email is white with dark text whatever the portal's mode */
  --email-text: #111827;
  --email-link: #2563eb;
  /* G11: the six email template colours (fixed: they are what the email shows, whatever the accent or mode). */
  --swatch-red: #dc2626;
  --swatch-orange: #ea580c;
  --swatch-green: #16a34a;
  --swatch-blue: #2563eb;
  --swatch-grey: #6b7280;
  --swatch-black: #111827;
  --tile: #18181a;
  --text: #f6f6f6;
  --muted: #c6c6c9;
  --bar: rgba(0, 0, 0, 0.6);
  --sidebar: rgba(0, 0, 0, 0.45);
  --hover-bg: rgba(var(--acc-rgb-d), 0.12);
  --active-bg: rgba(var(--acc-rgb-d), 0.14);
  --shadow-rest: 0 6px 16px rgba(0, 0, 0, 0.55);
  --shadow-pop: 0 18px 40px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.45);
  --backdrop: rgba(0, 0, 0, 0.55);  /* G9: behind the phone drawer */
  --logout-bg: var(--acc-d);
  --logout-text: var(--btn-text-d);
}

.swatch { background: var(--acc-d); }  /* each swatch carries its own data-accent */

/* --- palette: light mode (device prefers light and no dark choice, or light chosen) --- */

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --page-bg: radial-gradient(ellipse 70% 260px at 50% 0%, rgba(var(--acc-rgb-l), 0.30), transparent 72%), color-mix(in srgb, var(--acc-l) 6%, #ffffff);
    --page-fallback: color-mix(in srgb, var(--acc-l) 6%, #ffffff);
    --accent: var(--acc-l);
    --brand: var(--acc-deep-l);
    --brand-glow: 0 0 18px rgba(var(--acc-rgb-l), 0.45);
    --glow: rgba(var(--acc-rgb-l), 0.35);
    --line: rgba(var(--acc-rgb-l), 0.40);
    --line-bar: rgba(var(--acc-rgb-l), 0.45);
    --line-card: rgba(var(--acc-rgb-l), 0.55);
    --line-pill: rgba(var(--acc-rgb-l), 0.45);
    --field-line: rgba(var(--acc-rgb-l), 0.80);
    --chosen-bg: var(--acc-l);
    --chosen-text: #ffffff;
    --chosen-check: #ffffff;
    --active-text: var(--acc-deep-l);  /* accent text on the stronger tint was 4.3:1 (emerald, cyan) */
    --danger: #b42318;  /* errors: 6.6:1 on white, 5.8:1 on the tinted page */
    /* Bridge consent box: a soft yellow, the same in every accent (text 13.6:1 on its background). */
    --consent-bg: #fef9c3;
    --consent-line: #ca8a04;
    --consent-text: #422006;
    /* Bridge timeline and workflow chart, palette B (darker equivalents on white). */
    --step-done: #3f3f46;
    --step-current: var(--acc-l);
    --step-current-ring: rgba(var(--acc-rgb-l), 0.28);
    --step-current-bg: rgba(var(--acc-rgb-l), 0.08);
    --step-upcoming: #52525b;
    --yes: #15803d;
    --yes-bg: rgba(21, 128, 61, 0.1);
  --track-ok: #15803d;
  --track-ok-mark: #ffffff;
  --track-wait: #b45309;
  --track-wait-text: #92400e;
  --track-wait-bg: rgba(180, 83, 9, 0.12);
  --track-bad: #b42318;
  --track-bad-mark: #ffffff;
  --track-next: #71717a;
  --track-line: #d4d4d8;
  --diff-bg: rgba(180, 83, 9, 0.08);
  --hm-0: #db2777;
  --hm-1: #6366f1;
  --hm-2: #16a34a;
  --hm-3: #d97706;
  --hm-4: #0891b2;
  --hm-5: #9333ea;
  --hm-6: #ea580c;
  --hm-7: #0d9488;
  --hm-other: #52525b;
  --hm-open: #a1a1aa;
  --hm-unassigned: #52525b;
  --hm-rest: #e4e4e7;
    --fresh-line: #15803d;
    --fresh-bg: rgba(21, 128, 61, 0.08);
    --vis-requester: #b45309;
    --vis-admin: #6d28d9;
    --danger-bg: rgba(180, 35, 24, 0.06);
    /* Static IP sheet: the darker green (#15803d) and red (#b91c1c), at lower opacity. */
    --ip-used-line: rgba(21, 128, 61, 0.6);
    --ip-used-glow: 0 0 8px rgba(21, 128, 61, 0.3);
    --ip-free-line: rgba(185, 28, 28, 0.6);
    --ip-free-glow: 0 0 8px rgba(185, 28, 28, 0.3);
    --check-pass: #15803d;
    --check-fail: #dc2626;
    --check-tick: #ffffff;
    --tile: #ffffff;
    --text: #18181b;
    --muted: #52525b;
    --bar: rgba(255, 255, 255, 0.85);
    --sidebar: rgba(255, 255, 255, 0.7);
    --hover-bg: rgba(var(--acc-rgb-l), 0.12);
    --active-bg: rgba(var(--acc-rgb-l), 0.14);
    --shadow-rest: 0 4px 14px rgba(24, 24, 27, 0.08);
    --shadow-pop: 0 18px 40px rgba(24, 24, 27, 0.16);
    --shadow-card: 0 6px 24px rgba(var(--acc-rgb-l), 0.18);
    --backdrop: rgba(10, 10, 11, 0.4);
    --logout-bg: var(--acc-l);
    --logout-text: #ffffff;
  }
  :root:not([data-theme="dark"]) .swatch { background: var(--acc-l); }
}

:root[data-theme="light"] {
  color-scheme: light;
  --page-bg: radial-gradient(ellipse 70% 260px at 50% 0%, rgba(var(--acc-rgb-l), 0.30), transparent 72%), color-mix(in srgb, var(--acc-l) 6%, #ffffff);
  --page-fallback: color-mix(in srgb, var(--acc-l) 6%, #ffffff);
  --accent: var(--acc-l);
  --brand: var(--acc-deep-l);
  --brand-glow: 0 0 18px rgba(var(--acc-rgb-l), 0.45);
  --glow: rgba(var(--acc-rgb-l), 0.35);
  --line: rgba(var(--acc-rgb-l), 0.40);
  --line-bar: rgba(var(--acc-rgb-l), 0.45);
  --line-card: rgba(var(--acc-rgb-l), 0.55);
  --line-pill: rgba(var(--acc-rgb-l), 0.45);
  --field-line: rgba(var(--acc-rgb-l), 0.80);
  --chosen-bg: var(--acc-l);
  --chosen-text: #ffffff;
  --chosen-check: #ffffff;
  --active-text: var(--acc-deep-l);  /* accent text on the stronger tint was 4.3:1 (emerald, cyan) */
  --danger: #b42318;  /* errors: 6.6:1 on white, 5.8:1 on the tinted page */
  /* Bridge consent box: a soft yellow, the same in every accent (text 13.6:1 on its background). */
  --consent-bg: #fef9c3;
  --consent-line: #ca8a04;
  --consent-text: #422006;
  /* Bridge timeline and workflow chart, palette B (darker equivalents on white). */
  --step-done: #3f3f46;
  --step-current: var(--acc-l);
  --step-current-ring: rgba(var(--acc-rgb-l), 0.28);
  --step-current-bg: rgba(var(--acc-rgb-l), 0.08);
  --step-upcoming: #52525b;
  --yes: #15803d;
  --yes-bg: rgba(21, 128, 61, 0.1);
  --track-ok: #15803d;
  --track-ok-mark: #ffffff;
  --track-wait: #b45309;
  --track-wait-text: #92400e;
  --track-wait-bg: rgba(180, 83, 9, 0.12);
  --track-bad: #b42318;
  --track-bad-mark: #ffffff;
  --track-next: #71717a;
  --track-line: #d4d4d8;
  --diff-bg: rgba(180, 83, 9, 0.08);
  --hm-0: #db2777;
  --hm-1: #6366f1;
  --hm-2: #16a34a;
  --hm-3: #d97706;
  --hm-4: #0891b2;
  --hm-5: #9333ea;
  --hm-6: #ea580c;
  --hm-7: #0d9488;
  --hm-other: #52525b;
  --hm-open: #a1a1aa;
  --hm-unassigned: #52525b;
  --hm-rest: #e4e4e7;
  --fresh-line: #15803d;
  --fresh-bg: rgba(21, 128, 61, 0.08);
  --vis-requester: #b45309;
  --vis-admin: #6d28d9;
  --danger-bg: rgba(180, 35, 24, 0.06);
  /* Static IP sheet: the darker green (#15803d) and red (#b91c1c), at lower opacity. */
  --ip-used-line: rgba(21, 128, 61, 0.6);
  --ip-used-glow: 0 0 8px rgba(21, 128, 61, 0.3);
  --ip-free-line: rgba(185, 28, 28, 0.6);
  --ip-free-glow: 0 0 8px rgba(185, 28, 28, 0.3);
  --check-pass: #15803d;
  --check-fail: #dc2626;
  --check-tick: #ffffff;
  --tile: #ffffff;
  --text: #18181b;
  --muted: #52525b;
  --bar: rgba(255, 255, 255, 0.85);
  --sidebar: rgba(255, 255, 255, 0.7);
  --hover-bg: rgba(var(--acc-rgb-l), 0.12);
  --active-bg: rgba(var(--acc-rgb-l), 0.14);
  --shadow-rest: 0 4px 14px rgba(24, 24, 27, 0.08);
  --shadow-pop: 0 18px 40px rgba(24, 24, 27, 0.16);
  --shadow-card: 0 6px 24px rgba(var(--acc-rgb-l), 0.18);
  --backdrop: rgba(10, 10, 11, 0.4);
  --logout-bg: var(--acc-l);
  --logout-text: #ffffff;
}

:root[data-theme="light"] .swatch { background: var(--acc-l); }

/* --- end of palette: everything below uses only the variables --- */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--page-fallback);  /* fallback under the spotlight layer */
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

/* Spotlight from the top centre, CSS only. It sits on a fixed full-screen
   layer, so it stays put while the page scrolls and fills the screen on
   desktop and phone; this also works on iPhones, which ignore
   background-attachment: fixed. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--page-bg);
}

a { color: var(--accent); }

/* --- top bar -------------------------------------------------------------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1rem 1.5rem;
  background: var(--bar);
  border-bottom: 1px solid var(--line-bar);
}

.brand {
  color: var(--brand);
  /* about 3rem on desktop, smaller on phones */
  font-size: clamp(1.1rem, 0.3rem + 4.4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  white-space: nowrap;  /* the name always stays on one line */
  text-decoration: none;
  text-shadow: var(--brand-glow);
}

.account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.account-name {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.logout { margin: 0; }

/* G10 (L7): "Continue without admin tools" is a form button that looks like the link it was. */
.skip-form { margin: 0; }
.link-button { padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-decoration: underline; cursor: pointer; }
.link-button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* --- layout: sidebar and content (signed-in pages) ------------------------------ */

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
}

.content { min-width: 0; }

/* Always expanded on desktop. The column runs the full height of the page; the list inside it stays in
   place while the page scrolls (sticky, no JavaScript), at most one window tall with its own scroll.
   Settings is pinned to the bottom. */
.sidebar-column {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}

.sidebar {
  position: sticky;
  top: 0;
  box-sizing: border-box;
  height: min(100%, 100vh);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.75rem;
}

.nav-list {
  display: grid;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-left: 3px solid transparent;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}

.nav-item:hover { background: var(--hover-bg); }

.nav-item.active {
  color: var(--active-text);
  background: var(--active-bg);
  border-left-color: var(--accent);
  font-weight: 600;
}

.nav-item:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}

.nav-icon {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
}

.nav-heading {
  margin: 1.1rem 0.75rem 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.nav-bottom {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

/* On phones the same list sits behind a "Menu" <details>; hidden on desktop. */
.mobile-menu { display: none; }

.mobile-menu summary {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line-pill);
  border-radius: 8px;
  background: var(--tile);
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.mobile-menu summary::-webkit-details-marker { display: none; }

.mobile-menu summary::after {
  content: " \25BE";  /* small down arrow */
  color: var(--muted);
}

.mobile-menu summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.mobile-menu nav {
  margin-top: 0.6rem;
  padding: 0.6rem;
  background: var(--tile);
  border: 1px solid var(--line-card);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

.mobile-menu .nav-bottom { margin-top: 0.6rem; }

/* G9 part 7: with menu.js (html.drawer-ready), the open Menu on phones is a drawer from the left over a dimmed
   backdrop. Without the script the rules above still apply: the list opens in the page. */
.drawer-close { display: none; }
@media (max-width: 600px) {
  .drawer-ready .mobile-menu[open] nav {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 41;
    width: 80%;
    max-width: 22rem;
    margin: 0;
    padding: 3.5rem 0.75rem 1rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-width: 0 1px 0 0;
    border-radius: 0 14px 14px 0;
    background: var(--tile);
    animation: drawer-in 0.22s ease-out;
  }
  .drawer-ready .mobile-menu[open] .drawer-close {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--line-pill);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
  }
  .drawer-close:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
  .drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: var(--backdrop);
    backdrop-filter: blur(2px);
    animation: drawer-fade 0.22s ease-out;
  }
  html.drawer-open, html.drawer-open body { overflow: hidden; }
}
@keyframes drawer-in { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes drawer-fade { from { opacity: 0; } to { opacity: 1; } }

/* --- buttons ---------------------------------------------------------------- */

/* Buttons and button links look like the tiles, with the accent hover. */
.button {
  display: inline-block;
  padding: 0.55rem 1.05rem;
  border: 1px solid var(--line-pill);
  border-radius: 12px;
  background: var(--tile);
  color: var(--text);
  font: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-rest);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.button:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-rest), 0 0 22px var(--glow);
}

/* Log out: solid accent colour with bold text (per-accent dark text in dark mode, white in light). */
.logout .button {
  background: var(--logout-bg);
  color: var(--logout-text);
  font-weight: 700;
  border: none;
  border-radius: 8px;
  box-shadow: none;
}

.logout .button:hover {
  box-shadow: 0 0 0 3px var(--glow);  /* a glow ring only: colours (and contrast) stay the same */
}

.button:focus-visible,
.brand:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.button-large {
  display: block;
  padding: 0.85rem 1.2rem;
  font-size: 1.05rem;
}

/* --- page body ----------------------------------------------------------- */

main {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.25rem 1.25rem 3rem;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem);
  line-height: 1.25;
}

.card {
  max-width: 32rem;
  margin: 1rem auto;
  padding: 1.75rem;
  background: var(--tile);
  border: 1px solid var(--line-card);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}

.card h1 { margin-bottom: 0.75rem; }

.card p { color: var(--muted); }

.signin-buttons {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

/* --- settings ----------------------------------------------------------------- */

.settings-card {
  max-width: 44rem;
  margin: 0;
}

.settings-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
}

.settings-card h3 {
  margin: 1.25rem 0 0.6rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.choice-list form { margin: 0; }

.choice {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line-pill);
  border-radius: 999px;
  background: var(--tile);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.choice:hover {
  border-color: var(--accent);
  background: var(--hover-bg);
}

.choice.chosen {
  border-color: var(--accent);
  background: var(--chosen-bg);
  color: var(--chosen-text);
  font-weight: 600;
}

.choice:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.choice-check {
  width: 1em;
  color: var(--chosen-check);
  font-weight: 700;
}

.swatch {
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 50%;
}

/* --- security key pages ------------------------------------------------------------ */

.key-card { max-width: 36rem; }

.key-check {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.key-label {
  color: var(--text);
  font-weight: 600;
}

.key-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--field-line);
  border-radius: 8px;
  background: var(--tile);
  color: var(--text);
  font: inherit;
}

.key-input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.key-status {
  min-height: 1.5em;
  margin: 0;
}

.key-noscript {
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* --- admin pages ------------------------------------------------------------------- */

.admin-card { max-width: none; margin: 1.25rem 0; }

.admin-card h2 { margin: 0 0 0.75rem; font-size: 1.2rem; }

.admin-card h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }

.admin-search { display: grid; gap: 0.4rem; max-width: 36rem; margin-bottom: 1.25rem; }

.admin-search-row { display: flex; gap: 0.5rem; }

.admin-table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line-card); border-radius: 12px; background: var(--tile); }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }

.admin-table th,
.admin-table td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }

.admin-table tbody tr:last-child td { border-bottom: none; }

.admin-table th { color: var(--muted); font-weight: 600; white-space: nowrap; }

.admin-empty,
.admin-back { color: var(--muted); }

.badge {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
}

.badge-muted { border-color: var(--line); color: var(--muted); }

/* The label column grows to its longest label but never past 45%, so long labels wrap instead of pushing the page wide. */
.admin-facts { display: grid; grid-template-columns: fit-content(45%) minmax(0, 1fr); gap: 0.3rem 1rem; margin: 0 0 1rem; }

.admin-facts dt { color: var(--muted); }

.admin-facts dd { margin: 0; overflow-wrap: anywhere; }

.notice { padding: 0.7rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--active-bg); }

.notice-error,
.notice-warning { border-color: var(--accent); font-weight: 600; }

.perm-list,
.key-list { display: grid; gap: 0.75rem; margin: 0 0 1rem; padding: 0; list-style: none; }

.perm { display: flex; gap: 0.75rem; align-items: flex-start; cursor: pointer; }

.perm input { width: 1.15rem; height: 1.15rem; margin-top: 0.2rem; accent-color: var(--accent); }

.perm-disabled { cursor: default; }

.perm-text,
.key-facts { display: grid; gap: 0.1rem; }

.perm-name { font-weight: 600; }

.perm-desc,
.perm-hint { color: var(--muted); font-size: 0.9rem; }

.perm-reason { color: var(--accent); font-size: 0.9rem; }

.key-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.key-item:last-child { border-bottom: none; }

.key-facts { flex: 1 1 16rem; }

.inline-form { display: flex; gap: 0.5rem; align-items: center; }

.inline-form .key-input { width: 14rem; max-width: 100%; }

.key-group { padding: 0.75rem 0 1rem; border-bottom: 1px solid var(--line); }

.key-group:last-child { border-bottom: none; }

.link-text code { display: block; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  white-space: nowrap;
  font-size: 1px;  /* G12: clipped text still counts toward a scroll box's width; 1px text cannot widen one */
  line-height: 1;
}

/* --- audit log page --------------------------------------------------------------- */

.audit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.85rem 1rem; }

.audit-field { display: grid; gap: 0.3rem; align-content: start; }

.audit-wide { grid-column: 1 / -1; }

/* G14: the audit log filters in two wrapping rows: Search and the other filters, then From and To on their own. */
.audit-filter-row { display: flex; flex-wrap: wrap; gap: 0.85rem 1rem; align-items: flex-start; }
.audit-filter-row + .audit-filter-row { margin-top: 0.85rem; }
.audit-filter-row .audit-field { flex: 1 1 10.5rem; min-width: 0; max-width: 100%; }
.audit-filter-row .audit-search { flex: 2 1 16rem; }
.audit-filter-row-dates .audit-field { flex: 0 1 16rem; }
.audit-filter-row .key-input { min-width: 0; max-width: 100%; }

.audit-actions,
.audit-pages { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }

.audit-summary { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; color: var(--muted); }

.badge-alert { background: var(--chosen-bg); color: var(--chosen-text); border-color: var(--accent); }

/* The audit page uses the whole content area beside the sidebar. */
main.main-wide { max-width: none; }

/* Entries: each <details> has its row as the <summary>, a grid with the header's columns.
   Time and IP have fixed widths; Actor, Action, Target and Result share the rest. Cells are one line,
   cut with an ellipsis (the full value is in the title attribute and in the expanded part). */
.audit-list {
  --audit-columns: 1rem 11.75rem minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1.1fr) 7.75rem;
  border: 1px solid var(--line-card);
  border-radius: 12px;
  background: var(--tile);
}

.audit-head,
.audit-row {
  display: grid;
  grid-template-columns: var(--audit-columns);
  gap: 0 0.75rem;
  align-items: center;
  padding: 0.55rem 0.9rem;
}

.audit-head { color: var(--muted); font-size: 0.95rem; font-weight: 600; border-bottom: 1px solid var(--line); }

.audit-entry { border-bottom: 1px solid var(--line); }

.audit-entry:last-child { border-bottom: none; }

.audit-row { list-style: none; cursor: pointer; font-size: 0.95rem; }

.audit-row::-webkit-details-marker { display: none; }

.audit-row:hover { background: var(--hover-bg); }

.audit-row:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

.audit-cell {
  min-width: 0;
  overflow: hidden;  /* a single line with an ellipsis */
  white-space: nowrap;
  text-overflow: ellipsis;
}

.audit-time,
.audit-ip { font-variant-numeric: tabular-nums; }

.audit-muted { color: var(--muted); }

.audit-label { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); white-space: nowrap; }

/* A small chevron that turns when the entry is open (also .row-chevron in every expandable row list). */
.audit-chevron::before,
.row-chevron::before {
  content: "";
  display: block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.audit-entry[open] .audit-chevron::before,
details[open] > summary .row-chevron::before { transform: rotate(45deg); }

.audit-entry[open] .audit-row { background: var(--active-bg); }

/* The expanded part lines up with the Time column (past the chevron column and its gap). */
.audit-expanded { margin: 0; padding: 0.6rem 0.9rem 0.9rem calc(0.9rem + 1rem + 0.75rem); }

.audit-expanded dd { overflow-wrap: anywhere; }

/* Narrow screens: the cells stack, each with its label. */
@media (max-width: 900px) {
  .audit-head { display: none; }
  .audit-row { grid-template-columns: 1rem minmax(0, 1fr); gap: 0.2rem 0.6rem; }
  .audit-chevron { grid-row: 1 / span 6; align-self: start; padding-top: 0.45rem; }
  .audit-cell { grid-column: 2; white-space: normal; overflow-wrap: anywhere; }
  .audit-label { position: static; width: auto; height: auto; clip-path: none; color: var(--muted); }
  .audit-expanded { padding-left: calc(0.9rem + 1rem + 0.6rem); }
}

/* --- expandable rows: the site-wide pattern for lists whose entries hold more than one line -------------------
   <div class="row-list LIST-rows">            (LIST-rows sets --row-columns)
     <div class="row-head">                   optional column headings (hidden on phones)
     <details class="row-entry"><summary class="row-summary"> .row-chevron + one-line .audit-cell cells (ellipsis,
       full value in the title) </summary><div class="row-expanded"> every detail and action </div></details>
   Closed by default; clicking anywhere on the row (or its chevron) opens it, clicking again closes it. No script. */
.row-list { margin: 0 0 1rem; border: 1px solid var(--line-card); border-radius: 12px; background: var(--tile); }

.row-head,
.row-summary {
  display: grid;
  grid-template-columns: var(--row-columns);
  gap: 0 0.75rem;
  align-items: center;
  padding: 0.6rem 0.9rem;
}

.row-head { color: var(--muted); font-size: 0.95rem; font-weight: 600; border-bottom: 1px solid var(--line); }

.row-entry { border-bottom: 1px solid var(--line); }

.row-entry:last-child { border-bottom: none; }

.row-summary { list-style: none; cursor: pointer; }

.row-summary::-webkit-details-marker { display: none; }

.row-summary:hover { background: var(--hover-bg); }

.row-summary:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

.row-entry[open] > .row-summary { background: var(--active-bg); }

.row-expanded { display: grid; gap: 0.75rem; padding: 0.75rem 0.9rem 1rem calc(0.9rem + 1rem + 0.75rem); }

.row-expanded .admin-facts { margin: 0; }

.row-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-start; }

.row-actions form { margin: 0; }

.outside-rows { --row-columns: 1rem minmax(0, 1.2fr) minmax(0, 1.6fr) 10rem 12.5rem; }

.denied-rows { --row-columns: 1rem minmax(0, 1fr) minmax(0, 1.4fr) 10rem 12.5rem; }

.key-rows { --row-columns: 1rem minmax(0, 1.2fr) 8rem 12.5rem; }

@media (max-width: 900px) {
  .row-head { display: none; }
  .row-summary { grid-template-columns: 1rem minmax(0, 1fr); gap: 0.2rem 0.6rem; }
  .row-summary .row-chevron { grid-row: 1 / span 6; align-self: start; padding-top: 0.45rem; }
  .row-summary .audit-cell { grid-column: 2; white-space: normal; overflow-wrap: anywhere; }
  .row-summary .audit-label { position: static; width: auto; height: auto; clip-path: none; color: var(--muted); }
  .row-expanded { padding-left: calc(0.9rem + 1rem + 0.6rem); }
  .row-actions, .row-actions .inline-form { min-width: 0; max-width: 100%; flex-wrap: wrap; }
  .row-actions .inline-form .key-input { width: 100%; }
}

/* --- outside access page ------------------------------------------------------------ */

.outside-list { gap: 0; }

.outside-entry { margin: 0 0 1rem; }

.outside-email { overflow-wrap: anywhere; }

.outside-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

/* --- tickets --------------------------------------------------------------------------- */

.ticket-form { display: grid; gap: 1rem; max-width: 44rem; }

.ticket-field { display: grid; gap: 0.35rem; }

.ticket-field p { margin: 0; }

/* Every multi-line box: a fixed 3-line box (rows="3") where field-sizing is not supported; where it is,
   it starts one line tall, grows as the person types, and scrolls after about 12 lines. */
.ticket-text { resize: vertical; }

@supports (field-sizing: content) {
  .ticket-text {
    field-sizing: content;
    min-height: calc(1lh + 1.2rem + 2px);  /* one line plus the padding and border */
    max-height: calc(12lh + 1.2rem + 2px);
    overflow-y: auto;
    resize: none;
  }
}

.phone-row { display: grid; grid-template-columns: minmax(9rem, max-content) minmax(0, 1fr); gap: 0.5rem; }

.ticket-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }

.ticket-filter .key-input { width: auto; }

/* Software: "Application name" shows only while Application is on "Other". Browsers without :has()
   skip this rule and always show the box (the server ignores it unless "Other" is chosen). */
@supports selector(:has(*)) {
  .ticket-form:not(:has(.has-other option[value="Other"]:checked)) .other-box { display: none; }
}

/* G7: Request beside the side column (Quick links, Manage ticket: 26rem, about 416px). G11: Approvals and Messages
   are in the left column under Request (end of this file). */
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1.25rem; align-items: start; }

.ticket-layout-handler { grid-template-columns: minmax(0, 1fr) 26rem; }

.ticket-text-view { white-space: pre-wrap; overflow-wrap: anywhere; }

.ticket-thread { display: grid; gap: 0.9rem; margin: 0 0 1rem; padding: 0; list-style: none; }

.ticket-message { padding: 0.75rem 0.9rem; border: 1px solid var(--line); border-radius: 10px; }

.ticket-internal { border-color: var(--accent); background: var(--active-bg); }

/* On the tinted note background the accent badge text is just under AA in some colours: use the text colour. */
.ticket-internal .badge { color: var(--text); }

.ticket-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0 0 0.35rem; }

/* G7: times sit at the right of the message header (12-hour, Eastern). */
.ticket-when { margin-left: auto; color: var(--muted); font-size: 0.85rem; white-space: nowrap; }

.ticket-message .ticket-text-view { margin: 0; color: var(--text); }

.ticket-reply,
.ticket-control { display: grid; gap: 0.5rem; margin-top: 1rem; }

.ticket-control form { margin: 0; }

.ticket-control:has(form) { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.quick-links { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }

@media (max-width: 900px) {
  .ticket-layout { grid-template-columns: minmax(0, 1fr); }
}

/* --- refused forms: highlighted fields and the summary box ------------------------------- */

.key-input[aria-invalid="true"] { border: 2px solid var(--danger); }

.key-input[aria-invalid="true"]:focus-visible { outline-color: var(--danger); }

.field-error,
.card .field-error,  /* beats .card p, which would make it muted grey */
.error-title { display: flex; gap: 0.4rem; align-items: flex-start; color: var(--danger); font-weight: 600; }

.field-error { margin: 0.1rem 0 0; font-size: 0.95rem; }

.error-icon { flex: none; width: 1.1em; height: 1.1em; margin-top: 0.15em; }

.error-summary {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1.1rem;
  border: 2px solid var(--danger);
  border-radius: 12px;
  background: var(--tile);
}

.error-title { margin: 0 0 0.4rem; font-size: 1.05rem; }

.error-list { margin: 0; padding-left: 1.6rem; }

.error-list a { color: var(--danger); font-weight: 600; }

/* --- users page ----------------------------------------------------------------------- */

.users-tools { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.25rem; }

.users-tools .admin-search { flex: 1 1 24rem; margin: 0; }

.users-block { margin-bottom: 2rem; }

.users-block h2 { margin: 0 0 0.75rem; font-size: 1.2rem; }

.perm-fieldset { margin: 1rem 0 0; padding: 0; border: none; }

.perm-fieldset[aria-invalid="true"] .perm-list { padding: 0.6rem; border: 2px solid var(--danger); border-radius: 10px; }

/* --- admin settings: tiles --------------------------------------------------------------- */

.tile-setting { display: block; }

.tile-form { display: grid; gap: 0.6rem; }

.tile-form .button { justify-self: start; }

/* --- request tiles ---------------------------------------------------------- */

.tiles-heading { margin: 2.25rem 0 1rem; font-size: 1.25rem; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tile a {
  position: relative;  /* lets the popped tile rise above its neighbours */
  z-index: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  height: 100%;
  padding: 1.35rem 1.25rem;
  background: var(--tile);
  border: 1px solid var(--line-card);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-rest);
  transform: scale(1);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

/* Pop toward the viewer: the same for mouse hover and keyboard focus, for
   everyone (deliberately not turned off by prefers-reduced-motion). Nothing
   around the grid hides overflow, and the gaps leave room for the 1.12x size. */
.tile a:hover,
.tile a:focus-visible {
  z-index: 2;
  transform: scale(1.12);
  border-color: var(--accent);
  box-shadow: var(--shadow-pop), 0 0 22px var(--glow);
}

.tile a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.tile-icon {
  width: 2.1rem;
  height: 2.1rem;
  color: var(--accent);
}

.tile-title {
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 650;
}

.tile-desc {
  color: var(--muted);
  font-size: 0.95rem;
}

/* --- Admin settings: breadcrumb and the visual workflow builder ----------------- */

/* The hidden attribute always hides, even on elements given a display above (flags, notes, buttons). */
[hidden] { display: none !important; }

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.breadcrumb li + li::before { content: "\203A"; margin-right: 0.4rem; }

.breadcrumb a { color: var(--muted); }

.breadcrumb a:hover { color: var(--text); }

/* The tile row: one button per request tile; the open one is marked. */
.wf-picker ul { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }

.wf-pick {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--line-card);
  border-radius: 10px;
  background: var(--tile);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-rest);
}

.wf-pick:hover { border-color: var(--accent); }

.wf-pick[aria-current="page"] {
  border-color: var(--accent);
  background: var(--active-bg);
  color: var(--active-text);
  font-weight: 650;
}

.wf-pick:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wf-pick-icon { flex: none; width: 1.3rem; height: 1.3rem; color: var(--accent); }

/* The flow beside the People panel; the panel drops below on narrower screens. */
.wf-layout { display: grid; gap: 1.25rem; align-items: start; }

@media (min-width: 1100px) {
  .wf-layout { grid-template-columns: minmax(0, 1fr) 17rem; }
}

.wf-layout .card { max-width: none; margin: 0; }

.wf-attention { margin: 0 0 1rem; }

.wf-status { margin: 0 0 1rem; }

/* Boxes left to right, joined by arrows; rows wrap when there are many steps. */
.wf-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.75rem 0;
  margin: 0.5rem 0 1rem;
}

.wf-box {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  box-sizing: border-box;
  width: 12.5rem;
  padding: 0.85rem 0.9rem;
  border: 2px solid var(--line-pill);
  border-radius: 12px;
  background: var(--page-fallback);
}

.wf-start { border-style: dashed; }

.wf-flagged { border-color: var(--danger); }

/* A card or box dragged over this box (workflowdnd.js). */
.wf-box.wf-drop {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent), 0 0 18px var(--glow);
}

.wf-box.wf-dragging { opacity: 0.55; }

/* G10: Quick links (Admin settings). */
.ql-rows { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: 0.75rem; }
.ql-row { display: grid; grid-template-columns: 2.25rem minmax(10rem, 1fr) minmax(14rem, 2fr) auto; gap: 0.5rem 1rem; align-items: start; padding: 0.9rem 1rem; border: 1px solid var(--line-card); border-radius: 0.75rem; background: var(--tile); }
.ql-order { margin: 1.9rem 0 0; font-weight: 700; color: var(--muted); }
.ql-row .key-input { width: 100%; }
.ql-types { border: 0; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.ql-moves { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ql-scroll { position: relative; overflow-x: auto; max-width: 100%; min-width: 0; }  /* relative: hidden labels stay inside */
.ql-url { overflow-wrap: anywhere; }
.check-line { display: flex; align-items: center; gap: 0.5rem; }
/* G10: the Email outbox page. */
.ob-actions { display: flex; gap: 0.4rem; margin: 0; }
.ob-table td { vertical-align: top; }
/* G10: the Email templates editor and its Variables key. */
.et-grid { display: grid; grid-template-columns: 15rem minmax(0, 1fr) 16rem; gap: 1rem; align-items: start; }
.et-grid > * { min-width: 0; }
/* G12: below 1500px the Variables key moves under the editor, so the editor column is wide enough for the
   formatting bar on one row. */
@media (max-width: 1500px) {
  .et-grid { grid-template-columns: 13rem minmax(0, 1fr); }
  .et-grid > .et-key { grid-column: 2; }
}
.et-main { display: grid; gap: 1rem; min-width: 0; }
.et-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.4rem; }
.et-item { display: grid; gap: 0.25rem; padding: 0.55rem 0.7rem; border: 1px solid var(--line-card); border-radius: 10px; background: var(--tile); color: var(--text); text-decoration: none; }
.et-item:hover { border-color: var(--accent); }
.et-item-current { border-color: var(--accent); background: var(--active-bg); }
.et-to { justify-self: start; white-space: normal; }
.et-to-requester { border-color: var(--fresh-line); }
.et-to-handler { border-color: var(--step-current); }
.et-to-approver { border-color: var(--consent-line); }
.et-form .key-input { width: 100%; }
.et-body { min-height: 12rem; }
.et-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.et-bar { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; padding: 0.4rem; border: 1px solid var(--field-line); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--tile); }
.et-tool { min-width: 1.9rem; height: 1.9rem; padding: 0 0.45rem; border: 1px solid var(--line-pill); border-radius: 7px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.et-tool:hover, .et-tool:focus-visible { border-color: var(--accent); }
.et-tool-b { font-weight: 800; }
.et-tool-i { font-style: italic; }
.et-tool-u { text-decoration: underline; }
.et-sep { width: 1px; height: 1.3rem; background: var(--line); margin: 0 0.15rem; }
.et-size { height: 1.9rem; border: 1px solid var(--line-pill); border-radius: 7px; background: var(--tile); color: var(--text); font: inherit; font-size: 0.85rem; }
.et-swatch { width: 1.35rem; height: 1.35rem; border: 1px solid var(--line-pill); border-radius: 5px; cursor: pointer; }
.et-swatch:focus-visible, .et-swatch:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
/* The six template colours (fixed: they are what the email will show, whatever the viewer's accent). */
.et-swatch-red { background: var(--swatch-red); }
.et-swatch-orange { background: var(--swatch-orange); }
.et-swatch-green { background: var(--swatch-green); }
.et-swatch-blue { background: var(--swatch-blue); }
.et-swatch-grey { background: var(--swatch-grey); }
.et-swatch-black { background: var(--swatch-black); }
/* G12: four groups that never split; the bar wraps between them. The hex box is its own small field (about 90px),
   never stretched like a form field. */
.et-group { display: inline-flex; flex: none; gap: 0.35rem; align-items: center; }
.et-hex { box-sizing: border-box; width: 5.75rem; height: 1.9rem; padding: 0 0.5rem; border: 1px solid var(--field-line); border-radius: 7px; background: var(--tile); color: var(--text); font: inherit; font-size: 0.85rem; }
.et-hex[aria-invalid="true"] { border-color: var(--danger); }
.et-hex:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.et-apply { font-weight: 800; }
.et-swatch-black { border-color: var(--muted); box-shadow: 0 0 0 1px var(--muted); }  /* visible on a dark bar */
.et-box { min-height: 12rem; padding: 0.85rem; border: 1px solid var(--field-line); border-radius: 0 0 10px 10px; background: var(--email-bg); color: var(--email-text); font: 15px/1.55 Arial, Helvetica, sans-serif; overflow-wrap: anywhere; }
.et-box:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
.et-editor-on + .et-nojs { display: none; }
.et-vars { display: grid; gap: 0.5rem; margin: 0.5rem 0 0; font-size: 0.85rem; }
.et-vars > div { border-top: 1px solid var(--line); padding-top: 0.5rem; }
.et-vars dd { margin: 0.2rem 0 0; }
.et-vars code { white-space: nowrap; }
.et-example { overflow-wrap: anywhere; }
.et-mail { border: 1px solid var(--line-card); border-radius: 10px; background: var(--email-bg); color: var(--email-text); }
.et-mail-head { margin: 0; padding: 0.6rem 0.85rem; border-radius: 10px 10px 0 0; border-bottom: 1px solid var(--line-card); background: var(--tile); color: var(--muted); font-size: 0.85rem; }
.et-mail-body { padding: 0.9rem; font: 15px/1.55 Arial, Helvetica, sans-serif; overflow-wrap: anywhere; }
.et-mail-body a { color: var(--email-link); }

/* G9 part 5: the drag handle on each approver (shown by workflowdnd.js) and the marker in the gap where it lands. */
.wf-handle { display: inline-flex; align-items: center; justify-content: center; width: 1.1rem; height: 1.6rem; margin-right: -0.2rem; cursor: grab; color: var(--muted); }
.wf-handle[hidden] { display: none; }
.wf-handle:not([hidden]) + .wf-label { margin-right: auto; }
.wf-grip { width: 0.45rem; height: 1rem; background-image: radial-gradient(currentColor 1.4px, transparent 1.6px); background-size: 0.225rem 0.333rem; }
.wf-box[draggable="true"]:active .wf-handle { cursor: grabbing; }
.wf-link.wf-drop-gap { position: relative; }
.wf-link.wf-drop-gap::after { content: ""; position: absolute; inset: 0 auto 0 50%; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 12px var(--glow); }

.wf-box-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; min-height: 1.9rem; }

.wf-label { color: var(--muted); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; }

.wf-name {
  margin: 0;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.wf-name.wf-empty { color: var(--muted); font-size: 1.05rem; font-weight: 600; }

.wf-hint { margin: 0; color: var(--muted); font-size: 0.9rem; }

.wf-select { width: 100%; box-sizing: border-box; }

.wf-flag { margin: 0; }

.wf-moves { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; }

.wf-move { padding: 0.3rem 0.6rem; font-size: 0.85rem; }

.wf-remove,
.wf-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border: 1px solid var(--line-pill);
  border-radius: 999px;
  background: var(--tile);
  color: var(--text);
  font: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.wf-remove:hover { border-color: var(--danger); color: var(--danger); }

.wf-add:hover { border-color: var(--accent); color: var(--accent); }

.wf-remove:focus-visible,
.wf-add:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wf-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 2.9rem;
  color: var(--muted);
}

.wf-arrow { width: 1.6rem; height: 1.6rem; }

/* People: cards to drag onto a box (the dropdowns do the same). */
.wf-people h2 { margin-top: 0; }

.wf-cards { display: grid; gap: 0.6rem; margin: 0.75rem 0 0; padding: 0; list-style: none; }

.wf-card {
  display: grid;
  gap: 0.15rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line-card);
  border-radius: 10px;
  background: var(--page-fallback);
}

.wf-card[draggable="true"] { cursor: grab; }

.wf-card[draggable="true"]:hover { border-color: var(--accent); }

.wf-card-name { color: var(--text); font-weight: 700; }

.wf-card-email,
.wf-card-perms { color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }

/* --- Static IP sheet ---------------------------------------------------------- */

.ip-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; }

.ip-head h1 { margin: 0; }

.ip-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.ip-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.75rem;
  margin: 1.25rem 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.92rem;
}

.ip-legend li { display: flex; align-items: center; gap: 0.6rem; }

.ip-search-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; margin-bottom: 1rem; }

.ip-search-field { display: grid; gap: 0.3rem; }

.ip-search-field .key-input { min-width: 15rem; }

.ip-count { margin: 0 0 0.75rem; color: var(--muted); }

/* "Editing the sheet": a highlighted bar with Save changes and Cancel. */
.ip-editbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin: 0 0 1rem;
  padding: 0.85rem 1.1rem;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: var(--active-bg);
  box-shadow: 0 0 18px var(--glow);
}

.ip-editbar p { margin: 0; color: var(--active-text); font-weight: 650; }

.ip-editbar-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* In the bar, Save changes and Cancel keep to its right edge, even when they wrap below the sentence. */
.ip-editbar .ip-editbar-buttons { margin-left: auto; }

.ip-bottom { margin-top: 1rem; }

/* The sheet sizes to its columns (left aligned, no stretched middle): IP 9.5rem (about 150px), Hostname 16.25rem
   (about 260px), each check 4rem (about 64px). Separate borders so the sticky header cells keep theirs; both header
   rows stick to the top of the window while the page scrolls (the first row is a fixed height so the second knows
   where to sit). GENERAL and CHECKS span exactly their columns (colspan 2 and 6). */
.ip-sheet {
  width: auto;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--tile);
  border: 1px solid var(--line-card);
  border-radius: 12px;
}

.ip-sheet thead th {
  position: sticky;
  z-index: 1;
  box-sizing: border-box;
  background: var(--tile);
  color: var(--text);
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.ip-group th {
  top: 0;
  height: 2.4rem;
  padding: 0 0.9rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ip-group th + th { border-left: 1px solid var(--line); }

.ip-cols th {
  top: 2.4rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
}

.ip-cols th:first-child,
.ip-sheet tbody th { width: 9.5rem; }

.ip-cols th:nth-child(2),
.ip-host-cell { width: 16.25rem; }

.ip-sheet th.ip-check,
.ip-sheet td.ip-check { width: 4rem; padding-left: 0.5rem; padding-right: 0.5rem; text-align: center; }

.ip-sheet tbody th,
.ip-sheet tbody td {
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 400;
  vertical-align: middle;
}

.ip-sheet tbody tr:last-child th,
.ip-sheet tbody tr:last-child td { border-bottom: 0; }

.ip-sheet tbody td.ip-check { padding-left: 0.5rem; padding-right: 0.5rem; text-align: center; }

.ip-row-conflict th,
.ip-row-conflict td { background: var(--active-bg); }

/* The address in a thin box with a faint glow: green in use, red free (the title says which, too). */
.ip-addr {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border: 1px solid;
  border-radius: 7px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ip-used { border-color: var(--ip-used-line); box-shadow: var(--ip-used-glow); }

.ip-free { border-color: var(--ip-free-line); box-shadow: var(--ip-free-glow); }

/* A long hostname is cut with an ellipsis (its title has the full name). The fixed width is the column less its
   padding, so the name never widens the column. */
.ip-host {
  display: block;
  width: 14.45rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ip-host-nothing { color: var(--muted); }

.ip-host-input { width: 14.45rem; }

.ip-conflict { margin-top: 0.35rem; }

/* Wide screens: the sheet is centred in the content area, and everything above it (heading and buttons, notices,
   legend, search, edit bar, count) shares the table's width, so it all lines up with the table's left and right
   edges. The width is the columns (9.5 + 16.25 + 6 x 4 rem) plus the table's 1px borders. Narrower screens keep
   the scroll box below. */
@media (min-width: 1121px) {
  main:has(#ip-results) > * {
    max-width: calc(49.75rem + 2px);
    margin-inline: auto;
  }
  main:has(#ip-results) .ip-sheet {
    width: 100%;
    margin-inline: auto;
  }
}

/* Narrower than the sheet plus the sidebar: the sheet scrolls inside its own box, at most one window tall, with
   both header rows stuck to the box's top and the IP column stuck to its left, so the row is always in view.
   (The sheet is about 800px wide and the sidebar 240px, so this starts below 1120px rather than 900px.) */
@media (max-width: 1120px) {
  .ip-sheet { width: max-content; }  /* keep every column its width; the box scrolls instead */
  .ip-scroll {
    overflow: auto;
    max-width: 100%;
    max-height: calc(100vh - 2rem);
    border-radius: 12px;
  }
  .ip-sheet tbody th,
  .ip-cols th:first-child,
  .ip-group th:first-child {
    position: sticky;
    left: 0;
    border-right: 1px solid var(--line);
  }
  .ip-sheet tbody th { z-index: 1; background: var(--tile); }
  .ip-cols th:first-child,
  .ip-group th:first-child { z-index: 3; }
  .ip-row-conflict th { background: linear-gradient(var(--active-bg), var(--active-bg)), var(--tile); }
}

/* G10: each check is drawn here, never by the browser (whose read-only boxes look faded): passing is a solid green
   box with a white tick, failing an empty box with a clear red border, the same in the read-only sheet and the edit
   form, in every mode and accent. */
.ip-box {
  appearance: none;
  display: inline-grid;
  place-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  border: 2px solid var(--check-fail);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  vertical-align: middle;
}

.ip-box:checked { border-color: var(--check-pass); background: var(--check-pass); }

.ip-box:checked::before {
  content: "";
  width: 0.34rem;
  height: 0.62rem;
  border: solid var(--check-tick);
  border-width: 0 2.5px 2.5px 0;
  transform: translateY(-1px) rotate(45deg);
}

.ip-box:disabled { opacity: 1; cursor: default; }

.ip-box:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* The legend's sample boxes. */
.ip-sample-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--check-fail);
  border-radius: 4px;
  color: var(--check-tick);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

.ip-sample-on { border-color: var(--check-pass); background: var(--check-pass); }

.ip-sample-off { background: transparent; }

/* --- phones -------------------------------------------------------------------- */

@media (max-width: 600px) {
  .site-header { padding: 0.85rem 1rem; gap: 0.4rem 0.75rem; }
  /* Keep "S4K Entertainment" and Log out on the first row; the user's name
     moves to its own row underneath. */
  .account { display: contents; }
  .logout { order: 1; }
  .account-name { order: 2; flex-basis: 100%; }
  /* The sidebar becomes the "Menu" <details> at the top of the page. */
  .layout { display: block; }
  .sidebar-column { display: none; }
  .mobile-menu { display: block; margin: 1rem 1.5rem 0; }
  main { padding: 1.5rem 1.5rem 2.5rem; }  /* room for the 1.12x tile pop */
  .card { padding: 1.25rem; }
  /* The workflow runs top to bottom on phones: full-width boxes, arrows pointing down. */
  .wf-flow { flex-direction: column; }
  .wf-box { width: 100%; }
  .wf-link { flex-direction: row; width: 100%; padding: 0.35rem 0; }
  .wf-arrow { transform: rotate(90deg); }
  .ql-row { grid-template-columns: 1fr; }
  .et-grid { grid-template-columns: minmax(0, 1fr); }
  .ql-order { margin: 0; }
  .ql-moves { grid-column: auto; }
  .wf-link.wf-drop-gap::after { inset: 50% 0 auto 0; width: auto; height: 4px; margin: -2px 0 0; }
  .ip-search-field .key-input { min-width: 0; width: 100%; }
  .tiles { grid-template-columns: 1fr; gap: 1rem; }
}

/* --- Bridge Access Request (Prompt G) ------------------------------------------------- */

.bridge-progress { margin: -0.75rem 0 1rem; color: var(--muted); font-weight: 600; }

.bridge-who { margin: 0; }

/* The form card: roomy padding, generous space between questions and between answers, large answer buttons. */
.bridge-card { max-width: none; margin: 0; padding: 2.25rem 2.25rem 2.5rem; gap: 1.75rem; }

.bridge-choice { display: grid; gap: 0.7rem; min-width: 0; margin: 0; padding: 0; border: 0; }

.bridge-choice legend { padding: 0; margin-bottom: 0.7rem; }

.bridge-options { display: flex; flex-wrap: wrap; gap: 0.85rem; }

.bridge-option {
  display: inline-flex;
  gap: 0.65rem;
  align-items: center;
  min-height: 3rem;
  padding: 0.8rem 1.35rem;
  font-size: 1.05rem;
  border: 1px solid var(--line-pill);
  border-radius: 10px;
  background: var(--tile);
  cursor: pointer;
}

.bridge-option input { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--accent); }

.bridge-option:hover { border-color: var(--accent); }

.bridge-option:has(input:checked) { background: var(--chosen-bg); color: var(--chosen-text); border-color: var(--accent); }

.bridge-option:has(input:checked) input { accent-color: var(--chosen-check); }

.bridge-option:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

.bridge-choice[aria-invalid="true"] .bridge-option { border: 2px solid var(--danger); }

/* Follow-up fields show only while their answer is chosen; without :has() they always show. */
@supports selector(:has(*)) {
  .bridge-form:not(:has(input[name="for_whom"][value="Another person"]:checked)) .bridge-when-other,
  .bridge-form:not(:has(input[name="manager"][value="Other"]:checked)) .bridge-when-manager,
  .bridge-form:not(:has(input[name="computer"][value="My own"]:checked)) .bridge-when-own { display: none; }
}

/* Next comes first in the page (Enter moves on); Back is shown on the left. */
/* Back and Next sit below the card at its two bottom corners: Next (first in the page, so Enter moves on) on the
   right, Back on the left (row-reverse). With no Back, Next still sits on the right. */
.bridge-actions { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 0.75rem; margin-top: 1.25rem; }

.bridge-actions .button { min-width: 7.5rem; padding: 0.7rem 1.4rem; }

.bridge-actions .bridge-back { margin-right: auto; }  /* stays bottom-left even when it is alone (VPN confirmation) */

/* VPN Yes: the confirmation on the review page. */
.vpn-confirm { display: grid; gap: 1rem; padding: 1.25rem 1.35rem; border: 2px solid var(--accent); border-radius: 12px; background: var(--active-bg); }

.card .vpn-confirm-question { margin: 0; color: var(--text); font-weight: 600; font-size: 1.05rem; }

.vpn-confirm-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* The refusal message above the appeal box. */

.bridge-title-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.bridge-group { padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); }

.bridge-group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.5rem; }

.bridge-group-head h2 { margin: 0; font-size: 1.1rem; }

.bridge-group .admin-facts { margin: 0; }

.consent-box {
  display: grid;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--consent-line);
  border-radius: 10px;
  background: var(--consent-bg);
  color: var(--consent-text);
}

.card .consent-box p { margin: 0; color: var(--consent-text); }  /* beats .card p (muted) */

.consent-agree input { accent-color: var(--consent-line); }

.card .consent-box .field-error { color: var(--danger); }

/* Submit looks disabled until "I agree" is ticked (CSS only; the server refuses without it). */
.bridge-review:has(#b-agree:not(:checked)) .bridge-submit {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.bridge-list { display: grid; gap: 0.35rem; margin: 0 0 0.75rem; padding-left: 1.1rem; }

.bridge-warning-title { margin: 0 0 0.35rem; }

.bridge-quote { margin: 0 0 0.75rem; padding: 0.6rem 0.8rem; border-left: 3px solid var(--accent); background: var(--active-bg); border-radius: 0 8px 8px 0; }

.bridge-counts { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 0.75rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }

.bridge-counts li {
  display: grid;
  gap: 0.15rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line-card);
  border-radius: 12px;
  background: var(--tile);
  color: var(--muted);
  font-size: 0.9rem;
}

.bridge-count { color: var(--text); font-size: 1.6rem; font-weight: 700; line-height: 1.1; }

.bridge-search { max-width: none; }

.bridge-search-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }

.bridge-search-q { flex: 1 1 22rem; }

.bridge-subject { margin-bottom: 0.75rem; border: 1px solid var(--line-card); border-radius: 12px; background: var(--tile); }

/* One compact row per person (closed by default): chevron, name, email, type, count, latest outcome. */
.bridge-subject-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  align-items: center;
  padding: 0.65rem 1rem;
  cursor: pointer;
  list-style: none;
}

.bridge-subject-row::-webkit-details-marker { display: none; }

.bridge-person, .bridge-email { overflow-wrap: anywhere; }

.bridge-email { overflow-wrap: anywhere; color: var(--muted); }

.bridge-subject-body { display: grid; gap: 0.75rem; padding: 0 1rem 1rem; }

.bridge-request { padding: 0.8rem 0.9rem; border: 1px solid var(--line); border-radius: 10px; }

.bridge-request .admin-facts { margin-bottom: 0.5rem; }

.bridge-sub { margin: 0.25rem 0 0.35rem; font-weight: 600; }

.bridge-denied { margin-top: 2rem; }

.bridge-title-row { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }

.bridge-title-row h1 { margin: 0; }

.bridge-duplicate { border-style: dashed; }

.bridge-duplicate p { margin: 0 0 0.25rem; }

/* The comparison: rows that differ get the accent tint and bar plus a "Different" badge (never colour alone). */
.bridge-compare { max-width: none; }

.compare-table th[scope="row"] { color: var(--muted); font-weight: 600; text-align: left; vertical-align: top; }

.compare-table td { vertical-align: top; }

.compare-diff { background: var(--active-bg); box-shadow: inset 4px 0 0 var(--accent); }

.compare-diff th[scope="row"] { color: var(--text); }

.compare-facts { margin-top: 1rem; }

.bridge-unblock { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }

.bridge-unblock .key-input { width: 11rem; }

.bridge-add { max-width: 44rem; margin: 1.25rem 0; }

.bridge-add-title { margin: 0; font-size: 1.1rem; }

.bridge-lifted summary { cursor: pointer; margin: 1rem 0 0.5rem; color: var(--muted); }

.bridge-appeals { margin-top: 2rem; }

@media (max-width: 900px) {
  .bridge-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Centred Bridge pages (base.html main-centred-*), like the Static IP sheet: on desktop every direct child of
   main shares one centred width, so the heading, buttons, filters and cards line up with the content edges.
   Phones (the sidebar breakpoint, 900px) are unchanged. */
@media (min-width: 901px) {
  main.main-centred-narrow { --centred-width: 46rem; }
  main.main-centred-wide { --centred-width: 64rem; }
  main.main-centred > * { width: 100%; max-width: var(--centred-width); margin-inline: auto; }
}


@media (max-width: 600px) {
  .bridge-card { padding: 1.5rem 1.25rem 1.75rem; }
  .bridge-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bridge-option { flex: 1 1 100%; }
  .bridge-form .admin-facts, .bridge-request .admin-facts { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  .bridge-form .admin-facts dd, .bridge-request .admin-facts dd { margin-bottom: 0.5rem; overflow-wrap: anywhere; }
}

/* --- Bridge history cards, timeline and the Workflow tab (Prompt G4) ------------------------------------------ */

/* autosubmit.js marks a GET form whose dropdowns apply on pick: its button is only the no-script fallback. */
.autosubmit-on [data-hide-with-js] { display: none; }

/* Screen-reader words inside a positioned box (timeline items, chart nodes): pinned to the box's top-left with a 1px
   font so the hidden text can never widen the page (overflow clipping is not allowed in this stylesheet). */
.sr-note { position: absolute; top: 0; left: 0; width: 1px; height: 1px; clip-path: inset(50%); white-space: nowrap; font-size: 1px; }

.bridge-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 1rem; border-bottom: 1px solid var(--line); }  /* G10: five tabs wrap on phones */

.bridge-tab { padding: 0.55rem 1rem; border: 1px solid transparent; border-bottom: none; border-radius: 10px 10px 0 0; color: var(--muted); text-decoration: none; }

.bridge-tab:hover { color: var(--text); background: var(--hover-bg); }

.bridge-tab-current { color: var(--text); font-weight: 600; border-color: var(--line); background: var(--tile); margin-bottom: -1px; }

.state-chip { display: inline-block; padding: 0.1rem 0.55rem; border: 1px solid var(--line-pill); border-radius: 999px; font-size: 0.78rem; font-weight: 600; color: var(--text); white-space: nowrap; }

.state-pending, .state-reopened { border-color: var(--step-current); background: var(--step-current-bg); }

.state-approved, .state-resolved { border-color: var(--step-done); }

.state-denied, .state-auto_rejected { border-color: var(--accent); background: var(--chosen-bg); color: var(--chosen-text); }

.state-amber, .state-duplicate { border-color: var(--consent-line); background: var(--consent-bg); color: var(--consent-text); }

.state-kind, .state-count { color: var(--muted); }

.bridge-subject-row .bridge-email { flex: 1 1 14rem; min-width: 0; }

.bridge-latest { margin-left: auto; }

.prior-history { margin: 0; padding: 0.6rem 0.85rem; border: 1px solid var(--consent-line); border-radius: 10px; background: var(--consent-bg); color: var(--consent-text); }

.prior-label { font-weight: 700; margin-right: 0.35rem; }

.req-card { display: grid; gap: 0.85rem; padding: 1rem 1.1rem; border: 1px solid var(--line-card); border-radius: 12px; background: var(--tile); }

.req-duplicate { border-style: dashed; gap: 0.3rem; margin-left: 1.5rem; }

.req-duplicate p { margin: 0; }

.req-head { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; }

.req-ref { font-weight: 700; }

.req-workflow { font-size: 0.9rem; }

.now-pill { margin-left: auto; padding: 0.2rem 0.75rem; border: 1px solid var(--step-current); border-radius: 999px; background: var(--step-current-bg); font-size: 0.85rem; font-weight: 600; }

.req-body { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 1.25rem; align-items: start; }

.req-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.35rem 0.9rem; margin: 0; }

.req-facts dt { color: var(--muted); }

.req-facts dd { margin: 0; overflow-wrap: anywhere; }

.timeline { margin: 0; padding: 0; list-style: none; }

.tl-item { position: relative; display: grid; grid-template-columns: 1.1rem minmax(0, 1fr) auto; gap: 0.1rem 0.6rem; padding-bottom: 0.75rem; }

.tl-item:not(:last-child)::before { content: ""; position: absolute; left: calc(0.55rem - 1px); top: 0.95rem; bottom: 0; width: 2px; background: var(--line); }

.tl-dot { width: 0.75rem; height: 0.75rem; margin: 0.3rem 0 0 0.175rem; border-radius: 50%; background: var(--step-upcoming); }

.tl-done .tl-dot { background: var(--step-done); }

.tl-current .tl-dot { background: var(--step-current); box-shadow: 0 0 0 4px var(--step-current-ring); }

.tl-current .tl-text { font-weight: 600; }

.tl-upcoming .tl-text { color: var(--muted); }

.tl-when { grid-column: 3; grid-row: 1; justify-self: end; color: var(--muted); font-size: 0.82rem; white-space: nowrap; }

.req-fold summary { cursor: pointer; color: var(--muted); font-weight: 600; }

.req-fold[open] summary { margin-bottom: 0.6rem; }

.answers-list { display: grid; grid-template-columns: minmax(10rem, max-content) minmax(0, 1fr); gap: 0.35rem 1rem; margin: 0; }

.answers-list dt { color: var(--muted); }

.answers-list dd { margin: 0; }

/* The Workflow tab's chart (HTML and CSS only). */
.fc-summary { margin: 0 0 1rem; padding: 0.85rem 1rem; border: 1px solid var(--step-current); border-radius: 12px; background: var(--step-current-bg); font-weight: 600; }

.fc-picker { display: grid; gap: 0.4rem; margin-bottom: 1rem; }

.fc-picker .key-input { max-width: 30rem; }

.fc-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 0 0 1.25rem; padding: 0; list-style: none; color: var(--muted); font-size: 0.9rem; }

.fc-legend li { display: inline-flex; gap: 0.45rem; align-items: center; }

.fc-key { display: inline-block; width: 1.5rem; height: 0.9rem; border: 2px solid var(--line-card); border-radius: 5px; }

.fc-chart { display: grid; gap: 1.25rem; }

.fc-stage { display: grid; justify-items: center; gap: 0; padding: 1rem 1.1rem 1.25rem; border: 1px solid var(--line-card); border-radius: 14px; background: var(--tile); }

.fc-stage-title { justify-self: start; margin: 0 0 0.75rem; font-size: 1.05rem; }

.fc-lanes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; width: 100%; }

.fc-lane { display: grid; justify-items: center; align-content: start; padding: 0.75rem; border: 1px dashed var(--line); border-radius: 12px; }

.fc-lane-title { margin: 0 0 0.5rem; color: var(--muted); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.04em; }

.fc-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: center; }

.fc-node { position: relative; display: grid; gap: 0.2rem; justify-items: center; min-width: 11rem; max-width: 17rem; padding: 0.6rem 1.25rem; border: 2px solid var(--line-card); border-radius: 12px; background: var(--tile); text-align: center; }

.fc-dot { display: none; }

.fc-title { font-weight: 600; }

.fc-sub { color: var(--muted); font-size: 0.82rem; }

.fc-pill { padding: 0.1rem 0.6rem; border: 1px solid var(--line-pill); border-radius: 999px; font-size: 0.82rem; }

.fc-done, .fc-key.fc-done { border-color: var(--step-done); }

.fc-done .fc-dot { display: block; position: absolute; top: 0.3rem; left: 0.45rem; color: var(--step-done); font-size: 0.85rem; font-weight: 800; line-height: 1; }

.fc-done .fc-dot::before { content: "\2713"; }  /* done: a tick (palette B) */

.fc-current, .fc-key.fc-current { border-color: var(--step-current); box-shadow: 0 0 0 4px var(--step-current-ring), 0 0 18px var(--step-current-ring); background: var(--step-current-bg); }

.fc-here { position: absolute; top: -0.7rem; right: 0.6rem; padding: 0 0.45rem; border-radius: 999px; background: var(--step-current); color: var(--tile); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.05em; }

.fc-upcoming, .fc-key.fc-upcoming { border-color: var(--step-upcoming); border-style: dashed; }

.fc-upcoming .fc-title, .fc-upcoming .fc-sub { color: var(--muted); }

.fc-off, .fc-key.fc-off { border-style: dashed; opacity: 0.45; }

.fc-arrow { display: block; position: relative; width: 2px; height: 1.4rem; margin: 0.2rem auto 0.45rem; background: var(--line-card); }

.fc-arrow::after { content: ""; position: absolute; left: -4px; bottom: -5px; border: 5px solid transparent; border-top-color: var(--line-card); border-bottom: none; }

.fc-branch-label { color: var(--muted); font-size: 0.82rem; font-weight: 600; }

@media (max-width: 900px) {
  .req-body { grid-template-columns: minmax(0, 1fr); }
  .now-pill, .bridge-latest { margin-left: 0; }
}

@media (max-width: 700px) {
  .fc-lanes { grid-template-columns: minmax(0, 1fr); }
  .fc-node { min-width: 0; max-width: 100%; }
  .fc-row { flex-direction: column; }
  .fc-branch-label span { display: inline-block; transform: rotate(90deg); }
  .answers-list { grid-template-columns: minmax(0, 1fr); }
  .answers-list dd { margin-bottom: 0.4rem; }
  .req-duplicate { margin-left: 0; }
}

/* --- Prompt G6: the Handle panel, Bridge history reasons, Users with Bridge access, the guide, Handler metrics ---- */

/* Who sees a line: amber = the requester sees it; purple = admins only. */
.vis-requester, .vis-admin { margin: 0; font-size: 0.85rem; font-weight: 600; }
.vis-requester { color: var(--vis-requester); }
.vis-admin { color: var(--vis-admin); }
.vis-box-requester { display: grid; gap: 0.4rem; padding: 0.6rem 0.7rem; border: 1px solid var(--consent-line); border-radius: 8px; }

.handle-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.handle-head h2 { margin: 0; }
.handle-facts { margin: 0.75rem 0 0; }
.handle-section { margin: 1.1rem 0 0.5rem; color: var(--muted); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; }
.handle-assign { display: grid; gap: 0.35rem; }
.handle-row { display: flex; gap: 0.5rem; }
.handle-row select { flex: 1 1 auto; min-width: 0; }
.handle-wide { width: 100%; margin-top: 0.5rem; }

/* One action: a closed <details> row with its "?" pinned to the summary's right end (outside the summary, so a
   click on it never toggles the action). */
.handle-action { position: relative; margin-bottom: 0.5rem; border: 1px solid var(--line); border-radius: 10px; }
.handle-details > summary { position: relative; padding: 0.6rem 2.4rem 0.6rem 1.9rem; font-weight: 600; cursor: pointer; list-style: none; }
.handle-details > summary::-webkit-details-marker { display: none; }
.handle-details > summary::before {
  content: "";
  position: absolute;
  left: 0.8rem;
  top: 1.05rem;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}
.handle-details[open] > summary::before { transform: rotate(45deg); }
.handle-body { display: grid; gap: 0.5rem; padding: 0 0.8rem 0.8rem; }
.handle-body .button { justify-self: start; }
.handle-optional > summary { color: var(--muted); font-size: 0.9rem; cursor: pointer; }
.handle-optional[open] > summary { margin-bottom: 0.4rem; }
.handle-onhold { display: grid; gap: 0.5rem; margin-bottom: 0.5rem; padding: 0.6rem 0.8rem; border: 1px dashed var(--line); border-radius: 10px; }
.handle-onhold form { margin: 0; }

/* The "?" help tip (about 13px) and its text, shown below it by tooltip.js on hover and focus. */
.help-tip {
  position: absolute;
  top: 0.6rem;
  right: 0.65rem;
  width: 0.85rem;
  height: 0.85rem;
  padding: 0;
  border: 1px solid var(--muted);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}
.help-tip:hover, .help-tip:focus-visible { border-color: var(--accent); color: var(--text); }
.tip-text {
  position: absolute;
  top: 1.9rem;
  right: 0;
  z-index: 5;
  width: min(18rem, 100%);
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line-card);
  border-radius: 8px;
  background: var(--tile);
  box-shadow: var(--shadow-card);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 400;
}

/* Bridge history: the rejection reason on a person row, the Why box, Reopen on the card, earlier requests. */
.bridge-reject { min-width: 0; color: var(--danger); font-size: 0.9rem; font-weight: 600; overflow-wrap: anywhere; }
.why-box { padding: 0.7rem 0.9rem; border: 1px solid var(--danger); border-radius: 10px; background: var(--danger-bg); }
.why-title { margin: 0 0 0.3rem; color: var(--danger); font-size: 0.95rem; }
.why-text { margin: 0; overflow-wrap: anywhere; }
.why-rule { color: var(--muted); }
.req-reopen { display: grid; gap: 0.4rem; justify-items: start; margin: 0; }
.req-reopen p { margin: 0; }
.earlier-title { margin: 0.25rem 0 0; }
.earlier-list { border: 1px solid var(--line-card); border-radius: 12px; }
.earlier-row + .earlier-row { border-top: 1px solid var(--line); }
.earlier-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.65rem; padding: 0.55rem 0.9rem; cursor: pointer; list-style: none; }
.earlier-summary::-webkit-details-marker { display: none; }
.earlier-status { min-width: 0; color: var(--muted); font-size: 0.9rem; overflow-wrap: anywhere; }
.earlier-body { padding: 0 0.9rem 0.9rem; }
/* Long chips (the on-hold line names two people) wrap instead of widening the row. */
.bridge-latest .state-chip, .earlier-summary .state-chip { white-space: normal; }

/* Users with Bridge access. */
.ba-counts { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ba-counts .ba-needs-count { border-color: var(--consent-line); background: var(--consent-bg); color: var(--consent-text); }
.ba-counts .ba-needs-count .bridge-count { color: var(--consent-text); }
/* Values stay on one line (an email, phone or IP is never split); the table scrolls inside its box when narrow. */
.ba-table td { vertical-align: top; white-space: nowrap; }
.ba-table td:first-child { min-width: 9rem; white-space: normal; }
.ba-table .state-chip { margin-top: 0.3rem; white-space: normal; }
.ba-table th .perm-desc { font-weight: 400; }
/* Edit mode: compact boxes that share the width (the date box needs its own). */
.ba-editing td { position: relative; padding: 0.35rem; white-space: normal; }  /* keeps the hidden "Error:" words inside the scroll box */
.ba-editing .key-input { width: 100%; min-width: 4.5rem; padding: 0.45rem 0.5rem; font-size: 0.92rem; }
.ba-editing td:first-child { min-width: 0; }
.ba-editing select.key-input { min-width: 7.5rem; }
.ba-editing input[type="date"] { min-width: 8.75rem; }
.ba-editing .ba-remove { margin-top: 0.4rem; }
.ba-editbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--consent-line);
  border-radius: 10px;
  background: var(--consent-bg);
}
.ba-editbar p { margin: 0; color: var(--consent-text); font-weight: 650; }
.ba-editbar .ip-editbar-buttons { margin-left: auto; }
.ba-add { margin: 0.75rem 0 0; }
.ba-remove { display: inline-flex; gap: 0.35rem; align-items: center; white-space: nowrap; }

/* Permissions and guide. */
.guide-jump ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.guide-matrix th, .guide-matrix td { white-space: normal; }
.guide-matrix tbody th { font-weight: 600; text-align: left; }
.lvl { font-weight: 600; }
.lvl-yes { color: var(--yes); }
.lvl-read { color: var(--vis-requester); }
.lvl-no { color: var(--muted); font-weight: 400; }
.perm-cards { display: grid; gap: 0.6rem; }
.perm-card { border: 1px solid var(--line-card); border-radius: 12px; background: var(--tile); }
.perm-card:has(:target) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--glow); }
.perm-card-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.65rem; padding: 0.7rem 1rem; cursor: pointer; list-style: none; }
.perm-card-summary::-webkit-details-marker { display: none; }
.perm-card-body { display: grid; gap: 0.9rem; padding: 0 1rem 1rem; scroll-margin-top: 1rem; }
.perm-boxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.perm-box { padding: 0.7rem 0.85rem; border: 1px solid var(--line); border-radius: 10px; }
.perm-box h3 { margin: 0 0 0.4rem; font-size: 0.95rem; }
.perm-box ul { display: grid; gap: 0.35rem; margin: 0; padding-left: 1.1rem; }
.perm-box-unlocks { border-color: var(--yes); }
.perm-box .perm-name { display: inline; }
.perm-rename { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: end; }
.perm-rename .key-label { flex: 1 1 100%; }

/* Handler metrics: the period links, the team row, one card per handler with two inline SVG donuts. */
.period-switch ul { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.75rem; padding: 0; list-style: none; }
.period-switch .period-current { background: var(--chosen-bg); color: var(--chosen-text); }
.metrics-team { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metrics-time { font-size: 1.2rem; }
.metrics-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); gap: 1rem; }
.metrics-card h2 { margin: 0 0 0.6rem; }
.donuts { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 0.75rem; }
.donut { display: grid; justify-items: center; gap: 0.3rem; margin: 0; width: 7.5rem; text-align: center; }
.donut-svg { width: 6rem; height: 6rem; }
.donut-track { stroke: var(--line); }
.donut-empty .donut-track { stroke: var(--step-upcoming); }
.donut-fill { stroke: var(--accent); }
.donut-value { fill: var(--text); font-size: 7px; font-weight: 700; }
.donut figcaption { display: grid; gap: 0.15rem; font-size: 0.85rem; }
.donut-label { font-weight: 600; }
.metrics-note { margin-top: 1.25rem; }

@media (max-width: 900px) {
  .ba-counts, .metrics-team { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .perm-boxes { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .ba-counts, .metrics-team { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .handle-row { flex-direction: column; }
}

/* --- Prompt G7 ------------------------------------------------------------------------------------------------ */

/* Approve green and Deny red: solid fills, the same in every mode and accent. */
.button.button-approve { border-color: var(--approve-bg); background: var(--approve-bg); color: var(--on-fill); font-weight: 650; }
.button.button-approve:hover, .button.button-approve:focus-visible { background: var(--approve-hover); }
.button.button-deny { border-color: var(--deny-bg); background: var(--deny-bg); color: var(--on-fill); font-weight: 650; }
.button.button-deny:hover, .button.button-deny:focus-visible { background: var(--deny-hover); }

/* The Handle panel: the already-assigned message and the Internal memo box. */
.handle-notice { margin: 0 0 0.5rem; font-size: 0.9rem; }
.hold-internal { margin: 0; }
.older-title { margin: 1rem 0 0.5rem; color: var(--muted); }

/* The requester's "Action needed from you" banner (the consent yellow). */
.action-banner { margin: 0 0 1.25rem; padding: 0.9rem 1.1rem; border: 1px solid var(--consent-line); border-radius: 12px; background: var(--consent-bg); color: var(--consent-text); }
.action-banner h2 { margin: 0 0 0.4rem; font-size: 1.1rem; color: var(--consent-text); }
.action-banner p { margin: 0; color: var(--consent-text); }
.action-banner .action-meta { margin-top: 0.4rem; font-size: 0.88rem; }

/* My requests rows: G11's borders (yellow waiting, red denied, green resolved) are at the end of this file. */
.cue-waiting { border-color: var(--consent-line); background: var(--consent-bg); color: var(--consent-text); }
.cue-resolved { border-color: var(--fresh-line); color: var(--text); }
.cue-denied { border-color: var(--danger); color: var(--text); }  /* G11 */

/* The My requests badges in the sidebar (hidden at zero by the template). */
.nav-badge { position: relative; display: inline-block; min-width: 1.4rem; margin-left: 0.35rem; padding: 0 0.4rem; border: 1px solid; border-radius: 999px; font-size: 0.75rem; font-weight: 700; line-height: 1.3rem; text-align: center; }
.nav-badge-waiting { border-color: var(--consent-line); background: var(--consent-bg); color: var(--consent-text); }
.nav-badge-resolved { border-color: var(--fresh-line); background: var(--fresh-bg); color: var(--text); }
.nav-item .nav-badge + .nav-badge { margin-left: 0.25rem; }
.nav-item:has(.nav-badge) > span:not(.nav-badge) { white-space: nowrap; }  /* "My requests" stays on one line */

/* Handler metrics: centred cards, closed by default, every fact on one line. */
.metrics-cards { grid-template-columns: repeat(auto-fit, minmax(min(30rem, 100%), 30rem)); justify-content: center; align-items: start; }
.metrics-card { padding: 0; }
.metrics-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.65rem; padding: 0.9rem 1.2rem; cursor: pointer; list-style: none; }
.metrics-summary::-webkit-details-marker { display: none; }
.metrics-name { font-size: 1.15rem; font-weight: 700; }
.metrics-body { padding: 0 1.2rem 1.1rem; }
.metrics-card .admin-facts { grid-template-columns: max-content minmax(0, 1fr); }
.metrics-card .admin-facts dt, .metrics-card .admin-facts dd { white-space: nowrap; }

/* Users with Bridge access: the filters centred, a shorter search and a wider Home computer box. */
.ba-search .bridge-search-row { justify-content: center; gap: 0.75rem 1.5rem; }
.ba-search .bridge-search-q { flex: 0 1 22rem; }
.ba-search .ticket-field:not(.bridge-search-q) { flex: 0 1 15rem; }
.th-help { position: relative; }
.help-tip.help-inline { position: static; display: inline-grid; place-items: center; margin-left: 0.3rem; vertical-align: middle; }
.th-help .tip-text { top: 100%; right: auto; left: 0; width: 16rem; white-space: normal; text-align: left; }

@media (max-width: 1100px) {
  .ticket-layout-handler { grid-template-columns: minmax(0, 1fr); }
  .et-grid { grid-template-columns: minmax(0, 1fr); }  /* G11: list, editor and Variables key stack */
  .et-grid > .et-key { grid-column: auto; }  /* G12 */
}

@media (max-width: 600px) {
  .metrics-card .admin-facts dt, .metrics-card .admin-facts dd { white-space: normal; }
}

/* --- Prompt G8 ------------------------------------------------------------------------------------------------ */

/* Palette B: a tick before every done timeline step. */
.tl-done .tl-text::before { content: "\2713\00a0"; color: var(--step-done); font-weight: 800; }

/* The approval decision at the top: Approve (green tint) and Deny (red tint) side by side, stacked on phones. */
.decision-card .decision-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.decision-half { display: grid; gap: 0.45rem; align-content: start; padding: 0.9rem 1rem; border: 1px solid; border-radius: 12px; }
.decision-approve, .decision-deny { border-color: var(--line-card); background: var(--tile); }  /* G9: plain card style */
.decision-half form { display: grid; gap: 0.45rem; margin: 0; }
.decision-row { display: flex; gap: 0.5rem; align-items: flex-start; }
.decision-row .key-input { flex: 1 1 auto; min-width: 0; }
.decision-row .button { flex: none; }
.decision-next { margin: 0; color: var(--muted); font-size: 0.88rem; }
.decision-block { display: flex; align-items: center; gap: 0.5rem; position: relative; }
.decision-block .perm { flex: 1 1 auto; }

@media (max-width: 700px) {
  .decision-card .decision-split { grid-template-columns: minmax(0, 1fr); }
}

/* --- Prompt G9 ------------------------------------------------------------------------------------------------ */

/* Put on hold: the required choice between the two kinds of hold. */
.hold-kind { display: grid; gap: 0.5rem; margin: 0; padding: 0; border: none; }
.hold-kind legend { margin-bottom: 0.35rem; padding: 0; }
.hold-kind .perm-text .vis-requester, .hold-kind .perm-text .vis-admin { font-size: 0.82rem; }

/* live.js: "This page was updated." while the person is typing (G9). */
.live-bar { position: fixed; top: 0.75rem; left: 50%; z-index: 30; display: flex; gap: 0.75rem; align-items: center; padding: 0.6rem 0.9rem; border: 1px solid var(--line-card); border-radius: 12px; background: var(--tile); box-shadow: var(--shadow-card); transform: translateX(-50%); color: var(--text); font-weight: 600; }

/* G9 polish: notices that fade, the Unlink account help, the search note, error pages. */
.fade-out { opacity: 0; transition: opacity 0.6s ease; }
.unlink-help { position: relative; display: inline-flex; align-items: center; }
.unlink-help .tip-text { top: 1.6rem; right: auto; left: 0; width: 18rem; }
.search-all-note { margin: 0 0 0.75rem; font-weight: 600; }
.ticket-search { width: min(18rem, 100%); }
.error-card { text-align: left; }
.error-card h1 { margin-top: 0; }
.metrics-note { padding-left: 1.1rem; }

/* --- Prompt G11: the VPN Not Working guide (app/templates/vpn_guide.html) --------------------------------------- */

/* The two questions: picture cards that are links. */
.vpn-question { margin-top: 1.25rem; }
.vpn-q { font-size: 1.15rem; margin: 0 0 0.6rem; }
.vpn-choices { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
.vpn-choice { display: flex; flex-direction: column; gap: 0.45rem; height: 100%; padding: 0.9rem; border: 1px solid var(--line-card); border-radius: 14px; background: var(--tile); color: var(--text); text-decoration: none; box-shadow: var(--shadow-rest); transition: transform 0.15s ease, border-color 0.15s ease; }
.vpn-choice:hover, .vpn-choice:focus-visible, .vpn-choice-on { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-rest), 0 0 0 3px var(--glow); }
.vpn-choice-name { font-weight: 700; font-size: 1.02rem; }
/* The pictures (app/vpn_drawings.py): their colours are the real apps', drawn in the SVG itself. */
.vpn-pic { display: block; width: 100%; height: auto; border-radius: 10px; margin-top: 0.6rem; }
.vpn-choice .vpn-pic { margin-top: 0; }

/* The guide. */
.vpn-crumb { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.5rem 0 1rem; }
.vpn-pill { padding: 0.2rem 0.7rem; border: 1px solid var(--line-pill); border-radius: 999px; background: var(--tile); font-size: 0.9rem; }
.vpn-guide { display: flex; flex-direction: column; gap: 0.75rem; }
.vpn-head h2 { margin: 0; font-size: 1.15rem; }
/* The guide's cards use the content width (the plain .card is a narrow centred box). */
.vpn-guide .card, .vpn-fixed { max-width: none; margin: 0; }
/* Pictures stay a readable size on wide screens; the question cards keep theirs. */
.vpn-step .vpn-pic { max-width: 44rem; }
.vpn-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.6rem; }
.vpn-row h3 { margin: 0; font-size: 1.05rem; }
.vpn-progress { display: block; height: 8px; margin-top: 0.6rem; border-radius: 99px; background: var(--hover-bg); }
.vpn-progress[hidden] { display: none; }
.vpn-bar { display: block; width: 0; height: 100%; border-radius: 99px; background: var(--accent); transition: width 0.3s ease; }
.vpn-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.vpn-step { padding: 0.9rem 1rem; border: 1px solid var(--line-card); border-radius: 14px; background: var(--tile); box-shadow: var(--shadow-rest); }
.vpn-step.vpn-done { border-color: var(--fresh-line); }
.vpn-body { margin: 0.3rem 0 0; }
.vpn-sub { margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.vpn-sub-title { margin: 0; font-weight: 700; }
.vpn-note { margin: 0.6rem 0 0; padding: 0.5rem 0.75rem; border-left: 3px solid var(--consent-line); border-radius: 0 8px 8px 0; background: var(--consent-bg); color: var(--consent-text); }
.vpn-red { margin: 0.5rem 0 0; color: var(--danger); font-weight: 700; }
.vpn-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 0.75rem; }
.vpn-fix { border-color: var(--fresh-line); }
.vpn-tick { display: inline-flex; gap: 0.5rem; align-items: center; font-weight: 600; cursor: pointer; }
.vpn-cb { width: 1.3rem; height: 1.3rem; margin: 0; accent-color: var(--check-pass); cursor: pointer; }
.vpn-choice-set { display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; margin: 0.75rem 0 0; padding: 0; border: none; }
.vpn-email-yes.vpn-chosen { border-color: var(--accent); background: var(--chosen-bg); color: var(--chosen-text); }
/* The answer under the email question: shown by vpn_guide.js, or by CSS alone when "No" is ticked. */
.vpn-answer { display: none; flex-basis: 100%; margin: 0.3rem 0 0; padding: 0.7rem 0.9rem; border: 1px solid var(--consent-line); border-radius: 10px; background: var(--hover-bg); }
.vpn-answer.vpn-answer-on, .vpn-email-no:has(input:checked) ~ .vpn-answer { display: block; }
.vpn-address { font-family: Consolas, ui-monospace, monospace; font-size: 1rem; }
.vpn-request h2 { margin-top: 0; }
.vpn-fields { margin: 0; padding: 0; border: none; min-width: 0; }
.vpn-locked .vpn-fields { opacity: 0.45; }
.vpn-fixed { border-color: var(--fresh-line); }
.vpn-fixed h2 { margin-top: 0; }

/* The amber rings round each thing to click pulse between full and about a third, every 1.6 s; solid when the
   person's system asks for reduced motion (the only reduced-motion rule: the tiles keep their pop for everyone). */
@keyframes vpn-pulse { 0%, 100% { stroke-opacity: 1; } 50% { stroke-opacity: 0.33; } }
.vpn-pic .hl { animation: vpn-pulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .vpn-pic .hl { animation: none; }
}

@media (max-width: 640px) {
  .vpn-choices { grid-template-columns: minmax(0, 1fr); }
}

/* --- Prompt G11: VPN guide results (app/templates/admin_vpn_results.html) ---------------------------------------- */
.vr-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vr-good { color: var(--fresh-line); }
.vr-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.vr-split h2 { margin: 0 0 0.6rem; font-size: 1rem; }
.vr-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.vr-bar-row { display: grid; grid-template-columns: 11rem minmax(0, 1fr) 2.5rem; gap: 0.6rem; align-items: center; }
.vr-track { display: block; width: 100%; height: 10px; }
.vr-track-bg { fill: var(--hover-bg); }
.vr-fill { fill: var(--accent); }
.vr-fill-reason-password { fill: var(--danger); }
.vr-fill-reason-office { fill: var(--swatch-blue); }
.vr-fill-reason-stuck { fill: var(--vis-requester); }
.vr-value { text-align: right; font-variant-numeric: tabular-nums; }
.vr-os { margin-top: 1rem; }
@media (max-width: 720px) {
  .vr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vr-split { grid-template-columns: minmax(0, 1fr); }
  .vr-bar-row { grid-template-columns: 8rem minmax(0, 1fr) 2rem; }
}

/* --- Prompt G11: the condensed At a glance table (Permissions and guide) ------------------------------------------- */
.glance-key { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0.4rem 0 0.75rem; color: var(--muted); font-size: 0.85rem; }
.glance-key span { display: inline-flex; gap: 0.4rem; align-items: center; }
/* The wrap scrolls on its own (both ways) so the header row can stick to its top. */
.glance-wrap { position: relative; max-height: 70vh; overflow: auto; }  /* relative: the cells' screen reader words stay inside it */
.glance { font-size: 0.88rem; }
/* G12: the table fits the content width on laptops and desktops (no sideways scroll): a fixed layout where the first
   column takes the rest and wraps, and the five symbol columns stay narrow and centred. Only phones scroll it. */
.glance { table-layout: fixed; width: 100%; }
.glance th, .glance td { white-space: normal; overflow-wrap: anywhere; }
.glance thead th:not(:first-child) { width: 11%; }
@media (max-width: 600px) {
  .glance { min-width: 34rem; }
}
.glance th, .glance td { padding: 0.4rem 0.6rem; }
.glance thead th { position: sticky; top: 0; z-index: 1; background: var(--tile); text-align: center; font-size: 0.8rem; line-height: 1.2; }
.glance thead th:first-child { text-align: left; }
.glance td { text-align: center; }
.glance-group th { padding-top: 0.6rem; color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-align: left; }
.glance-entry th, .glance-entry td { border-top: 1px solid var(--line-card); font-weight: 700; }
.glance-yes { color: var(--yes); font-weight: 800; font-size: 1rem; }
.glance-no { color: var(--step-upcoming); }
.glance-eye { display: inline-block; vertical-align: middle; }
.glance-eye path { stroke: var(--vis-requester); }
.glance-eye circle { fill: var(--vis-requester); }

/* --- Prompt G11: sidebar borders and counts ----------------------------------------------------------------------- */
/* My requests: a coloured border, not a fill (yellow waiting on you, red denied, green resolved; the most urgent
   wins). All requests and Bridge: the person's accent while something is new or waiting. */
.nav-item.nav-cue, .nav-item.nav-accent { box-shadow: inset 0 0 0 2px var(--nav-cue-line, var(--accent)); }
.nav-item.nav-cue-waiting { --nav-cue-line: var(--consent-line); }
.nav-item.nav-cue-denied { --nav-cue-line: var(--danger); }
.nav-item.nav-cue-resolved { --nav-cue-line: var(--fresh-line); }
.nav-badge-queue { border-color: var(--accent); background: var(--chosen-bg); color: var(--text); }
/* My requests rows: the same borders, no fill. */
tr.row-waiting td, tr.row-denied td, tr.row-resolved td { box-shadow: inset 0 2px 0 var(--row-line), inset 0 -2px 0 var(--row-line); }
tr.row-waiting td:first-child, tr.row-denied td:first-child, tr.row-resolved td:first-child { box-shadow: inset 2px 0 0 var(--row-line), inset 0 2px 0 var(--row-line), inset 0 -2px 0 var(--row-line); }
tr.row-waiting td:last-child, tr.row-denied td:last-child, tr.row-resolved td:last-child { box-shadow: inset -2px 0 0 var(--row-line), inset 0 2px 0 var(--row-line), inset 0 -2px 0 var(--row-line); }
tr.row-waiting { --row-line: var(--consent-line); }
tr.row-denied { --row-line: var(--danger); }
tr.row-resolved { --row-line: var(--fresh-line); }

/* --- Prompt G11: the header and sidebar stay in view; only the page content scrolls (desktop) ----------------------- */
/* Signed-in pages (body > .layout): the page is exactly one screen tall; the header keeps its height, the sidebar
   column fills the rest and scrolls on its own when it is taller, and .content is the one scrolling area. Phones keep
   the normal page scroll and the Menu drawer. */
@media (min-width: 601px) {
  body:has(> .layout) { height: 100vh; height: 100dvh; }
  body:has(> .layout) > .site-header { flex: none; }
  body:has(> .layout) > .layout { min-height: 0; grid-template-rows: minmax(0, 1fr); }
  body:has(> .layout) .sidebar-column { min-height: 0; overflow-y: auto; }
  body:has(> .layout) .sidebar { position: static; height: auto; min-height: 100%; overflow-y: visible; }
  body:has(> .layout) .content { position: relative; min-height: 0; overflow-y: auto; }  /* holds absolutely placed parts (screen reader text) inside the scroller */
}
@media print {
  body:has(> .layout) { height: auto; }
  body:has(> .layout) .content, body:has(> .layout) .sidebar-column { overflow: visible; }
}

/* The ticket page (G11): Approvals and Messages sit in the left column under Request (the cards' own margins space
   them); where the two columns stack (1100px and below), the right column comes straight after Request. */
@media (max-width: 1100px) {
  .ticket-layout-handler .ticket-request { display: contents; }
  .ticket-layout-handler .ticket-request > * { order: 1; }
  .ticket-layout-handler .ticket-side { order: 2; }
  .ticket-layout-handler .ticket-approvals, .ticket-layout-handler .ticket-messages { order: 3; }
}

/* --- Prompt G12: the red (denied) number circle on My requests ---------------------------------------------------- */
.nav-badge-denied { border-color: var(--danger); background: var(--danger-bg); color: var(--text); }

/* --- Prompt G12: the ticket lock (someone else's or an unassigned ticket, read only) ------------------------------- */
.lock-banner { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; justify-content: space-between; margin: 0 0 1rem; padding: 0.8rem 1rem; border: 1px solid var(--accent); border-radius: 12px; background: var(--active-bg); }
.lock-banner p { margin: 0; flex: 1 1 18rem; }
.lock-banner form { margin: 0; }
.button-primary { background: var(--logout-bg); color: var(--logout-text); border-color: var(--logout-bg); font-weight: 700; }
.handle-off { margin: 0 0 0.5rem; padding: 0.6rem 0.8rem; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-weight: 600; cursor: not-allowed; }
.ticket-reply-off textarea, .button:disabled { opacity: 0.5; cursor: not-allowed; }
.button:disabled:hover { border-color: var(--line-pill); box-shadow: var(--shadow-rest); }

/* --- Prompt G12: names on messages (initials circle, name, label, time) ------------------------------------------- */
.msg-who { display: inline-flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; min-width: 0; }
/* An outlined circle (readable in both modes and every accent): green for the requester, the accent for a handler,
   violet for an internal note. */
.msg-avatar { display: inline-grid; place-items: center; flex: none; width: 1.75rem; height: 1.75rem; border: 2px solid var(--line); border-radius: 50%; background: var(--tile); color: var(--text); font-size: 0.7rem; font-weight: 800; }
.msg-avatar-requester { border-color: var(--fresh-line); }
.msg-avatar-handler { border-color: var(--accent); }
.msg-avatar-note { border-color: var(--vis-admin); }
.msg-label-requester { border-color: var(--fresh-line); }
.msg-label-handler { border-color: var(--accent); }
.msg-label-note, .msg-label-system { border-color: var(--vis-admin); }

/* --- Prompt G12: Quick links places as toggle pills in two groups ------------------------------------------------- */
.ql-types { min-width: 0; }
.ql-group { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; }
.ql-pills { display: flex; flex-wrap: wrap; gap: 0.35rem; min-width: 0; }
.ql-pill { display: inline-flex; gap: 0.35rem; align-items: center; padding: 0.2rem 0.65rem; border: 1px solid var(--line-pill); border-radius: 999px; background: var(--tile); color: var(--text); font-size: 0.85rem; cursor: pointer; }
.ql-pill input { margin: 0; accent-color: var(--accent); }
.ql-pill:has(input:checked) { border-color: var(--accent); background: var(--chosen-bg); color: var(--chosen-text); font-weight: 600; }
.ql-pill:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

/* --- Prompt G12: the Email outbox keeps its table inside the page with the Gmail id column -------------------------- */
.ob-gmail code { overflow-wrap: anywhere; font-size: 0.8rem; }

/* --- Prompt G13: Ticket history (admins, below Messages) --------------------------------------------------------- */
.ticket-history { padding: 0; }
.ticket-history-summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.25rem; font-size: 1.05rem; font-weight: 700; list-style: none; cursor: pointer; }
.ticket-history-summary::-webkit-details-marker { display: none; }
.ticket-history-summary:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; border-radius: 14px; }
.ticket-history-pill::after { content: "Show"; padding: 0.1rem 0.65rem; border: 1px solid var(--line-pill); border-radius: 999px; color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.ticket-history[open] .ticket-history-pill::after { content: "Hide"; }
.ticket-history-list { margin: 0; padding: 0; list-style: none; }
.ticket-history-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 1.25rem; border-top: 1px solid var(--line); font-size: 0.92rem; }
.ticket-history-row .ticket-when { flex: none; color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.ticket-history .admin-empty { margin: 0; padding: 0.6rem 1.25rem 1rem; }

/* --- Prompt G13: the requester's Bridge wording (green for good news, red for a denial) ---------------------------- */
.status-good { color: var(--fresh-line); font-weight: 700; }
.status-bad { color: var(--danger); font-weight: 700; }
.bridge-good-banner { border-color: var(--fresh-line); background: var(--fresh-bg); color: var(--text); }

/* --- Prompt G13: the email preview's Headline (the email itself carries it as an inline style) -------------------- */
.et-mail-body .et-headline { margin: 0 0 14px; font-size: 20px; line-height: 1.3; font-weight: 700; color: var(--email-text); }
/* The fixed Subject reads as read only; the template list's "To:" chips wrap inside the narrow list column. */
.et-fixed { opacity: 0.65; cursor: default; }
.et-list, .et-item { min-width: 0; }
.et-item .et-to { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

/* --- Prompt G16: the shared "?" help (_help.html) and the one line description under a page title ---------------- */
.help-wrap { position: relative; display: inline-block; vertical-align: middle; line-height: 1; }
.help-wrap .tip-text { top: 1.35rem; left: -0.5rem; right: auto; width: 18rem; max-width: min(18rem, 80vw); line-height: 1.4; text-align: left; white-space: normal; }
.page-desc { margin: -0.35rem 0 1rem; color: var(--muted); font-size: 0.95rem; }

/* --- Prompt G16: the requester's Bridge tracker, one line like an order tracker. Each step is a circle with its label
   under it; the line into a step turns green once the request got there. It never wraps: narrow screens scroll it. -- */
.bridge-track-card { padding: 0.9rem 0.6rem 0.7rem; }
.bridge-track { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 0; margin: 0; padding: 0.2rem 0 0.3rem; overflow-x: auto; list-style: none; }
.track-step { position: relative; flex: 1 0 6.5rem; min-width: 6.5rem; display: flex; flex-direction: column; align-items: center; gap: 0.45rem; text-align: center; }
.track-step + .track-step::before { content: ""; position: absolute; top: 14px; left: calc(-50% + 17px); right: calc(50% + 17px); height: 2px; background: var(--track-line); }
.track-step.track-done::before, .track-step.track-now::before, .track-step.track-bad::before { background: var(--track-ok); }
.track-dot { display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid var(--track-next); border-radius: 50%; color: var(--track-next); font-size: 0.85rem; font-weight: 800; line-height: 1; }
.track-label { padding: 0 0.3rem; color: var(--muted); font-size: 0.8rem; line-height: 1.3; }
.track-done .track-dot { border-color: var(--track-ok); background: var(--track-ok); color: var(--track-ok-mark); }
.track-done .track-label { color: var(--text); }
.track-now .track-dot { border-color: var(--track-wait); background: var(--track-wait-bg); color: var(--track-wait); box-shadow: 0 0 0 4px var(--track-wait-bg); }
.track-now .track-label { color: var(--track-wait-text); font-weight: 600; }
.track-bad .track-dot { border-color: var(--track-bad); background: var(--track-bad); color: var(--track-bad-mark); }
.track-bad .track-label { color: var(--danger); font-weight: 600; }
.track-next .track-dot { border-style: dashed; }
.bridge-bad-banner { border-color: var(--danger); background: var(--danger-bg); color: var(--text); }
.bridge-banner-reason { display: block; margin-top: 0.3rem; white-space: pre-line; overflow-wrap: anywhere; }

/* --- Prompt G16: Review the appeal (Accept appeal and Deny appeal halves, stacked on a phone) --------------------- */
.appeal-decide { display: grid; gap: 0.6rem; }
.appeal-decide-title { display: flex; align-items: center; gap: 0.35rem; margin: 0; font-size: 1rem; }
.appeal-decide .decision-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.decision-title { margin: 0; font-weight: 700; }
.decision-title-good { color: var(--yes); }
.decision-title-bad { color: var(--danger); }
@media (max-width: 620px) {
  .appeal-decide .decision-split { grid-template-columns: minmax(0, 1fr); }
}

/* --- Prompt G16: the Bridge history card's sections. Each opens and closes on its own (no script); the short state
   sits on the right of its heading; the comparison marks differing rows in amber with an amber left edge. --------- */
.req-secs { display: grid; gap: 0.5rem; }
.req-sec { border: 1px solid var(--line-card); border-radius: 10px; background: var(--hover-bg); }
.req-sec-head { display: flex; align-items: center; gap: 0.45rem; padding: 0.6rem 0.8rem; cursor: pointer; font-weight: 600; list-style: none; }
.req-sec-head::-webkit-details-marker { display: none; }
.req-sec-title { flex: none; }
.req-sec-right { margin-left: auto; min-width: 0; color: var(--muted); font-size: 0.82rem; font-weight: 400; text-align: right; overflow-wrap: anywhere; }
.req-sec-body { display: grid; gap: 0.5rem; padding: 0.2rem 0.85rem 0.85rem; }
.req-sec-body > * { margin: 0; }
.req-compare .compare-diff { background: var(--diff-bg); box-shadow: inset 3px 0 0 var(--track-wait); }

/* --- Prompt G17: the history tabs' counters in groups (normal case headings), each with its ?; approved green,
   denied and auto rejected red, waiting yellow. ------------------------------------------------------------------- */
.count-groups { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 0.75rem; margin: 0 0 1rem; }
.count-group { padding: 0.75rem; border: 1px solid var(--line-card); border-radius: 14px; background: var(--tile); }
.count-group-title { display: flex; align-items: center; gap: 0.35rem; margin: 0 0 0.6rem; color: var(--muted); font-size: 0.9rem; font-weight: 700; }
.count-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.count-tile { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.6rem 0.65rem; border: 1px solid var(--line); border-radius: 10px; background: var(--hover-bg); }
.count-num { font-size: 1.4rem; font-weight: 700; line-height: 1.1; }
.count-label { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.35rem; font-size: 0.82rem; }
.count-good .count-num { color: var(--yes); }
.count-bad .count-num { color: var(--danger); }
.count-wait .count-num { color: var(--track-wait-text); }
.bridge-title-buttons .help-wrap { margin-left: -0.2rem; }
@media (max-width: 980px) {
  .count-groups { grid-template-columns: minmax(0, 1fr); }
}


/* --- Prompt G18: Handler metrics. Server-drawn donuts (stroke colours are classes), legends with every number in
   words, the counter row, one card per Ticket Handler. -------------------------------------------------------- */
.hm-periods { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 0 0 1rem; }
.hm-periods .period-switch { margin: 0; }
.hm-range { margin: 0; }
.hm-title { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.75rem; font-size: 1.1rem; }
.hm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 1.75rem; }
.hm-donut { flex: none; }
.hm-donut-team { width: 13rem; height: 13rem; }
.hm-donut-card { width: 9.5rem; height: 9.5rem; }
.hm-track { stroke: var(--hm-rest); }
.hm-centre { fill: var(--text); font-size: 5.6px; font-weight: 800; }
.hm-donut-card .hm-centre { font-size: 7px; }
.hm-sub { fill: var(--muted); font-size: 2.8px; }
.hm-legend { display: grid; gap: 0.45rem; margin: 0; padding: 0; list-style: none; font-size: 0.9rem; }
.hm-legend li { display: flex; align-items: center; gap: 0.5rem; }
.hm-sw { flex: none; width: 0.8rem; height: 0.8rem; border-radius: 4px; }
.hm-slice.hm-c0 { stroke: var(--hm-0); } .hm-sw.hm-c0 { background: var(--hm-0); }
.hm-slice.hm-c1 { stroke: var(--hm-1); } .hm-sw.hm-c1 { background: var(--hm-1); }
.hm-slice.hm-c2 { stroke: var(--hm-2); } .hm-sw.hm-c2 { background: var(--hm-2); }
.hm-slice.hm-c3 { stroke: var(--hm-3); } .hm-sw.hm-c3 { background: var(--hm-3); }
.hm-slice.hm-c4 { stroke: var(--hm-4); } .hm-sw.hm-c4 { background: var(--hm-4); }
.hm-slice.hm-c5 { stroke: var(--hm-5); } .hm-sw.hm-c5 { background: var(--hm-5); }
.hm-slice.hm-c6 { stroke: var(--hm-6); } .hm-sw.hm-c6 { background: var(--hm-6); }
.hm-slice.hm-c7 { stroke: var(--hm-7); } .hm-sw.hm-c7 { background: var(--hm-7); }
.hm-slice.hm-other { stroke: var(--hm-other); } .hm-sw.hm-other { background: var(--hm-other); }
.hm-slice.hm-open { stroke: var(--hm-open); } .hm-sw.hm-open { background: var(--hm-open); }
.hm-slice.hm-unassigned { stroke: var(--hm-unassigned); } .hm-sw.hm-unassigned { background: var(--hm-unassigned); }
.hm-slice.hm-rest { stroke: var(--hm-rest); } .hm-sw.hm-rest { background: var(--hm-rest); border: 1px solid var(--line); }
.hm-slice.hm-faded { stroke-opacity: 0.4; } .hm-sw.hm-faded { opacity: 0.4; }
.hm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.6rem; margin: 1rem 0; padding: 0; list-style: none; }
.hm-stats li { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.75rem; border: 1px solid var(--line-card); border-radius: 12px; background: var(--tile); color: var(--muted); font-size: 0.85rem; }
.hm-stat { color: var(--text); font-size: 1.4rem; font-weight: 700; }
.hm-stat-time { font-size: 1.1rem; }
.hm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 0.75rem; }
.hm-average { margin: 0.6rem 0 0; }

/* --- Prompt G19 and G25: tile grids in an order (Edit homepage tiles, Admin settings). Each card carries its place,
   a grip for dragging (static/tileorder.js) and Move up / Move down buttons (keyboard and no-script). ------------- */
.tile-order-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; }
.tile-order-title { display: flex; align-items: center; gap: 0.35rem; margin: 0; }
.tile-draft-note { margin: 0.6rem 0 0; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.65rem; margin: 0.9rem 0 0; padding: 0; list-style: none; }
.tile-card { display: flex; flex-direction: column; gap: 0.45rem; padding: 0.75rem; border: 1px solid var(--line-card); border-radius: 12px; background: var(--hover-bg); cursor: grab; }
.tile-card.tile-card-chosen { border-color: var(--accent); box-shadow: 0 0 0 2px var(--step-current-ring); }
.tile-card.tile-card-hidden .tile-card-link { opacity: 0.6; }
.tile-card.tile-dragging { opacity: 0.5; }
.tile-card-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.tile-card-grip { letter-spacing: -0.15em; }
.tile-card-link { display: grid; gap: 0.25rem; color: var(--text); text-decoration: none; }
.tile-card-link:hover .tile-card-name, .tile-card-link:focus-visible .tile-card-name { text-decoration: underline; }
.tile-card-name { font-weight: 700; }
.tile-card-desc { color: var(--muted); font-size: 0.82rem; overflow-wrap: anywhere; }
.tile-card-chip { align-self: flex-start; }
.tile-card-moves { display: flex; gap: 0.4rem; margin-top: auto; }
.tile-move { padding: 0.25rem 0.55rem; font-size: 0.8rem; }
.tile-details { margin-top: 1rem; }
.tile-form-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
/* G14: the description with Reset to default order at its top right (wraps under it on a narrow screen) */
.settings-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 1rem; }
.settings-head .page-desc { flex: 1 1 20rem; min-width: 0; margin-bottom: 0; }
.settings-reset { flex: 0 0 auto; margin-left: auto; }
.settings-reset-off { display: inline-block; cursor: not-allowed; }
.settings-tiles .tile { display: flex; flex-direction: column; gap: 0.45rem; }
.settings-reordering .tile { position: relative; cursor: grab; }  /* G28: reorder mode only */
.tile-handle { position: absolute; top: 0.55rem; right: 0.55rem; z-index: 3; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border: 1px solid var(--line); border-radius: 6px; background: var(--tile); color: var(--muted); }
.tile-handle svg { width: 1rem; height: 1rem; }
.settings-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-left: auto; }
.settings-head-actions .settings-reset { margin-left: 0; }
.settings-tiles .tile a { flex: 1 1 auto; height: auto; }
.settings-tiles .tile.tile-dragging { opacity: 0.5; }
.settings-moves { justify-content: flex-end; }

/* --- Prompt G20: Ticket history at the bottom of the Manage ticket panel (narrow column: the time goes under the
   sentence). ------------------------------------------------------------------------------------------------------ */
.handle-history { margin-top: 1rem; border: 1px solid var(--line); border-radius: 10px; }
.handle-history .ticket-history-summary { padding: 0.7rem 0.85rem; font-size: 0.98rem; }
.handle-history .ticket-history-row { flex-direction: column; gap: 0.15rem; padding: 0.5rem 0.85rem; }
.handle-history .admin-empty { padding: 0.5rem 0.85rem 0.8rem; }

/* --- Prompt G21: a field label with its "?" on one line (All requests, Status). ---------------------------------- */
.key-label-row { display: flex; align-items: center; gap: 0.3rem; }
.key-label-row .key-label { margin-bottom: 0; }

/* --- Prompt G14: Users and permissions. Tabs, permission chips, Permission details lines (the add-ons indented),
   At a glance blocks (tick, eye, dot; the column header repeated per block; a phone scrolls each table in its own box)
   and Check access (green can use, yellow read only, grey not included). ---------------------------------------- */
.perm-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0 0 0.75rem; border-bottom: 1px solid var(--line-card); }
.perm-tab { padding: 0.55rem 0.9rem; border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; color: var(--muted); text-decoration: none; }
.perm-tab:hover, .perm-tab:focus-visible { color: var(--text); }
.perm-tab-current { border-color: var(--line-card); background: var(--tile); color: var(--text); font-weight: 700; }
.perm-tab-head { display: flex; align-items: center; gap: 0.35rem; margin: 0 0 0.75rem; }
.perm-tab-title { margin: 0; font-size: 1.15rem; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.perm-chip { display: inline-block; padding: 0.08rem 0.5rem; border: 1px solid var(--line-pill); border-radius: 999px; font-size: 0.76rem; font-weight: 600; color: var(--text); white-space: nowrap; }
.perm-chip-super { border-color: var(--accent); background: var(--chosen-bg); color: var(--chosen-text); }
.perm-chip-admin { border-color: var(--track-wait); color: var(--track-wait-text); }
.perm-chip-plain { color: var(--muted); }
.perm-pending { display: block; margin-top: 0.2rem; color: var(--track-wait-text); font-size: 0.8rem; }
.users-actions { white-space: nowrap; }
.users-role { margin-top: 0.3rem; }
.perm-pending-when { white-space: nowrap; }  /* G14: "2026-10-19 3:48 PM (Eastern)" never breaks in the narrow Name column */  /* G14: Make super admin, Remove super admin, Cancel (super admins only) */
.users-role-off { display: inline-block; cursor: not-allowed; }
.users-role-why { display: block; margin-top: 0.15rem; color: var(--muted); font-size: 0.8rem; white-space: normal; max-width: 16rem; }
.button-small { padding: 0.25rem 0.6rem; font-size: 0.8rem; }
.perm-lines { display: grid; gap: 0.5rem; }
.perm-line { border: 1px solid var(--line-card); border-radius: 12px; background: var(--tile); }
.perm-line-addon { margin-left: 1.75rem; }
.perm-line-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; padding: 0.7rem 0.9rem; cursor: pointer; list-style: none; }
.perm-line-head::-webkit-details-marker { display: none; }
.perm-line-name { font-weight: 700; }
.perm-addon-arrow { color: var(--muted); }
.perm-line-given { margin-left: auto; color: var(--muted); font-size: 0.82rem; }
.perm-line-body { padding: 0 0.9rem 0.9rem; }
.perm-line-text { margin: 0 0 0.5rem; }
.perm-gives { display: grid; gap: 0.35rem; margin: 0 0 0.6rem; padding-left: 1.1rem; }
.perm-give-label { font-weight: 600; }
.perm-give-does { display: block; color: var(--muted); font-size: 0.85rem; }
.glance-key { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 0 0 0.75rem; color: var(--muted); font-size: 0.88rem; }
.glance-key-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.glance-block { margin: 0 0 1rem; }
.glance-block-title { margin: 0 0 0.4rem; font-size: 1rem; }
.glance-scroll { position: relative; max-width: 100%; overflow-x: auto; }  /* relative: the cells' screen reader words stay inside the scroll box */
.glance-table { width: 100%; table-layout: fixed; }
.glance-table th, .glance-table td { padding: 0.4rem 0.35rem; font-size: 0.82rem; overflow-wrap: anywhere; }
.glance-table .glance-row-head { width: 30%; text-align: left; }
.glance-col { text-align: center; font-weight: 600; }
.glance-col a { color: var(--text); }
.glance-col-addon { font-weight: 500; }
.glance-col-addon a { color: var(--muted); }
.glance-cell { text-align: center; }
.glance-mark { color: var(--yes); font-weight: 800; }
.glance-cell-yes .glance-mark { color: var(--yes); }
.glance-cell-read, .glance-cell-read .glance-eye { color: var(--track-wait-text); }
.glance-eye { width: 1.1rem; height: 1.1rem; vertical-align: middle; }
.glance-dot { display: inline-block; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--track-next); vertical-align: middle; }
.check-boxes { display: grid; gap: 0.35rem; margin: 0.75rem 0 0; padding: 0; border: 0; }
.check-box-addon { margin-left: 1.5rem; }
.check-box-locked { opacity: 0.7; }
.check-result { margin-top: 1rem; }
.check-result-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.check-result-head h3 { margin: 0; }
.check-admin { padding: 0.2rem 0.65rem; border: 1px solid var(--line-pill); border-radius: 999px; font-size: 0.82rem; font-weight: 600; }
.check-admin-yes { border-color: var(--track-wait); color: var(--track-wait-text); }
.check-columns { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 2fr); gap: 1rem; margin-top: 0.75rem; }
.check-sub { margin: 0 0 0.4rem; font-size: 0.95rem; }
.check-list { display: grid; gap: 0.25rem; margin: 0 0 0.6rem; padding: 0; list-style: none; }
.check-item { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.3rem 0.55rem; border-left: 3px solid var(--track-line); border-radius: 6px; font-size: 0.86rem; }
.check-new, .check-yes { border-left-color: var(--yes); background: var(--fresh-bg); }
.check-read, .check-part { border-left-color: var(--track-wait); background: var(--track-wait-bg); }  /* G24.2: partly is yellow too */
.check-no { color: var(--muted); }
.check-level { flex: none; color: var(--muted); font-size: 0.78rem; }
.check-block-title { margin: 0.5rem 0 0.25rem; color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.check-ask p { margin: 0 0 0.35rem; }
@media (max-width: 720px) {
  .check-columns { grid-template-columns: minmax(0, 1fr); }
  .glance-table { width: 44rem; }
  .perm-line-given { margin-left: 0; width: 100%; }
}
.check-arrow { color: var(--muted); }
.glance-table th, .glance-table td { white-space: normal; vertical-align: middle; }
.glance-table td.glance-cell, .glance-table th.glance-col { text-align: center; }
.perm-addon-item { margin-left: 1.5rem; }


/* --- Prompt G28: DC Password age (read only, demo data). (G29: the demo note was removed.) The Updates card with its Read only
   chip, the counters (links that filter the table; the active one outlined), the status chips: Expired red, Expires
   soon yellow, OK green, Never expires grey. The table scrolls in its own box (.admin-table-wrap). ------------------ */
.dcp-updates { margin-bottom: 1rem; }
.dcp-updates-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.dcp-updates-head h2 { margin: 0; font-size: 1.1rem; }
.dcp-times { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin: 0.75rem 0; }
.dcp-times dt { color: var(--muted); font-size: 0.85rem; }
.dcp-times dd { margin: 0.15rem 0 0; font-weight: 600; }
.dcp-log summary { cursor: pointer; font-weight: 600; }
.dcp-log .admin-table-wrap { margin-top: 0.6rem; }
.dcp-counters { margin: 0 0 1rem; }
.dcp-counters li { position: relative; }
.dcp-counters .help-wrap { position: absolute; top: 0.55rem; right: 0.55rem; }
.dcp-counter { color: var(--text); text-decoration: none; padding-right: 2rem; }
.dcp-counter:hover { border-color: var(--accent); }
.dcp-counter:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.dcp-counter-active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }  /* an outline, so the red, yellow and grey numbers keep their contrast */
.count-muted .count-num { color: var(--muted); }
.dcp-search { margin: 0 0 1rem; }
.dcp-none { color: var(--muted); }
.dcp-table td { white-space: nowrap; }
.dcp-status { display: inline-block; padding: 0.1rem 0.55rem; border: 1px solid var(--line); border-radius: 999px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.dcp-status-expired { border-color: var(--danger); color: var(--danger); }
.dcp-status-soon { border-color: var(--track-wait); background: var(--track-wait-bg); color: var(--track-wait-text); }
.dcp-status-ok { border-color: var(--yes); color: var(--yes); }
.dcp-status-never { color: var(--muted); }


/* --- Prompt G22: Email templates as in the admin-polish preview. The Variables row (folded; each variable a chip
   that inserts itself at the cursor when a template is open), the template cards spaced apart (name and ?, To chip,
   Edit), and the Link panel under the formatting bar. ---------------------------------------------------------- */
.et-vars-row { margin-bottom: 1rem; }
.et-vars-row > summary { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; list-style: none; }
.et-vars-row > summary::-webkit-details-marker { display: none; }
.et-vars-title { font-size: 1.1rem; font-weight: 700; }
.et-vars-show { margin-left: auto; color: var(--muted); font-size: 0.9rem; }
.et-vars-row[open] .et-vars-show { visibility: hidden; }
.et-vars-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 0.6rem 1rem; margin: 0.8rem 0 0; padding: 0; list-style: none; }
.et-var-item { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; min-width: 0; }
.et-var { padding: 0.15rem 0.5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--hover-bg); color: var(--text); font: 600 0.85rem ui-monospace, Consolas, monospace; }
button.et-var { cursor: pointer; }
button.et-var:hover { border-color: var(--accent); }
button.et-var:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.et-var-text { color: var(--muted); font-size: 0.88rem; overflow-wrap: anywhere; }
.et-templates { margin-bottom: 1rem; }
.et-cards { display: grid; gap: 0.75rem; margin: 0.8rem 0 0; padding: 0; list-style: none; }
.et-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.75rem 0.9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--hover-bg); }
.et-card-current { border-color: var(--accent); }
.et-card-text { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; min-width: 0; }
.et-card-name { display: inline-flex; align-items: center; gap: 0.3rem; }
.et-form h2 { margin-top: 0; }
.et-link-pop { display: grid; gap: 0.5rem; max-width: 26rem; margin: 0.4rem 0; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--tile); }
.et-link-pop[hidden] { display: none; }
.et-link-buttons { display: flex; gap: 0.5rem; }
.et-link-buttons[hidden] { display: none; }
.et-tool-link, .et-tool-unlink { width: auto; padding: 0 0.55rem; }
.et-link-hint { margin-top: 0.4rem; }


/* --- Prompt G23: Email logs as in the admin-polish preview: the filters in one wrapping row, the in-page confirm
   (red, Yes, clear them / Cancel), the pager with page numbers. ----------------------------------------------- */
.ob-card { margin-top: 0.5rem; }
.ob-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1rem; margin: 0.75rem 0 0; }
.ob-field { display: grid; gap: 0.3rem; flex: 1 1 10rem; min-width: 0; }
.ob-search { flex: 2 1 16rem; }
.ob-field .key-input { min-width: 0; max-width: 100%; }
.ob-filter-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; flex: 1 1 100%; }
.ob-clear-all { margin-left: auto; }
.ob-confirm { margin: 0.75rem 0 0; padding: 0.65rem 0.9rem; border: 1px solid var(--danger); border-radius: 12px; background: var(--danger-bg); }
.ob-confirm p { margin: 0 0 0.5rem; }
.ob-confirm-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ob-wrap { margin-top: 0.9rem; }
.ob-when { white-space: nowrap; }
.ob-table { min-width: 44rem; }  /* on a phone the table scrolls in its own box instead of squeezing the addresses */
.ob-table td { white-space: nowrap; }
.ob-actions { display: flex; gap: 0.4rem; }
.ob-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-top: 0.75rem; }
.ob-pages { margin-top: 0; }
.ob-page-current { border-color: var(--accent); font-weight: 700; }



/* --- Prompt G24: Passkeys as in the admin-polish preview: the red note, the Show keys for picker, the one table of
   keys (a name you may rename is a link that opens its edit box), the enrollment links list. ------------------- */
.pk-note { margin: 0 0 1rem; padding: 0.65rem 0.9rem; border: 1px solid var(--danger); border-radius: 12px; background: var(--danger-bg); }
.pk-note p { margin: 0; }
.pk-note p + p { margin-top: 0.35rem; }
.pk-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 1rem; }
.pk-field { display: grid; gap: 0.3rem; flex: 0 1 18rem; min-width: 0; }
.pk-count { margin: 0 0 0.6rem; }
.pk-card .admin-table-wrap { margin-top: 0.75rem; }
.pk-table { min-width: 46rem; }  /* on a phone the table scrolls in its own box */
.pk-table td { white-space: nowrap; }
.pk-name-link { color: var(--text); text-decoration: underline dotted; text-underline-offset: 3px; }
.pk-name-link:hover { text-decoration-style: solid; }
.pk-rename { flex-wrap: wrap; }
.pk-rename .key-input { width: 11rem; max-width: 100%; }
.pk-table td.pk-name { white-space: normal; min-width: 12rem; }
.pk-add { margin-top: 0.9rem; }
.pk-links { margin-top: 1rem; }
.pk-link-list { display: grid; gap: 0.5rem; margin: 0.5rem 0 0; padding: 0; list-style: none; }
.pk-link-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 1rem; padding: 0.5rem 0.7rem; border: 1px solid var(--line); border-radius: 10px; }



/* --- Prompt G24.2: the partial access rule on Users and permissions (the partial-access preview). Each icon is a
   centred SVG in a small rounded square: full use green, view only and partly yellow, not included grey. The yellow ?
   beside a partly or view only action; its note is placed with fixed positioning (tooltip.js) so a scrolling table
   never cuts it off. ------------------------------------------------------------------------------------------- */
.acc-cell { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 1.6rem; height: 1.6rem; border-radius: 7px; line-height: 0; vertical-align: middle; }
.acc-cell svg { display: block; width: 0.9rem; height: 0.9rem; }
.acc-cell svg.acc-dot { width: 0.5rem; height: 0.5rem; }
.acc-yes { background: var(--yes-bg); color: var(--yes); }
.acc-part, .acc-read { background: var(--track-wait-bg); color: var(--track-wait-text); }
.acc-no { color: var(--muted); }
.acc-key { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; margin: 0 0 0.8rem; color: var(--muted); font-size: 0.88rem; }
.acc-key-item { display: inline-flex; align-items: center; gap: 0.45rem; }
.acc-q-wrap { margin-left: 0.35rem; }
.acc-q { border-color: var(--track-wait); color: var(--track-wait-text); }
.acc-q:hover, .acc-q:focus-visible { border-color: var(--track-wait); color: var(--track-wait-text); background: var(--track-wait-bg); }
.tip-text.tip-fixed { position: fixed; z-index: 60; width: 19rem; max-width: calc(100vw - 32px); }
.glance-cell .acc-cell { margin: 0 auto; }
.perm-give { display: flex; align-items: flex-start; gap: 0.55rem; }
.perm-give-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.perm-only { margin: 0.6rem 0 0.4rem; padding: 0.55rem 0.8rem; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: var(--hover-bg); }
.perm-only-title { margin: 0 0 0.3rem; font-weight: 700; }
.perm-only ul { margin: 0; padding-left: 1.1rem; }
.check-item .acc-cell { margin-right: 0.45rem; }
.check-label { flex: 1 1 auto; min-width: 0; }


/* --- Prompt G29, reworked in G30: the Network Monitor (docs/design/network-monitor-preview.html). The three tiles;
   inside a type one title row (All computers and the name), the filter row, then the list (0.8fr, left; scrolls in
   its own box, as tall as the details) and the sticky details (1.2fr, right); under 861px they stack. Rows are tinted
   by status: Up green, Check yellow (RAM over 75%, CPU over 50%, updates waiting, a service on your list stopped),
   Down red. The usage bars use a class per 5% step (the CSP allows no inline style). --------------------------- */
.nm-home { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; }
@media (max-width: 760px) { .nm-home { grid-template-columns: minmax(0, 1fr); } }
.nm-tile { display: flex; flex-direction: column; gap: 0.6rem; min-height: 9.5rem; padding: 1.1rem; border: 1px solid var(--line-card); border-radius: 14px; background: var(--tile); color: var(--text); text-decoration: none; }
.nm-tile:hover { border-color: var(--accent); }
.nm-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.nm-tile-name { font-size: 1.25rem; font-weight: 700; }
.nm-big { margin-top: auto; font: 700 2rem ui-monospace, Consolas, monospace; }
.nm-counts { display: flex; flex-wrap: wrap; gap: 0.4rem; font: 600 0.8rem ui-monospace, Consolas, monospace; }
.nm-counts span { padding: 0.1rem 0.55rem; border-radius: 999px; }
.nm-c-g { background: var(--yes-bg); color: var(--yes); }
.nm-c-y { background: var(--track-wait-bg); color: var(--track-wait-text); }
.nm-c-r { background: var(--danger-bg); color: var(--danger); }
.nm-titlerow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1rem; margin-bottom: 0.9rem; }
.nm-back { color: var(--accent); font-weight: 600; }
.nm-title { margin: 0; font-size: 1.6rem; line-height: 1.15; }
.nm-inline { display: inline; margin: 0; }
.nm-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.nm-filters .key-input { width: auto; flex: 0 1 auto; min-width: 0; max-width: 100%; }
.nm-filters .nm-q { flex: 1 1 12rem; }
.nm-split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 1.1rem; align-items: start; }
@media (max-width: 860px) { .nm-split { grid-template-columns: minmax(0, 1fr); } }
.nm-sec { margin: 0.25rem 0 0.5rem; color: var(--muted); font: 600 0.8rem ui-monospace, Consolas, monospace; }
.nm-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: calc(100vh - 15rem); padding: 2px; overflow: auto; }
@media (max-width: 860px) { .nm-list { max-height: none; overflow: visible; } }
.nm-dev { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; padding: 0.6rem 0.9rem; border: 1px solid var(--yes); border-radius: 10px; background: var(--yes-bg); color: var(--text); text-decoration: none; }
.nm-dev-y { border-color: var(--track-wait); background: var(--track-wait-bg); }
.nm-dev-r { border-color: var(--danger); background: var(--danger-bg); }
.nm-dev-sel { box-shadow: 0 0 0 2px var(--accent); }
.nm-dev:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.nm-dev-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.4rem; min-width: 0; }
.nm-nm { font-weight: 700; overflow-wrap: break-word; min-width: 0; }
.nm-ip { flex-basis: 100%; color: var(--muted); font: 500 0.82rem ui-monospace, Consolas, monospace; }
.nm-moved { padding: 0 0.45rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 0.72rem; }
.nm-why { flex-basis: 100%; font-size: 0.8rem; }
.nm-dev-y .nm-why { color: var(--track-wait-text); }
.nm-dev-r .nm-why { color: var(--danger); }
.nm-st { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.6rem; border-radius: 999px; font: 700 0.74rem ui-monospace, Consolas, monospace; white-space: nowrap; }
.nm-st::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; }
.nm-st-g { background: var(--yes-bg); color: var(--yes); }
.nm-st-y { background: var(--track-wait-bg); color: var(--track-wait-text); }
.nm-st-r { background: var(--danger-bg); color: var(--danger); }
.nm-detail { position: sticky; top: 0.75rem; }
@media (max-width: 860px) { .nm-detail { position: static; } }
.nm-empty { display: grid; place-items: center; min-height: 13.75rem; padding: 1.2rem; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.nm-panel { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem; border: 1px solid var(--line-card); border-radius: 14px; background: var(--tile); }
.nm-ptitle { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.nm-ptitle b { font-size: 1.15rem; overflow-wrap: anywhere; }
.nm-why-line { margin: 0; font-size: 0.86rem; }
.nm-panel .perm-hint { margin: 0; }
.nm-why-y { color: var(--track-wait-text); }
.nm-why-r { color: var(--danger); }
.nm-meta { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 0.25rem 0.75rem; margin: 0; font-size: 0.9rem; }
.nm-meta dt { color: var(--muted); }
.nm-meta dd { margin: 0; font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.nm-unk { color: var(--muted); }
.nm-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.nm-acts .button { width: 100%; padding-block: 0.6rem; }
.nm-acts .button:disabled { opacity: 0.5; cursor: not-allowed; }
.nm-act-form, .nm-btn-wrap { display: block; margin: 0; }
.nm-red { color: var(--danger); }
.nm-sent { margin: 0; color: var(--yes); font-size: 0.86rem; }
.nm-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.nm-disks { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.nm-disks .nm-stat { flex: 0 0 calc((100% - 1rem) / 3); min-width: 0; }
@media (max-width: 560px) {
  .nm-row3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nm-disks .nm-stat { flex-basis: calc((100% - 0.5rem) / 2); }
}
.nm-stat { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--hover-bg); }
.nm-stat small { color: var(--muted); font: 600 0.72rem ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.nm-stat-head { display: flex; align-items: center; gap: 0.35rem; }
.nm-stat b { font: 700 1.25rem ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.nm-stat b.nm-b-small { font-size: 1rem; }
.nm-stat i { color: var(--muted); font: 500 0.76rem ui-monospace, Consolas, monospace; font-style: normal; overflow-wrap: anywhere; }
.nm-hot { border-color: var(--track-wait); background: var(--track-wait-bg); }
.nm-hot b { color: var(--track-wait-text); }
.nm-meter { display: block; height: 0.32rem; border-radius: 999px; background: var(--line); }
.nm-meter-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.nm-meter-hot .nm-meter-fill { background: var(--track-wait); }
.nm-shead { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.nm-sec-title { margin: 0 auto 0 0; }
.nm-addrow { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.nm-addrow .key-input { flex: 1 1 12rem; width: auto; min-width: 0; }
.nm-add-error { flex-basis: 100%; margin: 0; }
.nm-svcs { display: flex; flex-direction: column; gap: 0.4rem; }
.nm-svc { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem; padding: 0.5rem 0.75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--hover-bg); font: 500 0.86rem ui-monospace, Consolas, monospace; }
.nm-svc-name { min-width: 0; overflow-wrap: anywhere; }
.nm-svc em { margin-left: 0.4rem; color: var(--muted); font: 0.78rem system-ui, sans-serif; font-style: normal; }
.nm-svcr { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.nm-cmd { margin: 0 0 0 0.25rem; }
.nm-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; border: 1px solid var(--track-wait); border-radius: 10px; background: var(--track-wait-bg); font-size: 0.86rem; }
.nm-mv { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.86rem; }
.nm-mv .key-input { width: auto; }
.nm-w-0 { width: 0%; }
.nm-w-5 { width: 5%; }
.nm-w-10 { width: 10%; }
.nm-w-15 { width: 15%; }
.nm-w-20 { width: 20%; }
.nm-w-25 { width: 25%; }
.nm-w-30 { width: 30%; }
.nm-w-35 { width: 35%; }
.nm-w-40 { width: 40%; }
.nm-w-45 { width: 45%; }
.nm-w-50 { width: 50%; }
.nm-w-55 { width: 55%; }
.nm-w-60 { width: 60%; }
.nm-w-65 { width: 65%; }
.nm-w-70 { width: 70%; }
.nm-w-75 { width: 75%; }
.nm-w-80 { width: 80%; }
.nm-w-85 { width: 85%; }
.nm-w-90 { width: 90%; }
.nm-w-95 { width: 95%; }
.nm-w-100 { width: 100%; }

/* --- Prompt G30: Admin settings > Watched services and Agent connection (docs/design/watched-services-preview.html):
   three explanation boxes, then one card per computer type with its rows, the Add box, an Unsaved changes chip and
   Save / Discard changes. A newly added row has a green edge until saved. ------------------------------------------ */
.ws-how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; margin-bottom: 1rem; }
@media (max-width: 760px) { .ws-how { grid-template-columns: minmax(0, 1fr); } }
.ws-how-box { padding: 0.75rem; border: 1px solid var(--line); border-radius: 12px; background: var(--hover-bg); font-size: 0.88rem; }
.ws-how-box b { display: block; margin-bottom: 0.25rem; }
.ws-card { display: flex; flex-direction: column; gap: 0.75rem; }
.ws-card .perm-hint { margin: 0; }
.ws-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.ws-head h2 { margin: 0 auto 0 0; font-size: 1.2rem; }
.ws-changed { padding: 0.1rem 0.6rem; border-radius: 999px; background: var(--track-wait-bg); color: var(--track-wait-text); font-size: 0.8rem; }
.ws-list { display: flex; flex-direction: column; gap: 0.4rem; }
.ws-svc { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.5rem 0.75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--hover-bg); }
.ws-svc code { font: 600 0.9rem ui-monospace, Consolas, monospace; overflow-wrap: anywhere; min-width: 0; }
.ws-new { border-color: var(--yes); }
.ws-add { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.ws-add .key-input { flex: 1 1 12rem; width: auto; min-width: 0; }
.ws-card .field-error { margin: -0.4rem 0 0; }
.ws-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.ws-foot .button:disabled { opacity: 0.5; cursor: not-allowed; }
.ac-choice { display: flex; flex-direction: column; gap: 0.4rem; margin: 0; padding: 0; border: 0; }
.ac-choice label { display: flex; align-items: flex-start; gap: 0.5rem; }
/* G30: a short confirmation that floats at the bottom of the window (Watched services and Email templates saves) */
.notice.toast { position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); z-index: 30; width: max-content; max-width: calc(100vw - 2rem); margin: 0; transform: translateX(-50%); border: 1px solid var(--accent); box-shadow: var(--shadow-pop); }

/* --- Prompt G30: per computer Network Monitor access (docs/design/monitor-access-preview.html). On the Edit page, the
   line under Network Monitor (hidden while Network Monitor is unticked); the Choose computers page: the type tiles,
   the single computers list (left) and the summary (right, sticky); one column under 861px. ----------------------- */
.perm-nm-choose { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin: 0.5rem 0 0 1.75rem; padding: 0.6rem 0.75rem; border-radius: 10px; background: var(--hover-bg); }
.perm-nm-item:has(> label input[value="network_monitor"]:not(:checked)) .perm-nm-choose { display: none; }
.perm-nm-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 14rem; }
.perm-nm-chosen { font-weight: 600; }
.ma-form { display: flex; flex-direction: column; gap: 1rem; }
.ma-card { display: flex; flex-direction: column; gap: 0.75rem; margin: 0; }
.ma-card .perm-hint, .ma-card .perm-tab-title { margin: 0; }
.ma-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
@media (max-width: 760px) { .ma-tiles { grid-template-columns: minmax(0, 1fr); } }
.ma-tile { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.75rem; border: 1px solid var(--line); border-radius: 12px; background: var(--hover-bg); }
.ma-tile.ma-on { border-color: var(--accent); background: var(--yes-bg); }
.ma-tile-name { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; cursor: pointer; }
.ma-switches { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; }
.ma-switch { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--muted); font-size: 0.8rem; white-space: nowrap; cursor: pointer; }
.ma-switch:has(input:disabled) { opacity: 0.45; cursor: default; }
.ma-grid { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 1rem; align-items: start; }
@media (max-width: 860px) { .ma-grid { grid-template-columns: minmax(0, 1fr); } }
.ma-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.ma-q { flex: 1 1 11rem; width: auto; min-width: 0; }
.ma-tabs { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; }
.ma-ftab { padding: 0.3rem 0.75rem; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--text); font: inherit; font-size: 0.85rem; cursor: pointer; }
.ma-ftab-on { border-color: var(--accent); color: var(--accent); }
.ma-ftab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ma-list { max-height: 29rem; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.ma-row { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto; align-items: center; gap: 0.6rem; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; }
.ma-row:last-of-type { border-bottom: 0; }
.ma-row:hover { background: var(--hover-bg); }
.ma-row.ma-on { background: var(--yes-bg); }
.ma-row.ma-lock { cursor: default; opacity: 0.8; }
.ma-row-name { display: flex; flex-direction: column; min-width: 0; }
.ma-nm { font-weight: 600; overflow-wrap: anywhere; }
.ma-ip { color: var(--muted); font: 500 0.8rem ui-monospace, Consolas, monospace; }
.ma-row-right { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.3rem 0.75rem; }
.ma-tag { padding: 0 0.5rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 0.74rem; white-space: nowrap; }
@media (max-width: 560px) { .ma-row { grid-template-columns: 1.5rem minmax(0, 1fr); } .ma-row-right { grid-column: 2; justify-content: flex-start; } }
.ma-none { padding: 0.75rem; }
.ma-sum { position: sticky; top: 0.75rem; }
@media (max-width: 860px) { .ma-sum { position: static; } }
.ma-count { font-size: 1.6rem; font-weight: 700; }
.ma-sum-list { margin: 0; padding-left: 1.1rem; font-size: 0.88rem; }
.ma-abil { display: flex; flex-direction: column; gap: 0.6rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.ma-addon { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.9rem; }
.ma-addon input { margin-top: 0.25rem; }
.ma-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* --- Prompt G30: the Email templates edit page (docs/design/email-templates-preview.html): the Variables bar pinned at
   the top of the scrolling area, the editor beside the preview (stacked under 901px), and back on the list the card
   you came from flashes (its #et-<key> target) a little below the top. ------------------------------------------- */
.et-sticky { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.5rem; margin: 0 0 1rem; padding: 0.55rem 0.75rem; border: 1px solid var(--line-card); border-radius: 12px; background: var(--tile); box-shadow: var(--shadow-rest); }
.et-sticky-hint { color: var(--muted); font-size: 0.8rem; }
.et-ed { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .et-ed { grid-template-columns: minmax(0, 1fr); } }
.et-ed > .card { margin: 0; min-width: 0; }
.et-live { position: sticky; top: 4.5rem; }
@media (max-width: 900px) { .et-live { position: static; } }
.et-live .perm-hint { margin: 0 0 0.6rem; }
.et-vars-hide { display: none; margin-left: auto; color: var(--muted); font-size: 0.9rem; }
.et-vars-row[open] .et-vars-show { display: none; }
.et-vars-row[open] .et-vars-hide { display: inline; }
.et-card { scroll-margin-top: 30vh; }
.et-card:target { animation: et-flash 1.6s ease-out; }
@keyframes et-flash { 0%, 40% { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: none; } }
/* G30: the Email logs Status column carries the ? on Sent, Waiting and Failed */
.ob-status-head .help-wrap { margin-left: 0.3rem; }
