:root {
  color-scheme: dark;
  --black: #0b0d0b;
  --panel: #131613;
  --panel-2: #1a1e1a;
  --line: #2f352e;
  --line-strong: #4a5249;
  --porcelain: #ebe6d8;
  --dim: #9aa192;
  --green: #6fce14;      /* #7CFC00, dimmed */
  --green-faint: #3f7a0c;
  --blood: #7a1d18;
  --blood-text: #e0857d; /* the same red, lifted enough to read on black */
  --serif: 'Source Serif 4', Georgia, serif;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;
  --gutter: clamp(16px, 4vw, 40px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--black); color: var(--porcelain); font: 400 1rem/1.55 var(--mono); }
/* Still film grain over everything. It does not flicker. */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 2000; pointer-events: none; opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}
main { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter) 72px; }
.home main { max-width: none; padding: 0 0 72px; }
.home main > *:not(.hero) { max-width: 1120px; margin-left: auto; margin-right: auto; padding-left: var(--gutter); padding-right: var(--gutter); }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--porcelain); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.12; margin: 0; }
p { margin: 0 0 .8em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); font-size: 1.125rem; line-height: 1.55; }
.dim { color: var(--dim); }
.small { font-size: .8125rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hp { position: absolute; left: -9999px; }

/* Threat strip */
.threat { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 5px var(--gutter); font-size: .8125rem; color: var(--accent); background: #0f140c; border-bottom: 1px solid var(--line); text-decoration: none; }
.threat:hover { color: var(--porcelain); }
.threat-level { letter-spacing: .06em; }
.threat-level b { font-weight: 600; }
.threat-name { font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.threat-meaning { color: var(--dim); }
.threat-4, .threat-5 { background: var(--blood); color: #fff; border-color: var(--blood); }
.threat-4 .threat-meaning, .threat-5 .threat-meaning { color: #f3d9d5; }
.threat-4:hover, .threat-5:hover { color: #fff; }

/* Header and footer */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 24px; padding: 8px var(--gutter); border-bottom: 1px solid var(--line); background: var(--black); }
.topbar a { color: var(--porcelain); text-decoration: none; }
.topbar a:hover { color: var(--accent); }
.wordmark { font: 600 1.375rem var(--serif); padding: 4px 0; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 0 18px; font-size: .875rem; }
.topbar nav a { padding: 6px 0; }
.topbar .nav-report { color: var(--accent); }
.return-note { margin: 0; padding: 8px var(--gutter); background: var(--panel-2); border-bottom: 1px solid var(--line); font-size: .875rem; color: var(--porcelain); }
footer { border-top: 1px solid var(--line); padding: 20px var(--gutter) 28px; font-size: .8125rem; color: var(--dim); }
.counter { color: var(--accent); margin-bottom: 8px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; align-items: center; }
footer a { color: var(--dim); }
form { margin: 0; }

/* Live map */
.hero { position: relative; }
.map { background: #101410; border: 1px solid var(--line); isolation: isolate; }
.map-live { height: clamp(380px, 68vh, 760px); border-width: 0 0 1px; }
.map-subject { height: clamp(280px, 44vw, 420px); margin-top: 40px; }
.map-picker { height: 280px; margin: 12px 0 14px; }
.map .leaflet-tile-pane { filter: grayscale(1) invert(1) brightness(.72) contrast(1.15) sepia(1) hue-rotate(52deg) saturate(1.5); }
.leaflet-container { background: #0b0d0b; font: .8125rem/1.4 var(--mono); }
.leaflet-container a { color: var(--accent); }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--panel-2); color: var(--porcelain); border-color: var(--line-strong); }
.leaflet-bar a.leaflet-disabled { background: var(--panel); color: #5a6158; }
.leaflet-bar { border: 1px solid var(--line-strong) !important; box-shadow: none !important; border-radius: 0 !important; }
.leaflet-bar a { border-radius: 0 !important; }
.leaflet-container .leaflet-control-attribution { background: rgba(11,13,11,.85); color: var(--dim); }
.leaflet-container .leaflet-control-attribution a { color: var(--dim); }
.leaflet-control-attribution svg { display: none !important; }
.glow-pin { border-radius: 50%; background: var(--accent-faint); box-shadow: 0 0 6px 1px rgba(111,206,20,.45); }
.glow-pin.is-latest { background: #a6ff4d; box-shadow: 0 0 6px 2px #7cfc00, 0 0 18px 6px rgba(124,252,0,.4); }
.pin-drop { cursor: grab; }
.leaflet-tooltip.pin-tip { background: var(--black); color: var(--accent); border: 1px solid var(--accent-faint); border-radius: 0; box-shadow: none; font: .75rem var(--mono); padding: 3px 7px; }
.leaflet-tooltip.pin-tip::before { display: none; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel-2); color: var(--porcelain); border-radius: 0; box-shadow: 0 0 0 1px var(--line-strong); }
.leaflet-popup-content { margin: 10px 14px; }
.leaflet-popup-content strong { font-weight: 600; }
.leaflet-popup-content p { margin: 3px 0 0; color: var(--dim); }
.leaflet-container a.leaflet-popup-close-button { color: var(--dim); }
.hero-burn { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.burn { position: absolute; font: 500 .75rem/1 var(--mono); color: #d6f7b4; text-shadow: 0 0 3px #000, 0 0 1px #000; letter-spacing: .03em; }
.burn-map-tl { top: 14px; right: 14px; }
.burn-map-br { bottom: 26px; left: 14px; }
.tagline-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 32px; padding-top: 28px; padding-bottom: 28px; }
.tagline-row h1 { font-size: clamp(1.875rem, 5vw, 3.25rem); }

/* Readouts */
.tally { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0; }
.tally div { padding: 10px 0; border-top: 1px solid var(--line); }
.tally dt { font-size: .75rem; color: var(--dim); }
.tally dd { margin: 0; font-size: clamp(1.375rem, 3.2vw, 1.75rem); font-weight: 600; color: var(--accent); line-height: 1.3; }
@media (min-width: 640px) { .tally { grid-template-columns: repeat(4, 1fr); } }

.section-head { font-size: clamp(1.625rem, 3.6vw, 2.25rem); margin: clamp(40px, 6vw, 64px) 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line-strong); scroll-margin-top: 16px; }
.page-head { padding: clamp(28px, 5vw, 48px) 0 24px; }
.page-head h1, .prose h1, .admin-head h1 { font-size: clamp(2.25rem, 6vw, 3.5rem); }
.lede { font: 1.1875rem/1.5 var(--serif); max-width: 36em; margin: 12px 0 0; color: var(--porcelain); }
.empty { font-family: var(--serif); font-style: italic; color: var(--dim); font-size: 1.125rem; }
.notice { border: 1px solid var(--line-strong); border-top: 3px solid var(--accent-faint); background: var(--panel); padding: 18px 20px; font-family: var(--serif); }
.notice-home { margin-top: 40px; }
.home main > .notice-home { padding: 18px var(--gutter); }
.notice h2 { font-size: 1.5rem; margin-bottom: 8px; }
.notice-kicker { font: .75rem var(--mono); letter-spacing: .04em; color: var(--accent); margin-bottom: 8px; }
.notice-sign { font-style: italic; color: var(--dim); margin: 8px 0 0; }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--serif); font-size: 1.0625rem; margin-bottom: 8px; }

/* CCTV frames */
.cctv { position: relative; overflow: hidden; background: #000; }
.cctv img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) sepia(1) hue-rotate(55deg) saturate(2.2) brightness(.72) contrast(1.2); }
.cctv::after { content: ''; position: absolute; inset: 0; pointer-events: none; background:
  repeating-linear-gradient(0deg, rgba(0,0,0,.2) 0 1px, transparent 1px 3px),
  radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.65) 100%); }
.burn-tl { top: 9px; left: 9px; z-index: 1; }
.burn-br { bottom: 9px; right: 9px; z-index: 1; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 44%), 1fr)); gap: 28px 18px; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 36px 24px; } }
.card-link { display: block; color: inherit; text-decoration: none; }
.card .cctv { aspect-ratio: 4 / 5; margin-bottom: 10px; border: 1px solid var(--line); }
.card-link:hover .cctv { border-color: var(--accent-faint); }
.card-link:hover h3 { color: var(--accent); }
@media (max-width: 480px) { .card .burn { font-size: .5625rem; } }
.designation { color: var(--accent); font-size: .8125rem; letter-spacing: .05em; text-transform: uppercase; margin: 0 0 2px; }
.card h3 { font-size: 1.5rem; }
.card-facts { margin: 8px 0 0; font-size: .75rem; }
.card-facts div { margin-top: 3px; }
.card-facts dt { color: var(--dim); }
.card-facts dd { margin: 0; overflow-wrap: anywhere; }

.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; gap: 0 20px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9375rem; overflow-wrap: anywhere; }
.log-time { font-size: .8125rem; color: var(--dim); }
@media (min-width: 640px) { .log li { grid-template-columns: 12.5em 1fr; } }

/* Subject file */
.dossier { display: grid; gap: 24px 40px; padding-top: clamp(24px, 4vw, 48px); }
.dossier-image .cctv { aspect-ratio: 4 / 5; border: 1px solid var(--line-strong); }
.dossier-text h1 { font-size: clamp(2.5rem, 7vw, 4.25rem); }
@media (min-width: 800px) { .dossier { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.facts { margin: 20px 0; border-top: 1px solid var(--line-strong); font-size: .9375rem; }
.facts div { display: grid; grid-template-columns: minmax(9em, 12em) minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--dim); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.minor-head { font: 600 .8125rem var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--dim); margin: 22px 0 8px; }
.notes { list-style: none; margin: 0; padding: 0; font: 1.125rem/1.5 var(--serif); }
.notes li { margin-bottom: 2px; }
.instruction { border-left: 3px solid var(--accent-faint); padding: 2px 0 2px 14px; margin: 20px 0; }
.instruction h2 { font: 600 .75rem var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin-bottom: 3px; }
.instruction p { margin: 0; font: 1.125rem/1.5 var(--serif); }
.alert { background: var(--blood); color: #fff; padding: 10px 14px; font-family: var(--serif); font-size: 1.0625rem; }
.linkish { background: none; border: 0; padding: 0; min-height: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { background: none; color: var(--porcelain); }
footer .linkish { color: var(--dim); }

.flash { background: var(--panel-2); border-left: 3px solid var(--accent); padding: 12px 16px; margin: 20px 0 0; font: 1.0625rem/1.5 var(--serif); }
.flash p:last-child { margin: 0; }
.trail { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 1px dashed var(--accent-faint); }
.trail > li { position: relative; padding: 0 0 36px 4px; scroll-margin-top: 16px; max-width: 42em; }
.trail > li::before { content: ''; position: absolute; left: -26px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-faint); }
.trail > li:first-child::before { background: #a6ff4d; box-shadow: 0 0 8px 2px rgba(124,252,0,.6); }
.trail > li:last-child { padding-bottom: 0; }
.trail h3 { font-size: 1.5rem; }
.trail-time { font-size: .8125rem; color: var(--dim); margin: 0 0 4px; }
.trail-note { margin: 10px 0; }
.trail-photo { margin: 12px 0; max-height: 480px; border: 1px solid var(--line-strong); aspect-ratio: 4 / 3; }
.report-facts { margin: 10px 0 0; font-size: .8125rem; }
.report-facts div { display: grid; grid-template-columns: 11em minmax(0, 1fr); gap: 8px; padding: 2px 0; }
.report-facts dt { color: var(--dim); }
.report-facts dd { margin: 0; overflow-wrap: anywhere; }

/* Forms */
label, legend { font-weight: 600; font-size: .9375rem; display: block; margin-bottom: 5px; padding: 0; }
.optional { font-weight: 400; color: var(--dim); font-size: .8125rem; }
.required { font-weight: 600; font-size: .75rem; background: var(--blood); color: #fff; padding: 1px 6px; margin-left: 4px; }
input:not([type=checkbox], [type=radio], [type=file]), textarea, select { width: 100%; min-height: 46px; padding: 9px 11px; font: 1rem/1.4 var(--mono); color: var(--porcelain); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 0; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input[type=file] { font: .9375rem var(--mono); max-width: 100%; min-height: 44px; color: var(--dim); }
input::placeholder, textarea::placeholder { color: #80877a; }
input[type=datetime-local], input[type=date] { color-scheme: dark; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px 16px; font: 600 .9375rem var(--mono); text-decoration: none; cursor: pointer; border: 1px solid var(--line-strong); border-radius: 0; background: var(--panel-2); color: var(--porcelain); flex: 0 0 auto; }
button:hover, .button:hover { border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: .6; cursor: wait; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #071004; }
button.primary:hover, .button.primary:hover { background: #8ae42f; border-color: #8ae42f; color: #071004; }
button.danger { background: none; color: var(--blood-text); border-color: var(--blood); }
button.danger:hover { background: var(--blood); color: #fff; border-color: var(--blood); }
.hint { font-size: .8125rem; line-height: 1.5; color: var(--dim); margin: 5px 0 0; }
.reminder { font: italic 1.0625rem/1.5 var(--serif); color: var(--porcelain); margin: 0; }
.stack { display: grid; gap: 28px; padding-top: 24px; max-width: 640px; }
.stack > .primary { width: 100%; min-height: 52px; font-size: 1rem; }
.stack.narrow { max-width: 420px; margin: 0 auto; padding-top: 48px; }
.stack h1 { font-size: clamp(2.125rem, 6vw, 3rem); }
.form-wide { max-width: 720px; }
.narrow-page { max-width: 640px; }
.form-no { font-size: .8125rem; color: var(--accent); margin-bottom: 6px; }
.code-form { margin-top: 24px; }
.code-row { display: flex; gap: 8px; flex-wrap: wrap; }
.code-row input { flex: 1 1 180px; width: auto; letter-spacing: .08em; text-transform: uppercase; }
.field-error { color: var(--blood-text); font-weight: 600; margin-top: 8px; font-size: .9375rem; }
.is-error { color: var(--blood-text); font-weight: 600; }
.alert-box { background: var(--blood); color: #fff; padding: 12px 16px; margin: 16px 0; }
.alert-box p { margin: 0; font-weight: 600; }
.alert-box ul { margin: 6px 0 0; padding-left: 20px; }
.alert-box a { color: #fff; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 9px 0 0; min-height: 26px; }
.check input { flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.photo-preview { max-height: 240px; margin-top: 10px; border: 1px solid var(--line-strong); }
.current-photo { max-height: 160px; margin-bottom: 10px; border: 1px solid var(--line-strong); }
.picker legend, .choices legend { font: 1.375rem/1.2 var(--serif); margin-bottom: 4px; }
.choices .required { font-family: var(--mono); vertical-align: middle; }
.picker-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.picker-search { display: flex; flex: 1 1 260px; gap: 8px; min-width: 0; }
.picker-search input { flex: 1 1 auto; min-width: 0; width: auto; }
.picker-results { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line-strong); }
.picker-results[hidden] { display: none; }
.picker-results button { width: 100%; justify-content: flex-start; text-align: left; font-weight: 400; border: 0; border-bottom: 1px solid var(--line); }
.picker-results li:last-child button { border-bottom: 0; }
.picker-status { min-height: 1.5em; margin: 8px 0 0; font-size: .875rem; }
.report-head { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding-top: 24px; align-items: start; }
.report-head .cctv { aspect-ratio: 4 / 5; }
.report-head .burn { font-size: 0; }
.report-head h1 { font-size: clamp(1.75rem, 6vw, 3rem); }
.report main { max-width: 688px; }
@media (min-width: 640px) { .report-head { grid-template-columns: 150px 1fr; gap: 24px; } .report-head .burn { font-size: .625rem; } }

/* Prose pages */
.prose { max-width: 38em; padding-top: clamp(28px, 5vw, 48px); font-family: var(--serif); font-size: 1.125rem; }
.prose h1 { margin-bottom: 14px; }
.prose h2 { font-size: 1.625rem; margin: 32px 0 10px; }
.prose li { margin-bottom: 8px; }
.rules { padding-left: 26px; margin-top: 24px; }
.moved { padding-top: 96px; min-height: 50vh; }
.moved-doll { font-size: 1.25rem; opacity: .85; }

/* Threat table */
.threat-table { min-width: 0; }
.serif-strong { font: 1.25rem var(--serif); white-space: nowrap; }
.threat-table .is-current td { background: var(--panel-2); color: var(--accent); }

/* Watchers */
.avatar { width: 56px; height: 56px; object-fit: cover; border: 1px solid var(--line-strong); background: #000; flex: 0 0 auto; }
.avatar-large { width: clamp(120px, 26vw, 200px); height: clamp(120px, 26vw, 200px); }
.ladder { list-style: none; display: flex; flex-wrap: wrap; gap: 0; margin: 22px 0 0; padding: 0; font-size: .8125rem; }
.ladder li { padding-right: 28px; position: relative; }
.ladder li:not(:last-child)::after { content: '→'; position: absolute; right: 8px; top: 0; color: var(--dim); }
.ladder b { display: block; font-weight: 600; color: var(--accent); }
.ladder span { color: var(--dim); }
.watcher-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 0 24px; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--line-strong); }
.watcher-grid a { display: grid; grid-template-columns: 56px 1fr; gap: 0 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.watcher-grid .avatar { grid-row: span 3; }
.watcher-grid a:hover .w-name { color: var(--accent); }
.w-name { font-weight: 600; overflow-wrap: anywhere; }
.w-rank { font-size: .8125rem; color: var(--accent); }
.after-list { margin-top: 28px; }
.profile { display: grid; gap: 20px 32px; padding-top: clamp(24px, 4vw, 48px); align-items: start; }
.profile h1 { font-size: clamp(2.25rem, 6vw, 3.5rem); overflow-wrap: anywhere; }
@media (min-width: 640px) { .profile { grid-template-columns: auto 1fr; } }

/* Bulletin */
.post-form { padding-bottom: 8px; }
.posts { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 14px; max-width: 760px; }
.post:not(.notice) { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.post h3 { font-size: 1.25rem; margin-bottom: 4px; }
.post-meta { margin-bottom: 6px; font-weight: 600; overflow-wrap: anywhere; }
.post-meta span { font-weight: 400; }
.post .dim.small { margin: 0; }

/* Admin */
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 28px 0 16px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; padding-bottom: 20px; font-size: .875rem; }
.admin-nav a { padding: 4px 0; }
.admin-nav a[aria-current] { color: var(--porcelain); text-decoration: none; border-bottom: 2px solid var(--accent); }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; max-width: 640px; }
.inline-form > div { flex: 1 1 280px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line-strong); background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: .875rem; min-width: 780px; }
.threat-table { min-width: 0; font-size: .9375rem; }
th { text-align: left; font: 600 .75rem var(--mono); color: var(--dim); border-bottom: 1px solid var(--line-strong); }
th, td { padding: 9px 12px; vertical-align: top; }
tbody tr + tr td { border-top: 1px solid var(--line); }
.num { text-align: right; }
.review { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--line-strong); }
.review li { display: flex; flex-wrap: wrap; gap: 12px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.review img:not(.avatar) { width: 84px; height: 84px; object-fit: cover; border: 1px solid var(--line-strong); }
.review-body { flex: 1 1 280px; min-width: 0; overflow-wrap: anywhere; }
.review-body p { margin: 0 0 4px; }
.review-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.rank-form { display: flex; gap: 6px; }
.rank-form select { width: auto; }
.is-hidden .review-body, .is-hidden img { opacity: .55; }
.pill { font: 600 .6875rem var(--mono); background: var(--line-strong); color: var(--porcelain); padding: 1px 6px; }
.danger-zone { margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--blood); max-width: 640px; }
.danger-zone h2 { font-size: 1.5rem; margin-bottom: 6px; }
.delete-form { display: flex; flex-wrap: wrap; gap: 8px; }
.delete-form input { flex: 1 1 220px; width: auto; }
.tag-facts { max-width: 760px; }

/* The figure at the edge of the screen. Hidden attribute handles appearing; there's no fade. */
.idle-figure { position: fixed; right: -26px; bottom: 0; width: clamp(90px, 13vw, 150px); z-index: 1500; pointer-events: none; opacity: .13; }
.idle-figure.from-left { right: auto; left: -26px; transform: scaleX(-1); }
.idle-figure[hidden] { display: none; }
.idle-figure svg { display: block; width: 100%; fill: var(--porcelain); }

/* Night mode: same page, deeper into the green */
html[data-night] { --black: #050805; --panel: #0a100a; --panel-2: #0e160d; --porcelain: #cfe8bb; --dim: #84a26f; --line: #1f2e1a; --line-strong: #33492b; }
html[data-night] .threat:not(.threat-4, .threat-5) { background: #081006; }
html[data-night] .cctv img { filter: grayscale(1) sepia(1) hue-rotate(55deg) saturate(3) brightness(.58) contrast(1.3); }
html[data-night] .map .leaflet-tile-pane { filter: grayscale(1) invert(1) brightness(.5) contrast(1.2) sepia(1) hue-rotate(52deg) saturate(2.2); }
html[data-night] body::after { opacity: .14; }

/* Printed tags: always black on white, sized in real inches */
.print-sheet { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 24px; align-items: flex-start; }
.luggage-tag, .custody-card { background: #fff; color: #000; border: 1.5px dashed #000; font-family: var(--serif); }
.luggage-tag { width: 2.5in; height: 4in; padding: .16in .2in; display: flex; flex-direction: column; align-items: center; text-align: center; }
.tag-kicker { font: 600 8.5pt var(--mono); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 .06in; }
.tag-qr { width: 2.05in; height: 2.05in; }
.tag-qr svg { display: block; width: 100%; height: 100%; }
.tag-name { font: 600 15pt/1.1 var(--serif); margin: .08in 0 .03in; }
.tag-line { font-size: 10pt; margin: 0; }
.tag-code { font: 600 13pt var(--mono); letter-spacing: .06em; margin: .05in 0 0; }
.tag-url { font: 8pt var(--mono); margin: 0; overflow-wrap: anywhere; }
.custody-card { width: 4in; max-width: 100%; min-height: 4in; padding: .22in .26in; }
.custody-card h2 { font-size: 17pt; margin-bottom: .08in; overflow-wrap: anywhere; }
.card-mission { font-style: italic; font-size: 11pt; margin: 0 0 .08in; }
.custody-card ol { font-size: 10.5pt; line-height: 1.35; margin: .1in 0; padding-left: .22in; }
.custody-card li { margin-bottom: .04in; }
.card-foot { font-size: 9.5pt; margin: .08in 0 0; overflow-wrap: anywhere; }

@media print {
  @page { margin: .5in; }
  body { background: #fff; }
  body::after { display: none; }
  main { max-width: none; padding: 0; }
  .no-print { display: none !important; }
  .print-sheet { margin: 0; }
  .luggage-tag, .custody-card { break-inside: avoid; }
}

/* Later adjustments */
.home main > .notice-home { width: calc(min(1120px, 100%) - 2 * var(--gutter)); padding: 18px 20px; }
.cctv img[src^="/portrait/"] { filter: grayscale(1) sepia(1) hue-rotate(55deg) saturate(1.5) brightness(.42) contrast(1.35); }
html[data-night] .cctv img[src^="/portrait/"] { filter: grayscale(1) sepia(1) hue-rotate(55deg) saturate(2) brightness(.32) contrast(1.4); }
.start-head { font-size: 1.625rem; margin: 36px 0 8px; }
.start-head + .serif { margin-bottom: 0; }
.code-row select { flex: 1 1 200px; width: auto; }
.file-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 20px; }
.tally dd a { color: inherit; }

/* ==========================================================================
   The house. Brass, damask and candle-dark for the mansion itself. Green stays
   only where something is watching: camera frames, the map and data readouts.
   ========================================================================== */
:root {
  --black: #120d0f;
  --panel: #1a1215;
  --panel-2: #231719;
  --line: #3a2c28;
  --line-strong: #5e4a35;
  --porcelain: #ebe2d0;
  --dim: #ab9e8c;
  --accent: #c9a45c;
  --accent-faint: #7b6132;
  --paper: #d9cdb2;
  --ink: #1c1410;
  --serif: 'EB Garamond', Georgia, serif;
  --display: 'IM Fell English', 'Times New Roman', serif;
  --display-sc: 'IM Fell English SC', 'IM Fell English', serif;
}
body { background: var(--black) url(/img/wallpaper.svg) center top / 140px 210px; font: 400 1.125rem/1.5 var(--serif); }
/* Candlelight: the corners of every room fall away */
body::before { content: ''; position: fixed; inset: 0; z-index: 1900; pointer-events: none; background: radial-gradient(ellipse at 50% 35%, transparent 45%, rgba(5,2,3,.62) 100%); }
h1, h2, h3 { font-family: var(--display); }
.serif, .lede, .notes, .instruction p, .flash, .alert, .prose, .reminder, .empty, .post-body { font-family: var(--serif); }
.serif { font-size: 1.1875rem; }
.lede { font-size: 1.3125rem; }
.post-body { font-size: 1.125rem; }
.notes { font-size: 1.1875rem; font-style: italic; }
.instruction p { font-size: 1.1875rem; }
.prose { font-size: 1.1875rem; }

/* Data stays typewritten and green */
.threat, .counter, .designation, .form-no, .tally dd, .notice-kicker, .w-rank, .ladder b, .log-time, .trail-time { font-family: var(--mono); }
.threat { color: var(--green); background: #0d0a0b; border-bottom: 1px solid #000; }
.threat-4, .threat-5 { background: var(--blood); color: #fff; }
.counter, .designation, .form-no, .tally dd, .w-rank, .ladder b { color: var(--green); }
.trail-time, .log-time { color: var(--dim); }
.glow-pin { background: #3f7a0c; }
.leaflet-tooltip.pin-tip { color: var(--green); border-color: #3f7a0c; }
.trail > li:first-child::before { background: var(--accent); box-shadow: 0 0 8px 2px rgba(201,164,92,.5); }
.trail > li::before { background: var(--accent-faint); }

/* The entry hall */
.topbar { background: linear-gradient(#21140e, #150c09); border-bottom: 3px double var(--accent-faint); padding-top: 12px; padding-bottom: 12px; }
.wordmark { font: 400 1.875rem/1 var(--display-sc); letter-spacing: .02em; }
.topbar nav { font-size: 1.0625rem; gap: 0 20px; align-items: center; }
.topbar .nav-report { color: var(--accent); }
.return-note { background: var(--panel-2); font-style: italic; font-size: 1.0625rem; }

/* Portraits on the wall */
.home main { max-width: 1120px; padding: 0 var(--gutter) 72px; }
.home main > *:not(.hero) { max-width: none; padding-left: 0; padding-right: 0; }
.cctv, .map-live, .map-subject, .map-picker { border: 18px solid transparent; border-image: url(/img/frame.svg) 30 / 18px stretch; box-shadow: 0 10px 28px rgba(0,0,0,.65); }
.card .cctv { border-width: 14px; border-image-width: 14px; }
.dossier-image .cctv { border-width: 24px; border-image-width: 24px; }
.report-head .cctv { border-width: 9px; border-image-width: 9px; box-shadow: 0 4px 12px rgba(0,0,0,.6); }
.card .cctv, .dossier-image .cctv, .trail-photo { border-style: solid; border-color: transparent; }
.card-link:hover .cctv { border-color: transparent; filter: brightness(1.12); }
.map { background: #0b0d0b; }
.hero { margin-top: clamp(20px, 3vw, 36px); }
.map-live { height: clamp(380px, 64vh, 720px); border-width: 22px; border-image-width: 22px; }
.map-picker { border-width: 12px; border-image-width: 12px; height: 300px; }
.burn-map-tl { top: 34px; right: 36px; }
.burn-map-br { bottom: 44px; left: 34px; }

/* Nothing hangs quite straight in this house */
.cards > .card:nth-child(3n+2) .cctv { transform: rotate(.9deg); }
.cards > .card:nth-child(4n) .cctv { transform: rotate(-1.2deg); }
.card { text-align: center; }
.card-facts div { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.card h3 { font-size: 1.625rem; }
.card-facts { font-size: .8125rem; color: var(--porcelain); }
.card-link:hover h3 { color: var(--accent); }

.tagline-row h1 { font-size: clamp(2.125rem, 5.4vw, 3.75rem); font-style: italic; }
.page-head h1, .prose h1, .admin-head h1, .stack h1, .dossier-text h1, .profile h1 { font-weight: 400; }
.dossier-text h1 { font-size: clamp(2.75rem, 7.500vw, 4.75rem); }
.section-head { font-size: clamp(1.875rem, 4vw, 2.625rem); border-bottom: 0; padding-bottom: 28px; background: url(/img/fleuron.svg) left bottom / 220px 20px no-repeat; }
.minor-head, .instruction h2, th, .tally dt { font-family: var(--display-sc); font-weight: 400; font-size: 1.0625rem; letter-spacing: .03em; text-transform: none; color: var(--accent); }
.tally dt { color: var(--dim); font-size: 1rem; }
.tally div { border-top-color: var(--accent-faint); }
.facts { font-size: .9375rem; border-top-color: var(--accent-faint); }
.facts dt { font: 1.0625rem var(--serif); font-style: italic; }
.facts dd { font-family: var(--mono); }
.report-facts dt { font: italic 1rem var(--serif); }
.instruction { border-left-color: var(--accent-faint); }

/* Black-edged mourning stationery, pinned to the wallpaper */
.notice { background: var(--paper); color: var(--ink); border: 0; outline: 5px solid #0a0708; outline-offset: -5px; padding: 26px 28px; box-shadow: 0 8px 22px rgba(0,0,0,.6); position: relative; font-family: var(--serif); }
.notice-home.notice, .home main > .notice-home { width: auto; padding: 26px 28px; margin-top: 40px; }
.notice h2 { font-size: 1.75rem; color: var(--ink); }
.notice .post-body { color: var(--ink); }
.notice-kicker { color: #5a1712; font-weight: 600; }
.notice a { color: #5a1712; }
.notice a:hover { color: #000; }
.notice-sign { color: #4b3e30; }
.notice::after { content: ''; position: absolute; top: 18px; right: 20px; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 38% 34%, #a23228, #6a1712 62%, #3d0c09); box-shadow: 0 1px 3px rgba(0,0,0,.6), inset 0 0 0 4px rgba(0,0,0,.14); }
.notice h2, .notice-kicker { padding-right: 44px; }

/* Forms: a ledger on the study desk */
label, legend { font-size: 1.0625rem; }
input:not([type=checkbox], [type=radio], [type=file]), textarea, select { background: #0e090b; border-color: var(--line-strong); }
input:not([type=checkbox], [type=radio], [type=file]), select { font-family: var(--mono); font-size: 1rem; }
textarea { font: 1.125rem/1.45 var(--serif); }
input[type=file] { font: 1rem var(--serif); }
.check input { accent-color: var(--accent); }
.picker legend, .choices legend { font: 1.625rem/1.2 var(--display); }
.hint { font-size: .9688rem; }
button, .button { font: 400 1.0625rem var(--display-sc); letter-spacing: .03em; background: linear-gradient(#2a1c15, #1a100c); border-color: var(--accent-faint); }
button:hover, .button:hover { border-color: var(--accent); color: var(--accent); }
button.primary, .button.primary { background: linear-gradient(#d3ae66, #a2803f); border: 1px solid #5e4620; color: #1a1006; box-shadow: inset 0 1px 0 rgba(255,240,200,.45), 0 2px 6px rgba(0,0,0,.5); }
button.primary:hover, .button.primary:hover { background: linear-gradient(#e0bc74, #b08c48); color: #1a1006; border-color: #5e4620; }
.linkish { font-family: inherit; letter-spacing: 0; background: none; }
.flash { background: var(--panel-2); border-left-color: var(--accent); font-size: 1.1875rem; }
.required { font-family: var(--mono); }

/* Cameo portraits for the Watchers */
.avatar { width: 56px; height: 68px; border-radius: 50%; border: 2px solid var(--accent-faint); }
.avatar-large { width: clamp(130px, 26vw, 200px); height: clamp(160px, 32vw, 250px); border-width: 3px; }
.current-photo.avatar { max-height: none; }
.watcher-grid { border-top-color: var(--accent-faint); }
.w-name { font: 1.25rem var(--display); }
.post:not(.notice) { align-items: start; }
.post h3 { font-size: 1.375rem; }
.post-meta { font: 1.1875rem var(--display); }
.post-meta span { font-family: var(--mono); }
.ladder { font-size: .875rem; }

/* Tables and admin */
.table-wrap { background: rgba(26,18,21,.92); }
th { border-bottom-color: var(--accent-faint); }
.serif-strong { font: 1.375rem var(--display); }
.threat-table .is-current td { color: var(--green); }
.pill { font-size: .6875rem; }

/* Below the floorboards: the house at night, one window lit */
footer { position: relative; border-top: 3px double var(--accent-faint); padding: clamp(140px, 22vw, 240px) var(--gutter) 28px; background: url(/img/mansion.svg) center top / auto clamp(130px, 21vw, 230px) no-repeat, linear-gradient(#0d090b 0, #0d090b clamp(120px, 20vw, 220px), #090607 clamp(120px, 20vw, 220px)); font-size: .9375rem; color: var(--dim); }
.counter { font-size: .8125rem; }

/* Night mode: the candles go out */
html[data-night] { --black: #090b09; --panel: #0c120b; --panel-2: #101a0f; --porcelain: #cfe8bb; --dim: #84a26f; --line: #1f2e1a; --line-strong: #33492b; --accent: #8fb65d; --accent-faint: #46602e; }
html[data-night] body::before { background: radial-gradient(ellipse at 50% 35%, rgba(4,10,4,.25) 30%, rgba(1,4,1,.82) 100%); }
html[data-night] .cctv, html[data-night] .map-live, html[data-night] .map-subject { filter: saturate(.25) brightness(.8); }
html[data-night] .notice { background: #aab89a; }
html[data-night] .topbar { background: #0a0f09; }

@media print {
  body { background: #fff; }
  body::before { display: none; }
}
@media (max-width: 640px) {
  .wordmark { font-size: 1.625rem; }
  .map-live { border-width: 14px; border-image-width: 14px; }
  .burn-map-tl { top: 24px; right: 22px; }
  .burn-map-br { bottom: 36px; left: 22px; font-size: .625rem; }
  .card .cctv { border-width: 10px; border-image-width: 10px; }
  .dossier-image .cctv { border-width: 16px; border-image-width: 16px; }
}

/* Corrections: an earlier border shorthand resets the frame image, so restate it */
.card .cctv { border: 14px solid transparent; border-image: url(/img/frame.svg) 30 / 14px stretch; }
.dossier-image .cctv { border: 24px solid transparent; border-image: url(/img/frame.svg) 30 / 24px stretch; }
.trail-photo { border: 14px solid transparent; border-image: url(/img/frame.svg) 30 / 14px stretch; }
.card-link:hover .cctv { border-color: transparent; }
body::before { background: radial-gradient(ellipse at 50% 40%, transparent 60%, rgba(5,2,3,.5) 100%); }
/* A bruised dusk behind the house so its outline reads */
footer { background: url(/img/mansion.svg) center top / auto clamp(130px, 21vw, 230px) no-repeat, linear-gradient(#141018 0, #3a2d3c clamp(120px, 20vw, 220px), #090607 clamp(120px, 20vw, 220px)); }
@media (max-width: 640px) {
  .card .cctv { border-width: 10px; border-image-width: 10px; }
  .dossier-image .cctv { border-width: 16px; border-image-width: 16px; }
  .trail-photo { border-width: 10px; border-image-width: 10px; }
}

/* Old-style figures make a 0 look like an o, which won't do for subject numbers and codes */
body, .luggage-tag, .custody-card { font-variant-numeric: lining-nums; }
.num-inline { font-size: .82em; letter-spacing: -.01em; }
.card-foot strong { font-family: var(--mono); font-weight: 600; }
/* Night vision keeps its green even with the candles out */
html[data-night] .cctv, html[data-night] .map-live, html[data-night] .map-subject { filter: brightness(.88); }
