/* Shadow RolePlay. Clean and readable: one typeface, one accent, no effects. */
:root {
  --bg: #0c0c0d;
  --bg-2: #111113;
  --surface: #161618;
  --surface-2: #1e1e21;
  --border: #2a2a2e;
  --border-strong: #3a3a40;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --dim: #71717a;
  /* The logo is black and white, so the accent is bone white; colour is kept for status only. */
  --accent: #f4f4f5;
  --accent-hi: #ffffff;
  --on-accent: #0c0c0d;
  --ok: #4ade80;
  --warn: #facc15;
  --bad: #f87171;
  --discord: #5865f2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* Blocky display face, close to the SHADOW lettering in the logo. */
  --display: 'Russo One', 'Inter', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--text); text-decoration: underline; text-decoration-color: rgba(244, 244, 245, 0.35); text-underline-offset: 3px; }
a:hover { color: #fff; text-decoration-color: #fff; }
.btn, .nav a, .brand, .card, .chip, .toc a, .p-nav-link, .footer-links a, .account-menu a, .text-link, .step-link { text-decoration: none; }
img { max-width: 100%; }
::selection { background: var(--accent); color: #111; }

h1, h2, h3, .h2, .h3, .h4 { font-weight: 700; line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1, h2, .h2 { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.01em; line-height: 1.1; }
h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
h2, .h2 { font-size: clamp(1.45rem, 2.6vw, 1.95rem); }
h3, .h3 { font-size: 1.125rem; letter-spacing: -0.01em; }
.h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85em; }
code { background: var(--surface-2); padding: 0.1em 0.4em; border-radius: 6px; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.pre { white-space: pre-wrap; }
.text-bad { color: var(--bad); }
.dim { opacity: 0.55; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 99; background: var(--surface); padding: 0.5rem 1rem; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); }
.section { padding: 56px 0; }
.pad-xl { padding: 112px 0; }
.section-head { margin-bottom: 28px; max-width: 680px; }
.section-head h1, .section-head h2 { margin-bottom: 0.3em; }
.section-head p:last-child { margin-bottom: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
/* A small spiked badge, after the logo's ring. */
.eyebrow::before { content: ''; width: 12px; height: 12px; flex: none; background: var(--text); clip-path: polygon(50% 0, 61% 30%, 93% 25%, 72% 50%, 93% 75%, 61% 70%, 50% 100%, 39% 70%, 7% 75%, 28% 50%, 7% 25%, 39% 30%); }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.text-link:hover { color: #fff; }
.ico { width: 22px; height: 22px; flex: none; }
.ico-sm { width: 16px; height: 16px; }
.icon { width: 1.15em; height: 1.15em; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em; justify-content: center;
  padding: 0.7em 1.15em; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: 600 0.95rem/1.2 var(--font); color: var(--text); background: var(--surface-2);
  cursor: pointer; text-decoration: none !important; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: #26262a; color: var(--text); }
.btn-sm { padding: 0.45em 0.8em; font-size: 0.85rem; }
.btn-lg { padding: 0.85em 1.4em; font-size: 1rem; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: #fff; color: var(--on-accent); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12); }
.btn-ghost { background: transparent; border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface); border-color: var(--muted); }
.btn-discord { background: var(--discord); color: #fff; }
.btn-discord:hover { background: #4752c4; color: #fff; }
.btn-danger { background: transparent; border-color: rgba(248, 113, 113, 0.5); color: var(--bad); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.1); color: var(--bad); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(12, 12, 13, 0.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.brand:hover { color: var(--text); }
.logo-mark { width: 38px; height: 38px; object-fit: contain; }
.wordmark { font: 400 1.05rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }
.wordmark b { color: var(--muted); font-weight: 400; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav > a { color: var(--muted); padding: 8px 12px; border-radius: var(--radius-sm); font-weight: 500; font-size: 0.93rem; }
.nav > a:hover, .nav > a.active { color: var(--text); background: var(--surface); text-decoration: none; }
.nav .nav-discord { display: inline-flex; align-items: center; gap: 6px; }
.nav .btn { margin-left: 8px; }
.nav > a.btn, .nav > a.btn:hover { color: var(--on-accent); background: var(--accent); }
.nav-toggle, .nav-burger { display: none; }
.account-menu { position: relative; margin-left: 8px; }
.account-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 5px 10px 5px 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-weight: 500; font-size: 0.9rem; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary img { border-radius: 50%; }
.account-menu .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; box-shadow: var(--shadow); }
.account-menu .menu a, .account-menu .menu button { display: block; width: 100%; text-align: left; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text); background: none; border: 0; font: inherit; font-size: 0.9rem; cursor: pointer; }
.account-menu .menu a:hover, .account-menu .menu button:hover { background: var(--surface-2); text-decoration: none; }

@media (max-width: 1000px) {
  .nav-burger { display: block; margin-left: auto; width: 40px; height: 40px; position: relative; cursor: pointer; border-radius: var(--radius-sm); }
  .nav-burger span, .nav-burger span::before, .nav-burger span::after { position: absolute; left: 9px; width: 22px; height: 2px; border-radius: 2px; background: var(--text); content: ''; }
  .nav-burger span { top: 19px; }
  .nav-burger span::before { top: -7px; left: 0; }
  .nav-burger span::after { top: 7px; left: 0; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 8px 16px 16px; }
  .nav > a { padding: 12px; }
  .nav-toggle:checked ~ .nav { display: flex; }
  .nav .btn, .account-menu { margin: 8px 0 0; }
  .account-menu .menu { position: static; margin-top: 6px; box-shadow: none; }
}

/* Home hero: centred logo, one line, two actions, live status. */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: 64px 0 120px; text-align: center; background: radial-gradient(55% 65% at 50% 25%, rgba(255, 255, 255, 0.07), transparent 70%); border-bottom: 1px solid var(--border); }
/* The desert from the logo's background, in greys. */
.hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 240px; z-index: -1; background: url('/static/desert.svg') bottom center / cover no-repeat; }
.hero-inner { display: flex; flex-direction: column; align-items: center; }
.hero-logo { width: 250px; height: auto; margin-bottom: 26px; filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.6)) drop-shadow(0 18px 40px rgba(0, 0, 0, 0.7)); }
.hero h1 { max-width: 760px; }
.lead { font-size: 1.15rem; color: #d4d4d8; max-width: 620px; margin-bottom: 28px; }
.hero .cta-row { justify-content: center; }
.status-bar { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 32px 0 0; padding: 0; }
.status-bar li { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }
.status-bar strong { color: var(--text); font-weight: 600; }
@media (max-width: 640px) { .hero { padding: 40px 0 96px; } .hero-logo { width: 180px; } .hero::after { height: 160px; } }

/* Live stat tiles (status page). */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat dt { font-size: 0.8rem; color: var(--muted); }
.stat dd { margin: 4px 0 0; font-size: 1.5rem; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat small { font-size: 0.95rem; color: var(--muted); font-weight: 500; }
.stat-text { font-size: 1.05rem; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot-on { background: var(--ok); box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2); }
.dot-off { background: var(--bad); }
.dot-soon { background: var(--warn); }

/* Cards & grids */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid + .grid { margin-top: 16px; }
@media (max-width: 960px) { .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.section-foot { margin: 24px 0 0; }
.section-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.section-row .section-head { margin-bottom: 28px; }
.section-row > .text-link { margin-bottom: 30px; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.step { display: flex; flex-direction: column; }
.step p { flex: 1; }
.step-n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 400 1rem/1 var(--display); margin-bottom: 14px; }
.steps-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .steps-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.step-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.95rem; color: var(--text); }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

/* Features */
.feature h3 { margin: 14px 0 6px; }
.feature p { margin: 0; }
.feature-icon { flex: none; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); }
.feature-card { display: flex; gap: 16px; align-items: flex-start; }
.feature-card .checks { margin-top: 4px; }
.feature-card .checks li { margin: 6px 0; }
/* Older pillar markup (kept for safety). */
.pillar-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 14px; }
.news h3 { font-size: 1.05rem; }
.news p:last-child { margin-bottom: 0; color: #d4d4d8; }
.news-list { display: grid; gap: 16px; }

.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 20px 24px; flex-wrap: wrap; padding: 32px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.cta-band h2 { margin-bottom: 0.2em; font-size: 1.5rem; }
.cta-band p { margin: 0; }

/* Inner page header */
.page-hero { padding: 56px 0 8px; border-bottom: 1px solid var(--border); background: radial-gradient(50% 120% at 80% 0%, rgba(255, 255, 255, 0.05), transparent 70%); }
.page-hero .section-head { margin-bottom: 40px; }
.page-hero .eyebrow a { color: inherit; }

/* Departments */
/* Fallbacks for the game's department colours (app.js sets --dept from data-dept-colour). */
.dept-sast { --dept: #c9a227; }
.dept-lspd { --dept: #2f6fdb; }
.dept-lssd { --dept: #3b7d3b; }
.dept-bcso { --dept: #8a5a2b; }
.dept-safr { --dept: #f87171; }
.dept-doj { --dept: #c084fc; }
.dept-civilian { --dept: #4ade80; }
.dept { display: flex; align-items: center; gap: 14px; padding: 18px; color: var(--text); transition: border-color 0.15s, background 0.15s; }
.dept:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); text-decoration: none; }
.dept-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.dept-text strong { font-weight: 600; line-height: 1.3; }
.dept-arrow { color: var(--dim); transition: transform 0.15s, color 0.15s; }
.dept:hover .dept-arrow { color: var(--text); transform: translateX(3px); }
/* Game colours can be dark; --dept-ink is a lighter tone of it for text and icons on the dark page. */
[class*="dept-"] { --dept-ink: color-mix(in srgb, var(--dept, var(--accent)) 62%, #fff); }
.dept-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 10px; color: var(--dept-ink, var(--accent)); background: color-mix(in srgb, var(--dept, var(--accent)) 18%, transparent); border: 1px solid color-mix(in srgb, var(--dept, var(--accent)) 30%, transparent); }
.dept-icon-lg { width: 64px; height: 64px; border-radius: 14px; }
.dept-icon-lg .ico { width: 32px; height: 32px; }
.dept-hero .eyebrow { color: var(--dept-ink); }
.dept-hero .eyebrow::before { background: var(--dept-ink); }
.dept-hero { background: radial-gradient(60% 140% at 85% 0%, color-mix(in srgb, var(--dept, #fff) 16%, transparent), transparent 70%); border-bottom-color: color-mix(in srgb, var(--dept, #fff) 30%, var(--border)); }
.dept-title { display: flex; gap: 18px; align-items: center; padding-bottom: 40px; }
.dept-title > div { flex: 1; min-width: 0; }
.dept-title .dept-apply { flex: none; align-self: center; }
.dept-title h1 { margin-bottom: 0.15em; }
.dept-title .lead { margin: 0; }
.doc-layout.doc-layout-wide { grid-template-columns: 1fr 320px; }
.doc-layout-wide > div > .card + .card { margin-top: 16px; }
.doc-layout-wide aside .btn { margin-top: 8px; width: 100%; }
@media (max-width: 800px) { .doc-layout.doc-layout-wide { grid-template-columns: 1fr; } .dept-title { flex-direction: column; align-items: flex-start; } .dept-title .dept-apply { align-self: stretch; } }
.dept-motto { font-style: italic; }
.dept-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 0; padding: 0; color: var(--muted); font-size: 0.9rem; }
.dept-facts li { display: inline-flex; align-items: center; gap: 6px; }
.dept-facts .ico { color: var(--dept-ink); }
.dept-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--dept, var(--accent)); }
.dept-soon { align-self: flex-start; margin-top: 6px; text-transform: none; }
.dept-coming { border-style: dashed; }
.dept-section .section-head { margin-bottom: 20px; }
.dept-layout > div > .card + .card, .dept-layout > div > .card + .roster-card { margin-top: 16px; }
.dept-aside { display: flex; flex-direction: column; gap: 16px; }
.dept-aside .card { margin: 0; }
.dept-aside .chips { margin-bottom: 0; }
.dept-aside .chip { text-transform: none; }
.apply-card { border-color: color-mix(in srgb, var(--dept, var(--accent)) 45%, var(--border)); background: linear-gradient(160deg, color-mix(in srgb, var(--dept, #fff) 12%, var(--surface)), var(--surface) 70%); }
.division-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.division { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--dept, var(--accent)); }
.division p { margin: 0; }
.division p + p { margin-top: 4px; }
.division-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.division-name .badge { text-transform: none; letter-spacing: 0.04em; }
@media (max-width: 620px) { .division-grid { grid-template-columns: 1fr; } }
.stations { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.stations li { display: flex; gap: 12px; align-items: flex-start; }
.stations p { margin: 0; }
.station-icon { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 8px; color: var(--dept-ink); background: color-mix(in srgb, var(--dept, var(--accent)) 16%, transparent); }
.station-name .badge { margin-left: 6px; text-transform: none; }
.ladder { display: grid; gap: 14px; }
.ladder-title { margin: 0 0 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dept-ink, var(--muted)); }
.ladder-list { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid color-mix(in srgb, var(--dept, var(--accent)) 50%, transparent); display: grid; gap: 4px; }
.ladder-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 0.9rem; line-height: 1.35; }
.ladder-short { color: var(--dim); font-size: 0.8rem; white-space: nowrap; }
.ladder-entry .ladder-rank::after { content: ' · entry'; color: var(--dim); font-size: 0.8rem; }
.roster-card { overflow-x: auto; position: relative; }
.roster-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; flex-wrap: wrap; }
.roster-head h2 { margin: 0; }
.roster td { white-space: nowrap; }
.duty { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.dept-source { margin-top: 20px; }
/* Penal code */
.penal-classes { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.penal-classes li { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
@media (max-width: 760px) { .penal-classes { grid-template-columns: 1fr; } }
.penal-toc { margin: -8px 0 24px; }
.penal-toc .chip { text-transform: none; }
.penal-group { scroll-margin-top: 90px; }
.penal-table td:first-child { white-space: nowrap; }
.more-title { margin: 44px 0 16px; color: var(--muted); }

/* Rules & FAQ */
.doc-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.toc { position: sticky; top: 84px; display: flex; flex-direction: column; padding: 10px; }
.toc a { color: var(--muted); padding: 7px 10px; border-radius: var(--radius-sm); font-size: 0.93rem; }
.toc a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.doc-section { margin-bottom: 16px; scroll-margin-top: 84px; }
.doc-section h2 { font-size: 1.3rem; }
.doc-section ol, .doc-section ul { padding-left: 1.3em; margin: 0; }
.doc-section li { margin: 0.45em 0; color: #d4d4d8; }
@media (max-width: 800px) { .doc-layout { grid-template-columns: 1fr; } .toc { position: static; flex-direction: row; flex-wrap: wrap; } }
.faq { margin-bottom: 10px; padding: 0; }
.faq summary { cursor: pointer; padding: 18px 22px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--muted); font-size: 1.3rem; line-height: 1; transition: transform 0.15s; }
.faq[open] summary::after { transform: rotate(45deg); }
.faq-body { padding: 0 22px 18px; color: #d4d4d8; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding-left: 26px; position: relative; margin: 10px 0; }
.checks li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.timeline { list-style: none; counter-reset: step; padding: 0; margin: 32px 0 0; border-left: 2px solid var(--border); }
.timeline li { counter-increment: step; position: relative; padding: 0 0 28px 30px; }
.timeline li::before { content: counter(step); position: absolute; left: -15px; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; }
.prose p { color: #d4d4d8; }

/* Join requirements */
.req-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.req-list li { display: flex; align-items: center; gap: 14px; }
.req-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; background: var(--surface-2); color: var(--accent); }
.req-icon .ico { width: 20px; height: 20px; }

/* Status */
.status-list { list-style: none; margin: 24px 0; padding: 4px 22px; }
.status-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.status-row:last-child { border-bottom: 0; }
.page-hero + .section, .section + .section { padding-top: 24px; }

/* Staff */
.rank-title { margin-top: 32px; font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.staff-card { display: flex; align-items: center; gap: 14px; padding: 14px; }
.staff-card img { border-radius: 50%; }
.staff-card div { display: flex; flex-direction: column; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.label { font-weight: 600; }
input, textarea, select {
  width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; font: inherit; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12); }
textarea { resize: vertical; min-height: 120px; }
.hint { font-size: 0.8rem; color: var(--muted); }
.hint-ok { color: var(--ok); }
.check { display: flex; gap: 12px; align-items: flex-start; }
.check input { width: auto; margin-top: 5px; accent-color: var(--accent); }
.search { display: flex; gap: 8px; margin-bottom: 8px; }
.search input { flex: 1; }

/* Notices & badges */
.notice { border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px; border: 1px solid; }
.notice-info { background: rgba(88, 101, 242, 0.1); border-color: rgba(88, 101, 242, 0.4); }
.notice-ok { background: rgba(74, 222, 128, 0.08); border-color: rgba(74, 222, 128, 0.35); }
.notice-warn { background: rgba(250, 204, 21, 0.07); border-color: rgba(250, 204, 21, 0.35); }
.notice-error { background: rgba(248, 113, 113, 0.09); border-color: rgba(248, 113, 113, 0.4); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--surface-2); color: var(--muted); text-transform: capitalize; vertical-align: middle; }
.badge-ok { background: rgba(74, 222, 128, 0.14); color: var(--ok); }
.badge-warn { background: rgba(250, 204, 21, 0.14); color: var(--warn); }
.badge-bad { background: rgba(248, 113, 113, 0.14); color: var(--bad); }
.badge-accent { background: rgba(255, 255, 255, 0.12); color: var(--accent); }

/* Dashboard */
.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.profile-head img { border-radius: 50%; border: 2px solid var(--border); }
.profile-head h1 { margin-bottom: 4px; }
.profile-head .eyebrow { margin-bottom: 2px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: 0.875rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list.mono li { flex-direction: row; justify-content: space-between; gap: 12px; }

/* Staff panel */
main.wide { width: 100%; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: block; overflow-x: auto; }
.table thead, .table tbody { display: table; width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 0.9rem; vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.who { display: flex; align-items: center; gap: 8px; }
.who img { border-radius: 50%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; }
.chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-size: 0.85rem; text-transform: capitalize; }
.chip.active, a.chip:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
.chip-static { color: var(--text); background: var(--surface-2); }
.pager { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.tile { display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.tile .feature-icon { margin-bottom: 6px; }
.tile:hover { border-color: var(--accent); text-decoration: none; color: var(--text); }
.tile-n { font-size: 2.4rem; font-weight: 700; }
.app-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.app-head img { border-radius: 50%; }
.app-head div { flex: 1; }
.app-head p { margin: 0; }
.answers { display: grid; gap: 12px; margin-bottom: 16px; }
.answer p { margin: 0; color: #d4d4d8; }
.decision { margin-top: 8px; }
.profile-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.inline-form { position: relative; }
.inline-form summary { list-style: none; }
.inline-form summary::-webkit-details-marker { display: none; }
.inline-form .form { position: absolute; right: 0; z-index: 5; width: 300px; gap: 10px; box-shadow: var(--shadow); padding: 16px; }
.transcript { width: 100%; height: 75vh; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.sev { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-weight: 700; font-size: 0.8rem; }
.sev-1 { background: rgba(74, 222, 128, 0.15); color: var(--ok); }
.sev-2 { background: rgba(163, 230, 53, 0.15); color: #a3e635; }
.sev-3 { background: rgba(250, 204, 21, 0.15); color: var(--warn); }
.sev-4 { background: rgba(251, 146, 60, 0.16); color: #fb923c; }
.sev-5 { background: rgba(248, 113, 113, 0.16); color: var(--bad); }

/* Footer */
.footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 40px 0 24px; margin-top: 40px; }
main.wide + .footer { margin-top: 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer .brand { margin-bottom: 12px; }
.footer-links { display: grid; grid-template-columns: repeat(3, auto); gap: 8px 40px; align-content: start; }
.footer-links a { color: var(--muted); font-size: 0.93rem; }
.footer-links a:hover { color: var(--text); }
.copyright { margin-top: 24px; }
@media (max-width: 560px) { .footer-links { grid-template-columns: repeat(2, auto); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Guide, penal code, safety, support, streamers */
.align-start { align-items: start; }
.flush { padding: 0; overflow: hidden; }
.flush .table { border: 0; border-radius: 0; }
.table-plain th, .table-plain td { font-size: 0.92rem; }
.num { text-align: right !important; white-space: nowrap; }
kbd { display: inline-block; min-width: 2.2em; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border-strong); border-bottom-width: 2px; font: 600 0.82rem/1.3 var(--font); text-align: center; }
.glossary { display: grid; gap: 10px; margin: 0; }
.glossary .card { padding: 14px 18px; }
.glossary dt { font-weight: 700; }
.glossary dd { margin: 2px 0 0; font-size: 0.92rem; }
.penal-group { margin-bottom: 28px; }
.penal-group h2 { font-family: var(--font); text-transform: none; font-weight: 700; }
.search { display: block; max-width: 520px; margin-bottom: 24px; }
.rules-links { margin: -8px 0 28px; }
.mt { margin-top: 24px; }
.dim-text { color: var(--dim); margin: 0; }
.streamer { display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.streamer:hover { border-color: var(--border-strong); }
.empty { text-align: center; padding: 40px 24px; }
.quick-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.quick-links a { display: flex; align-items: center; gap: 12px; padding: 16px 18px; color: var(--text); }
.quick-links a:hover { border-color: var(--border-strong); background: var(--surface-2); }
.quick-links strong { display: block; font-weight: 600; }
@media (max-width: 900px) { .quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .quick-links { grid-template-columns: 1fr; } }
/* Plain tables keep header and body in one table so columns line up. */
.table.table-plain { display: table; }
.table.table-plain thead { display: table-header-group; }
.table.table-plain tbody { display: table-row-group; }
.flush { overflow-x: auto; }

/* Staff panel refinements */
.section-title { margin: 32px 0 12px; }
.stat-card { display: flex; flex-direction: column; gap: 4px; padding: 18px; }
.stat-card strong { font-size: 1.5rem; display: flex; align-items: center; gap: 8px; }
.control { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.control p { margin: 2px 0 0; }
.save-bar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 30%); z-index: 3; }
.rank-card { padding: 0; }
.rank-card summary { display: flex; align-items: center; gap: 14px; padding: 16px 20px; cursor: pointer; list-style: none; }
.rank-card summary::-webkit-details-marker { display: none; }
.rank-card[open] summary { border-bottom: 1px solid var(--border); }
.rank-n { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border-strong); font: 400 0.9rem/1 var(--display); flex: none; }
.rank-count { margin-left: auto; }
.rank-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 18px; }
.rank-body > .field { max-width: 360px; }
.picker { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); }
.picker-search { border: 0; border-bottom: 1px solid var(--border); border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: transparent; }
.picker-list { max-height: 220px; overflow-y: auto; padding: 6px; }
.picker-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 0.9rem; }
.picker-item:hover { background: var(--surface); }
.picker-item input { width: auto; margin: 0; accent-color: #fff; }
.picker-item[hidden] { display: none; }
.picker-count { margin: 0; padding: 6px 12px 8px; border-top: 1px solid var(--border); }
.swatch { width: 10px; height: 10px; flex: none; }
.code-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; line-height: 1.5; min-height: 480px; tab-size: 2; white-space: pre; }
.reset-form { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.reset-form p { margin: 0; }
.narrow-form { max-width: 560px; }
.nowrap { white-space: nowrap; }
.details { max-width: 320px; overflow-wrap: anywhere; }
.p-content form.form > section.card { display: flex; flex-direction: column; gap: 14px; }
.p-content form.form > section.card h2 { margin: 0; }
.p-content form.form > section.card p { margin: 0; }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.quick-actions a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); }
.quick-actions a:hover { border-color: var(--border-strong); background: var(--surface-2); }
/* Card titles stay in the body font; the display face is for page and section headings. */
h2.h3, .card h2 { font-family: var(--font); font-weight: 700; text-transform: none; letter-spacing: -0.01em; }
.btn { white-space: nowrap; }
.narrow-field { max-width: 320px; }
.who-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.members-search { display: flex; gap: 8px; max-width: 560px; margin: 20px 0 4px; }
.members-search input { flex: 1; }
.members-table td { vertical-align: middle; }
.bot-card { display: flex; flex-direction: column; gap: 8px; }
.bot-card p { margin: 0; }
.server-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); font-weight: 700; font-size: 0.8rem; flex: none; }
.server-details summary { cursor: pointer; color: var(--muted); margin-top: 4px; }
.server-details .kv { margin-top: 8px; }
.track-form { display: flex; gap: 6px; align-items: center; }
.track-form input { padding: 6px 10px; width: 170px; font-size: 0.85rem; }
form.inline { display: inline; }
.section-gap { margin-bottom: 20px; }
.table-scroll { overflow-x: auto; margin: 0 -4px; }
.command-matrix th.center, .command-matrix td.center { width: 120px; }
.command-matrix td.center input { width: auto; accent-color: var(--accent); }
.command-matrix .group-row th { text-transform: capitalize; padding-top: 18px; color: var(--muted); font-size: 0.8rem; letter-spacing: 0.08em; }
.edit-table input[type="checkbox"] { width: auto; accent-color: var(--accent); }
.edit-table td { vertical-align: middle; }
.pos-input { width: 72px; }
.emoji-input { width: 72px; text-align: center; }
.color-input { width: 72px; height: 40px; padding: 4px; }
.p-content form.form > section.settings-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; align-items: start; }
.settings-fields .field:has(textarea), .settings-fields fieldset { grid-column: 1 / -1; }
.settings-fields fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

/* ─── Glass ──────────────────────────────────────────────────────────────
   Frosted panels over a soft monochrome light field. Falls back to solid surfaces where
   backdrop-filter isn't supported or the visitor asks for less transparency. */
:root {
  --glass-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025) 60%);
  --glass-bg-strong: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04));
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-hi: rgba(255, 255, 255, 0.22);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 18px 48px rgba(0, 0, 0, 0.35);
  --glass-blur: blur(18px) saturate(140%);
}
.glass, .home .card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.glass-strong { background: var(--glass-bg-strong); border-color: var(--glass-border-hi); }
.glass-pad { padding: 24px; }
.glass-hover, .home .card { transition: border-color 0.2s, transform 0.2s, background 0.2s; }
.glass-hover:hover, .home a.card:hover { border-color: var(--glass-border-hi); background: var(--glass-bg-strong); transform: translateY(-2px); color: var(--text); text-decoration: none; }
.glass-icon { background: rgba(255, 255, 255, 0.07); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.btn-glass { background: rgba(255, 255, 255, 0.07); border-color: var(--glass-border-hi); color: var(--text); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.btn-glass:hover { background: rgba(255, 255, 255, 0.13); border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.topbar { background: rgba(12, 12, 13, 0.6); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-bottom-color: rgba(255, 255, 255, 0.08); }

/* The light field behind the home page. */
.home { position: relative; isolation: isolate; }
.ambient { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.85; animation: drift 28s ease-in-out infinite alternate; }
.orb-1 { width: 620px; height: 620px; left: -160px; top: -120px; background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 65%); }
.orb-2 { width: 520px; height: 520px; right: -140px; top: 420px; background: radial-gradient(circle, rgba(148, 163, 184, 0.2), transparent 65%); animation-duration: 34s; }
.orb-3 { width: 700px; height: 700px; left: 20%; top: 1500px; background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent 65%); animation-duration: 40s; }
.orb-4 { width: 560px; height: 560px; right: -100px; top: 2700px; background: radial-gradient(circle, rgba(161, 161, 170, 0.16), transparent 65%); animation-duration: 31s; }
.grid-lines { position: absolute; inset: 0 0 auto; height: 900px; background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px); background-size: 56px 56px; -webkit-mask-image: radial-gradient(70% 60% at 50% 20%, #000, transparent 75%); mask-image: radial-gradient(70% 60% at 50% 20%, #000, transparent 75%); }
@keyframes drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(60px, 40px, 0) scale(1.08); } }

/* Hero */
.hero-glass { background: none; border-bottom: 0; padding-bottom: 140px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 0.85rem; color: var(--muted); margin-bottom: 26px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 40px 0 0; width: min(720px, 100%); padding: 0; overflow: hidden; }
.hero-stats > div { padding: 16px 18px; text-align: left; }
.hero-stats > div + div { border-left: 1px solid var(--glass-border); }
.hero-stats dt { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.hero-stats dd { margin: 4px 0 0; font-size: 1.35rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.hero-stats small { color: var(--muted); font-weight: 500; font-size: 0.85rem; }
@media (max-width: 640px) { .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hero-stats > div:nth-child(3) { border-left: 0; } .hero-stats > div:nth-child(n + 3) { border-top: 1px solid var(--glass-border); } }

/* About + at a glance */
.intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.intro-text p { max-width: 620px; }
.glance h3 { margin-bottom: 14px; }
.glance dl { margin: 0; display: grid; gap: 0; }
.glance dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid var(--glass-border); }
.glance dt { color: var(--muted); font-size: 0.9rem; }
.glance dd { margin: 0; text-align: right; font-weight: 600; font-size: 0.92rem; }
@media (max-width: 860px) { .intro { grid-template-columns: 1fr; } }

.pillar h3, .system h3 { margin: 16px 0 6px; }
.pillar p, .system p { margin: 0; }
.system .checks { margin-top: 12px; }
.system .checks li { margin: 6px 0; }

/* Steps + first day */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.steps-stack { grid-template-columns: 1fr; gap: 12px; }
.steps-stack .step { flex-direction: row; gap: 16px; align-items: flex-start; }
.steps-stack .step-n { margin: 2px 0 0; flex: none; }
.steps-stack .step p { margin-bottom: 8px; }
.first-day { list-style: none; margin: 0; counter-reset: day; display: grid; gap: 0; }
.first-day li { position: relative; padding: 0 0 20px 34px; counter-increment: day; }
.first-day li:last-child { padding-bottom: 0; }
.first-day li::before { content: ''; position: absolute; left: 6px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12); }
.first-day li:not(:last-child)::after { content: ''; position: absolute; left: 10px; top: 22px; bottom: 2px; width: 1px; background: var(--glass-border-hi); }
.first-day h3 { font-size: 1rem; margin: 0 0 4px; }
.first-day p { margin: 0; }

.needs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 32px; align-items: center; }
.needs h2 { margin: 0; }
.needs .req-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
@media (max-width: 860px) { .needs { grid-template-columns: 1fr; } .needs .req-list { grid-template-columns: 1fr; } }

.home .quick-links a { padding: 16px 18px; }
.home .cta-band { padding: 36px; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .home .card { background: var(--surface); }
  .topbar { background: rgba(12, 12, 13, 0.96); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .home .card, .btn-glass { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .orb { display: none; }
}
@media (prefers-reduced-motion: reduce) { .orb { animation: none; } .glass-hover:hover, .home a.card:hover { transform: none; } }
a.glass { text-decoration: none; color: var(--text); }
.hero-stats dd { white-space: nowrap; }
.hero-stats > div:first-child dd { font-size: 1.1rem; }

/* ─── Live map ─────────────────────────────────────────────────────────── */
.map-page { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - 64px); height: calc(100dvh - 64px); position: relative; background: #0d2b4f; }
.map-side { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 0; border-width: 0 1px 0 0; overflow: hidden; z-index: 2; background: rgba(12, 12, 13, 0.82); }
.map-side-head h1 { margin: 0 0 4px; }
.map-side-head p { margin: 0; }
.map-live::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 8px; box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2); }
.map-search input { width: 100%; }
.map-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.map-cat { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; opacity: 0.55; font: inherit; font-size: 0.82rem; text-transform: capitalize; }
.map-cat.active { opacity: 1; }
.map-cat small { color: var(--muted); }
.map-list { list-style: none; margin: 0 -8px; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.map-list button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 8px; cursor: pointer; }
.map-list button:hover, .map-list button:focus-visible { background: rgba(255, 255, 255, 0.06); }
.map-list-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.map-list-text strong { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-list-text .muted { text-transform: capitalize; }
.map-empty { padding: 8px; }
.map-wrap { position: relative; min-width: 0; }
.map { position: absolute; inset: 0; background: #0d2b4f; }
.map-back { position: absolute; left: 16px; top: 16px; z-index: 500; }
.map-back .flip { transform: rotate(180deg); }
.map-noscript { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; }
/* Blips: the game's radar sprite (white glyph, dark outline) multiplied by the blip colour, which
   is how the game tints them; --blip, --pin and --size are set per blip by map.js. */
.blip { --pin: #fefefe; --size: 26px; position: relative; display: inline-block; flex: none; width: var(--size); height: var(--size); isolation: isolate; background: var(--blip) center / contain no-repeat; }
.blip::after { content: ''; position: absolute; inset: 0; background: var(--pin); -webkit-mask: var(--blip) center / contain no-repeat; mask: var(--blip) center / contain no-repeat; mix-blend-mode: multiply; }
.blip-missing { background: none; }
.blip-missing::after { inset: 22%; border-radius: 50%; -webkit-mask: none; mask: none; mix-blend-mode: normal; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.7); }
.map-pin { background: none; border: 0; }
.map-pin .blip { display: block; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1.3), filter 0.16s; }
.map-pin:hover .blip, .map-pin.is-open .blip { transform: scale(1.3); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 6px var(--pin)); }
.map-pin.is-open { z-index: 1000 !important; }
/* Zoomed out: smaller blips without crowding the city. */
.map-far .map-pin .blip { transform: scale(0.75); }
.map-far .map-pin:hover .blip, .map-far .map-pin.is-open .blip { transform: scale(1.05); }
.map-chip-icon { margin-right: 2px; }
.map-pop-head { display: flex; align-items: center; gap: 10px; }
.leaflet-container { font: inherit; background: #0d2b4f; }
.map-popup .leaflet-popup-content-wrapper { background: rgba(18, 18, 20, 0.88); color: var(--text); border: 1px solid var(--glass-border-hi); border-radius: 12px; -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); }
.map-popup .leaflet-popup-tip { background: rgba(18, 18, 20, 0.88); border: 1px solid var(--glass-border-hi); }
.map-popup .leaflet-popup-content { margin: 14px 16px; line-height: 1.5; }
.map-popup a.leaflet-popup-close-button { color: var(--muted); }
.map-pop strong { display: block; font-size: 1rem; }
.map-pop-cat { display: block; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.map-pop p { margin: 6px 0 0; color: #d4d4d8; white-space: pre-line; }
.leaflet-control-zoom a { background: rgba(18, 18, 20, 0.85) !important; color: var(--text) !important; border-color: var(--glass-border) !important; }
@media (max-width: 860px) {
  .map-page { grid-template-columns: 1fr; grid-template-rows: 62vh auto; height: auto; }
  .map-wrap { grid-row: 1; height: 62vh; }
  .map-side { grid-row: 2; border-width: 1px 0 0; max-height: none; }
  .map-list { max-height: 50vh; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.map-cat { background: transparent; }
.region .eyebrow { font-size: 0.7rem; margin-bottom: 6px; }
.region h3 { margin-bottom: 6px; }
.region p:last-child { margin: 0; }

/* ─── Ticket desk ──────────────────────────────────────────────────────── */
.ico-xs { width: 13px; height: 13px; flex: none; }
.btn-block { width: 100%; }
.block { display: block; }
.grow { flex: 1; min-width: 0; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; margin: -6px 0 22px; border-bottom: 1px solid var(--border); }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; margin-bottom: -1px; color: var(--muted); font-weight: 500; font-size: 0.92rem; border-bottom: 2px solid transparent; text-decoration: none; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); border-bottom-color: var(--text); }
.tabs .tabs-end { margin-left: auto; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* KPI strip */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--surface); color: var(--text); text-decoration: none; min-width: 0; }
a.kpi:hover { background: var(--surface-2); color: var(--text); }
.kpi-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.kpi-value { font-size: 1.55rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-value small { font-size: 0.85rem; color: var(--muted); font-weight: 500; margin-left: 2px; }
.kpi-hint { font-size: 0.75rem; color: var(--dim); }
.tone-warn { color: var(--warn); }
.tone-bad { color: var(--bad); }

/* Views, filters, bulk */
.views { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.views .chip { text-transform: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; margin-bottom: 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); }
.toolbar select, .toolbar input, .bulk-bar select, .bulk-bar input { padding: 7px 10px; font-size: 0.86rem; width: auto; }
.toolbar select { max-width: 190px; }
.tool-search { display: flex; align-items: center; gap: 8px; flex: 1 1 280px; min-width: 220px; padding-left: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--dim); }
.tool-search:focus-within { border-color: var(--accent); }
.tool-search input { border: 0; background: transparent; padding-left: 0; flex: 1; width: 100%; box-shadow: none !important; }
.tool-field { display: contents; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; margin-bottom: 10px; border-radius: var(--radius-sm); background: transparent; border: 1px dashed var(--border); }
.bulk-bar.has-selection { position: sticky; top: 72px; z-index: 6; border-style: solid; border-color: var(--border-strong); background: rgba(22, 22, 24, 0.94); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--shadow); }
.bulk-all { display: inline-flex; align-items: center; gap: 8px; font-size: 0.86rem; color: var(--muted); margin-right: auto; cursor: pointer; }
.bulk-all input, .q-check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.bulk-group { display: inline-flex; gap: 6px; align-items: center; }
.bulk-group input { width: 180px; }

/* Queue */
.queue { margin-bottom: 12px; }
.q-head, .q-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 92px 186px 160px 150px; gap: 12px; align-items: center; padding: 0 16px 0 12px; }
.q-head { padding-top: 10px; padding-bottom: 10px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.q-list { list-style: none; margin: 0; padding: 0; }
.q-row { position: relative; padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); transition: background 0.12s; }
.q-row:last-child { border-bottom: 0; }
.q-row:hover { background: rgba(255, 255, 255, 0.025); }
.q-row::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.q-row.sla-warn::before { background: var(--warn); }
.q-row.sla-breach::before { background: var(--bad); }
.q-row.is-closed .q-subject { color: var(--muted); }
.q-check { display: flex; justify-content: center; }
.q-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.q-subject { font-weight: 600; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-subject:hover { text-decoration: underline; color: #fff; }
.q-subject::after { content: ''; position: absolute; inset: 0; z-index: 0; }
.q-check, .q-row .q-claim, .q-row .tp, .q-row time { position: relative; z-index: 1; }
.q-id { color: var(--dim); font-weight: 600; font-variant-numeric: tabular-nums; }
.q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 0.82rem; color: var(--muted); }
.q-opener, .q-claimer { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.q-claimer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.88rem; }
.av, .msg-av, .who-av { border-radius: 50%; flex: none; background: var(--surface-2); }
.q-time { display: flex; flex-direction: column; font-size: 0.86rem; line-height: 1.35; }
.q-state { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.cat-tag { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: #d4d4d8; font-size: 0.78rem; font-weight: 500; white-space: nowrap; }
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; text-transform: capitalize; color: var(--muted); }
.prio::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--dim); }
.prio-low::before { background: transparent; border: 1.5px solid var(--dim); }
.prio-normal { color: #d4d4d8; }
.prio-normal::before { background: #a1a1aa; }
.prio-high { color: #fb923c; }
.prio-high::before { background: #fb923c; }
.prio-urgent { color: var(--bad); }
.prio-urgent::before { background: var(--bad); box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18); }
.tp { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid transparent; }
.tp-staff { color: #e4e4e7; border-color: var(--border-strong); }
.tp-staff.tp-warn, .tp-warn { color: var(--warn); background: rgba(250, 204, 21, 0.1); border-color: rgba(250, 204, 21, 0.3); }
.tp-staff.tp-breach, .tp-breach { color: var(--bad); background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.35); }
.tp-member { color: var(--muted); }
.tp-esc { color: #fb923c; background: rgba(251, 146, 60, 0.1); }
.tp-closed { color: var(--dim); }
.stars { color: var(--warn); letter-spacing: 1px; font-size: 0.85rem; white-space: nowrap; }
.stars-off { color: var(--border-strong); }
.q-legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0 0; }
.q-legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { display: inline-block; width: 3px; height: 14px; border-radius: 2px; }
.sw-warn { background: var(--warn); }
.sw-breach { background: var(--bad); }
.empty .feature-icon { margin-bottom: 12px; }
.empty p { margin: 0; }
@media (max-width: 1180px) {
  .q-head, .q-row { grid-template-columns: 34px minmax(0, 1fr) 84px 176px 150px; }
  .q-head span:nth-child(5), .q-row .q-claim { display: none; }
}
@media (max-width: 760px) {
  .q-head { display: none; }
  .q-row { grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-areas: 'check main main' '. prio time' '. state state'; row-gap: 8px; padding: 14px 14px 14px 10px; }
  .q-check { grid-area: check; align-self: start; padding-top: 3px; }
  .q-main { grid-area: main; }
  .q-subject { white-space: normal; }
  .q-prio { grid-area: prio; }
  .q-time { grid-area: time; text-align: right; flex-direction: row; gap: 8px; justify-content: flex-end; }
  .q-time .small { display: none; }
  .q-state { grid-area: state; }
  .bulk-bar.has-selection { top: 64px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .toolbar .tool-more { display: none; }
  .views { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .views .chip { white-space: nowrap; }
  .bulk-group input { width: 140px; }
  .toolbar select { flex: 1 1 140px; max-width: none; }
}

/* Ticket detail */
.ticket-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: -6px 0 18px; }
.ticket-bar-claim { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 0.9rem; }
.desk { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.desk-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.desk-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (max-width: 1100px) { .desk { grid-template-columns: minmax(0, 1fr); } }
.intake { padding: 18px 20px; }
.intake-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.intake p { margin: 0; color: #d4d4d8; }
.answers-list { margin: 0; display: grid; gap: 10px; }
.answers-list dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.answers-list dd { margin: 2px 0 0; white-space: pre-wrap; color: #e4e4e7; }
.convo { list-style: none; margin: 0; padding: 6px 0; display: flex; flex-direction: column; gap: 4px; }
.msg { display: flex; gap: 12px; align-items: flex-start; padding: 8px 4px; }
.msg-bubble { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 4px 12px 12px 12px; background: var(--surface); border: 1px solid var(--border); }
.msg-staff { flex-direction: row-reverse; }
.msg-staff .msg-bubble { border-radius: 12px 4px 12px 12px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.04)); border-color: var(--border-strong); }
.msg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 3px; }
.msg-head strong { font-size: 0.93rem; }
.msg-head time { font-size: 0.75rem; color: var(--dim); margin-left: auto; }
.role-tag { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; background: var(--accent); color: var(--on-accent); }
.role-member { background: var(--surface-2); color: var(--muted); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; color: #e4e4e7; font-size: 0.95rem; }
.msg-embed { margin-top: 6px; padding: 8px 12px; border-left: 3px solid var(--border-strong); background: rgba(0, 0, 0, 0.2); border-radius: 4px; font-size: 0.9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-files { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.msg-files li { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-2); font-size: 0.84rem; }
.msg-files a { display: inline-flex; align-items: center; gap: 6px; }
.msg-bot { justify-content: center; padding: 4px; }
.msg-sys { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 12px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border); color: var(--muted); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-bot time { font-size: 0.72rem; color: var(--dim); margin-left: 8px; white-space: nowrap; }
.empty-convo { padding: 24px; text-align: center; }
.composer { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.composer-head, .composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.composer textarea { min-height: 96px; background: var(--bg); }
.snippet-pick { width: auto; max-width: 240px; padding: 6px 10px; font-size: 0.85rem; }
.composer .hint code { font-size: 0.78rem; }
.side-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.side-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-family: var(--font); }
.side-title .badge { margin-left: auto; text-transform: none; letter-spacing: 0; }
.side-sub { margin: 4px 0 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.act-form { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.act-group { display: flex; flex-direction: column; gap: 6px; }
.act-label { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.inline-pair { display: flex; gap: 6px; }
.inline-pair select { flex: 1; min-width: 0; padding: 7px 10px; font-size: 0.88rem; }
.act-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border); }
.seg-btn { flex: 1; padding: 6px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: 600 0.82rem/1.2 var(--font); text-transform: capitalize; cursor: pointer; text-decoration: none; text-align: center; white-space: nowrap; }
.seg-btn:hover { color: var(--text); background: var(--surface); }
.seg-btn.active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.seg-btn.seg-urgent.active { color: var(--bad); }
.seg-btn.seg-high.active { color: #fb923c; }
.act-form .seg { display: flex; }
.pop { position: relative; }
.pop > summary { list-style: none; }
.pop > summary::-webkit-details-marker { display: none; }
.pop[open] > summary { border-color: var(--muted); }
.pop-body { margin-top: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); }
.pop-body input, .pop-body textarea { padding: 8px 10px; font-size: 0.9rem; }
.pop-body textarea { min-height: 70px; }
.pop-body p { margin: 0; }
.act-row .pop[open] { flex-basis: 100%; }
.who-head { display: flex; align-items: center; gap: 12px; }
.who-head div { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.who-head strong { font-size: 1.02rem; }
.who-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.kv-tight { gap: 5px 12px; font-size: 0.88rem; }
.kv-tight dt { font-size: 0.8rem; }
.prev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.prev-list li { display: flex; flex-direction: column; padding: 7px 0; border-top: 1px solid var(--border); font-size: 0.88rem; }
.prev-list a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prev-list a:hover { text-decoration: underline; }
.note-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.note-form textarea { min-height: 64px; padding: 9px 11px; font-size: 0.9rem; background: rgba(250, 204, 21, 0.03); border-color: rgba(250, 204, 21, 0.18); }
.timeline-list { list-style: none; margin: 0; padding: 0; position: relative; }
.tl-item { position: relative; display: flex; gap: 10px; padding: 0 0 14px; }
.tl-item:not(:last-child)::before { content: ''; position: absolute; left: 11px; top: 24px; bottom: 2px; width: 1px; background: var(--border); }
.tl-icon { display: inline-grid; place-items: center; width: 23px; height: 23px; flex: none; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.tl-note .tl-icon { color: var(--warn); border-color: rgba(250, 204, 21, 0.4); background: rgba(250, 204, 21, 0.08); }
.tl-closed .tl-icon, .tl-escalated .tl-icon { color: var(--bad); }
.tl-rated .tl-icon, .tl-claimed .tl-icon, .tl-reopened .tl-icon { color: var(--ok); }
.tl-text { min-width: 0; flex: 1; font-size: 0.86rem; }
.tl-text p { margin: 1px 0 0; color: #d4d4d8; }
.tl-text .prio { font-size: 0.78rem; }
.tl-memo { margin-top: 6px !important; padding: 8px 10px; border-radius: 8px; background: rgba(250, 204, 21, 0.07); border: 1px solid rgba(250, 204, 21, 0.2); white-space: pre-wrap; overflow-wrap: anywhere; color: #fef9c3 !important; }
.tl-quote { margin-top: 4px !important; padding-left: 10px; border-left: 2px solid var(--border-strong); color: var(--muted) !important; white-space: pre-wrap; overflow-wrap: anywhere; }
.tl-when { display: block; font-size: 0.75rem; color: var(--dim); margin-top: 2px; }
.closed-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.closed-card h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.closed-card p { margin: 0; }
.rating-line { margin-top: 6px !important; }
.reopen-note { max-width: 320px; }
@media (max-width: 760px) {
  .ticket-bar-claim { margin-left: 0; }
  .msg { gap: 8px; }
  .msg-av { width: 28px; height: 28px; }
}

/* Analytics */
.range-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.chart-card { margin: 0 0 16px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.chart-head h2 { margin: 0; }
.legend { display: flex; align-items: center; gap: 14px; font-size: 0.82rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-scale { gap: 4px; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.lg-opened { background: #d4d4d8; }
.lg-closed { height: 2px; width: 14px; border-radius: 1px; background: var(--ok); }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--dim); font: 11px var(--font); }
.chart .bar-opened { fill: #d4d4d8; }
.chart .line-closed { fill: none; stroke: var(--ok); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot-closed { fill: var(--ok); stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: rgba(255, 255, 255, 0.05); }
.heat-wrap, .chart-scroll { overflow-x: auto; }
.chart-scroll .chart { min-width: 520px; }
.table-compact .meter-cell { min-width: 110px; }
.heatmap { min-width: 640px; }
.heat { stroke: var(--surface); stroke-width: 1; }
.heat:hover { stroke: var(--text); }
.heat-0 { fill: var(--bg-2); }
.heat-1, .heat-sw-1 { fill: rgba(244, 244, 245, 0.16); background: rgba(244, 244, 245, 0.16); }
.heat-2, .heat-sw-2 { fill: rgba(244, 244, 245, 0.32); background: rgba(244, 244, 245, 0.32); }
.heat-3, .heat-sw-3 { fill: rgba(244, 244, 245, 0.5); background: rgba(244, 244, 245, 0.5); }
.heat-4, .heat-sw-4 { fill: rgba(244, 244, 245, 0.72); background: rgba(244, 244, 245, 0.72); }
.heat-5, .heat-sw-5 { fill: #f4f4f5; background: #f4f4f5; }
.meter { display: block; width: 100%; height: 6px; }
.meter-bg { fill: var(--surface-2); }
.meter-fg { fill: #d4d4d8; }
.meter-cell { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.meter-cell span { min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }
.table-compact { border: 0; background: transparent; border-radius: 0; width: 100%; }
.table-compact th { background: transparent; }
.table-compact th, .table-compact td { padding: 9px 10px; vertical-align: middle; }
.range-row .seg-btn { text-transform: none; }
.table-view { margin-top: 10px; }
.table-view summary { cursor: pointer; }
.table-view .table { margin-top: 8px; }
.rating-dist { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rating-dist li { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; gap: 10px; font-size: 0.88rem; }
.rd-label { color: var(--warn); white-space: nowrap; }
.rd-n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Ticket settings */
.q-editor { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.q-editor-head, .q-editor-row { display: grid; grid-template-columns: 28px minmax(0, 1.4fr) 130px 78px minmax(0, 1fr); gap: 8px; align-items: center; padding: 8px 10px; }
.q-editor-head { background: var(--surface-2); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.q-editor-row + .q-editor-row { border-top: 1px solid var(--border); }
.q-editor-row input, .q-editor-row select { padding: 7px 10px; font-size: 0.9rem; }
.q-n { color: var(--dim); font-weight: 700; text-align: center; }
.check-cell { display: flex; justify-content: center; }
.check-cell input { width: 16px; height: 16px; accent-color: var(--accent); }
@media (max-width: 760px) {
  .q-editor-head { display: none; }
  .q-editor-row { grid-template-columns: 24px 1fr 1fr; }
  .q-editor-row input[name$='.label'] { grid-column: 2 / -1; }
  .q-editor-row input[name$='.placeholder'] { grid-column: 2 / -1; }
}
.radio-cards { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.radio-cards legend { margin-bottom: 8px; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--surface-2); }
.radio-card input { width: auto; margin-top: 4px; accent-color: var(--accent); }
.radio-card span { display: flex; flex-direction: column; gap: 2px; }
.check-grid { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; }
.check-grid legend { margin-bottom: 8px; }
@media (max-width: 620px) { .radio-cards { grid-template-columns: 1fr; } }
.panel-editor { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.panel-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }
.panel-side .card h2 { margin-bottom: 0; }
@media (max-width: 1100px) { .panel-editor { grid-template-columns: minmax(0, 1fr); } .panel-side { position: static; } }
.color-pair { display: flex; align-items: center; gap: 12px; }
.dc-preview { margin-top: 12px; padding: 14px; border-radius: 8px; background: #313338; color: #dbdee1; font-size: 0.88rem; }
.dc-msg { display: flex; gap: 12px; }
.dc-av { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: #1e1f22; color: #fff; }
.dc-content { min-width: 0; flex: 1; }
.dc-name { margin: 0 0 4px; font-weight: 600; color: #f2f3f5; }
.dc-bot { font-size: 0.62rem; font-weight: 700; padding: 1px 4px; border-radius: 3px; background: #5865f2; color: #fff; vertical-align: 1px; }
.dc-embed { display: flex; border-radius: 4px; background: #2b2d31; overflow: hidden; }
.dc-bar { width: 4px; flex: none; height: auto; }
.dc-embed-body { padding: 10px 14px 12px; min-width: 0; }
.dc-embed-body strong { display: block; color: #f2f3f5; margin-bottom: 4px; }
.dc-embed-body p { margin: 0 0 8px; overflow-wrap: anywhere; }
.dc-embed-body .dc-list { margin: 0; color: #b5bac1; }
.dc-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dc-btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 4px; font-weight: 500; font-size: 0.82rem; color: #fff; }
.dc-btn-primary { background: #5865f2; }
.dc-btn-secondary { background: #4e5058; }
.dc-btn-success { background: #248046; }
.dc-btn-danger { background: #da373c; }
.snippet-list { display: grid; gap: 12px; }
.snippet-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.snippet-card.is-new { border-style: dashed; background: transparent; }
.snippet-top { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.snippet-key { margin-bottom: 12px; }
.snippet-top .check { margin-bottom: 10px; }
.snippet-card textarea { min-height: 84px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-title-row .badge { text-transform: none; }
.p-content .grid > * { min-width: 0; }
.text-warn { color: var(--warn); }
.problem-list { margin: 6px 0 4px; padding-left: 18px; }
.problem-list li { margin: 2px 0; }
.feature-group { margin: 18px 0 8px; }
.feature-table td:first-child { max-width: 360px; }
.feature-table .badge { text-transform: none; margin: 0 4px 4px 0; }
.dev-card { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.dev-card p { margin: 0; }
.dc-text { margin: 0 0 6px; }
.dc-author { margin: 0 0 4px; font-size: 0.78rem; font-weight: 600; color: #f2f3f5; }
.dc-field { margin: 0 0 8px; display: flex; flex-direction: column; }
.dc-field-name { font-weight: 600; color: #f2f3f5; }
.dc-image { display: block; max-width: 100%; border-radius: 4px; margin-top: 6px; }
.dc-footer { margin: 8px 0 0 !important; font-size: 0.75rem; color: #b5bac1; }
.dc-muted { color: #b5bac1; }
/* Map credit: the Leaflet attribution bar is off, so the imagery is credited in the page chrome. */
.map-credit { position: absolute; right: 10px; bottom: 8px; z-index: 500; margin: 0; padding: 2px 8px; border-radius: 6px; font-size: 0.7rem; line-height: 1.5; color: rgba(244, 244, 245, 0.72); background: rgba(12, 12, 13, 0.55); pointer-events: none; user-select: none; }
/* Grid children default to min-width: auto, so a wide roster table would widen the page. */
.dept-layout > div, .dept-layout > aside { min-width: 0; }
.unit-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.unit-list li { font-size: 0.875rem; padding-left: 12px; border-left: 2px solid var(--border, rgba(127, 127, 127, 0.3)); }

/* Internal affairs complaints and records requests */
.section-head-row { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.complaint { display: flex; flex-direction: column; gap: 12px; }
.complaint-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.complaint-head .h3 { margin: 0; }
.ia-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; list-style: none; padding: 0; margin: 0; }
.ia-steps li { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); color: var(--muted); font-size: 0.82rem; text-align: center; }
.ia-steps li.done { border-color: transparent; background: rgba(74, 222, 128, 0.1); color: var(--ok); }
.ia-steps li.current { border-color: var(--accent); color: var(--text); font-weight: 600; }
@media (max-width: 600px) { .ia-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.updates { list-style: none; padding: 0 0 0 14px; margin: 0; border-left: 2px solid var(--border); }
.updates li { display: flex; flex-direction: column; gap: 2px; padding: 0 0 14px 12px; position: relative; }
.updates li::before { content: ''; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.updates li.internal::before { background: var(--muted); }
.complaint-details summary, .dept-settings summary { cursor: pointer; }
.court-search { display: grid; grid-template-columns: 1fr 200px auto; gap: 12px; align-items: end; margin-bottom: 20px; }
@media (max-width: 700px) { .court-search { grid-template-columns: 1fr; } }
.court-table code { white-space: nowrap; }
/* The economy page: the treasury chart */
.econ-chart { margin: 0; }
.econ-chart svg { display: block; width: 100%; height: 140px; }
.econ-bar { fill: var(--accent); opacity: 0.75; }
.econ-bar:hover { opacity: 1; }
