/* ==========================================================================
   CRIMSON MOTEL FILM NOIR — Silver Pines Field Archive
   Midnight Film Blue-Black (#060913) · Motel Crimson (#E11D48) · Tungsten Gold (#F59E0B)
   ZERO grey-green, ZERO mustard boxes, ZERO 1px admin-dashboard grids!
   ========================================================================== */

@font-face {
  font-family: 'Cinzel';
  src: url('/fonts/cinzel-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: fallback;
}
@font-face {
  font-family: 'Cinzel';
  src: url('/fonts/cinzel-800.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: fallback;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/fonts/plus-jakarta-sans-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: fallback;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/fonts/plus-jakarta-sans-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: fallback;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/fonts/plus-jakarta-sans-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: fallback;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: fallback;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: fallback;
}

@view-transition { navigation: auto; }

:root {
  --bg-noir: #060913;
  --bg-abyss: #0B1122;
  --bg-glass: rgba(9, 14, 29, 0.62);
  --bg-glass-strong: rgba(8, 12, 24, 0.86);

  --ink: #F1F5F9;
  --ink-muted: #CBD5E1;
  --ink-dim: #94A3B8;

  --crimson: #E11D48;
  --crimson-soft: #FB7185;
  --crimson-glow: rgba(225, 29, 72, 0.36);

  --tungsten: #F59E0B;
  --tungsten-bright: #FCD34D;
  --tungsten-glow: rgba(245, 158, 11, 0.28);

  --polaroid-paper: #EEF2F7;
  --polaroid-ink: #0F172A;

  --hairline: rgba(241, 245, 249, 0.08);
  --hairline-crimson: rgba(225, 29, 72, 0.34);

  --font-display: 'Cinzel', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --topbar-h: 62px;
  --max-w: 1320px;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--bg-noir);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.64;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  overflow-x: clip;
  scrollbar-width: thin;
  scrollbar-color: rgba(225, 29, 72, 0.45) #060913;
}
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(225, 29, 72, 0.45) #070B16;
}
*::-webkit-scrollbar { width: 7px; height: 7px; }
*::-webkit-scrollbar-track { background: #070B16; }
*::-webkit-scrollbar-thumb {
  background: rgba(225, 29, 72, 0.42);
  border-radius: 99px;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(245, 158, 11, 0.72); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-noir);
  color: var(--ink);
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--tungsten-bright); text-decoration: none; transition: color .18s ease; }
a:hover { color: #FFF; }
button, input { font-family: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--crimson-soft); outline-offset: 2px; }

.skip-link {
  position: fixed; top: -64px; left: 16px; z-index: 9999;
  padding: 10px 16px; border-radius: 99px;
  background: var(--crimson); color: #FFF; font-weight: 700;
}
.skip-link:focus { top: 12px; }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.14);
  color: var(--tungsten-bright);
}

.is-hidden { display: none !important; }
.is-tab-hidden { display: none; }

/* ==========================================================================
   FULL-BLEED 100vw x 100svh RAINY CRIMSON HIGHWAY BACKDROP + FLASHLIGHT CANVAS
   ========================================================================== */
.noir-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100svh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.noir-backdrop-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
  filter: brightness(0.86) contrast(1.06) saturate(1.12);
}
.noir-backdrop-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 65% at 50% 44%, rgba(6, 9, 19, 0.14) 0%, rgba(6, 9, 19, 0.68) 72%, rgba(6, 9, 19, 0.94) 100%),
    linear-gradient(180deg, rgba(6, 9, 19, 0.42) 0%, rgba(6, 9, 19, 0.12) 45%, rgba(6, 9, 19, 0.88) 100%);
}

#noir-atmosphere {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

/* ==========================================================================
   TRANSLUCENT CINEMA TOPBAR (62px fixed, 0px nav shift)
   ========================================================================== */
.noir-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  z-index: 120;
  background: linear-gradient(180deg, rgba(6, 9, 19, 0.84) 0%, rgba(6, 9, 19, 0.48) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.noir-topbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(225, 29, 72, 0.35), rgba(245, 158, 11, 0.25), transparent);
}
.topbar-inner {
  max-width: var(--max-w);
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  flex-shrink: 0;
}
.brand-beacon {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--crimson);
  box-shadow: 0 0 12px var(--crimson), 0 0 24px rgba(225, 29, 72, 0.6);
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.topbar-nav { display: flex; align-items: center; gap: 6px; }
.top-link {
  padding: 7px 14px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-muted);
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
  white-space: nowrap;
}
.top-link:hover { color: #FFF; background: rgba(241, 245, 249, 0.06); }
.top-link.is-active {
  color: #FFF;
  background: rgba(225, 29, 72, 0.24);
  box-shadow: inset 0 0 0 1px rgba(225, 29, 72, 0.55), 0 0 18px rgba(225, 29, 72, 0.28);
}

.topbar-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tool-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: 99px;
  border: 0;
  background: rgba(15, 23, 42, 0.65);
  box-shadow: inset 0 0 0 1px rgba(241, 245, 249, 0.14);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s ease, box-shadow .18s ease;
}
.tool-pill:hover {
  background: rgba(225, 29, 72, 0.22);
  box-shadow: inset 0 0 0 1px rgba(225, 29, 72, 0.55);
}
.tool-pill kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-muted);
}
.progress-pill strong { font-family: var(--font-mono); color: var(--tungsten-bright); }
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--tungsten);
  box-shadow: 0 0 10px var(--tungsten);
  flex-shrink: 0;
}
.mobile-nav-btn { display: none; }

.mobile-drawer {
  position: fixed;
  top: var(--topbar-h); left: 0; right: 0;
  z-index: 115;
  background: rgba(6, 9, 19, 0.96);
  backdrop-filter: blur(18px);
  padding: 16px 20px 24px;
  display: none;
}
.mobile-drawer.is-open { display: block; }
.mobile-drawer nav { display: flex; flex-direction: column; gap: 6px; }
.drawer-link {
  padding: 11px 16px;
  border-radius: 10px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(241, 245, 249, 0.05);
}
.drawer-link.drawer-sub { font-size: 13.5px; color: var(--ink-muted); background: transparent; }

/* ==========================================================================
   PAGE SHELL & FILM NOIR TYPOGRAPHY
   ========================================================================== */
.page-shell { position: relative; z-index: 2; padding-top: var(--topbar-h); }
#dossier-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 28px 28px 72px;
}
#dossier-main.page-home { padding-top: 0; }

.sub-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  margin-bottom: 14px;
}
.sub-breadcrumb a { color: var(--ink-muted); }

h1, h2, h3 {
  font-family: var(--font-display);
  margin: 0;
  color: var(--ink);
  letter-spacing: 0.02em;
}
h1 { font-size: clamp(2rem, 3.6vw, 3.35rem); line-height: 1.12; font-weight: 800; }
h2 { font-size: clamp(1.35rem, 2.2vw, 1.9rem); line-height: 1.2; font-weight: 700; }
h3 { font-family: var(--font-body); font-size: 1.08rem; line-height: 1.32; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 12px; color: var(--ink-muted); }

.noir-section { margin-top: 64px; }
.section-head-noir {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 14px;
  position: relative;
}
.section-head-noir::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(225, 29, 72, 0.5), rgba(245, 158, 11, 0.25) 45%, transparent 100%);
}
.noir-kicker, .crimson-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--crimson-soft);
}
.mono-dim {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-crimson { background: rgba(225, 29, 72, 0.2); color: #FDA4AF; }
.badge-tungsten { background: rgba(245, 158, 11, 0.18); color: var(--tungsten-bright); }
.badge-mist { background: rgba(241, 245, 249, 0.1); color: var(--ink-muted); }

/* Buttons */
.btn-crimson, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 20px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  border: 0;
  transition: transform .16s ease, background .18s ease, box-shadow .18s ease;
}
.btn-crimson {
  background: linear-gradient(135deg, #E11D48, #BE123C);
  color: #FFF;
  box-shadow: 0 8px 26px rgba(225, 29, 72, 0.4);
}
.btn-crimson:hover {
  background: linear-gradient(135deg, #F43F5E, #E11D48);
  color: #FFF;
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(225, 29, 72, 0.55);
}
.btn-ghost {
  background: rgba(15, 23, 42, 0.56);
  box-shadow: inset 0 0 0 1px rgba(241, 245, 249, 0.16);
  color: var(--ink);
}
.btn-ghost:hover {
  background: rgba(245, 158, 11, 0.14);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.45);
  color: #FFF;
}
.btn-danger-subtle {
  box-shadow: inset 0 0 0 1px rgba(225, 29, 72, 0.45);
  color: #FDA4AF;
}

/* ==========================================================================
   HOMEPAGE HERO: FULL-VIEWPORT NOIR SPOTLIGHT SEARCH STAGE (ZERO STAT BOX!)
   ========================================================================== */
.noir-spotlight-hero {
  min-height: calc(100svh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 16px 64px;
  position: relative;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tungsten-bright);
  margin-bottom: 18px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
}
.noir-spotlight-hero h1 {
  max-width: 18ch;
  font-size: clamp(2.35rem, 5.2vw, 4.3rem);
  line-height: 1.08;
  letter-spacing: 0.04em;
  color: #F8FAFC;
  text-shadow: 0 0 42px rgba(225, 29, 72, 0.42), 0 8px 34px rgba(0, 0, 0, 0.92);
  margin-bottom: 16px;
}
.hero-subtitle {
  max-width: 58ch;
  font-size: 16.5px;
  color: #E2E8F0;
  margin-bottom: 32px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.92);
}

/* Borderless Crimson-Halo Spotlight Search Bar */
.spotlight-search-wrap {
  position: relative;
  width: 100%;
  max-width: 680px;
}
.spotlight-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 22px;
  border-radius: 99px;
  background: rgba(8, 12, 24, 0.72);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow:
    0 0 0 1px rgba(225, 29, 72, 0.42),
    0 0 48px rgba(225, 29, 72, 0.24),
    0 24px 54px rgba(0, 0, 0, 0.72);
  transition: box-shadow .22s ease, background .22s ease;
}
.spotlight-bar:focus-within {
  background: rgba(8, 12, 24, 0.88);
  box-shadow:
    0 0 0 1.5px rgba(251, 113, 133, 0.8),
    0 0 64px rgba(225, 29, 72, 0.42),
    0 24px 54px rgba(0, 0, 0, 0.82);
}
.spotlight-bar input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  font-size: 15.5px;
  color: #FFF;
  height: 42px;
}
.spotlight-bar input::placeholder { color: #94A3B8; }

.hero-quick-results {
  position: absolute;
  top: calc(100% + 12px);
  left: 0; right: 0;
  z-index: 40;
  text-align: left;
  background: rgba(7, 11, 22, 0.96);
  backdrop-filter: blur(22px);
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(225, 29, 72, 0.3), 0 28px 60px rgba(0, 0, 0, 0.85);
  max-height: 320px;
  overflow-y: auto;
  display: none;
  padding: 8px;
}
.hero-quick-results.is-open { display: block; }

.spotlight-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}
.quick-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 99px;
  border: 0;
  background: rgba(9, 14, 29, 0.62);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(241, 245, 249, 0.16);
  color: #E2E8F0;
  cursor: pointer;
  transition: all .18s ease;
}
.quick-chip:hover {
  background: rgba(225, 29, 72, 0.28);
  box-shadow: inset 0 0 0 1px rgba(251, 113, 133, 0.65), 0 0 18px rgba(225, 29, 72, 0.35);
  color: #FFF;
  transform: translateY(-1px);
}

.hero-telemetry-whisper {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 28px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: #94A3B8;
  text-transform: uppercase;
}
.hero-telemetry-whisper strong { color: var(--tungsten-bright); font-weight: 600; }

/* ==========================================================================
   35MM PERFORATED CINEMA FILMSTRIP DISTRICT PANORAMA
   ========================================================================== */
.filmstrip-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.pill-row { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-pill, .layer-pill {
  padding: 6px 14px;
  border-radius: 99px;
  border: 0;
  background: rgba(15, 23, 42, 0.56);
  box-shadow: inset 0 0 0 1px rgba(241, 245, 249, 0.14);
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s ease;
}
.filter-pill:hover, .layer-pill:hover {
  color: #FFF;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.5);
}
.filter-pill.is-active, .layer-pill.is-active {
  background: linear-gradient(135deg, #E11D48, #BE123C);
  color: #FFF;
  box-shadow: 0 0 18px rgba(225, 29, 72, 0.45);
}

.filmstrip-shell {
  position: relative;
  margin: 0 -28px;
  padding: 26px 0;
  background: linear-gradient(180deg, rgba(4, 6, 14, 0.92), rgba(7, 11, 22, 0.86));
  box-shadow: inset 0 1px 0 rgba(241, 245, 249, 0.08), inset 0 -1px 0 rgba(241, 245, 249, 0.08);
}
/* Authentic 35mm Cinema Sprocket Holes Top & Bottom */
.filmstrip-shell::before,
.filmstrip-shell::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 12px;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0 14px,
    rgba(241, 245, 249, 0.18) 14px 26px,
    transparent 26px 40px
  );
}
.filmstrip-shell::before { top: 7px; }
.filmstrip-shell::after { bottom: 7px; }

.filmstrip-track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 6px 28px 10px;
}
.film-frame {
  flex: 0 0 320px;
  scroll-snap-align: start;
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: #040710;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
  transition: transform .26s cubic-bezier(.22,1,.36,1), box-shadow .26s ease, opacity .22s ease, filter .22s ease;
}
.film-frame.is-dimmed { opacity: 0.24; filter: grayscale(0.8); }
.film-frame:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.8), 0 22px 46px rgba(225, 29, 72, 0.25);
}
.film-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.92) contrast(1.06);
  transition: transform .42s ease;
}
.film-frame:hover img { transform: scale(1.06); }
.film-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 9, 19, 0.22) 0%, rgba(6, 9, 19, 0.08) 44%, rgba(6, 9, 19, 0.94) 100%);
  pointer-events: none;
}
.ff-reel {
  position: absolute;
  top: 10px; left: 12px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--tungsten-bright);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}
.ff-counts {
  position: absolute;
  top: 10px; right: 12px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(6, 9, 19, 0.78);
  color: #E2E8F0;
}
.ff-footer {
  position: absolute;
  left: 14px; right: 14px; bottom: 12px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}
.ff-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15.5px;
  line-height: 1.2;
  color: #FFF;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95);
}
.ff-arrow { font-family: var(--font-mono); font-size: 11px; color: var(--crimson-soft); white-space: nowrap; }

.filmstrip-nav-btns { display: flex; gap: 8px; }

/* ==========================================================================
   TACTILE BRASS SAFE DIAL & DARKROOM POLAROID EVIDENCE REVEAL
   ========================================================================== */
.brass-polaroid-stage {
  display: grid;
  grid-template-columns: minmax(290px, 0.88fr) minmax(0, 1.12fr);
  gap: 32px;
  align-items: center;
  padding: 30px 28px;
  border-radius: 20px;
  background: radial-gradient(circle at 24% 46%, rgba(245, 158, 11, 0.12), rgba(8, 13, 27, 0.74) 58%, rgba(6, 9, 19, 0.88) 100%);
  backdrop-filter: blur(16px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.65);
}
.brass-dial-pedestal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.brass-dial-svg {
  width: min(360px, 100%);
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.82));
}
.brass-readout-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--tungsten-bright);
  padding: 6px 16px;
  border-radius: 99px;
  background: rgba(6, 9, 19, 0.78);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.35);
}

/* Scattered Darkroom Polaroid Prints */
.polaroid-deck {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.polaroid-card {
  background: linear-gradient(180deg, #F1F5F9 0%, #DCE4EE 100%);
  color: var(--polaroid-ink);
  padding: 10px 10px 16px;
  border-radius: 3px;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  transform: rotate(var(--tilt, -1.2deg));
  transition: transform .26s cubic-bezier(.22,1,.36,1), box-shadow .26s ease;
}
.polaroid-card:nth-child(even) { --tilt: 1.3deg; }
.polaroid-card:hover {
  transform: rotate(0deg) translateY(-5px);
  box-shadow: 0 28px 58px rgba(0, 0, 0, 0.84), 0 0 28px rgba(225, 29, 72, 0.22);
}
.polaroid-photo {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #060913;
  margin-bottom: 10px;
}
.polaroid-photo img { width: 100%; height: 100%; object-fit: cover; filter: contrast(1.06); }
.polaroid-stamp {
  position: absolute;
  top: 8px; left: 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 2px;
  background: rgba(6, 9, 19, 0.84);
  color: var(--tungsten-bright);
  letter-spacing: 0.08em;
}
.polaroid-body { padding: 0 4px; }
.polaroid-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14.5px;
  color: #0F172A;
  margin-bottom: 4px;
}
.polaroid-hint {
  font-size: 12.5px;
  line-height: 1.45;
  color: #334155;
  margin: 0 0 10px;
}

/* Peelable Crimson Evidence Seal Button */
.spoiler-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 158px;
  max-width: 100%;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 4px;
  border: 0;
  background: repeating-linear-gradient(
    -45deg,
    #9F1239 0 10px,
    #BE123C 10px 20px
  );
  color: #FFF;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: normal;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.35);
  transition: transform .15s ease, background .18s ease, box-shadow .18s ease;
}
.spoiler-box:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(225, 29, 72, 0.5); }
.polaroid-card .spoiler-box { width: 100%; }
.spoiler-box.is-block {
  display: flex;
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  line-height: 1.56;
  font-family: var(--font-body);
  font-size: 14px;
}
.spoiler-box.spoiler-compact { min-width: 112px; padding: 5px 10px; font-size: 11.5px; flex-shrink: 0; }
.spoiler-box .spoiler-secret {
  filter: blur(8px);
  opacity: 0.1;
  user-select: none;
  word-break: break-word;
  transition: filter .16s ease, opacity .16s ease;
}
.spoiler-box .spoiler-toggle-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: #FFF1F2;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}
.spoiler-box[aria-expanded="true"] {
  background: #0F172A;
  color: var(--tungsten-bright);
  box-shadow: inset 0 0 0 1.5px var(--tungsten), 0 8px 22px rgba(0, 0, 0, 0.45);
}
.spoiler-box[aria-expanded="true"] .spoiler-secret {
  filter: none;
  opacity: 1;
  color: var(--tungsten-bright);
  font-weight: 700;
  user-select: text;
}
.spoiler-box[aria-expanded="true"] .spoiler-toggle-label {
  position: static;
  flex-shrink: 0;
  align-self: center;
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(245, 158, 11, 0.18);
  color: var(--tungsten-bright);
  text-shadow: none;
}

/* ==========================================================================
   4 CINEMATIC GUIDE PORTALS & BORDERLESS SURVIVAL STRIP
   ========================================================================== */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.portal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(9, 14, 29, 0.62);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  transition: transform .22s ease, box-shadow .22s ease;
}
.portal-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 0 1px rgba(225, 29, 72, 0.55), 0 24px 54px rgba(225, 29, 72, 0.22);
}
.portal-media { aspect-ratio: 16 / 9; overflow: hidden; background: #040710; }
.portal-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .38s ease; }
.portal-card:hover .portal-media img { transform: scale(1.06); }
.portal-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.portal-kicker { font-family: var(--font-mono); font-size: 10px; color: var(--crimson-soft); letter-spacing: 0.1em; }
.portal-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: #FFF; }
.portal-desc { font-size: 13px; color: var(--ink-muted); line-height: 1.5; }

.rules-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.rule-tile {
  padding: 16px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(13, 20, 40, 0.7), rgba(6, 9, 19, 0.5));
  backdrop-filter: blur(10px);
  border-left: 2px solid var(--crimson);
}
.rule-tile strong { display: block; font-size: 14px; color: #FFF; margin-bottom: 5px; }
.rule-tile span { font-size: 13px; color: var(--ink-muted); line-height: 1.5; }

/* ==========================================================================
   SLIDE-OUT DRAWERS (Global Field Log & District Quick-Lookup)
   ========================================================================== */
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(3, 5, 12, 0.72);
  backdrop-filter: blur(6px);
  display: none;
}
.drawer-scrim.is-open { display: block; }

.slide-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(460px, 94vw);
  z-index: 200;
  background: rgba(8, 12, 24, 0.96);
  backdrop-filter: blur(22px);
  box-shadow: -24px 0 64px rgba(0, 0, 0, 0.85), inset 1px 0 0 rgba(225, 29, 72, 0.28);
  transform: translateX(104%);
  visibility: hidden;
  transition: transform .28s cubic-bezier(.22, 1, .36, 1), visibility 0s linear .28s;
  display: flex;
  flex-direction: column;
}
.slide-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform .28s cubic-bezier(.22, 1, .36, 1), visibility 0s linear 0s;
}
.slide-drawer-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.slide-drawer-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; margin-top: 4px; color: #FFF; }
.slide-drawer-body { padding: 18px 22px 28px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }

.drawer-photo-banner { border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; background: #040710; }
.drawer-photo-banner img { width: 100%; height: 100%; object-fit: cover; }
.drawer-section-lbl { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; color: var(--tungsten-bright); }
.drawer-codes-list { display: flex; flex-direction: column; gap: 8px; }
.ins-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(241, 245, 249, 0.04);
  border-left: 2px solid var(--crimson);
}
.ins-code-meta { min-width: 0; }
.ins-code-meta strong { display: block; font-size: 13.5px; color: #FFF; }
.ins-code-meta span { display: block; font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.drawer-key-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.drawer-key-chips span {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(245, 158, 11, 0.14);
  color: var(--tungsten-bright);
}
.drawer-loot-box {
  font-size: 13px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(225, 29, 72, 0.12);
  color: #E2E8F0;
  line-height: 1.5;
}

.log-meter-card { padding: 12px 14px; border-radius: 10px; background: rgba(241, 245, 249, 0.04); }
.log-meter-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.log-meter-row strong { font-family: var(--font-mono); color: var(--tungsten-bright); }
.log-bar { height: 6px; border-radius: 99px; background: rgba(241, 245, 249, 0.1); overflow: hidden; }
.log-bar-fill { height: 100%; transition: width .25s ease; }
.log-bar-fill.is-crimson { background: linear-gradient(90deg, #E11D48, #FB7185); }
.log-bar-fill.is-tungsten { background: linear-gradient(90deg, #D97706, #FCD34D); }
.log-quick-links { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.log-footnote { font-size: 12px; color: var(--ink-dim); margin-top: auto; }

/* ==========================================================================
   SUBPAGE COMPACT CINEMA HEADER
   ========================================================================== */
.subpage-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  margin-bottom: 28px;
  position: relative;
}
.subpage-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(225, 29, 72, 0.55), rgba(245, 158, 11, 0.28) 45%, transparent 100%);
}
.subpage-header-copy { max-width: 780px; }
.subpage-header-copy p { margin: 10px 0 0; font-size: 15.5px; color: #CBD5E1; }
.subpage-header-tags { display: flex; gap: 8px; flex-wrap: wrap; }

/* ==========================================================================
   WALKTHROUGH: 2.5D ILLUSTRATED DIORAMA + SINGLE-CHAPTER FOCUS STAGE
   ========================================================================== */
.terrain-studio {
  border-radius: 18px;
  overflow: hidden;
  background: rgba(7, 11, 22, 0.78);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.72);
  margin-bottom: 28px;
}
.studio-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: rgba(6, 9, 19, 0.85);
}
.studio-bar-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.diorama-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #050811; }
.diorama-bg-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.95) contrast(1.06); }
.diorama-overlay-svg { position: relative; z-index: 2; width: 100%; height: 100%; display: block; }
.terrain-pin { cursor: pointer; }
.terrain-pin:hover .pin-core { fill: #FFF; }
.terrain-pin:hover .pin-pill { fill: #E11D48; }
.terrain-pin.is-active .pin-halo { fill: rgba(225, 29, 72, 0.42); }
.terrain-pin.is-active .pin-ring { stroke: #FCD34D; stroke-width: 3; }
.terrain-pin.is-active .pin-pill { fill: #E11D48; stroke: #FCD34D; stroke-width: 1.6; }
.terrain-pin.is-active .pin-pill-txt { fill: #FFF; }

.chapter-workbench {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.chapter-rail { position: sticky; top: calc(var(--topbar-h) + 18px); display: flex; flex-direction: column; gap: 6px; }
.chapter-tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 0;
  background: rgba(9, 14, 29, 0.56);
  backdrop-filter: blur(10px);
  text-align: left;
  cursor: pointer;
  transition: all .18s ease;
}
.chapter-tab-btn:hover { background: rgba(20, 30, 56, 0.78); }
.chapter-tab-btn.is-active {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.34), rgba(15, 23, 42, 0.88));
  box-shadow: inset 3px 0 0 var(--crimson), 0 10px 24px rgba(0, 0, 0, 0.45);
}
.ch-num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(245, 158, 11, 0.16);
  color: var(--tungsten-bright);
  flex-shrink: 0;
}
.chapter-tab-btn.is-active .ch-num { background: var(--crimson); color: #FFF; }
.ch-meta { min-width: 0; }
.ch-meta strong { display: block; font-size: 13.5px; color: #FFF; line-height: 1.25; }
.ch-meta span { display: block; font-size: 11px; color: var(--ink-dim); font-family: var(--font-mono); }

.chapter-stage {
  background: rgba(9, 14, 29, 0.68);
  backdrop-filter: blur(18px);
  border-radius: 18px;
  padding: 26px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.chapter-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.75fr);
  gap: 20px;
  margin: 16px 0 20px;
  align-items: stretch;
}
.chapter-brief-glass {
  background: linear-gradient(160deg, rgba(225, 29, 72, 0.14), rgba(8, 12, 24, 0.86));
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 2px solid var(--crimson);
}
.chapter-brief-glass h3 { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tungsten-bright); }
.chapter-brief-glass ul { margin: 0; padding-left: 16px; font-size: 13px; color: #E2E8F0; display: flex; flex-direction: column; gap: 6px; }

.step-cards { display: grid; gap: 10px; margin: 14px 0 22px; }
.step-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(6, 9, 19, 0.56);
  border-left: 2px solid var(--tungsten);
}
.step-index {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(225, 29, 72, 0.22);
  color: #FDA4AF;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-card strong { color: #FFF; }
.step-card p { margin: 4px 0 0; font-size: 14.5px; }

.chapter-pager { display: flex; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--hairline); }

.bell-studio {
  border-radius: 14px;
  overflow: hidden;
  background: rgba(5, 8, 17, 0.88);
  margin: 18px 0;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.55);
}
.svg-bell-item { cursor: pointer; }
.svg-bell-item .bell-body { transition: fill .2s, stroke .2s; }
.svg-bell-item.is-chiming .bell-body { fill: rgba(245, 158, 11, 0.45); stroke: #FCD34D; }

/* ==========================================================================
   PUZZLES & SAFE CODES: MASTER/DETAIL DARKROOM + BRASS DIAL WORKBENCH
   ========================================================================== */
.puzzles-workbench {
  display: grid;
  grid-template-columns: minmax(290px, 0.84fr) minmax(0, 1.16fr);
  gap: 24px;
  align-items: start;
}
.puzzle-dir-panel {
  background: rgba(9, 14, 29, 0.68);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.55);
}
.puzzle-dir-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.field-input {
  flex: 1;
  min-width: 140px;
  height: 36px;
  padding: 0 12px;
  border-radius: 99px;
  border: 0;
  background: rgba(6, 9, 19, 0.78);
  box-shadow: inset 0 0 0 1px rgba(241, 245, 249, 0.14);
  color: #FFF;
  font-size: 13.5px;
}
.puzzle-dir-list { max-height: 620px; overflow-y: auto; display: flex; flex-direction: column; }
.puz-list-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(241, 245, 249, 0.05);
  text-align: left;
  cursor: pointer;
  transition: background .15s ease;
}
.puz-list-item:hover { background: rgba(241, 245, 249, 0.05); }
.puz-list-item.is-selected {
  background: linear-gradient(90deg, rgba(225, 29, 72, 0.24), transparent);
  box-shadow: inset 3px 0 0 var(--crimson);
}
.puz-list-id { font-family: var(--font-mono); font-size: 11px; color: var(--tungsten-bright); }
.puz-list-name { font-size: 13.5px; font-weight: 600; color: #FFF; display: block; }
.puz-list-loc { font-size: 11.5px; color: var(--ink-dim); display: block; }
.puz-list-type {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(241, 245, 249, 0.08);
  color: var(--ink-muted);
  white-space: nowrap;
}
.puz-list-type.has-svg { background: rgba(245, 158, 11, 0.22); color: var(--tungsten-bright); }

.puzzle-stage-sticky { position: sticky; top: calc(var(--topbar-h) + 18px); }
.puzzle-inspector-card {
  border-radius: 18px;
  overflow: hidden;
  background: rgba(9, 14, 29, 0.74);
  backdrop-filter: blur(18px);
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.65);
}
.puz-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 14px;
  background: rgba(6, 9, 19, 0.72);
}
.wb-tab {
  padding: 7px 13px;
  border-radius: 99px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.wb-tab:hover { color: #FFF; background: rgba(241, 245, 249, 0.06); }
.wb-tab.is-active { background: var(--crimson); color: #FFF; box-shadow: 0 0 16px rgba(225, 29, 72, 0.45); }

.wb-panel { display: none; padding: 20px 22px; }
.wb-panel.is-active { display: block; }

.puz-polaroid-inspector {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.puz-scene-banner { border-radius: 10px; overflow: hidden; height: 190px; background: #040710; }
.puz-scene-banner img { width: 100%; height: 100%; object-fit: cover; }

.puz-noir-sheet {
  padding: 18px 20px;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.85), rgba(6, 9, 19, 0.92));
  border-top: 2px solid var(--crimson);
}
.puz-sheet-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--crimson-soft);
  margin-bottom: 6px;
}
.puz-noir-sheet h3 { font-family: var(--font-display); font-size: 20px; color: #FFF; margin-bottom: 14px; }
.puz-sheet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.puz-kv { padding: 10px 12px; border-radius: 8px; background: rgba(241, 245, 249, 0.04); }
.puz-kv span { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--tungsten-bright); text-transform: uppercase; letter-spacing: 0.08em; }
.puz-kv strong { display: block; font-size: 13.5px; color: #F1F5F9; margin-top: 3px; font-weight: 600; }
.puz-reveal-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}

.wb-svg-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(220px, 0.95fr); gap: 18px; align-items: center; }
.wb-svg-box { border-radius: 12px; overflow: hidden; background: #050811; }
.wb-step-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.wb-step-btn {
  text-align: left;
  padding: 10px 13px;
  border-radius: 8px;
  border: 0;
  background: rgba(6, 9, 19, 0.65);
  box-shadow: inset 0 0 0 1px rgba(241, 245, 249, 0.1);
  cursor: pointer;
  transition: all .16s ease;
}
.wb-step-btn strong { display: block; font-size: 13px; color: #FFF; }
.wb-step-btn span { display: block; font-size: 11.5px; color: var(--ink-muted); }
.wb-step-btn:hover, .wb-step-btn.is-active {
  background: rgba(245, 158, 11, 0.16);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.6);
}

.payphone-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.payphone-card {
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(9, 14, 29, 0.65);
  backdrop-filter: blur(12px);
  border-top: 2px solid var(--tungsten);
}
.payphone-num { font-family: var(--font-mono); font-size: 21px; font-weight: 700; color: var(--tungsten-bright); letter-spacing: 0.06em; }
.payphone-card strong { display: block; font-size: 14px; color: #FFF; margin: 5px 0 4px; }
.payphone-card span { font-size: 12.5px; color: var(--ink-muted); line-height: 1.48; }

/* ==========================================================================
   KEYS & ITEMS: MIDNIGHT SURVIVAL-HORROR GRID INVENTORY (NO MUSTARD BOXES!)
   ========================================================================== */
.mode-tablist { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 99px;
  border: 0;
  background: rgba(9, 14, 29, 0.65);
  box-shadow: inset 0 0 0 1px rgba(241, 245, 249, 0.14);
  color: var(--ink-muted);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s ease;
}
.mode-tab:hover { color: #FFF; box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.5); }
.mode-tab.is-active {
  background: linear-gradient(135deg, #E11D48, #BE123C);
  color: #FFF;
  box-shadow: 0 0 22px rgba(225, 29, 72, 0.42);
}
.mode-tab .tab-count { font-family: var(--font-mono); font-size: 11px; padding: 1px 7px; border-radius: 99px; background: rgba(0, 0, 0, 0.3); }

.inventory-workbench { display: grid; grid-template-columns: minmax(0, 1.38fr) minmax(290px, 0.62fr); gap: 22px; align-items: start; }
.inv-grid-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  background: radial-gradient(circle at top left, rgba(225, 29, 72, 0.1), rgba(6, 9, 19, 0.78) 65%);
  backdrop-filter: blur(14px);
}
.inv-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 112px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 0;
  background: rgba(15, 23, 42, 0.62);
  box-shadow: inset 0 0 0 1px rgba(241, 245, 249, 0.08);
  text-align: left;
  cursor: pointer;
  transition: all .18s ease;
}
.inv-slot:hover {
  background: rgba(24, 35, 64, 0.78);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.55);
  transform: translateY(-2px);
}
.inv-slot.is-selected {
  background: rgba(30, 41, 74, 0.88);
  box-shadow: inset 0 0 0 1.5px var(--tungsten), 0 0 20px rgba(245, 158, 11, 0.24);
}
.inv-slot.is-checked {
  background: linear-gradient(160deg, rgba(225, 29, 72, 0.24), rgba(15, 23, 42, 0.78));
  box-shadow: inset 0 0 0 1.5px var(--crimson-soft);
}
.inv-slot-top { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.inv-icon { width: 25px; height: 25px; color: var(--tungsten-bright); flex-shrink: 0; }
.inv-slot.is-checked .inv-icon { color: #FDA4AF; }
.inv-slot-tag { font-family: var(--font-mono); font-size: 9.5px; padding: 2px 6px; border-radius: 4px; background: rgba(241, 245, 249, 0.07); color: var(--ink-muted); }
.inv-slot-name { font-size: 13px; font-weight: 700; line-height: 1.25; color: #FFF; margin-top: 8px; }
.inv-slot-sub { font-family: var(--font-mono); font-size: 10px; color: var(--ink-dim); margin-top: 3px; }
.inv-check-badge {
  position: absolute;
  top: 7px; right: 7px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--crimson);
  color: #FFF;
  font-size: 11px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
}
.inv-slot.is-checked .inv-check-badge { display: flex; }

.inv-inspector {
  position: sticky;
  top: calc(var(--topbar-h) + 18px);
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.86), rgba(6, 9, 19, 0.94));
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 22px;
  border-top: 3px solid var(--crimson);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.72);
}
.inv-inspector h3 { font-family: var(--font-display); color: #FFF; font-size: 20px; margin: 8px 0 14px; }
.inv-ins-field { padding: 10px 0; border-top: 1px solid var(--hairline); }
.inv-ins-field span { display: block; font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: var(--tungsten-bright); text-transform: uppercase; letter-spacing: 0.08em; }
.inv-ins-field strong { display: block; font-size: 13.5px; color: #F1F5F9; margin-top: 3px; font-weight: 600; }
.inv-check-toggle {
  margin-top: 16px;
  width: 100%;
  min-height: 42px;
  border-radius: 99px;
  border: 0;
  background: linear-gradient(135deg, #E11D48, #BE123C);
  color: #FFF;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(225, 29, 72, 0.35);
}
.inv-check-toggle.is-checked { background: linear-gradient(135deg, #D97706, #F59E0B); color: #090D16; }

.craft-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.craft-card { padding: 13px 16px; border-radius: 10px; background: rgba(15, 23, 42, 0.66); border-left: 2px solid var(--tungsten); }
.craft-card strong { display: block; font-size: 13.5px; color: #FFF; }
.craft-card span { font-family: var(--font-mono); font-size: 11.5px; color: var(--tungsten-bright); }

.key-graph-studio { border-radius: 16px; overflow: hidden; background: rgba(6, 9, 19, 0.85); margin-top: 20px; }
.svg-key-chain { cursor: pointer; opacity: 0.45; transition: opacity .16s ease; }
.svg-key-chain:hover, .svg-key-chain.is-active { opacity: 1; }

/* ==========================================================================
   BOSSES & ENDINGS: PHOTOGRAPHIC 3-ENDING BOARD + RADAR + CUSTOM CHECKBOXES
   ========================================================================== */
.endings-studio { border-radius: 18px; overflow: hidden; background: rgba(7, 11, 22, 0.78); backdrop-filter: blur(16px); box-shadow: 0 26px 64px rgba(0, 0, 0, 0.65); }
.endings-board-inner { padding: 20px 22px 24px; }
.endings-root-banner {
  max-width: 740px;
  margin: 0 auto;
  padding: 13px 20px;
  border-radius: 99px;
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.24), rgba(15, 23, 42, 0.88));
  box-shadow: inset 0 0 0 1px rgba(225, 29, 72, 0.45);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  text-align: center;
  font-size: 13.5px;
}
.endings-wire-svg { width: 100%; max-width: 900px; height: 40px; margin: 0 auto; display: block; }
.end-path { transition: opacity .18s ease; }
.end-path.is-dimmed { opacity: 0.22; }
.endings-photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ending-photo-card {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: #040710;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.65);
  transition: transform .22s ease, opacity .22s ease, box-shadow .22s ease;
}
.ending-photo-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.88) contrast(1.06); transition: transform .36s ease; }
.ending-photo-card:hover img { transform: scale(1.05); }
.epc-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 9, 19, 0.34) 0%, rgba(6, 9, 19, 0.22) 38%, rgba(6, 9, 19, 0.94) 100%); }
.ending-photo-card.is-dimmed { opacity: 0.46; filter: saturate(0.6); }
.ending-photo-card.is-dimmed:hover { opacity: 0.85; filter: saturate(1); }
.ending-photo-card.is-active { opacity: 1; transform: translateY(-4px); }
.ending-photo-card.is-crimson.is-active { box-shadow: 0 0 0 2px var(--crimson), 0 18px 42px rgba(225, 29, 72, 0.36); }
.ending-photo-card.is-teal.is-active { box-shadow: 0 0 0 2px var(--tungsten-bright), 0 18px 42px rgba(245, 158, 11, 0.32); }
.ending-photo-card.is-amber.is-active { box-shadow: 0 0 0 2px #F43F5E, 0 18px 42px rgba(244, 63, 94, 0.32); }
.epc-top { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.epc-num { font-family: var(--font-mono); font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--crimson); color: #FFF; }
.epc-req { font-family: var(--font-mono); font-size: 10px; padding: 3px 8px; border-radius: 99px; background: rgba(6, 9, 19, 0.82); color: var(--tungsten-bright); }
.epc-body { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 2; display: flex; flex-direction: column; gap: 3px; }
.epc-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: #FFF; }
.epc-line { font-size: 12.5px; color: #E2E8F0; }
.epc-reward { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--tungsten-bright); margin-top: 2px; }

.ending-action-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr); gap: 18px; margin-top: 20px; }
.ending-action-card {
  background: rgba(9, 14, 29, 0.78);
  backdrop-filter: blur(16px);
  border-radius: 14px;
  padding: 22px 24px;
  border-left: 3px solid var(--tungsten);
}
.ending-action-card h3 { font-family: var(--font-display); color: #FFF; font-size: 20px; margin: 8px 0 12px; }
.ending-action-card ol { margin: 0; padding-left: 20px; color: #CBD5E1; font-size: 14px; display: flex; flex-direction: column; gap: 8px; }
.ending-action-card strong { color: #FFF; }

.trap-callout-card {
  background: linear-gradient(160deg, rgba(225, 29, 72, 0.22), rgba(9, 14, 29, 0.9));
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: inset 0 0 0 1px rgba(225, 29, 72, 0.45);
}
.trap-callout-card h3 { font-family: var(--font-display); color: #FFF; font-size: 17px; margin: 10px 0 8px; }
.trap-callout-card p { font-size: 13.5px; color: #FECDD3; margin: 0 0 8px; }

.boss-workbench { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.boss-roster { background: rgba(9, 14, 29, 0.72); backdrop-filter: blur(14px); border-radius: 16px; overflow: hidden; }
.boss-roster-list { max-height: 490px; overflow-y: auto; }
.boss-roster-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 14px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(241, 245, 249, 0.05);
  text-align: left;
  cursor: pointer;
}
.boss-roster-btn:hover { background: rgba(241, 245, 249, 0.05); }
.boss-roster-btn.is-active { background: linear-gradient(90deg, rgba(225, 29, 72, 0.28), transparent); box-shadow: inset 3px 0 0 var(--crimson); }
.boss-roster-btn strong { display: block; font-size: 13.5px; color: #FFF; }
.boss-roster-btn span { display: block; font-size: 11.5px; color: var(--ink-dim); }

.boss-radar-stage { background: rgba(6, 9, 19, 0.85); border-radius: 16px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65); }
#boss-radar-canvas { width: 100%; height: auto; display: block; }
.boss-brief-box { padding: 20px 22px; background: rgba(9, 14, 29, 0.82); }
.boss-brief-box h3 { font-family: var(--font-display); margin: 8px 0 8px; font-size: 19px; color: #FFF; }
.boss-brief-box ul { margin: 10px 0 0; padding-left: 18px; color: var(--ink-muted); font-size: 13.5px; display: flex; flex-direction: column; gap: 6px; }

.ach-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ach-card {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(9, 14, 29, 0.66);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: background .16s ease, box-shadow .16s ease;
}
.ach-card:hover { background: rgba(15, 23, 42, 0.82); box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.35); }
.ach-card.is-checked { background: linear-gradient(135deg, rgba(225, 29, 72, 0.18), rgba(9, 14, 29, 0.82)); box-shadow: inset 0 0 0 1px rgba(225, 29, 72, 0.5); }
.dossier-check {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  margin: 2px 0 0;
  border-radius: 5px;
  border: 1.5px solid rgba(241, 245, 249, 0.28);
  background: rgba(6, 9, 19, 0.85);
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: all .16s ease;
}
.dossier-check:hover { border-color: var(--tungsten-bright); }
.dossier-check::after {
  content: '';
  width: 11px; height: 11px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23FFFFFF' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 8.5 6.5 12 13 4.5'/%3E%3C/svg%3E") center/contain no-repeat;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity .14s ease, transform .14s ease;
}
.dossier-check:checked {
  background: var(--crimson);
  border-color: var(--crimson);
  box-shadow: 0 0 12px rgba(225, 29, 72, 0.55);
}
.dossier-check:checked::after { opacity: 1; transform: scale(1); }

/* ==========================================================================
   FIGURES, FAQ ACCORDION, RELAY, PROSE, MODALS & FOOTER
   ========================================================================== */
.noir-figure { margin: 0; border-radius: 12px; overflow: hidden; background: #040710; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6); }
.evidence-figure-btn { position: relative; display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; overflow: hidden; }
.evidence-figure-btn img { width: 100%; display: block; transition: transform .32s ease; }
.evidence-figure-btn:hover img { transform: scale(1.03); }
.zoom-pill {
  position: absolute;
  right: 10px; bottom: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(6, 9, 19, 0.86);
  color: var(--tungsten-bright);
}
.noir-figure figcaption { padding: 10px 14px; font-size: 12.5px; color: var(--ink-muted); }

.faq-accordion { display: flex; flex-direction: column; gap: 10px; }
.faq-details {
  border-radius: 12px;
  background: rgba(9, 14, 29, 0.62);
  backdrop-filter: blur(12px);
  overflow: hidden;
}
.faq-details[open] { box-shadow: inset 0 0 0 1px rgba(225, 29, 72, 0.32); }
.faq-summary {
  list-style: none;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  padding: 15px 18px;
  cursor: pointer;
  font-weight: 700;
  color: #FFF;
}
.faq-summary::-webkit-details-marker { display: none; }
.faq-idx { font-family: var(--font-mono); font-size: 11.5px; color: var(--crimson-soft); }
.faq-chevron { font-family: var(--font-mono); font-size: 18px; color: var(--tungsten-bright); text-align: right; transition: transform .18s ease; }
.faq-details[open] .faq-chevron { transform: rotate(45deg); }
.faq-body { padding: 0 18px 16px 60px; }
.faq-body p { margin: 0; font-size: 14.5px; color: #CBD5E1; }

.relay-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.relay-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 22px;
  border-radius: 14px;
  background: rgba(9, 14, 29, 0.66);
  backdrop-filter: blur(12px);
  transition: transform .18s ease, box-shadow .18s ease;
}
.relay-card:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px rgba(225, 29, 72, 0.5), 0 18px 40px rgba(0, 0, 0, 0.55); }
.relay-tag { font-family: var(--font-mono); font-size: 10px; color: var(--crimson-soft); letter-spacing: 0.1em; }
.relay-title { font-family: var(--font-display); font-size: 16.5px; font-weight: 700; color: #FFF; }
.relay-desc { font-size: 13px; color: var(--ink-muted); }
.relay-arrow { position: absolute; right: 18px; top: 18px; color: var(--tungsten-bright); font-weight: 700; }

.direct-answer {
  padding: 18px 22px;
  border-radius: 14px;
  background: rgba(9, 14, 29, 0.72);
  backdrop-filter: blur(14px);
  border-left: 3px solid var(--crimson);
  margin: 14px 0 24px;
}
.direct-answer-kicker { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--tungsten-bright); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px; }
.direct-answer p { margin: 0; }

.table-wrap { overflow-x: auto; border-radius: 10px; background: rgba(6, 9, 19, 0.65); }
.dossier-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dossier-table th, .dossier-table td { padding: 10px 14px; border-bottom: 1px solid var(--hairline); text-align: left; }
.dossier-table th { font-family: var(--font-mono); font-size: 11px; color: var(--tungsten-bright); background: rgba(15, 23, 42, 0.6); }

.site-footer {
  background: rgba(4, 6, 14, 0.92);
  border-top: 1px solid var(--hairline);
  padding: 32px 28px 42px;
}
.footer-inner { max-width: var(--max-w); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-disclaimer { max-width: 68ch; font-size: 12.5px; color: var(--ink-dim); margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; }
.footer-links a { color: var(--ink-muted); }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(3, 5, 12, 0.86);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.is-open { display: flex; }
.lightbox-panel, .search-panel {
  width: min(1060px, 96vw);
  max-height: 90vh;
  background: rgba(9, 14, 29, 0.96);
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(225, 29, 72, 0.32), 0 32px 80px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.search-panel { width: min(680px, 94vw); }
.lightbox-head, .search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hairline);
}
.search-head input { flex: 1; background: transparent; border: 0; outline: none; font-size: 15.5px; color: #FFF; }
.lightbox-body { padding: 14px; overflow: auto; display: flex; justify-content: center; background: #040710; }
.lightbox-body img { max-height: 75vh; width: auto; object-fit: contain; }
.search-results { max-height: 62vh; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.live-hit { display: block; padding: 11px 14px; border-radius: 10px; background: rgba(241, 245, 249, 0.04); transition: background .15s ease; }
.live-hit:hover { background: rgba(225, 29, 72, 0.2); }
.live-hit-top { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10.5px; color: var(--tungsten-bright); }
.live-hit-title { font-weight: 700; font-size: 14px; color: #FFF; margin-top: 2px; }
.live-hit-desc { font-size: 12.5px; color: var(--ink-muted); }

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (1080px, 760px, 540px, 390px, 320px safe)
   ========================================================================== */
@media (max-width: 1080px) {
  .topbar-nav { display: none; }
  .mobile-nav-btn { display: inline-flex; }
  .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brass-polaroid-stage, .chapter-workbench, .puzzles-workbench, .inventory-workbench, .boss-workbench {
    grid-template-columns: 1fr;
  }
  .chapter-rail { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .puzzle-stage-sticky, .inv-inspector { position: static; }
  .chapter-top-grid, .ending-action-grid, .wb-svg-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  #dossier-main { padding: 18px 16px 54px; }
  .topbar-inner { padding: 0 16px; }
  .filmstrip-shell { margin: 0 -16px; }
  .filmstrip-track { padding: 6px 16px 10px; }
  .film-frame { flex: 0 0 264px; }
  .brass-polaroid-stage { padding: 20px 16px; }
  .polaroid-deck, .rules-strip, .payphone-grid, .craft-strip, .relay-grid, .ach-grid, .endings-photo-grid {
    grid-template-columns: 1fr;
  }
  .endings-wire-svg { display: none; }
  .puz-sheet-grid { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .tool-pill kbd { display: none; }
  .portal-grid, .chapter-rail { grid-template-columns: 1fr; }
  .inv-grid-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chapter-stage { padding: 18px 14px; }
  .faq-body { padding: 0 16px 14px 16px; }
  .polaroid-card, .polaroid-card:nth-child(even) { --tilt: 0deg; }
}

@media (max-width: 420px) {
  .topbar-inner { padding: 0 10px; gap: 6px; }
  .brand-name { font-size: 13px; letter-spacing: 0.1em; }
  .topbar-tools { gap: 5px; }
  .tool-pill { padding: 0 9px; font-size: 11.5px; height: 32px; }
  .progress-pill > span:not(.pulse-dot) { display: none; }
  .spotlight-bar { padding: 5px 6px 5px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
