/* GVM stylesheet — Terminal direction.
   Ported from docs/ui-mocks/source/styles.css; only the Terminal direction
   is shipped, with both dark + light theme tokens. */

:root {
  --accent-h: 22;
  --accent-c: 0.18;
  --accent-l: 0.58;
  --accent: oklch(var(--accent-l) var(--accent-c) var(--accent-h));
  --accent-soft: oklch(var(--accent-l) var(--accent-c) var(--accent-h) / 0.14);
  --accent-line: oklch(var(--accent-l) var(--accent-c) var(--accent-h) / 0.42);

  --ok: oklch(0.7 0.14 150);
  --warn: oklch(0.78 0.14 80);
  --err: oklch(0.62 0.2 27);
}

/* ---------- Direction: Terminal (CRT, mono-heavy) ---------- */
.dir-terminal {
  /* color-scheme drives the browser's own UA-rendered widgets — calendar
     picker icon inside datetime-local inputs, scrollbars, form-control
     focus rings. Without this, the calendar icon stays black on a dark
     background. The .theme-light block below flips it. */
  color-scheme: dark;
  --bg: #0a0908;
  --panel: #100e0d;
  --panel-2: #161311;
  --ink: oklch(0.92 0.02 30);
  --ink-2: oklch(0.74 0.04 30);
  --ink-3: oklch(0.52 0.04 30);
  --line: oklch(0.32 0.02 30);
  --line-2: oklch(0.24 0.02 30);
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --sans: "JetBrains Mono", ui-monospace, monospace;
  --radius: 2px;
  --radius-pill: 999px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
}
.dir-terminal.theme-light {
  color-scheme: light;
  --bg: oklch(0.97 0.005 60);
  --panel: oklch(0.99 0.002 60);
  --panel-2: oklch(0.95 0.005 60);
  --ink: oklch(0.16 0.01 30);
  --ink-2: oklch(0.42 0.02 30);
  --ink-3: oklch(0.58 0.02 30);
  --line: oklch(0.85 0.008 30);
  --line-2: oklch(0.91 0.005 30);
  --ok:   oklch(0.52 0.14 150);
  --warn: oklch(0.55 0.13 70);
  --err:  oklch(0.55 0.20 27);
}

/* ---------- Body / app shell ---------- */
html, body { margin: 0; padding: 0; height: 100%; }
.dir-terminal { background: var(--bg); color: var(--ink); font-family: var(--mono); }

a { color: inherit; }

.gvm-app {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  box-sizing: border-box;
  position: relative;
}

.gvm-topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  font-size: 13px;
}
.gvm-brand { font-family: var(--mono); font-weight: 700; letter-spacing: 0.02em; }
.gvm-brand .accent { color: var(--accent); }
.gvm-topbar .crumbs { color: var(--ink-3); font-family: var(--mono); font-size: 12px; }
.gvm-topbar .spacer { flex: 1; }

/* Title-bar "copy link to this page" button. Sits snug against the path
   (tighter than the topbar's 16px gap) and stays visually quiet until
   hovered/focused, matching the muted .crumbs treatment. */
.gvm-crumb-group { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.gvm-copy-link {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 6px; line-height: 1;
  border: 1px solid transparent; border-radius: 2px;
  background: none; color: var(--ink-3);
  font-family: var(--mono); font-size: 12px;
}
.gvm-copy-link:hover { color: var(--accent); border-color: var(--accent-line); }
.gvm-copy-link:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.gvm-copy-link.copied { color: var(--ok); border-color: oklch(0.7 0.14 150 / 0.4); }
.gvm-copy-link.copy-failed { color: var(--err); border-color: oklch(0.62 0.2 27 / 0.4); }
.gvm-copy-link-icon {
  /* JetBrains Mono lacks ⧉/✓/⚠ — fall back to system symbol fonts, same as
     the theme toggle's moon/sun glyphs. */
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
               "Noto Color Emoji", "Noto Sans Symbols2", system-ui, monospace;
}
.gvm-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border: 1px solid var(--line);
  border-radius: 999px; font-family: var(--mono); font-size: 11px;
  color: var(--ink-2); background: var(--panel-2);
}
.gvm-pill .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.gvm-pill.accent { border-color: var(--accent-line); color: var(--accent); }

.gvm-theme-toggle {
  cursor: pointer; line-height: 1; padding: 4px 10px; font-size: 14px;
  /* JetBrains Mono lacks glyphs for ◑ ☾ ☀ — fall back to system symbol fonts. */
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
               "Noto Color Emoji", "Noto Sans Symbols2", system-ui, monospace;
  min-width: 28px; text-align: center;
}
.gvm-theme-toggle:hover { color: var(--accent); border-color: var(--accent-line); }
.gvm-theme-toggle:focus-visible {
  outline: 1px solid var(--accent); outline-offset: 2px;
}

/* Identity-chip dropdown (topbar). Pure CSS using <details>/<summary>;
   click the summary to toggle, click again to dismiss. No JS. */
.gvm-pill-menu { position: relative; display: inline-block; }
.gvm-pill-menu > summary { list-style: none; cursor: pointer; }
.gvm-pill-menu > summary::-webkit-details-marker { display: none; }
.gvm-pill-menu .caret { font-size: 10px; opacity: 0.7; }
.gvm-pill-menu-items {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--panel-2);
  border: 1px solid var(--line);
  min-width: 160px;
  z-index: 50;
}
.gvm-pill-menu-items li > a,
.gvm-pill-menu-items li .link-button {
  display: block;
  width: 100%;
  padding: 6px 12px;
  background: none;
  border: none;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.gvm-pill-menu-items li > a:hover,
.gvm-pill-menu-items li .link-button:hover {
  background: var(--panel);
  color: var(--accent);
}
.gvm-pill-menu-items li form { margin: 0; }

.gvm-body { display: grid; grid-template-columns: 200px 1fr; min-height: 0; }
.gvm-body.no-nav { grid-template-columns: 1fr; }
.gvm-nav { border-right: 1px solid var(--line); padding: 14px 10px; background: var(--panel); }
.gvm-nav h6 {
  margin: 14px 8px 6px; font-size: 13px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-3); font-family: var(--mono); font-weight: 600;
}
.gvm-nav h6:first-child { margin-top: 0; }
.gvm-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 2px; font-size: 16px;
  color: var(--ink-2); text-decoration: none; cursor: pointer;
  position: relative;
}
.gvm-nav a:hover { background: var(--panel-2); color: var(--ink); }
.gvm-nav a.active { background: transparent; color: var(--accent); }
.gvm-nav a.active::before { content: "▸ "; position: absolute; left: -2px; }
.gvm-nav a.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.gvm-nav a .glyph {
  font-family: var(--mono); font-size: 14px; color: var(--ink-3);
  width: 16px; text-align: center;
}
.gvm-nav a.active .glyph { color: var(--accent); }

/* Second-level bucket label inside the Manage section — lighter than an <h6>
   section header so the two-level hierarchy (Manage › People › item) reads. */
.gvm-nav-subhead {
  margin: 12px 8px 4px; padding-left: 8px;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); font-family: var(--mono); font-weight: 600; opacity: 0.72;
}
.gvm-nav-bucket { margin-bottom: 2px; }

.gvm-nav-group-header { display: flex; align-items: stretch; }
.gvm-nav-group-header > a { flex: 1; min-width: 0; }
.gvm-nav-group-toggle {
  background: transparent; border: 0; color: var(--ink-3); cursor: pointer;
  padding: 0 8px; font-family: var(--mono); font-size: 15px; line-height: 1;
  display: flex; align-items: center; border-radius: 2px;
}
.gvm-nav-group-toggle:hover { color: var(--ink); background: var(--panel-2); }
.gvm-nav-group-toggle[aria-disabled="true"] {
  cursor: not-allowed; opacity: 0.5;
}
.gvm-nav-group-toggle[aria-disabled="true"]:hover { background: transparent; color: var(--ink-3); }
.gvm-nav-group-toggle .caret { display: inline-block; transform: rotate(-90deg); transition: transform 0.1s ease; }
.gvm-nav-group.open .gvm-nav-group-toggle .caret { transform: none; }
.gvm-nav-group-children { display: none; padding-left: 16px; }
.gvm-nav-group.open .gvm-nav-group-children { display: block; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.gvm-main { padding: 22px 28px; overflow: auto; min-width: 0; }

.gvm-h1 {
  font-family: var(--mono); font-weight: 600; font-size: 2em;
  display: flex; align-items: baseline; gap: 12px; margin: 0 0 4px;
}
.gvm-h1 .ix { color: var(--accent); }
.gvm-sub { color: var(--ink-3); font-size: 13px; margin: 0 0 22px; font-family: var(--mono); }

.accent-bar {
  height: 2px; background: var(--accent); width: 28px; margin-top: 2px;
}

/* ---------- Cards / KPIs ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.card h3 {
  margin: 0 0 10px; font-size: 13px; font-family: var(--mono);
  font-weight: 600; letter-spacing: 0.02em; color: var(--ink-2);
  text-transform: uppercase;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.card h3 .meta { font-size: 11px; color: var(--ink-3); text-transform: none; letter-spacing: 0; font-weight: 500; }

.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); font-family: var(--mono); }
.kpi .value { font-family: var(--mono); font-size: 28px; font-weight: 600; line-height: 1; }
.kpi .delta { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }
.kpi .delta.up   { color: var(--ok); }
.kpi .delta.down { color: var(--err); }
.kpi .value.err { color: var(--err); }
.kpi .value.ok  { color: var(--ok); }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  padding: 6px 12px; border-radius: 2px; font-size: 12px; font-family: var(--mono); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent-line); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); color: #fff; }
.btn.danger  { color: var(--err); border-color: oklch(0.62 0.2 27 / 0.4); }
.btn:disabled, .btn.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* Equal-width / equal-height button grid for "shortcut" rows.
   Cells share width within each row; buttons stretch to match the
   tallest in their row; labels wrap rather than overflow. */
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  align-items: stretch;
}
.shortcut-grid > .btn {
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
  text-align: center;
  white-space: normal;
  min-height: 30px;
  line-height: 1.25;
}
@media (max-width: 480px) {
  .shortcut-grid { grid-template-columns: 1fr; }
}

/* ---------- Inputs ---------- */
.gvm-input, .gvm-textarea, .gvm-select {
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 2px; padding: 8px 10px;
  font-family: var(--mono); font-size: 13px;
  width: 100%; box-sizing: border-box;
}
.gvm-input:focus, .gvm-textarea:focus, .gvm-select:focus {
  outline: none; border-color: var(--accent-line);
}
.gvm-textarea { resize: vertical; min-height: 80px; }
.gvm-field { display: flex; flex-direction: column; gap: 4px; }
.gvm-field-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3);
}
.gvm-field-hint {
  text-transform: none; letter-spacing: 0; margin-left: 6px; color: var(--ink-3);
}
/* One emergency-contact slot: separated from the slot above it. */
.gvm-ec-slot { gap: 6px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.gvm-ec-slot:first-of-type { padding-top: 0; border-top: 0; }
/* emergency-contacts.js reveals slots out of source order, so the first
   *visible* slot — flagged with this class — is the one that drops the
   separator. Declared after :first-of-type to win the specificity tie. */
.gvm-ec-slot.gvm-ec-slot-first { padding-top: 0; border-top: 0; }

/* ---------- Tags / chips ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 11px; padding: 2px 7px;
  border-radius: 2px; border: 1px solid var(--line); color: var(--ink-2);
  background: var(--panel-2);
}
.tag.dot::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--ink-3); }
.tag.ok    { color: var(--ok);   border-color: oklch(0.7 0.14 150 / 0.3); }
.tag.ok::before    { background: var(--ok); }
.tag.warn  { color: var(--warn); border-color: oklch(0.78 0.14 80 / 0.3); }
.tag.warn::before  { background: var(--warn); }
.tag.err   { color: var(--err);  border-color: oklch(0.62 0.2 27 / 0.3); }
.tag.err::before   { background: var(--err); }
.tag.accent{ color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

.mini-chip {
  display: inline-block; padding: 1px 6px; font-family: var(--mono);
  font-size: 10px; border-radius: var(--radius); background: var(--panel-2);
  border: 1px solid var(--line); color: var(--ink-2);
}
.mini-chip .chip-remove {
  margin-left: 4px; color: var(--ink-3); text-decoration: none;
  font-weight: bold; line-height: 1;
}
.mini-chip .chip-remove:hover { color: var(--err); }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-weight: 500; font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3); font-family: var(--mono);
  padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.tbl th.text-right { text-align: right; }
.tbl th.text-center { text-align: center; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--panel-2); }
.tbl tr.selected td { background: var(--accent-soft); }
.tbl .mono { font-family: var(--mono); }
.tbl .dim { color: var(--ink-3); }

/* Wrap a wide table inside `<div class="tbl-scroll">…</div>` so the
   table scrolls horizontally inside its card on narrow viewports
   instead of pushing the whole page into horizontal scroll. */
.tbl-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.tbl-scroll .tbl { width: 100%; min-width: max-content; }

/* Narrow-viewport overflow safety: form controls cap at container
   width (defends against `min-width:240px` inputs on a 360px viewport),
   and long unbroken strings inside `<pre>`/`<code>` scroll within their
   own container instead of pushing the page into horizontal scroll. */
.gvm-input, .gvm-textarea, .gvm-select { max-width: 100%; }
/* Compact numeric input (e.g. a category's sort-order field in a table row). */
.gvm-input-narrow { width: 5.5rem; }
pre, code { overflow-x: auto; max-width: 100%; }

/* ---------- Layout helpers ---------- */
.row { display: flex; gap: 12px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

.diff-add { color: var(--ok); }
.diff-rm  { color: var(--err); }

.dim { color: var(--ink-3); }
.mono { font-family: var(--mono); }

/* ---------- Notice / inline messages ---------- */
.notice {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 2px;
  background: var(--panel-2); font-size: 12px; font-family: var(--mono);
}
.notice.warn { border-color: oklch(0.78 0.14 80 / 0.3); color: var(--warn); }
.notice.err  { border-color: oklch(0.62 0.2 27 / 0.3);  color: var(--err); }
.notice.ok   { border-color: oklch(0.7 0.14 150 / 0.3); color: var(--ok); }

/* ---------- CRT scanline overlay (dark only) ---------- */
.dir-terminal:not(.theme-light) .gvm-app::after {
  content: ""; pointer-events: none; position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 2px,
    oklch(1 0 0 / 0.018) 2px, oklch(1 0 0 / 0.018) 3px
  );
  mix-blend-mode: overlay;
  z-index: 100;
}

/* ---------- Dev-mode impersonation banner ---------- */
/* Sticky bar at the top of every authenticated page when DEV_AUTH_ENABLED
   is on. Amber so it's impossible to mistake for production chrome and
   easy to spot in any screenshot taken during dev capture. */
.gvm-dev-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  background: oklch(0.78 0.16 80);
  color: #1a1207;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  border-bottom: 1px solid oklch(0.6 0.14 70);
}
.gvm-dev-banner-label {
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 1px 6px;
  border: 1px solid #1a1207;
  border-radius: 2px;
}
.gvm-dev-banner-link {
  margin-left: auto;
  color: inherit;
  text-decoration: underline;
}

/* ---------- Incident report QR ----------
   The QR SVG always has a white background (so it scans cleanly under
   the dark theme too) and sizes to its container. Capped at ~360 px so
   the camera-app focus distance is sensible on phone screens. */
.incident-report-qr { max-width: 360px; margin: 0 auto; }
.incident-report-qr svg { display: block; width: 100%; height: auto; }
.incident-report-qr-frame { width: 100%; }
.incident-report-qr-counter {
  text-align: center;
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  letter-spacing: 0.04em;
}

/* ---------- Date picker ---------- */
.gvm-datepicker { position: relative; display: block; }
.gvm-datepicker.is-upgraded + .gvm-datepicker-native,
.gvm-datepicker-native.is-hidden { display: none; }

.gvm-datepicker-row {
  display: flex; gap: 6px; align-items: stretch;
}
.gvm-datepicker-typed {
  flex: 1 1 auto;
}
.gvm-datepicker-trigger {
  flex: 0 0 auto;
  min-width: 36px;
  padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1;
}

.gvm-datepicker-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius, 2px);
  padding: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  min-width: 260px;
  font-family: var(--mono);
  font-size: 12px;
  animation: gvm-datepicker-fade 80ms ease-out;
}
.gvm-datepicker-popover.no-anim { animation: none; }
@keyframes gvm-datepicker-fade {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}

.gvm-datepicker-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.gvm-datepicker-month-label {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-2);
}
.gvm-datepicker-nav {
  background: transparent; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 2px;
  width: 26px; height: 26px;
  font-family: var(--mono); font-size: 14px; line-height: 1;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.gvm-datepicker-nav:hover { color: var(--accent); border-color: var(--accent-line); }
.gvm-datepicker-nav:focus-visible {
  outline: 1px solid var(--accent); outline-offset: 1px;
}

.gvm-datepicker-weekdays,
.gvm-datepicker-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.gvm-datepicker-weekday {
  text-align: center; padding: 4px 0;
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3);
}
.gvm-datepicker-day {
  background: transparent; color: var(--ink);
  border: 1px solid transparent; border-radius: 2px;
  font-family: var(--mono); font-size: 12px;
  height: 30px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.gvm-datepicker-day:hover {
  border-color: var(--accent-line); color: var(--accent);
}
.gvm-datepicker-day:focus-visible {
  outline: 1px solid var(--accent); outline-offset: 1px;
}
.gvm-datepicker-day.is-other-month { color: var(--ink-3); }
.gvm-datepicker-day.is-today {
  border-color: var(--line);
  color: var(--accent);
}
.gvm-datepicker-day.is-selected {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.gvm-datepicker-day.is-selected:hover { color: #fff; filter: brightness(1.07); }
.gvm-datepicker-day.is-disabled {
  color: var(--ink-3);
  cursor: not-allowed;
  opacity: 0.45;
}
.gvm-datepicker-day.is-disabled:hover {
  border-color: transparent;
  color: var(--ink-3);
}

.gvm-datepicker-footer {
  display: flex; justify-content: space-between; gap: 6px;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--line-2);
}
.gvm-datepicker-footer .btn {
  padding: 4px 10px; font-size: 11px;
}

@media (max-width: 420px) {
  .gvm-datepicker-popover { min-width: calc(100vw - 32px); }
}

/* ---------- Mobile navigation drawer (<768px) ---------- */
/* Hamburger button: hidden on desktop, shown only at <768px in topbar. */
.gvm-hamburger {
  display: none;
  align-items: center; justify-content: center;
  flex: 0 0 32px;
  width: 32px; height: 32px;
  padding: 0; margin: 0;
  background: transparent; border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink-2); cursor: pointer;
}
.gvm-hamburger:hover { color: var(--accent); border-color: var(--accent-line); }
.gvm-hamburger:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.gvm-hamburger-bars {
  display: inline-flex; flex-direction: column; gap: 3px;
  width: 16px;
}
.gvm-hamburger-bars span {
  display: block; height: 2px; background: currentColor; border-radius: 1px;
}

/* Backdrop covers the page behind the drawer; only visible while open. */
.gvm-drawer-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 40;
}
body.drawer-open .gvm-drawer-backdrop { display: block; }

@media (max-width: 767px) {
  .gvm-hamburger { display: inline-flex; }

  /* Body becomes a single column; nav lives off-canvas as a fixed drawer. */
  .gvm-body { grid-template-columns: 1fr; }

  .gvm-nav {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(80vw, 320px);
    z-index: 50;
    border-right: 1px solid var(--line);
    background: var(--panel);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 180ms ease;
    -webkit-overflow-scrolling: touch;
  }
  body.drawer-open .gvm-nav { transform: translateX(0); }
  /* Lock background scroll while the drawer is open. */
  body.drawer-open { overflow: hidden; }

  /* Existing grid collapses, preserved from the old <960px rules. */
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- Upcoming Important Dates list (home page) ---------- */
.imp-dates-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.imp-dates-row {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: baseline;
}
.imp-dates-date {
  flex-shrink: 0;
  width: 12ch;
}
.imp-dates-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.imp-dates-content,
.imp-dates-content .announcement-body {
  overflow-wrap: anywhere;
}
.imp-dates-content .announcement-body img {
  max-width: 100%;
  height: auto;
}
@media (max-width: 599px) {
  .imp-dates-row {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .imp-dates-date {
    width: auto;
  }
}

/* ---------- Rendered-markdown tables ----------
   Markdown bodies rendered via `markdown_to_html()` (announcements,
   reports, the dashboard "Upcoming Important Dates" card, feedback notes)
   may contain GFM tables. Give every cell a collapsed border, and style
   the header row as a shaded header bar. The header row is whatever sits
   above the `|---|` delimiter line — GFM renders exactly that row as
   <thead>, so keying the bar off `thead th` needs no author marker. The
   wiki keeps its own `.wiki-content table` rules. */
.announcement-body table {
  border-collapse: collapse;
  margin: 0.6em 0;
  font-size: 13px;
}
.announcement-body th,
.announcement-body td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}
.announcement-body thead th {
  background: var(--panel-2);
  color: var(--ink);
  border-bottom-width: 2px;
}

/* ---------- Utility classes ----------
   Single-purpose utilities used by templates instead of inline `style`
   attributes. Defined at the bottom so they override component-scoped
   rules of equal specificity (e.g. `class="row gap-8"` beats `.row`'s
   default `gap: 12px`). Keep the set minimal — multi-property combos
   that aren't repeated should become a component class, not a utility. */

/* Typography */
.fs-10 { font-size: 10px; }
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.text-right { text-align: right; }
.label-caps { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }

/* Tone (color) — shared with Chunk-4 conditional class swap */
.tone-ok { color: var(--ok); }
.tone-warn { color: var(--warn); }
.tone-err { color: var(--err); }
.tone-dim { color: var(--ink-3); }
.tone-accent { color: var(--accent); }
.tone-ink { color: var(--ink); }
.tone-ink-2 { color: var(--ink-2); }

/* Flex / layout */
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.align-start { align-items: flex-start; }
.flex-wrap { flex-wrap: wrap; }

/* Gap */
.gap-0 { gap: 0; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-14 { gap: 14px; }

/* Margin */
.m-0 { margin: 0; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 4px; }
.mb-6 { margin-bottom: 6px; }
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-14 { margin-bottom: 14px; }
.mb-18 { margin-bottom: 18px; }
.mt-0 { margin-top: 0; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }

/* Max-width tokens (cards / forms) */
.mw-420 { max-width: 420px; }
.mw-540 { max-width: 540px; }
.mw-560 { max-width: 560px; }
.mw-680 { max-width: 680px; }
.mw-720 { max-width: 720px; }

/* Width / min-width */
.w-full { width: 100%; }
.min-w-100 { min-width: 100px; }
.min-w-240 { min-width: 240px; }
.min-w-280 { min-width: 280px; }
.min-w-320 { min-width: 320px; }
.flex-1 { flex: 1; }

/* Display */
.d-inline { display: inline; }
.d-none, .is-hidden { display: none; }

/* Composite: kv-row — repeated 21+ times for dense definition lists.
   The non-bordered variant (`.kv-row-plain`) is for the last item or
   for groups that handle their own separator. */
.kv-row {
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-2);
}
.kv-row-plain {
  justify-content: space-between;
  padding: 6px 0;
}

/* Composite: kv-list — `.col` variant with no gap and 13px font, used
   to stack `.kv-row`s into a definition list. */
.col-kv { gap: 0; font-size: 13px; }

/* Misc one-line utilities */
.cursor-pointer { cursor: pointer; }
.fw-normal { font-weight: normal; }
.fw-600 { font-weight: 600; }
.d-block { display: block; }
.align-self-start { align-self: flex-start; }
.align-self-end { align-self: flex-end; }
.align-self-center { align-self: center; }
.align-baseline { align-items: baseline; }
.gap-2 { gap: 2px; }
.gap-18 { gap: 18px; }
.gap-22 { gap: 22px; }
.mt-4 { margin-top: 4px; }
.mt-18 { margin-top: 18px; }
.mb-12 { margin-bottom: 12px; }
.mr-4 { margin-right: 4px; }
.ml-6 { margin-left: 6px; }
.ml-8 { margin-left: 8px; }
.ml-auto { margin-left: auto; }
.pt-10 { padding-top: 10px; }
.white-space-pre { white-space: pre-wrap; }
.white-space-normal { white-space: normal; }
.box-border { box-sizing: border-box; }

/* ---------- Component classes (page-scoped) ----------
   Multi-property styles tied to a specific layout / page that don't
   collapse onto generic utilities. Named after their context to keep
   blast radius local. */

/* admin/noons/detail.html — feedback author group card and per-item
   row separator. */
.gvm-noon-author-card {
  padding: 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
}
.gvm-noon-author-item {
  border-top: 1px dashed var(--line-2);
  padding-top: 6px;
}

/* admin/noons/index.html — sponsor group-header row introducing each
   per-sponsor section of the cohort table. */
.gvm-noon-sponsor-row td {
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}

/* admin/reports/list.html — "danger zone" archive-all card with the
   error-tone outline. */
.gvm-danger-zone {
  margin-bottom: 18px;
  border-color: oklch(0.62 0.2 27 / 0.4);
}

/* admin/discord.html — inline constraint-warning box inside the role
   inspector card. */
.gvm-constraint-box {
  padding: 10px;
  background: var(--panel-2);
  border-radius: 2px;
}

/* admin/discord.html — split-grid layouts at 1.1fr/1fr (managed-roles
   table + inspector) and 1.3fr/1fr (live diff + status policy). */
.grid-2-11-10 { grid-template-columns: 1.1fr 1fr; }
.grid-2-13-10 { grid-template-columns: 1.3fr 1fr; }

/* _nav.html — logout form spacing in the left nav. */
.gvm-nav-logout-form { margin: 8px 6px 0; }

/* roster/detail.html — visual divider between info sections inside a card. */
.gvm-section-divider {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-2);
}

/* feedback/picker.html — Noon list using a stripped-down <ul> with the
   kv-row separator pattern at 8px padding (not the 6px kv-row default). */
.list-reset { list-style: none; padding: 0; margin: 8px 0 0; }
.list-reset-flat { list-style: none; padding: 0; margin: 0; }
.gvm-feedback-row {
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-2);
}

/* profile.html — push-subscription row label that wraps long device
   labels rather than overflowing. */
.gvm-push-row-label {
  font-size: 12px;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* profile.html — bold the label of the push subscription row that
   matches the current browser's endpoint. JS adds .this-device to the
   <li>; styling lives here so the JS doesn't need to write inline
   styles. */
.push-device-row.this-device .gvm-push-row-label { font-weight: 600; }

/* ---------- QR login (story 5) ---------- */
.qr-login-card {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}
.qr-login-qr {
  background: #fff;
  padding: 16px;
  border-radius: var(--radius);
  display: inline-block;
  margin: 8px auto 16px;
  max-width: 100%;
}
.qr-login-qr svg {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
}
.qr-login-fallback { margin-bottom: 12px; }
.qr-login-fallback-label { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.qr-login-fallback-code {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 4px;
  margin: 0;
  word-break: keep-all;
}
.qr-login-hint { font-size: 13px; color: var(--ink-2); margin-top: 12px; }
.qr-login-confirm-h2 { font-size: 18px; margin: 0 0 12px; }
.qr-login-confirm-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 12px;
  row-gap: 4px;
  font-size: 13px;
  text-align: left;
  margin: 0 auto 16px;
  max-width: 360px;
}
.qr-login-confirm-meta dt { color: var(--ink-3); }
.qr-login-confirm-meta dd { margin: 0; overflow-wrap: anywhere; }
.qr-login-ua { font-size: 11px; }
.qr-login-confirm-warn { font-size: 13px; color: var(--warn); margin: 0 0 12px; }
.qr-login-consumed {
  font-size: 18px;
  font-weight: 600;
  color: var(--ok, var(--accent));
  margin: 0 0 8px;
}

.qr-login-code-input {
  display: block;
  width: 100%;
  max-width: 240px;
  margin: 12px auto 0;
  padding: 10px 12px;
  font-size: 24px;
  letter-spacing: 4px;
  text-align: center;
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-sizing: border-box;
}
.qr-login-code-input:focus {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent-line);
}
.qr-login-code-actions {
  justify-content: center;
  margin-top: 16px;
}

@media (max-width: 480px) {
  .qr-login-fallback-code { font-size: 22px; letter-spacing: 3px; }
  .qr-login-qr svg { max-width: 220px; }
  .qr-login-code-input { font-size: 20px; letter-spacing: 3px; }
}

/* ── Dry-run preview ───────────────────────────────────────────────── */
.dry-run-preview-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}
.dry-run-preview-summary-item {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 110px;
}
.dry-run-preview-status {
  margin-bottom: 12px;
}
.dry-run-preview-skeleton {
  padding: 10px 14px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--panel-2);
  animation: dry-run-preview-pulse 1.4s ease-in-out infinite;
}
.dry-run-preview-skeleton:not([hidden]) {
  display: inline-block;
}
.dry-run-preview-status [hidden] {
  display: none !important;
}
@keyframes dry-run-preview-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.dry-run-preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.dry-run-preview-table td {
  vertical-align: top;
}
.dry-run-preview-filters {
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}
.dry-run-preview-filters:not([hidden]) {
  display: flex;
}
.dry-run-preview-filters .gvm-field {
  min-width: 140px;
}
.dry-run-preview-checkbox {
  padding-bottom: 6px;
}
.dry-run-preview-sort {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dry-run-preview-sort::after {
  content: "↕";
  color: var(--ink-3);
  font-size: 11px;
}
.dry-run-preview-sort[aria-sort="ascending"]::after {
  content: "↑";
  color: var(--accent);
}
.dry-run-preview-sort[aria-sort="descending"]::after {
  content: "↓";
  color: var(--accent);
}
.dry-run-preview-table th.text-right .dry-run-preview-sort {
  justify-content: flex-end;
  width: 100%;
}

/* --- Wiki ---------------------------------------------------------- */

.wiki-content {
  line-height: 1.55;
}
.wiki-content h1,
.wiki-content h2,
.wiki-content h3,
.wiki-content h4,
.wiki-content h5,
.wiki-content h6 {
  font-family: var(--mono);
  font-weight: 600;
  line-height: 1.25;
  margin: 1em 0 0.5em;
}
.wiki-content h1 { font-size: 2em; }
.wiki-content h2 { font-size: 1.5em; }
.wiki-content h3 { font-size: 1.25em; }
.wiki-content h4 { font-size: 1.1em; }
.wiki-content h5 { font-size: 1em; }
.wiki-content h6 { font-size: 0.9em; color: var(--ink-3); }
/* Section dividers: a horizontal rule under the major section headings
   (Wikipedia-style). Separates sections visually, and keeps each boundary
   readable when a section is collapsed down to just its heading. */
.wiki-content h1,
.wiki-content h2 {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.2em;
}
.wiki-content img {
  max-width: 100%;
  height: auto;
}
.wiki-content table {
  border-collapse: collapse;
  margin: 1em 0;
}
.wiki-content th,
.wiki-content td {
  border: 1px solid var(--ink-3);
  padding: 4px 10px;
  text-align: left;
}
.wiki-content pre {
  background: var(--panel-2);
  padding: 10px 12px;
  overflow-x: auto;
}
.wiki-content code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95em;
}
.wiki-content .task-list-item-checkbox {
  margin-right: 6px;
  vertical-align: middle;
}
.wiki-breadcrumbs {
  font-family: "JetBrains Mono", monospace;
  color: var(--ink-3);
  font-size: 13px;
}
.wiki-banner {
  padding: 10px 14px;
  margin-bottom: 14px;
  border-left: 3px solid var(--accent);
  background: var(--panel-2);
}
.wiki-link {
  color: var(--accent);
  text-decoration: underline;
}
.wiki-link-missing {
  color: var(--err);
  font-style: italic;
  text-decoration: underline dotted;
}

/* --- Table of contents + section layout (Wikipedia-style) ----------------
   The page renders an empty `<nav class="wiki-toc" hidden>` as the first
   child of `.wiki-layout`; wiki-toc.js fills it and adds `.has-toc`, which
   turns the layout into a two-column grid (TOC rail left, article right).
   Without JS, with `__NOTOC__`, or with too few headings, `.has-toc` is never
   added and the article keeps the full width. */
.wiki-layout {
  min-width: 0;
}
.wiki-layout.has-toc {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
/* min-width:0 lets wide <pre>/tables shrink instead of blowing out the grid. */
.wiki-layout.has-toc > .wiki-content {
  min-width: 0;
}
/* Anchored headings shouldn't hide under the sticky topbar when jumped to. */
.wiki-content :is(h1, h2, h3, h4, h5, h6) {
  scroll-margin-top: 1rem;
}

.wiki-toc {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 6rem);
  overflow: auto;
  font-family: var(--mono);
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 10px 12px;
}
.wiki-toc-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-2);
}
.wiki-toc-title {
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}
.wiki-toc-toggle {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.wiki-toc-toggle:hover {
  text-decoration: underline;
}
/* Nested numbered list. counters() yields hierarchical 1, 1.1, 1.1.1. */
.wiki-toc-list,
.wiki-toc-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: wiki-toc;
}
.wiki-toc-list ul {
  margin-left: 0.85em;
}
.wiki-toc-list li {
  counter-increment: wiki-toc;
}
.wiki-toc-link {
  display: block;
  padding: 2px 0;
  color: var(--ink-2);
  text-decoration: none;
  line-height: 1.35;
}
.wiki-toc-link::before {
  content: counters(wiki-toc, ".") "  ";
  color: var(--ink-3);
}
.wiki-toc-link:hover {
  color: var(--ink);
  text-decoration: underline;
}
.wiki-toc-link.active {
  color: var(--accent);
  font-weight: 600;
}
/* Narrow screens: the rail can't stick beside the article — drop to a single
   column with the TOC as a box on top (its DOM position is already first, so
   it stacks above the content). Matches the app's other wiki breakpoint. */
@media (max-width: 760px) {
  .wiki-layout.has-toc {
    display: block;
  }
  .wiki-toc {
    position: static;
    max-height: none;
    margin-bottom: 18px;
  }
}

/* Collapsible sections — a chevron toggle injected at the start of each heading
   by wiki-toc.js. Default expanded; `.wiki-collapsed` (set on the hidden
   sibling run, never by re-parenting) drops nodes out of flow. */
.wiki-section-toggle {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-3);
  font: inherit;
  padding: 0;
  margin-right: 0.4em;
  line-height: 1;
}
.wiki-section-toggle::before {
  content: "\25B8"; /* ▸ */
  display: inline-block;
  transition: transform 0.12s ease;
}
.wiki-section-toggle[aria-expanded="true"]::before {
  transform: rotate(90deg);
}
.wiki-section-toggle:hover,
.wiki-section-toggle:focus-visible {
  color: var(--accent);
}
.wiki-collapsed {
  display: none;
}

/* Per-section permalink — a "§" link injected at the end of each heading by
   wiki-toc.js, revealed on heading hover / focus (kept space-reserved so it
   doesn't shift the heading text when it appears). */
.wiki-section-anchor {
  margin-left: 0.4em;
  color: var(--ink-3);
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.1s ease;
}
.wiki-section-anchor::before {
  content: "\00A7"; /* § */
}
.wiki-content :is(h1, h2, h3, h4, h5, h6):hover .wiki-section-anchor,
.wiki-content :is(h1, h2, h3, h4, h5, h6):focus-within .wiki-section-anchor,
.wiki-section-anchor:focus-visible {
  opacity: 1;
}
.wiki-section-anchor:hover {
  color: var(--accent);
}

/* PDF embed block — same-origin iframe to the browser PDF viewer, with
   a sibling download-fallback link. The iframe is sandboxed at the
   strictest setting (sandbox=""). If a future browser breaks the
   embed entirely the download link is always there. */
.wiki-pdf-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0;
}
.wiki-pdf-embed {
  width: 100%;
  aspect-ratio: 8.5 / 11;
  max-width: 100ch;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.wiki-pdf-download {
  font-size: 13px;
  color: var(--accent);
}
.wiki-pdf-missing {
  color: var(--err);
  font-style: italic;
  border-left: 3px solid var(--err);
  padding: 8px 12px;
  background: rgba(204, 102, 102, 0.08);
}

.wiki-banner-deleted {
  border-left-color: var(--err);
  background: rgba(204, 102, 102, 0.08);
}
.wiki-banner-deleted .btn {
  margin-left: 12px;
}

/* `inline-form` keeps a single-button form on the same line as
   surrounding inline-flex content (banner text, action rows). Forms are
   block-level by default which would push the button onto its own
   line. */
.inline-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}
.wiki-page-actions {
  align-items: center;
}

.wiki-editor-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.wiki-editor-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.wiki-editor-textarea {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  min-height: 360px;
  resize: vertical;
}
.wiki-editor-preview-target {
  border: 1px solid var(--ink-3);
  background: var(--panel-2);
  padding: 10px 12px;
  min-height: 360px;
  overflow-x: auto;
}
@media (max-width: 760px) {
  .wiki-editor-panes {
    grid-template-columns: 1fr;
  }
}

.wiki-index-search {
  flex: 1;
}
.wiki-index-search .gvm-input {
  width: 100%;
}
.wiki-index-section {
  margin-bottom: 24px;
}
.wiki-index-heading {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: var(--ink-3);
  text-transform: lowercase;
  letter-spacing: 0.05em;
  margin: 0 0 8px;
}
.wiki-index-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.wiki-index-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-2);
}
.wiki-index-item:last-child {
  border-bottom: none;
}
.wiki-index-link {
  color: var(--accent);
  text-decoration: none;
}
.wiki-index-link:hover {
  text-decoration: underline;
}

.wiki-search-form .wiki-search-input {
  flex: 1;
}
.wiki-search-results {
  list-style: none;
  padding: 0;
  margin: 0;
}
.wiki-search-hit {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.wiki-search-title {
  color: var(--accent);
  font-size: 16px;
  text-decoration: none;
}
.wiki-search-title:hover {
  text-decoration: underline;
}
.wiki-search-path {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}
.wiki-search-snippet {
  margin-top: 4px;
  color: var(--ink-2);
  line-height: 1.5;
}
.wiki-search-snippet b {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.wiki-search-empty {
  padding: 14px 0;
}

.wiki-tag-chips {
  margin-top: 18px;
  flex-wrap: wrap;
}
.wiki-tag-chip {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--ink-3);
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--ink-2);
  text-decoration: none;
}
.wiki-tag-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.wiki-editor-tag-field {
  position: relative;
}
.wiki-tag-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--panel-2);
  border: 1px solid var(--ink-3);
  border-top: none;
  max-height: 240px;
  overflow-y: auto;
  z-index: 10;
}
.wiki-tag-autocomplete-item {
  padding: 6px 10px;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
}
.wiki-tag-autocomplete-item:hover {
  background: var(--line-2);
  color: var(--accent);
}

.sponsor-field {
  position: relative;
}
.sponsor-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--panel-2);
  border: 1px solid var(--ink-3);
  border-top: none;
  max-height: 240px;
  overflow-y: auto;
  z-index: 10;
}
.sponsor-autocomplete-item {
  padding: 6px 10px;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
}
.sponsor-autocomplete-item:hover {
  background: var(--line-2);
  color: var(--accent);
}

.wiki-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.wiki-history-table th,
.wiki-history-table td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid var(--ink-3);
  vertical-align: top;
}
.wiki-history-table th {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wiki-banner-historical {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}
.wiki-diff {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  background: var(--panel-2);
  border: 1px solid var(--ink-3);
  padding: 10px 12px;
  overflow-x: auto;
}
.wiki-diff .diff-line {
  display: block;
  white-space: pre;
}
.wiki-diff .diff-add {
  background: rgba(102, 204, 102, 0.12);
  color: var(--ok);
}
.wiki-diff .diff-del {
  background: rgba(204, 102, 102, 0.12);
  color: var(--err);
}
.wiki-diff .diff-context {
  color: var(--ink-2);
}
.wiki-diff .diff-hunk {
  color: var(--ink-3);
  background: var(--line-2);
}

/* Avatar — square, rounded corners, content cropped to fill the box.
   Used by `_shared/_avatar.html`. */
.avatar {
  display: inline-block;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--line-2);
  flex-shrink: 0;
  vertical-align: middle;
}
.avatar-sm {
  width: 32px;
  height: 32px;
}
.avatar-lg {
  width: 96px;
  height: 96px;
  border-radius: var(--radius);
}

/* Profile-page avatar uploader: side-by-side preview + form. The
   controls column grows to fill, while the preview stays at the lg
   avatar's natural 96 px. No inline styles per CLAUDE.md rule 9. */
.avatar-uploader-preview {
  flex-shrink: 0;
}
.avatar-uploader-controls {
  flex: 1;
  min-width: 0;
}

/* Display-name pattern: primary effective name with an optional
   secondary muted handle on the next line, for list/table rows where
   the chosen handle differs from the displayed effective name. */
.gvm-name {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.25;
}
.gvm-name-primary {
  color: var(--ink);
}
.gvm-name-secondary {
  color: var(--ink-3);
  font-size: 12px;
  font-family: var(--mono);
}

/* ---------- Feedback / Bug report admin queue + detail ---------- */
.gvm-nav-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--ink-on-accent, #0c0c0c);
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 600;
  line-height: 1.4;
  min-width: 18px;
  text-align: center;
}
.gvm-feedback-preview {
  max-width: 480px;
}
.gvm-feedback-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 13px;
  margin: 0;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.gvm-kv {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 6px 16px;
  margin: 0;
}
.gvm-kv dt {
  color: var(--ink-3);
  font-size: 12px;
  font-family: var(--mono);
}
.gvm-kv dd {
  margin: 0;
}

/* ---------- Floating Report widget (Bug & Feedback) ---------- */
/* z-index 9000 is well above existing UI (highest currently in use is
   200 — see the topbar/drawer rules above) so the widget overlays
   page content without fighting any other modal-style chrome. */
.gvm-feedback-fab {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 9000;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink-on-accent, #0c0c0c);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.gvm-feedback-fab:hover,
.gvm-feedback-fab:focus-visible {
  filter: brightness(1.1);
  outline: none;
}
/* Reserve scroll space at the bottom of the page so the fixed FAB never
   overlaps the last row of content — e.g. the right-aligned "update"
   button on the roster detail admin card, the case that prompted this.
   Scoped to .has-feedback-fab (set in base.html from the same predicate
   that renders the widget) so non-reporter pages get no dead space.
   FAB clearance: 44px height + 16px bottom gap + 16px breathing room. */
.gvm-app.has-feedback-fab .gvm-main {
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}
.gvm-feedback-fab-glyph {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
}

.gvm-feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 9001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 16px;
}
.gvm-feedback-modal[hidden] { display: none; }
.gvm-feedback-modal-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  width: min(540px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gvm-feedback-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.gvm-feedback-modal-close {
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  color: var(--ink-3);
  border: none;
  font-size: 22px;
  cursor: pointer;
}
.gvm-feedback-modal-close:hover,
.gvm-feedback-modal-close:focus-visible {
  color: var(--ink);
  outline: none;
}

.gvm-feedback-toast {
  position: fixed;
  right: 16px;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  z-index: 9002;
  padding: 10px 14px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.gvm-feedback-toast[hidden] { display: none; }

/* Full-screen sheet on small viewports — soft keyboard + tiny tap
   targets are the failure modes the centered dialog has. */
@media (max-width: 639px) {
  .gvm-feedback-modal {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }
  .gvm-feedback-modal-panel {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .gvm-feedback-fab {
    /* Slim down the label on narrow screens so the FAB doesn't
       overlap page-level bottom chrome. */
    padding: 10px 14px;
  }
}

/* ---------- Offline download panel ---------- */
.offline-progress-track {
  height: 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel-2);
  overflow: hidden;
}
.offline-progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.2s ease;
}
.offline-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 0;
}
.offline-stat dt { margin-bottom: 2px; }
.offline-stat dd { font-family: var(--mono); }

.offline-stale {
  border-color: oklch(0.78 0.14 80 / 0.3);
  color: var(--warn);
}

/* ---------- Global offline banner + read-only affordances ---------- */
/* Hidden by default; a bare `.gvm-offline-banner { display: flex }` would
   beat the `[hidden]`/`.is-hidden` rules (author + later in source) and show
   the banner on every page. Visibility is driven off the `.gvm-offline` root
   class that offline-banner.js toggles — same pattern as the hooks below. */
.gvm-offline-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--panel-2);
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
}
.gvm-offline .gvm-offline-banner { display: flex; }
.gvm-offline-banner-dot { color: var(--warn); }

/* Progressive-enhancement hooks toggled by offline-banner.js. The server
   routes stay protected regardless — this is purely so users don't dead-end
   on controls that need a connection. */
.gvm-offline [data-offline-only] { display: revert; }
[data-offline-only] { display: none; }
.gvm-offline [data-offline-disable] {
  opacity: 0.4;
  pointer-events: none;
}

/* Conference headcount trend (Chunk 7). Colour comes from these classes, never
   inline fill=/style= attributes, so the server-rendered SVG stays CSP-clean. */
.gvm-trend-svg { width: 100%; max-width: 100%; height: auto; }
.gvm-trend-bar { fill: var(--accent); }
.gvm-trend-count { fill: var(--ink); font: 10px var(--mono); }
.gvm-trend-label { fill: var(--ink); opacity: 0.55; font: 10px var(--mono); }
