/* ============================================================
   BUREAU OF LOST TIMELINES — Base sheet
   Version: 4.0 (Dossier system)

   Requires css/tokens.css loaded first. Everything here is shared
   anatomy — cover header, wire strip, search, tab rail, record rows,
   story cards, imagery frames, the vault terminal, modals — and is
   consumed by all 18 pages. Per-surface sheets (admin.css,
   dashboard.css …) layer on top of it.

   Rules for this file:
   1. Colour comes from tokens only. Literal values appear nowhere
      except the vault block, which is deliberately a phosphor CRT.
   2. Structure comes from rules and margins, not card soup. A record
      is a ROW with a file number in the margin; a story is a CARD
      with a category spine. Those are the only two containers.
   3. Red is authority: the seal, the active tab, a destructive action,
      a redacted line. Nothing else gets it.
   4. Green is a machine. It appears where a machine is speaking —
      the vault, the boot sequence, a live status readout.
   ============================================================ */

/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--ink-0);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Paper fibre: a faint woven texture over the whole room. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--fibre);
  pointer-events: none;
  z-index: 9999;
}

/* Room light: cold red spill from the seal lamp above, falling dark
   at the edges. Behind the content, never over it. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--vignette);
  pointer-events: none;
  z-index: -1;
}

::selection {
  background: var(--alert);
  color: var(--paper-bright);
}

:focus-visible {
  outline: 2px solid var(--alert-bright);
  outline-offset: 2px;
}

a {
  color: var(--paper-bright);
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--alert-bright);
  text-decoration-color: var(--alert);
}

img {
  max-width: 100%;
  display: block;
}

.my,
[class$="-my"] {
  font-family: var(--font-my);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--ink-0);
}
::-webkit-scrollbar-thumb {
  background: var(--ink-4);
  border: 2px solid var(--ink-0);
  border-radius: var(--r-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--alert-deep);
}

/* ============================================================
   PRIMITIVES
   ============================================================ */
/* A mono eyebrow above any heading or block. */
.kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

/* The signature: a line the Bureau withheld, and you can unseal.
   Decorative only — the text stays in the DOM for assistive tech. */
.redact {
  font-family: var(--font-mono);
  color: var(--ink-0);
  background: var(--paper-dim);
  padding: 0 0.32em;
  border-radius: var(--r-1);
  cursor: help;
  transition: color var(--dur-2) var(--ease),
              background var(--dur-2) var(--ease);
}

.redact:hover,
.redact:focus-visible,
*:hover > .redact {
  color: var(--alert-bright);
  background: var(--alert-wash);
}

/* Buttons: what commits, what destroys, what cancels. */
.blt-btn {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  line-height: 1;
  padding: 12px 18px;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  background: var(--ink-2);
  color: var(--paper);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--dur-1) var(--ease),
              color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease),
              box-shadow var(--dur-1) var(--ease);
}

.blt-btn:hover {
  background: var(--ink-3);
  color: var(--paper-bright);
}

.blt-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.blt-btn--primary {
  background: var(--alert);
  border-color: var(--alert);
  color: var(--ink-0);
  font-weight: 600;
}

.blt-btn--primary:hover {
  background: var(--alert-bright);
  border-color: var(--alert-bright);
  color: var(--ink-0);
  box-shadow: 0 10px 30px var(--alert-glow);
}

.blt-btn--danger {
  background: transparent;
  border-color: var(--alert-deep);
  color: var(--alert-bright);
}

.blt-btn--danger:hover {
  background: var(--alert-wash-2);
  border-color: var(--alert);
}

.blt-btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted-strong);
}

.blt-btn--ghost:hover {
  color: var(--paper-bright);
  border-color: var(--line-strong);
  background: var(--ink-1);
}

/* Ruled form fields — a line to write on, not a bubble. */
.blt-field {
  display: block;
  margin-bottom: var(--s-3);
}

.blt-field > label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.blt-input,
.blt-textarea,
.blt-select {
  width: 100%;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: var(--r-1);
  color: var(--paper-bright);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.5;
  padding: 11px 12px;
  transition: border-color var(--dur-1) var(--ease),
              box-shadow var(--dur-1) var(--ease),
              background var(--dur-1) var(--ease);
}

.blt-input:focus,
.blt-textarea:focus,
.blt-select:focus {
  outline: none;
  background: var(--ink-1);
  border-color: var(--alert);
  box-shadow: 0 0 0 3px var(--alert-wash);
}

.blt-input::placeholder,
.blt-textarea::placeholder {
  color: var(--muted);
}

/* ============================================================
   HEADER — the file cover
   ============================================================ */
.site-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: var(--s-5);
  padding: var(--s-7) var(--page-pad) var(--s-5);
  background: linear-gradient(180deg, var(--ink-1), rgba(11, 12, 14, 0));
  border-bottom: 1px solid var(--line-strong);
}

/* The seal band: a red rule that fades out to the right, like a
   rubber stamp that ran short of ink. */
.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--alert) 0%, var(--alert-deep) 55%, transparent 92%);
}

.classified-stamp {
  position: absolute;
  top: var(--s-4);
  right: var(--page-pad);
  border: 2px solid var(--alert);
  border-radius: var(--r-1);
  color: var(--alert-bright);
  background: rgba(11, 12, 14, 0.55);
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transform: rotate(3deg);
  box-shadow: inset 0 0 0 1px rgba(216, 50, 63, 0.22);
  opacity: 0.92;
}

.site-header h1 {
  grid-column: 1;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-flat);
  text-transform: uppercase;
  color: var(--paper-bright);
  max-width: 20ch;
}

.my-title {
  grid-column: 1;
  font-family: var(--font-my);
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  color: var(--paper-dim);
  margin-top: var(--s-2);
  line-height: 1.7;
}

.subtitle {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.subtitle::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--alert);
  flex: none;
}

/* The cover line. This site is one file of eighteen sheets, and the header
   says which sheet you are holding: a form number, the series it belongs to,
   the clearance the page demands and its place in the file. Records offices
   print exactly this on a front sheet, so it is a mono line with hairline
   dividers and no container — the page's identity, not a card.

   The binder order is fixed, one number per page, and a new page takes the
   last slot rather than a gap: 01 intro, 02 index, 03 auth, 04 verify,
   05 dashboard, 06 submit, 07 missions, 08 review, 09 manage-roles,
   10 leaderboard, 11 badges, 12 admin, 13 backup, 14 credits, 15 org,
   16 rooms, 17 mail, 18 rules.
   The denominator is the whole file, so adding a sheet restates the count on
   every other page; sync-counts.js does not own that number, it is edited here
   on purpose.
   FORM BLT-<dept>/<sheet> uses the DEPT. number printed on that page's own
   subtitle line, so the two never disagree. */
.cover-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: var(--s-4);
  padding-top: var(--s-2);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.cover-meta > * + * {
  border-left: 1px solid var(--line);
  padding-left: var(--s-3);
  margin-left: var(--s-3);
}

.cover-meta .cm-form {
  color: var(--paper-dim);
}

/* Red is the one thing on this line that is a claim rather than a label: the
   page states who may open it, and states it in the colour of authority. */
.cover-meta .cm-clear {
  color: var(--alert-bright);
}

.header-actions {
  grid-column: 2;
  grid-row: 1 / span 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  max-width: 460px;
}

/* ===== HEADER CHROME ===== */
.audio-toggle,
.admin-link {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tr-mono);
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  color: var(--muted-strong);
  padding: 9px 12px;
  min-height: 36px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease),
              background var(--dur-1) var(--ease);
}

.audio-toggle:hover,
.admin-link:hover {
  color: var(--paper-bright);
  border-color: var(--line-strong);
  background: var(--ink-1);
}

.audio-toggle.on {
  color: var(--phosphor);
  border-color: var(--phosphor-dim);
  background: var(--phosphor-wash);
}

.auth-widget {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  padding: 5px 10px 5px 6px;
  text-decoration: none;
  background: var(--ink-1);
  box-shadow: var(--shadow-inset);
  transition: border-color var(--dur-1) var(--ease),
              background var(--dur-1) var(--ease);
}

.user-chip:hover {
  border-color: var(--alert);
  background: var(--ink-2);
  color: var(--paper-bright);
}

.user-role {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  font-weight: 600;
  color: var(--ink-0);
  background: var(--paper-dim);
  padding: 3px 7px;
  border-radius: var(--r-1);
}

.user-name {
  font-size: var(--fs-label);
  color: var(--paper-bright);
}

.user-xp {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--folklore);
  letter-spacing: 0.08em;
}

.logout-btn {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--alert-deep);
  border-radius: var(--r-1);
  color: var(--alert-bright);
  padding: 9px 12px;
  min-height: 36px;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease),
              color var(--dur-1) var(--ease);
}

.logout-btn:hover {
  background: var(--alert);
  border-color: var(--alert);
  color: var(--ink-0);
}

.login-link,
.register-link {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  padding: 9px 14px;
  min-height: 36px;
  text-decoration: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  color: var(--paper);
  background: var(--ink-1);
  display: inline-flex;
  align-items: center;
  transition: color var(--dur-1) var(--ease),
              background var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease);
}

.login-link:hover,
.register-link:hover {
  background: var(--alert);
  border-color: var(--alert);
  color: var(--ink-0);
}

/* ============================================================
   WIRE STRIP
   ============================================================ */
.ticker {
  display: flex;
  align-items: stretch;
  background: var(--ink-1);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  font-size: 12px;
  color: var(--paper-dim);
}

.ticker::before {
  content: "WIRE";
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--alert);
  color: var(--ink-0);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.26em;
}

.ticker span {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tr-mono);
  animation: ticker 46s linear infinite;
}

.ticker:hover span {
  animation-play-state: paused;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ============================================================
   SEARCH
   ============================================================ */
.search-bar-wrap {
  max-width: var(--maxw);
  margin: var(--s-4) auto 0;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 950;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 0 12px;
  transition: border-color var(--dur-1) var(--ease),
              box-shadow var(--dur-1) var(--ease);
}

.search-bar:focus-within {
  border-color: var(--alert);
  box-shadow: 0 0 0 3px var(--alert-wash);
}

.search-icon {
  flex: none;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: var(--muted);
  border-right: 1px solid var(--line);
  padding-right: 12px;
}

.search-bar input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--paper-bright);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 13px 0;
}

.search-bar input::placeholder {
  color: var(--muted);
  font-family: var(--font-my);
}

.search-clear {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 6px;
  transition: color var(--dur-1) var(--ease);
}

.search-clear:hover {
  color: var(--alert-bright);
}

.search-results {
  display: none;
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: 100%;
  margin-top: 8px;
  background: var(--ink-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  box-shadow: var(--shadow-2);
  max-height: 420px;
  overflow-y: auto;
  z-index: 960;
}

.search-results.show {
  display: block;
}

.search-results .sr-empty {
  padding: 26px 20px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  font-family: var(--font-my);
}

.search-results .sr-category {
  position: sticky;
  top: 0;
  padding: 9px 16px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--ink-2);
  border-bottom: 1px solid var(--line);
}

.search-results .sr-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--line-hair);
  transition: background var(--dur-1) var(--ease),
              box-shadow var(--dur-1) var(--ease);
}

.search-results .sr-item:hover {
  background: var(--ink-2);
  box-shadow: inset 3px 0 0 var(--alert);
}

.search-results .sr-item .sr-title {
  font-size: 14px;
  color: var(--paper-bright);
  margin-bottom: 2px;
}

.search-results .sr-item .sr-my {
  font-family: var(--font-my);
  font-size: 13px;
  color: var(--paper-dim);
  margin-bottom: 4px;
}

.search-results .sr-item .sr-snippet {
  font-size: 12px;
  color: var(--muted-strong);
  line-height: 1.6;
}

.search-results .sr-item mark {
  background: var(--alert-wash-2);
  color: var(--alert-bright);
  padding: 0 2px;
  border-radius: 1px;
}

/* ============================================================
   TAB RAIL
   ============================================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 800;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
  padding: 10px var(--page-pad);
  margin-top: var(--s-4);
  background: rgba(18, 20, 23, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
}

.nav-btn {
  flex: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-1);
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  padding: 9px 13px;
  min-height: 36px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-1) var(--ease),
              background var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease);
}

.nav-btn:hover {
  color: var(--paper-bright);
  background: var(--ink-2);
}

.nav-btn.active {
  color: var(--paper-bright);
  background: var(--alert-wash);
  border-color: var(--line-red);
  box-shadow: inset 0 -2px 0 var(--alert);
}

/* ============================================================
   MAIN / PANELS
   The archive is one file in seven sections; §NN is that section
   number, derived by CSS counter so it can never disagree with the
   order of the tab rail above it.
   ============================================================ */
.site-main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-6) var(--gutter) var(--s-8);
}

.panel {
  display: none;
  animation: fadeIn var(--dur-3) var(--ease);
}

.panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.panel h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  position: relative;
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: var(--lh-snug);
  color: var(--paper-bright);
  padding-bottom: var(--s-2);
  margin-bottom: var(--s-4);
  border-bottom: 1px solid var(--line);
}

.panel h2::before {
  /* The register number of the section, written on the heading itself:
     only one panel is on screen at a time, so a CSS counter would always
     say 01 and tell nobody anything. */
  content: "§" attr(data-sec);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--alert-bright);
  flex: none;
}

.panel h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 64px;
  height: 2px;
  background: var(--alert);
}

.panel h2 .my {
  flex-basis: 100%;
  font-family: var(--font-my);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted-strong);
}

/* ============================================================
   CLASSIFICATION KEY
   ============================================================ */
.marker-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px var(--s-4);
  border: 1px solid var(--line);
  border-left: var(--spine) solid var(--line-strong);
  border-radius: var(--r-2);
  background: var(--ink-1);
  padding: 12px 16px;
  margin-bottom: var(--s-4);
  font-size: 13px;
}

.marker-legend .legend-title {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.marker-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.marker-legend .dot {
  width: 9px;
  height: 9px;
  border-radius: 1px;
  flex: none;
}

.marker-legend .dot.real {
  background: var(--real);
  box-shadow: 0 0 8px rgba(51, 255, 102, 0.45);
}

.marker-legend .dot.folklore {
  background: var(--folklore);
}

.marker-legend .dot.fiction {
  background: var(--fiction);
}

.marker-legend .label {
  color: var(--muted-strong);
  font-family: var(--font-my);
  font-size: 12px;
}

/* ============================================================
   RECORD ROWS — classified files
   A file is a line in a register: number in the margin, title on
   the line, status underneath. Hover opens the red spine.
   ============================================================ */
.file-grid {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--line);
}

.file-card {
  position: relative;
  display: grid;
  grid-template-columns: var(--gutter-id) minmax(0, 1fr);
  column-gap: var(--s-4);
  padding: var(--s-3) 104px var(--s-3) var(--s-2);
  border-bottom: 1px solid var(--line-hair);
  cursor: pointer;
  background: transparent;
  transition: background var(--dur-1) var(--ease);
}

.file-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--spine);
  background: var(--alert);
  transform: scaleY(0);
  transition: transform var(--dur-2) var(--ease);
}

.file-card:hover,
.file-card:focus-visible {
  background: var(--ink-1);
}

.file-card:hover::before,
.file-card:focus-visible::before {
  transform: scaleY(1);
}

.file-card .file-id {
  grid-column: 1;
  grid-row: 1 / 4;
  align-self: start;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border-right: 1px solid var(--line-hair);
  padding: 4px var(--s-3) 0 0;
}

.file-card .file-title {
  grid-column: 2;
  grid-row: 1;
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  font-weight: 600;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  color: var(--paper-bright);
  line-height: var(--lh-snug);
}

.file-card .file-title-my {
  grid-column: 2;
  grid-row: 2;
  font-family: var(--font-my);
  font-size: 13px;
  color: var(--muted-strong);
  margin-top: 2px;
}

.file-card .file-meta {
  grid-column: 2;
  grid-row: 3;
  display: flex;
  gap: var(--s-4);
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.status-redacted { color: var(--alert-bright); }
.status-lost { color: var(--folklore); }
.status-erased { color: var(--cat-timeline); }
.status-sealed { color: var(--cat-places); }
.status-active { color: var(--phosphor); }

.file-marker {
  position: absolute;
  top: var(--s-3);
  right: var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border: 1px solid;
  border-radius: var(--r-1);
  z-index: 5;
}

.file-marker.real {
  color: var(--real);
  border-color: var(--phosphor-dim);
  background: var(--phosphor-wash);
}

.file-marker.folklore {
  color: var(--folklore);
  border-color: var(--folklore-line);
  background: var(--folklore-wash);
}

.file-marker.fiction {
  color: var(--alert-bright);
  border-color: var(--line-red);
  background: var(--alert-wash);
}

/* ============================================================
   STORYLINES
   A story keeps the card: it has an excerpt to read. The spine is
   its category — the same five values the filter names.
   ============================================================ */
.storyline-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--s-4);
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--muted-strong);
  padding: 7px 14px;
  cursor: pointer;
  transition: color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease),
              background var(--dur-1) var(--ease);
}

.filter-btn:hover {
  color: var(--paper-bright);
  border-color: var(--line-strong);
}

.filter-btn.active {
  color: var(--paper-bright);
  border-color: var(--alert);
  background: var(--alert-wash);
}

.storyline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--s-3);
}

.storyline-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--ink-1);
  padding: var(--s-4) var(--s-4) var(--s-3) calc(var(--s-4) + var(--spine));
  cursor: pointer;
  box-shadow: var(--shadow-inset);
  transition: transform var(--dur-2) var(--ease),
              border-color var(--dur-2) var(--ease),
              box-shadow var(--dur-2) var(--ease),
              background var(--dur-2) var(--ease);
}

.storyline-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: var(--spine);
  height: 100%;
  background: var(--line-strong);
  transition: width var(--dur-2) var(--ease);
}

.storyline-card[data-cat="timeline"]::before { background: var(--cat-timeline); }
.storyline-card[data-cat="places"]::before { background: var(--cat-places); }
.storyline-card[data-cat="observers"]::before { background: var(--cat-observers); }
.storyline-card[data-cat="memory"]::before { background: var(--cat-memory); }
.storyline-card[data-cat="deep"]::before { background: var(--cat-deep); }

.storyline-card:hover,
.storyline-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--ink-2);
  box-shadow: var(--shadow-1);
}

.storyline-card:hover::before {
  width: 5px;
}

.storyline-card .sl-tag {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.storyline-card .sl-title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--paper-bright);
  line-height: 1.14;
  margin-bottom: 4px;
}

.storyline-card .sl-title-my {
  font-family: var(--font-my);
  font-size: 14px;
  color: var(--paper-dim);
  margin-bottom: 10px;
  line-height: 1.6;
}

.storyline-card .sl-excerpt {
  font-size: 13.5px;
  color: var(--muted-strong);
  line-height: 1.65;
  margin-bottom: var(--s-3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.storyline-card .sl-meta {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--line-hair);
  padding-top: 10px;
}

.sl-marker {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  margin-bottom: 8px;
  border: 1px solid;
  border-radius: var(--r-1);
}

.sl-marker.real {
  color: var(--real);
  border-color: var(--phosphor-dim);
  background: var(--phosphor-wash);
}

.sl-marker.folklore {
  color: var(--folklore);
  border-color: var(--folklore-line);
  background: var(--folklore-wash);
}

.sl-marker.fiction {
  color: var(--alert-bright);
  border-color: var(--line-red);
  background: var(--alert-wash);
}

/* ============================================================
   NEWS / BULLETINS
   ============================================================ */
.news-item {
  position: relative;
  display: grid;
  grid-template-columns: var(--gutter-id) minmax(0, 1fr);
  column-gap: var(--s-4);
  padding: var(--s-3) var(--s-2) var(--s-4) var(--s-3);
  border-bottom: 1px solid var(--line-hair);
}

.news-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: var(--s-3);
  bottom: var(--s-4);
  width: var(--spine);
  background: var(--alert);
}

.news-item h3 {
  grid-column: 2;
  grid-row: 1;
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 700;
  letter-spacing: 0.012em;
  text-transform: uppercase;
  color: var(--paper-bright);
  line-height: var(--lh-snug);
}

.news-item .news-my {
  grid-column: 2;
  grid-row: 2;
  font-family: var(--font-my);
  font-size: 14px;
  color: var(--paper-dim);
  margin-top: 2px;
}

.news-item p {
  grid-column: 2;
  grid-row: 3;
  font-size: var(--fs-body);
  color: var(--muted-strong);
  line-height: var(--lh-body);
  margin-top: 10px;
}

.news-item .date {
  grid-column: 1;
  grid-row: 1;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
  border-right: 1px solid var(--line-hair);
  padding: 4px var(--s-3) 0 0;
}

/* ============================================================
   RECOVERED IMAGERY
   Contact-sheet frames: image, a caption strip that is always
   readable, then the withheld description on hover or focus.
   ============================================================ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-3);
}

.photo {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;                 /* it is a <figure>: kill the UA indent */
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--ink-1);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--dur-2) var(--ease),
              box-shadow var(--dur-2) var(--ease),
              transform var(--dur-2) var(--ease);
}

.photo:hover,
.photo:focus-within {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-1);
  transform: translateY(-2px);
}

.photo img {
  width: 100%;
  flex: 1;
  min-height: 0;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08) brightness(0.72) sepia(0.3);
  transition: filter var(--dur-3) var(--ease);
}

.photo:hover img,
.photo:focus-within img {
  filter: grayscale(0.25) contrast(1.02) brightness(0.95) sepia(0.06);
}

.photo .caption {
  flex: none;
  background: var(--ink-2);
  border-top: 1px solid var(--line);
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-dim);
}

.photo .caption-my {
  font-family: var(--font-my);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted-strong);
  margin-top: 2px;
}

.photo-marker {
  position: absolute;
  top: 8px;
  left: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 3px 7px;
  border: 1px solid;
  border-radius: var(--r-1);
  z-index: 5;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(11, 12, 14, 0.78);
}

.photo-marker.real {
  color: var(--real);
  border-color: var(--phosphor-dim);
}

.photo-marker.folklore {
  color: var(--folklore);
  border-color: var(--folklore-line);
}

.photo-marker.fiction {
  color: var(--alert-bright);
  border-color: var(--line-red);
}

.photo-desc {
  display: none;
  position: absolute;
  inset: 0 0 auto 0;
  max-height: 100%;
  background: rgba(11, 12, 14, 0.96);
  color: var(--paper);
  padding: 14px;
  font-size: 12.5px;
  line-height: 1.65;
  overflow-y: auto;
  z-index: 10;
}

.photo:hover .photo-desc,
.photo:focus-within .photo-desc,
.photo.open .photo-desc {
  display: block;
}

.photo-desc .desc-title {
  font-family: var(--font-mono);
  color: var(--alert-bright);
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ============================================================
   VAULT — the one place a machine speaks
   Phosphor, scanlines and a black bezel are diegetic here: this is
   the terminal, not the filing room. Literal values are allowed.
   ============================================================ */
.vault {
  position: relative;
  border: 1px solid var(--phosphor-dim);
  border-radius: var(--r-2);
  padding: var(--s-6) var(--s-4);
  text-align: center;
  background:
    repeating-linear-gradient(0deg,
      rgba(51, 255, 102, 0.045) 0 1px,
      transparent 1px 4px),
    #040a06;
  box-shadow: inset 0 0 60px rgba(51, 255, 102, 0.07);
  color: var(--phosphor);
  overflow: hidden;
}

.vault .lock-icon {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--phosphor);
  border: 1px solid var(--phosphor-dim);
  border-radius: var(--r-1);
  padding: 6px 14px;
  margin-bottom: var(--s-3);
  text-shadow: 0 0 12px rgba(51, 255, 102, 0.5);
  animation: pulse 2.4s var(--ease) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.vault-label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.vault input {
  background: #000;
  border: 1px solid var(--phosphor-dim);
  border-radius: var(--r-1);
  color: var(--phosphor-bright);
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.3em;
  text-align: center;
  padding: 11px 14px;
  width: min(260px, 90%);
  margin: var(--s-4) 0;
  outline: none;
}

.vault input:focus {
  border-color: var(--phosphor);
  box-shadow: 0 0 0 3px rgba(51, 255, 102, 0.14);
}

.vault button {
  background: var(--phosphor);
  color: #04120a;
  border: none;
  border-radius: var(--r-1);
  padding: 12px 26px;
  min-height: 42px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  margin-left: 8px;
  transition: background var(--dur-1) var(--ease),
              box-shadow var(--dur-1) var(--ease);
}

.vault button:hover {
  background: var(--phosphor-bright);
  box-shadow: 0 0 24px rgba(51, 255, 102, 0.35);
}

.vault .hint {
  font-size: 13px;
  color: var(--phosphor-dim);
  margin-top: var(--s-4);
  font-family: var(--font-my);
}

.secret-content {
  display: none;
  margin-top: var(--s-5);
  text-align: left;
  border-top: 1px dashed var(--phosphor-dim);
  padding-top: var(--s-4);
  animation: fadeIn var(--dur-3) var(--ease);
}

.secret-content.show {
  display: block;
}

.secret-content p {
  font-size: var(--fs-body);
  line-height: 1.85;
  color: var(--phosphor-bright);
  margin-bottom: var(--s-3);
}

.secret-content .my {
  font-family: var(--font-my);
  font-size: 14px;
  color: var(--phosphor);
}

/* ============================================================
   SURVEILLANCE NOTICE
   ============================================================ */
.surveillance {
  border: 1px solid var(--folklore-line);
  border-left: var(--spine) solid var(--folklore);
  border-radius: var(--r-2);
  padding: var(--s-5) var(--s-4);
  background: linear-gradient(180deg, var(--folklore-wash), transparent 70%);
  color: var(--folklore);
}

.surveillance h3 {
  margin-bottom: var(--s-3);
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: var(--lh-snug);
}

/* The observation lamp: drawn, not pasted. An emoji eye makes a threat look
   like a sticker; a red lens with a pulse looks like equipment. */
.eye-anim {
  width: 22px;
  height: 22px;
  margin: var(--s-5) auto;
  border: 2px solid var(--alert-deep);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--alert-bright) 0 32%, rgba(216, 50, 63, 0.18) 34%, transparent 62%);
  box-shadow: 0 0 26px var(--alert-glow), inset 0 0 8px rgba(216, 50, 63, 0.5);
  animation: eyeWatch 4s var(--ease) infinite;
}

@keyframes eyeWatch {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.1); opacity: 1; }
}

.surveillance p {
  font-size: var(--fs-body);
  line-height: 1.8;
  color: var(--paper-dim);
  margin-bottom: var(--s-3);
}

.surveillance .my {
  font-family: var(--font-my);
  font-size: 14px;
  color: var(--folklore);
}

.monitor-id {
  font-family: var(--font-mono) !important;
  font-size: var(--fs-micro) !important;
  letter-spacing: 0.18em !important;
  text-transform: uppercase;
  color: var(--muted) !important;
  margin-top: var(--s-4) !important;
  border-top: 1px solid var(--line-hair);
  padding-top: var(--s-3);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  text-align: center;
  padding: var(--s-5) var(--gutter) var(--s-6);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.site-footer .my {
  font-family: var(--font-my);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  margin-top: 8px;
  color: var(--muted-strong);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--s-4);
  margin-top: var(--s-4);
  flex-wrap: wrap;
}

.footer-links a {
  font-family: var(--font-mono);
  color: var(--muted-strong);
  text-decoration: none;
  font-size: var(--fs-micro);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease);
}

.footer-links a:hover {
  color: var(--alert-bright);
  border-bottom-color: var(--alert);
}

/* ============================================================
   MODAL — document viewer
   ============================================================ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 8, 0.86);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  padding: var(--s-5) var(--gutter);
  overflow-y: auto;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-inner {
  width: 100%;
  max-width: var(--maxw-modal);
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  background: var(--ink-1);
  border: 1px solid var(--line-strong);
  border-top: var(--spine) solid var(--alert);
  border-radius: var(--r-2);
  box-shadow: var(--shadow-2);
  padding: var(--s-5);
  animation: modalIn var(--dur-3) var(--ease-out);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.modal-inner h3 {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: var(--lh-snug);
  color: var(--paper-bright);
  margin-bottom: var(--s-3);
  padding-bottom: var(--s-3);
  padding-right: 44px;
  border-bottom: 1px solid var(--line);
}

.modal-inner .modal-body {
  font-size: var(--fs-body);
  line-height: 1.8;
  color: var(--paper-dim);
}

.modal-inner .modal-body .my {
  font-family: var(--font-my);
  color: var(--paper);
  font-size: 15px;
  display: block;
  margin-top: var(--s-3);
}

/* The Burmese restatement that opens a storyline record */
.modal-inner .modal-body .modal-my {
  font-family: var(--font-my);
  font-size: 15px;
  line-height: 1.8;
  color: var(--paper);
  margin-bottom: var(--s-4);
  padding-left: var(--s-3);
  border-left: var(--spine) solid var(--line-strong);
}

/* A marker chip reused inside the document viewer: no absolute positioning. */
.modal-marker {
  position: static;
  display: inline-block;
  margin-bottom: var(--s-3);
}

.modal-inner .modal-body h4 {
  font-family: var(--font-mono);
  color: var(--alert-bright);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: var(--s-5) 0 var(--s-2);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.modal-inner .modal-body p {
  margin-bottom: var(--s-3);
}

.modal-inner .modal-body .fragment {
  border-left: var(--spine) solid var(--cat-timeline);
  border-radius: 0 var(--r-1) var(--r-1) 0;
  padding: var(--s-2) var(--s-3);
  margin: var(--s-3) 0;
  background: var(--timeline-wash);
  font-family: var(--font-my);
  font-size: 14px;
  color: var(--paper);
  white-space: pre-line;
}

.modal-inner .modal-body .char-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: var(--s-3) 0;
}

.modal-inner .modal-body .char-chip {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 4px 10px;
  color: var(--muted-strong);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  color: var(--alert-bright);
  font-family: var(--font-mono);
  font-size: 15px;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease),
              color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease);
}

.modal-close:hover {
  background: var(--alert);
  border-color: var(--alert);
  color: var(--ink-0);
}

/* ============================================================
   BANNERS
   ============================================================ */
.verify-banner {
  background: var(--folklore-wash);
  border-top: 1px solid var(--folklore-line);
  border-bottom: 1px solid var(--folklore-line);
  color: var(--folklore);
  padding: 12px var(--gutter);
  text-align: center;
  font-size: 14px;
  font-family: var(--font-my);
}

.verify-banner a {
  color: var(--paper-bright);
  font-weight: 700;
  text-decoration-color: var(--folklore);
}

/* ============================================================
   NOTIFICATION BELL
   ============================================================ */
.notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  color: var(--paper-dim);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tr-mono);
  text-transform: uppercase;
  padding: 8px 12px;
  min-height: 36px;
  cursor: pointer;
  transition: color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease),
              background var(--dur-1) var(--ease);
}

.notif-bell:hover {
  color: var(--paper-bright);
  border-color: var(--line-strong);
  background: var(--ink-2);
}

.notif-bell:focus-visible {
  outline: 2px solid var(--alert-bright);
  outline-offset: 2px;
}

.notif-bell.has-unread {
  border-color: var(--line-red);
  background: var(--alert-wash);
  color: var(--paper-bright);
  animation: bellPulse 2.8s var(--ease) infinite;
}

@keyframes bellPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--alert-glow); }
  50% { box-shadow: 0 0 0 6px rgba(216, 50, 63, 0); }
}

.notif-count {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--tr-mono);
  background: var(--alert);
  color: var(--ink-0);
  border-radius: var(--r-pill);
  padding: 2px 7px;
}

/* The bell carries the word NOTICES rather than a pictogram; this copy of the
   rules must stay identical to css/notifications.css. */
.notif-bell-label {
  line-height: 1;
  white-space: nowrap;
}

/* ============================================================
   OPERATIVE AVATAR
   ============================================================ */
.profile-avatar {
  width: 76px;
  height: 76px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--paper-bright);
  background: var(--ink-2);
  box-shadow: var(--shadow-1);
  flex-shrink: 0;
  overflow: hidden;
}

.profile-avatar.has-img {
  padding: 0;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.avatar-edit-btn {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--alert);
  color: var(--ink-0);
  border: 2px solid var(--ink-0);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease),
              box-shadow var(--dur-1) var(--ease);
}

.avatar-edit-btn:hover {
  background: var(--alert-bright);
  box-shadow: 0 6px 18px var(--alert-glow);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.empty-note {
  color: var(--muted);
  text-align: center;
  padding: var(--s-7) var(--s-4);
  font-size: 14px;
  font-family: var(--font-my);
  border: 1px dashed var(--line);
  border-radius: var(--r-2);
  background: var(--ink-1);
}

.text-real { color: var(--real); }
.text-folklore { color: var(--folklore); }
.text-fiction { color: var(--alert-bright); }

.badge-real,
.badge-folklore,
.badge-fiction {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border: 1px solid;
  border-radius: var(--r-1);
}

.badge-real {
  color: var(--real);
  border-color: var(--phosphor-dim);
  background: var(--phosphor-wash);
}

.badge-folklore {
  color: var(--folklore);
  border-color: var(--folklore-line);
  background: var(--folklore-wash);
}

.badge-fiction {
  color: var(--alert-bright);
  border-color: var(--line-red);
  background: var(--alert-wash);
}

/* ============================================================
   EMPTY STATE — the one desk component shared by every sheet
   (missions, review, manage-roles). A queue with nothing in it is an
   instruction, not a gap, so it is a dashed well in the Myanmar face.
   ============================================================ */
.empty-note {
  font-family: var(--font-my);
  font-size: var(--fs-label);
  line-height: 1.7;
  color: var(--muted-strong);
  text-align: center;
  background: var(--ink-1);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-2);
  padding: var(--s-7) var(--s-4);
}

/* ============================================================
   THE POSTING STAMP — desk furniture shared by every sheet that
   distributes work: the mission board, the rooms terminal, the
   mailbox. It moved out of css/missions.css when the second and
   third page appeared, because a stamp printed three ways stops
   being the Bureau's stamp. Who you belong to, above the work that
   follows from it: mono, hairline box, the division code in the
   colour the rest of the site uses for an assigned thing.
   ============================================================ */
.posting-stamp-wrap:empty {
  display: none;
}

.posting-stamp {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-1) var(--s-2);
  border: 1px solid var(--line-strong);
  border-left: var(--spine) solid var(--cat-timeline);
  border-radius: var(--r-1);
  background: var(--ink-1);
  padding: var(--s-2) var(--s-3);
  margin-bottom: var(--s-3);
}

.ps-code {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--cat-timeline);
  white-space: nowrap;
}

.ps-en {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tr-mono);
  text-transform: uppercase;
  color: var(--paper-bright);
}

.ps-my {
  font-family: var(--font-my);
  font-size: var(--fs-label);
  line-height: 1.7;
  color: var(--paper-dim);
  flex: 1 1 100%;
}

/* An operative with no posting sees the sheet they are missing, in the colour the
   site uses when a file is not right yet. */
.posting-stamp.none {
  border-left-color: var(--folklore);
}

.posting-stamp.none .ps-en {
  color: var(--folklore);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .header-actions {
    grid-column: 1;
    grid-row: auto;
    justify-content: flex-start;
    max-width: none;
    margin-top: var(--s-4);
  }

  .classified-stamp {
    top: var(--s-1);
    right: var(--gutter);
  }
}

@media (max-width: 768px) {
  :root {
    --gutter-id: 64px;
  }

  .site-main {
    padding: var(--s-5) var(--gutter) var(--s-7);
  }

  .marker-legend {
    gap: 8px var(--s-3);
    padding: 10px 12px;
    font-size: 12px;
  }

  .marker-legend .legend-title {
    flex-basis: 100%;
  }

  .storyline-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding-top: var(--s-6);
  }

  .file-card,
  .news-item {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 2px;
  }

  .file-card {
    padding-right: var(--s-3);
  }

  .file-card .file-id,
  .file-card .file-title,
  .file-card .file-title-my,
  .file-card .file-meta,
  .news-item h3,
  .news-item .news-my,
  .news-item p,
  .news-item .date {
    grid-column: 1;
    grid-row: auto;
  }

  .file-card .file-id,
  .news-item .date {
    text-align: left;
    border-right: none;
    padding: 0 0 2px;
  }

  .file-marker {
    position: static;
    align-self: start;
    margin-bottom: 6px;
  }

  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .vault input {
    width: 100%;
    margin-bottom: var(--s-3);
  }

  .vault button {
    margin-left: 0;
    width: 100%;
  }

  .modal {
    padding: var(--s-3) var(--s-2);
  }

  .modal-inner {
    padding: var(--s-4) var(--s-3);
  }
}

@media (max-width: 420px) {
  .site-header h1 {
    font-size: 28px;
  }

  .my-title {
    font-size: 0.9rem;
  }

  .nav-btn {
    font-size: 10px;
    padding: 8px 10px;
  }
}

/* ============================================================
   PRINT — the dossier should still print as a document
   ============================================================ */
@media print {
  body::before,
  body::after,
  .ticker,
  .site-nav,
  .search-bar-wrap,
  .header-actions,
  .modal-close {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111;
  }

  .site-header h1,
  .panel h2,
  .file-card .file-title,
  .storyline-card .sl-title,
  .news-item h3 {
    color: #000;
  }

  .panel {
    display: block !important;
    page-break-after: always;
  }

  .storyline-card,
  .file-card,
  .news-item,
  .marker-legend {
    border-color: #bbb;
    background: #fff;
  }
}

/* ============================================================
   ACCESSIBILITY — reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .ticker span {
    animation: none;
    padding-left: 0;
    white-space: normal;
  }

  /* With no transition, a hover-only reveal is unreachable —
     show the withheld text instead of hiding it. */
  .redact {
    color: var(--alert-bright);
    background: var(--alert-wash);
  }
}
