/* ============================================================
   DOSSIER DECLASSIFIE — THE INTERFACE SERIES
   ============================================================ */

:root {
  --void:       #0B0B0C;
  --chrome:     #141416;
  --raised:     #1E1E20;
  --border:     #2A2A2C;
  --muted:      #8A8A8E;
  --text:       #C9C9CC;
  --paper:      #E8E6E0;
  --paper-dk:   #D1CECC;
  --oxblood:    #7A1414;
  --oxblood-lo: #5C0F0F;
  --accent:     #7A1414;
  --green:      #3A4A3A;
  /* Deck (player from mockup B) */
  --amber:        #ffb000;
  --amber-glow:   rgba(255,176,0,0.35);
  --chassis-top:  #43464b;
  --chassis-mid:  #33363b;
  --chassis-bot:  #27292d;
  --deck-recessed:#17181b;
  --tech:       'JetBrains Mono', 'IBM Plex Mono', monospace;
  --mono:       'IBM Plex Mono', 'Courier Prime', monospace;
  --head:       'Special Elite', 'IBM Plex Mono', monospace;
  --body:       'IBM Plex Sans', sans-serif;

  /* ---- Type scale — modular, ratio 1.2 (minor third) ----
     Anchored on --fs-md (reading text). Root is 106.25% = 17px,
     so 1rem = 17px and every step is a clean 1.2 multiple. */
  --fs-2xs:  0.579rem;  /* ~10px — micro mono labels / eyebrows */
  --fs-xs:   0.694rem;  /* ~12px — small mono / captions */
  --fs-sm:   0.833rem;  /* ~14px — UI text, list titles */
  --fs-md:   1rem;      /*  17px — body / reading (base) */
  --fs-lg:   1.2rem;    /* ~20px — titles */
  --fs-xl:   1.44rem;   /* ~24px — large titles */
  --fs-2xl:  1.728rem;  /* ~29px — icons / display */
  --fs-hero: 5.5rem;    /* ~93px — CLASSIFIED watermark */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 106.25%; }  /* 1rem = 17px — root of the type scale */

html, body {
  height: 100%;
  background: var(--void);
  color: var(--text);
  font-family: var(--body);
  font-size: var(--fs-md);
  overflow: hidden;
}

/* Paper grain */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 300px 300px;
  opacity: 0.035;
  pointer-events: none; z-index: 900;
}

/* Vignette */
body::after {
  content: '';
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
  pointer-events: none; z-index: 901;
}

/* ---- LAYOUT ---- */
#app {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100vh;
  overflow: hidden;
}

#classification-bar {
  background: var(--oxblood);
  color: var(--paper);
  text-align: center;
  padding: 5px 16px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--oxblood-lo);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  user-select: none;
}

/* Subtle scanlines on classification bar */
#classification-bar::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0.18) 0px, rgba(0,0,0,0.18) 1px,
    transparent 1px, transparent 3px
  );
  pointer-events: none;
}

#workspace {
  display: grid;
  grid-template-columns: 288px 1fr;
  overflow: hidden;
  height: 100%;
}

/* ================================================================
   SIDEBAR
   ================================================================ */
#sidebar {
  background: var(--chrome);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

#sidebar-header {
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--raised);
  flex-shrink: 0;
  position: relative;
}

#sidebar-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, var(--oxblood) 0%, transparent 100%);
  opacity: 0.5;
}

.sidebar-eyebrow {
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin-bottom: 3px;
}

.sidebar-title {
  font-family: var(--head);
  font-size: var(--fs-lg);
  color: var(--text);
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.sidebar-subtitle {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  letter-spacing: 0.12em;
  margin-top: 4px;
}

/* ---- FILTERS ---- */
#filters {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--chrome);
}

.filter-group {
  margin-bottom: 8px;
}
.filter-group:last-of-type {
  margin-bottom: 6px;
}

.filter-label {
  display: block;
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin-bottom: 4px;
}

.filter-select {
  width: 100%;
  background: var(--raised);
  border: 1px solid var(--border);
  border-left: 2px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  padding: 5px 24px 5px 7px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%238A8A8E'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  transition: border-color 0.15s;
}
.filter-select:focus { border-left-color: var(--oxblood); outline: none; }
.filter-select option { background: var(--raised); }

.filter-status {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-top: 6px;
}
.filter-status span { color: var(--text); }

/* ---- PLAYLIST ---- */
#playlist-header {
  padding: 7px 12px 6px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--raised);
}

.playlist-heading {
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

#playlist-count-badge {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  background: var(--chrome);
  border: 1px solid var(--border);
  padding: 1px 6px;
  min-width: 28px;
  text-align: center;
}

#playlist {
  flex: 1;
  overflow-y: auto;
  padding: 2px 0;
}

#playlist::-webkit-scrollbar { width: 3px; }
#playlist::-webkit-scrollbar-track { background: var(--chrome); }
#playlist::-webkit-scrollbar-thumb { background: var(--border); }
#playlist::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.playlist-item {
  display: flex;
  align-items: flex-start;
  padding: 6px 12px 6px 10px;
  cursor: pointer;
  border-left: 3px solid transparent;
  border-bottom: 1px solid transparent;
  gap: 7px;
  transition: background 0.1s;
}
.playlist-item:hover {
  background: rgba(255,255,255,0.03);
  border-bottom-color: var(--border);
}
.playlist-item.active {
  background: rgba(122,20,20,0.08);
  border-left-color: var(--oxblood);
  border-bottom-color: rgba(122,20,20,0.2);
}

.item-num {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  min-width: 26px;
  flex-shrink: 0;
  padding-top: 2px;
  letter-spacing: 0.05em;
}

.playlist-item.active .item-num { color: var(--oxblood); }

.item-info { flex: 1; min-width: 0; }

.item-title {
  font-family: var(--body);
  font-size: var(--fs-sm);
  color: var(--text);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.playlist-item.active .item-title { color: var(--paper); }

.item-listened-badge {
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--oxblood);
  text-transform: uppercase;
  margin-top: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}
.item-listened-badge.on { opacity: 1; }

/* Empty filter state */
#playlist-empty {
  display: none;
  padding: 24px 16px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--muted);
  letter-spacing: 0.15em;
  text-align: center;
  text-transform: uppercase;
}

/* ================================================================
   MAIN AREA
   ================================================================ */
#main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

/* ---- LOADING ---- */
#loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 14px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--muted);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.loading-bar {
  width: 200px;
  height: 2px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.loading-bar::after {
  content: '';
  position: absolute;
  left: -40%;
  width: 40%;
  height: 100%;
  background: var(--oxblood);
  animation: loadprogress 1.4s ease-in-out infinite;
}
@keyframes loadprogress {
  0% { left: -40%; }
  100% { left: 100%; }
}

/* ================================================================
   PLAYER SECTION — TAPE DECK (transplanted from mockup B)
   ================================================================ */
#player-section {
  flex-shrink: 0;
  background: var(--void);
  border-bottom: 1px solid var(--border);
  display: none;
}

/* ─── DECK WRAPPER ────────────────────────────────────────────────── */
#deck-wrapper {
  padding: 12px 16px 10px;
  flex-shrink: 0;
  background: var(--void);
}
.deck-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.deck-banner-left {
  font-family: var(--tech);
  font-size: var(--fs-2xs);
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
}
.deck-banner-right {
  font-family: var(--tech);
  font-size: var(--fs-2xs);
  letter-spacing: 0.14em;
  color: #3a3a3c;
  text-transform: uppercase;
}

/* ─── THE DECK (machine chassis) ─────────────────────────────────── */
#deck {
  background: linear-gradient(175deg, var(--chassis-top) 0%, var(--chassis-mid) 45%, var(--chassis-bot) 100%);
  border-radius: 5px;
  padding: 13px 14px 11px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.07) inset,
    0 -1px 0 rgba(0,0,0,0.6) inset,
    1px 0 0 rgba(255,255,255,0.04) inset,
    -1px 0 0 rgba(0,0,0,0.3) inset,
    0 6px 24px rgba(0,0,0,0.7),
    0 2px 4px rgba(0,0,0,0.5);
  position: relative;
}

/* ─── DECK PLATE (recessed dark panel with reels) ─────────────────── */
#deck-plate {
  background: var(--deck-recessed);
  border-radius: 3px;
  padding: 12px;
  box-shadow:
    inset 0 3px 10px rgba(0,0,0,0.8),
    inset 0 1px 3px rgba(0,0,0,0.6),
    0 1px 0 rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  gap: 10px;
  height: 168px;
}

/* ─── REELS ──────────────────────────────────────────────────────── */
.reel-mount {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.reel {
  width: 136px;
  height: 136px;
  animation: reel-spin 3s linear infinite;
  animation-play-state: paused;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.9));
}
.reel svg { display: block; width: 100%; height: 100%; }
@keyframes reel-spin { to { transform: rotate(360deg); } }
.reel-label {
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  letter-spacing: 0.16em;
  color: #444;
  text-transform: uppercase;
}

/* ─── DECK CENTER COLUMN ──────────────────────────────────────────── */
#deck-center-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  gap: 8px;
  min-width: 0;
}
#tape-path-svg {
  width: 100%;
  flex-shrink: 0;
  height: 52px;
}

/* ─── CRT DISPLAY ─────────────────────────────────────────────────── */
#crt-display {
  background: #080b07;
  border: 1.5px solid #1a2018;
  border-radius: 2px;
  padding: 8px 11px 7px;
  font-family: var(--tech);
  color: var(--amber);
  text-shadow: 0 0 7px #ff8c00, 0 0 14px rgba(255,140,0,0.25);
  position: relative;
  overflow: hidden;
  width: 100%;
  flex: 1;
}
#crt-display::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(rgba(0,0,0,0.22) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.crt-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: var(--fs-xs);
  opacity: 0.85;
  margin-bottom: 2px;
}
.crt-top {
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.crt-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}
.crt-label { color: #7a5500; font-size: var(--fs-2xs); letter-spacing: 0.1em; }
#crt-postnum { font-size: var(--fs-sm); font-weight: 700; }
.crt-sep { color: #7a5500; }
#crt-status { letter-spacing: 0.12em; }
#crt-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
}
.crt-bottom { margin-top: 2px; justify-content: space-between; }
#crt-speed { color: #b07800; margin-left: auto; }

/* ─── VU METER ────────────────────────────────────────────────────── */
#vu-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  width: 80px;
}
.vu-header {
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  letter-spacing: 0.18em;
  color: #444;
  text-transform: uppercase;
}
#vu-svg { width: 78px; height: 66px; }
#rec-dot {
  font-size: var(--fs-sm);
  color: var(--accent);
  opacity: 0.2;
  transition: opacity 0.1s;
  line-height: 1;
}

/* ─── TRANSPORT STRIP ─────────────────────────────────────────────── */
#transport-strip {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#seek-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.t-time {
  font-family: var(--tech);
  font-size: var(--fs-xs);
  color: var(--muted);
  min-width: 34px;
  white-space: nowrap;
}
.t-time:last-child { text-align: right; }
#seek-bar {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 3px;
  cursor: pointer;
  outline: none;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) 0%, #252528 0%, #252528 100%);
}
#seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ffd060, var(--amber));
  cursor: pointer;
  box-shadow: 0 0 5px rgba(255,176,0,0.6), 0 1px 2px rgba(0,0,0,0.5);
}
#seek-bar::-moz-range-thumb {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--amber);
  border: none;
  cursor: pointer;
}
#seek-bar::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; }

#transport-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.btn-t {
  background: linear-gradient(180deg, #4c5058 0%, #3a3d44 55%, #30333a 100%);
  border: none;
  border-radius: 3px;
  color: #9aa0a8;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  padding: 0;
  cursor: pointer;
  box-shadow:
    0 2px 0 #1a1c20,
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 -1px 0 rgba(0,0,0,0.4) inset;
  transition: transform 0.07s, box-shadow 0.07s, color 0.1s;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 42px;
  gap: 2px;
  text-transform: uppercase;
}
.btn-t:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #1a1c20, inset 0 1px 3px rgba(0,0,0,0.5);
}
.btn-t.active {
  background: linear-gradient(180deg, #3e4148 0%, #2e3138 55%, #26292e 100%);
  box-shadow: 0 1px 0 #0e0f12, inset 0 2px 4px rgba(0,0,0,0.6);
  color: var(--amber);
  text-shadow: 0 0 6px rgba(255,176,0,0.5);
}
.btn-t.btn-play { width: 64px; height: 48px; font-size: var(--fs-xl); }
.btn-sym { font-size: var(--fs-md); }
.btn-sub {
  font-size: var(--fs-2xs);
  letter-spacing: 0.12em;
  opacity: 0.65;
}
#speed-section {
  margin-left: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#speed-section .f-label {
  font-family: var(--tech);
  font-size: var(--fs-2xs);
  letter-spacing: 0.18em;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 0;
}
#speed-select {
  width: 68px;
  background: #0d0d0f;
  border: 1px solid var(--border);
  color: var(--amber);
  font-family: var(--tech);
  font-size: var(--fs-sm);
  padding: 4px 6px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  text-shadow: 0 0 4px rgba(255,176,0,0.3);
}
#speed-select option { background: #141416; color: var(--text); text-shadow: none; }

#transport-buttons {
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ─── DYMO LABEL ──────────────────────────────────────────────────── */
#dymo-strip {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}
#dymo-label {
  background: #111;
  border: 1px solid #000;
  padding: 3px 16px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.22em;
  color: #e8e6d8;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

#audio-error {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--oxblood);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 6px 18px 8px;
  display: none;
}

/* ================================================================
   POST SECTION
   ================================================================ */
#post-section {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px 40px;
  background: var(--void);
  display: none;
}

#post-section::-webkit-scrollbar { width: 5px; }
#post-section::-webkit-scrollbar-track { background: var(--void); }
#post-section::-webkit-scrollbar-thumb { background: var(--border); }
#post-section::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ---- OLD REDDIT BLOCK ---- */
#reddit-block {
  max-width: 740px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid #C0BDB7;
  color: #222;
  font-family: Verdana, Arial, sans-serif;
  font-size: var(--fs-md);
  position: relative;
  box-shadow:
    0 1px 3px rgba(0,0,0,0.3),
    0 0 0 1px rgba(0,0,0,0.08);
}

/* Faint CLASSIFIED diagonal watermark */
#reddit-block::before {
  content: 'CLASSIFIED';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-family: var(--mono);
  font-size: var(--fs-hero);
  font-weight: 900;
  color: rgba(122,20,20,0.04);
  letter-spacing: 0.12em;
  pointer-events: none;
  z-index: 0;
  white-space: nowrap;
  user-select: none;
}

/* Dossier stamp overlaying top-right of reddit block */
.dossier-stamp-block {
  position: absolute;
  top: 10px; right: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  z-index: 2;
  pointer-events: none;
}

.dossier-stamp-block .doc-stamp {
  font-size: var(--fs-2xs);
  padding: 1px 5px;
}

.reddit-thing {
  display: flex;
  padding: 8px 0;
  position: relative;
  z-index: 1;
}

.reddit-midcol {
  width: 40px;
  text-align: center;
  padding-top: 8px;
  flex-shrink: 0;
}

.reddit-arrow {
  width: 16px; height: 14px;
  margin: 0 auto 2px;
  border-style: solid;
  border-width: 0 8px 12px 8px;
  border-color: transparent transparent #c6c6c6;
  cursor: default;
}
.reddit-arrow.down {
  border-width: 12px 8px 0 8px;
  border-color: #c6c6c6 transparent transparent;
  margin-top: 2px;
}

.reddit-score {
  font-weight: bold;
  color: #333;
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.reddit-entry {
  flex: 1;
  padding: 6px 10px 8px 4px;
  min-width: 0;
}

.reddit-title-p {
  margin-bottom: 3px;
  padding-right: 80px; /* space for stamp */
}

.reddit-title-link {
  color: #0000ff;
  text-decoration: none;
  font-size: var(--fs-lg);
  font-weight: bold;
  line-height: 1.3;
  font-family: Verdana, Arial, sans-serif;
}
.reddit-title-link:visited { color: #551a8b; }
.reddit-title-link:hover { text-decoration: underline; }

.reddit-domain {
  color: #888;
  font-size: var(--fs-sm);
  font-family: Verdana, Arial, sans-serif;
}

.reddit-tagline {
  color: #888;
  font-size: var(--fs-sm);
  font-family: Verdana, Arial, sans-serif;
  margin-bottom: 8px;
  line-height: 1.5;
}

.reddit-author {
  color: #336699;
  text-decoration: none;
  font-family: Verdana, Arial, sans-serif;
}
.reddit-author:hover { text-decoration: underline; }

.reddit-expando { margin-top: 2px; }

.reddit-usertext-body {
  background: #f6f7f8;
  border: 1px solid #e1e1e1;
  padding: 8px 12px;
}

.reddit-md p {
  margin: 0.55em 0;
  line-height: 1.55;
  color: #222;
  font-family: Verdana, Arial, sans-serif;
  font-size: var(--fs-md);
}
.reddit-md p:first-child { margin-top: 0; }
.reddit-md p:last-child { margin-bottom: 0; }

/* ---- KARAOKE TEXT-SYNC ---- */
.kw {
  border-radius: 2px;
  padding: 0 0.5px;
  transition: background-color 0.12s linear, color 0.12s linear;
}
/* Current sentence: soft highlighter wash on the paper */
.reddit-md .kara-sent {
  background: rgba(255, 190, 60, 0.32);
  color: #1a1200;
}

/* Toggle bar above the post */
#karaoke-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.kara-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-left: 2px solid var(--muted);
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 5px 10px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.kara-toggle .kara-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.12s, box-shadow 0.12s;
}
.kara-toggle.on {
  color: var(--paper);
  border-left-color: var(--oxblood);
}
.kara-toggle.on .kara-dot {
  background: var(--oxblood);
  box-shadow: 0 0 6px rgba(122, 20, 20, 0.8);
}
.kara-toggle:hover { border-color: var(--muted); }

.reddit-footer {
  padding: 6px 10px;
  border-top: 1px solid #e1e1e1;
  background: #f0f1f2;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.reddit-footer a {
  color: #888;
  text-decoration: none;
  font-size: var(--fs-sm);
  font-family: Verdana, Arial, sans-serif;
}
.reddit-footer a:hover { text-decoration: underline; color: #336699; }
.reddit-footer span {
  color: #aaa;
  font-size: var(--fs-sm);
  font-family: Verdana, Arial, sans-serif;
}

/* ---- METADATA BLOCK ---- */
#doc-metadata {
  max-width: 740px;
  margin: 10px auto 0;
  border: 1px solid var(--border);
  background: var(--raised);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}

.meta-field {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.meta-key {
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
  padding-top: 2px;
  min-width: 60px;
}

.meta-val {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--text);
  line-height: 1.5;
}

/* ================================================================
   POST GRID — two columns: reddit (left 50%) + dossier (right 50%)
   ================================================================ */
#post-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  max-width: 1500px;
  margin: 0 auto;
}
#post-left { min-width: 0; }
/* Reddit block now flush-left, fills its column */
#post-left #reddit-block { max-width: none; margin: 0; }
#post-left #doc-metadata  { max-width: none; margin: 10px 0 0; }

/* ---- DOSSIER PANE (right column) ---- */
#dossier-pane {
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--chrome);
  position: sticky;
  top: 0;
  align-self: start;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
#dossier-header {
  padding: 11px 14px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--raised);
  position: relative;
}
#dossier-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, var(--oxblood) 0%, transparent 100%);
  opacity: 0.5;
}
.dossier-sub {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-top: 3px;
}
#dossier-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.dossier-tag {
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 7px;
  border: 1px solid var(--border);
  background: var(--chrome);
  color: var(--text);
}
.dossier-tag.narr  { border-left: 2px solid var(--oxblood); color: var(--paper); }
.dossier-tag.char  { border-left: 2px solid var(--green); }

/* ---- CAROUSEL ---- */
#carousel { position: relative; }
#carousel-viewport {
  position: relative;
  background: var(--void);
  min-height: 320px;
  overflow: hidden;
}
#carousel-track { position: relative; }
.car-slide {
  display: none;
  flex-direction: column;
}
.car-slide.active { display: flex; }

/* media slide (image / gif / video placeholder or real <img>) */
.slide-media {
  position: relative;
  width: 100%;
  height: 300px;
  background: #0d0d0f;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.slide-media img,
.slide-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.slide-media-ph {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0 10px, transparent 10px 20px),
    linear-gradient(160deg, #1c1c20 0%, #121214 100%);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.18em;
  color: #4a4a4e;
  text-transform: uppercase;
  text-align: center;
  padding: 16px;
}
.slide-type-badge {
  position: absolute;
  top: 8px; left: 8px;
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--oxblood);
  padding: 2px 7px;
  z-index: 2;
}
.slide-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-2xl);
  color: rgba(255,255,255,0.85);
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
  pointer-events: none;
}

/* text / wiki card slide */
.slide-card {
  padding: 16px 16px 18px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.slide-card.wiki { background: #f3f1ea; color: #1a1a1a; }
.slide-card.note {
  background: var(--raised);
  color: var(--text);
  border-left: 2px solid var(--oxblood);
}
.slide-card-kicker {
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.slide-card.wiki .slide-card-kicker { color: #7a1414; }
.slide-card.note .slide-card-kicker { color: var(--oxblood); }
.slide-card-title {
  font-family: var(--head);
  font-size: var(--fs-lg);
  line-height: 1.2;
}
.slide-card.wiki .slide-card-title { color: #111; }
.slide-card.note .slide-card-title { color: var(--paper); }
.slide-card-text {
  font-size: var(--fs-sm);
  line-height: 1.55;
  font-family: var(--body);
  overflow-y: auto;
}
.slide-card.wiki .slide-card-text { color: #2a2a2a; }
.slide-card-source {
  margin-top: auto;
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  letter-spacing: 0.08em;
  opacity: 0.7;
}

/* caption under media slides */
.slide-caption {
  padding: 8px 12px 10px;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  letter-spacing: 0.04em;
  line-height: 1.4;
  border-top: 1px solid var(--border);
  background: var(--chrome);
}
.slide-caption b { color: var(--text); font-weight: 500; }

/* nav arrows */
.car-nav {
  position: absolute;
  top: 150px;
  transform: translateY(-50%);
  width: 30px; height: 44px;
  background: rgba(10,10,12,0.7);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: background 0.12s, color 0.12s;
}
.car-nav:hover { background: var(--oxblood); color: var(--paper); border-color: var(--oxblood); }
#car-prev { left: 0; }
#car-next { right: 0; }

#carousel-empty {
  display: none;
  align-items: center;
  justify-content: center;
  height: 320px;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.15em;
  color: var(--muted);
  text-align: center;
  text-transform: uppercase;
}

#carousel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--raised);
}
#carousel-dots { display: flex; gap: 5px; flex-wrap: wrap; }
.car-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.car-dot.active { background: var(--oxblood); }
#carousel-counter {
  font-family: var(--mono);
  font-size: var(--fs-2xs);
  color: var(--muted);
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1100px) {
  #post-grid { grid-template-columns: 1fr; }
  #dossier-pane { position: static; }
}
@media (max-width: 800px) {
  #workspace { grid-template-columns: 240px 1fr; }
}
@media (max-width: 600px) {
  #workspace { grid-template-columns: 1fr; grid-template-rows: 260px 1fr; }
  #sidebar { height: 260px; }
}

