/* ==========================================================================
   《決定性瞬間 / 1/1000s》v2.0 — Leica Industrial Design & Archival Monograph CSS
   ========================================================================== */

:root {
  --bg-obsidian: #0b0b0a;
  --bg-body: #141312;
  --bg-metal-top: #262522;
  --bg-metal-bot: #151412;
  --bg-paper: #f3efe6;
  --bg-paper-dim: #e7e1d4;
  --ink-black: #121110;
  --ink-muted: #5a554d;
  --silver-bright: #ece7dc;
  --silver-mid: #9a948a;
  --silver-dim: #5c5852;
  --border-subtle: rgba(236, 231, 220, 0.13);
  --border-strong: rgba(236, 231, 220, 0.28);
  --leica-red: #c8231c;
  --rangefinder-amber: #e8b949;
  --grease-red: #d93025;
  --font-serif: 'Songti TC', 'Noto Serif TC', 'Playfair Display', Georgia, serif;
  --font-sans: 'PingFang TC', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', 'Space Mono', Menlo, ui-monospace, monospace;
}

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

html, body {
  width: 100%; height: 100%;
  background-color: var(--bg-obsidian);
  color: var(--silver-bright);
  font-family: var(--font-sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

.global-grain {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 999; opacity: 0.04;
  background-image: radial-gradient(rgba(255,255,255,0.65) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
}

.mono-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mono-tag.amber { color: var(--rangefinder-amber); }
.mono-tag.dim { color: var(--silver-mid); }
.mono-tag.red-tag { color: #ff6b63; }

.screen { position: fixed; inset: 0; display: none; flex-direction: column; width: 100%; height: 100%; }
.screen.active { display: flex; }
.hidden { display: none !important; }

/* ==================== 1. TITLE / MONOGRAPH SCREEN ==================== */
#screen-title {
  background: radial-gradient(circle at 50% 8%, #262420 0%, #0d0d0c 72%);
  overflow-y: auto;
  padding: 22px 28px 34px;
}

.title-frame {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100%;
}

.title-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.brand-badge { display: flex; align-items: center; gap: 10px; }
.red-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f04a42, var(--leica-red));
  box-shadow: 0 0 12px rgba(200, 35, 28, 0.75);
}
.topbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.ghost-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  color: var(--silver-bright);
  padding: 7px 14px;
  border-radius: 3px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.ghost-btn:hover {
  background: rgba(232, 185, 73, 0.12);
  border-color: var(--rangefinder-amber);
  color: #fff;
}
.ghost-btn em {
  font-style: normal;
  font-family: var(--font-mono);
  color: var(--rangefinder-amber);
  font-size: 0.76rem;
}
.ghost-btn.icon-only { padding: 7px 11px; }

.title-hero { text-align: center; padding: 6px 0 0; }
.hero-eyebrow { color: var(--silver-mid); margin-bottom: 10px; }
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.3rem, 4.8vw, 3.7rem);
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--bg-paper);
  line-height: 1.15;
}
.hero-sub {
  display: block; margin-top: 7px;
  font-family: Georgia, serif;
  font-size: clamp(0.92rem, 1.6vw, 1.18rem);
  font-weight: 500; letter-spacing: 0.22em; color: var(--silver-mid);
}
.hero-sub em { color: var(--rangefinder-amber); font-style: italic; }
.hero-desc {
  max-width: 780px; margin: 15px auto 0;
  font-size: 0.92rem; line-height: 1.8; color: #cfc8bc; font-weight: 300;
}
.hero-desc strong { color: var(--bg-paper); font-weight: 600; }
.hero-hook { display: inline-block; margin-top: 5px; color: var(--rangefinder-amber); font-size: 0.88rem; }

.roll-selector-wrap { display: flex; flex-direction: column; gap: 14px; }
.section-label {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border-subtle); padding-bottom: 8px; flex-wrap: wrap; gap: 8px;
}

.roll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 16px;
}

.roll-card {
  position: relative;
  background: linear-gradient(170deg, #211f1c 0%, #141311 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.roll-card:hover {
  transform: translateY(-4px);
  border-color: var(--rangefinder-amber);
  box-shadow: 0 16px 36px rgba(0,0,0,0.62);
}
.roll-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #100f0e;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
}
.roll-thumb-canvas {
  width: 100%; height: 100%; display: block;
  transition: transform 0.35s ease;
}
.roll-card:hover .roll-thumb-canvas { transform: scale(1.04); }
.roll-thumb-badges {
  position: absolute; top: 8px; left: 8px; right: 8px;
  display: flex; justify-content: space-between; align-items: center;
}
.roll-canister-tag {
  font-family: var(--font-mono); font-size: 0.66rem; padding: 2px 7px;
  background: rgba(13, 13, 12, 0.84);
  color: var(--rangefinder-amber);
  border: 1px solid rgba(232, 185, 73, 0.48);
  border-radius: 2px;
}
.roll-difficulty {
  font-family: var(--font-mono); font-size: 0.65rem; padding: 2px 7px;
  background: rgba(13, 13, 12, 0.8); color: var(--silver-bright); border-radius: 2px;
}

.roll-card-body {
  padding: 13px 15px 14px;
  display: flex; flex-direction: column; gap: 7px; flex: 1;
}
.roll-card-title { font-family: var(--font-serif); font-size: 1.08rem; font-weight: 700; color: var(--bg-paper); }
.roll-card-loc { font-family: var(--font-mono); font-size: 0.64rem; color: var(--silver-mid); }
.roll-card-desc { font-size: 0.8rem; line-height: 1.52; color: #b7b0a4; flex-grow: 1; }
.roll-card-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 9px; border-top: 1px dashed var(--border-subtle);
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--silver-mid);
}
.roll-card-footer .load-cta { color: var(--bg-paper); font-weight: 700; }
.roll-card:hover .load-cta { color: var(--rangefinder-amber); }

.title-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-subtle); display: flex; justify-content: center; }
.controls-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; font-size: 0.78rem; color: var(--silver-mid); }
.controls-legend kbd {
  font-family: var(--font-mono); font-size: 0.7rem;
  background: rgba(255,255,255,0.08); border: 1px solid var(--border-strong);
  border-radius: 3px; padding: 2px 6px; color: var(--bg-paper); margin-right: 4px;
}

/* ==================== 2. VIEWFINDER SHOOTING SCREEN ==================== */
#screen-shoot { background: #090908; }

.camera-topbar {
  height: 52px;
  background: linear-gradient(180deg, var(--bg-metal-top) 0%, var(--bg-metal-bot) 100%);
  border-bottom: 1px solid var(--border-strong);
  padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; z-index: 20;
}
.cam-left, .cam-right { display: flex; align-items: center; gap: 10px; }

.cam-chip-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-subtle);
  color: var(--silver-bright);
  padding: 6px 11px; border-radius: 3px; font-size: 0.78rem;
  cursor: pointer; transition: all 0.16s ease; white-space: nowrap;
}
.cam-chip-btn:hover { border-color: var(--rangefinder-amber); color: #fff; }
.cam-chip-btn.active { background: var(--grease-red); border-color: #f0554c; color: #fff; font-weight: 700; }
.cam-chip-btn.accent { background: var(--leica-red); border-color: #e6463f; color: #fff; font-weight: 600; }
.cam-chip-btn.accent:hover { background: #df2f27; }

.roll-meta { display: flex; align-items: baseline; gap: 8px; }
.roll-name-text { font-family: var(--font-serif); font-size: 0.94rem; color: var(--bg-paper); }

.loop-meter { display: flex; align-items: center; gap: 9px; }
.loop-track { position: relative; width: 170px; height: 6px; background: rgba(255,255,255,0.09); border-radius: 3px; overflow: hidden; }
.loop-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--silver-mid), var(--rangefinder-amber)); }
.loop-ticks { position: absolute; inset: 0; display: flex; justify-content: space-evenly; }
.loop-ticks span { width: 1px; height: 100%; background: rgba(0,0,0,0.45); }

.viewfinder-stage { position: relative; flex: 1; width: 100%; overflow: hidden; background: #080807; cursor: crosshair; }
#viewfinder-canvas { display: block; width: 100%; height: 100%; }

.shutter-curtain { pointer-events: none; position: absolute; inset: 0; background: #000; opacity: 0; z-index: 15; }
.shutter-curtain.snap { animation: shutterSnap 0.17s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes shutterSnap {
  0% { opacity: 0; } 20% { opacity: 0.98; } 55% { opacity: 0.92; } 100% { opacity: 0; }
}

.hint-drawer {
  position: absolute; top: 14px; right: 14px; width: 340px; max-width: calc(100% - 28px);
  max-height: calc(100% - 28px); overflow-y: auto;
  background: rgba(18, 17, 15, 0.95); backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong); border-radius: 4px; padding: 15px; z-index: 25;
  box-shadow: 0 18px 44px rgba(0,0,0,0.72);
}
.hint-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.close-x { background: none; border: none; color: var(--silver-mid); font-size: 1.4rem; cursor: pointer; line-height: 1; }
.close-x:hover { color: #fff; }
.hint-note { font-size: 0.8rem; line-height: 1.55; color: #ccc6bb; margin-bottom: 10px; }
.hint-subhead { margin-bottom: 6px; font-size: 0.64rem; }
.hint-clues, .hint-assignments { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.hint-clues li {
  font-size: 0.78rem; line-height: 1.45; padding: 7px 9px;
  background: rgba(255,255,255,0.04); border-left: 2px solid var(--rangefinder-amber); color: var(--silver-bright);
}
.hint-clues li strong { color: var(--rangefinder-amber); display: block; margin-bottom: 2px; font-size: 0.76rem; }
.hint-assignments li {
  font-size: 0.77rem; padding: 6px 9px; background: rgba(255,255,255,0.03);
  border-left: 2px solid var(--silver-dim); color: #cfc8bc;
}

.shot-toast {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(16, 15, 14, 0.92); border: 1px solid var(--rangefinder-amber);
  padding: 8px 18px; border-radius: 3px; display: flex; align-items: center; gap: 12px;
  font-size: 0.84rem; z-index: 22; pointer-events: none;
}

.breath-badge {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  background: rgba(18, 17, 15, 0.85); border: 1px solid rgba(232, 185, 73, 0.55);
  color: var(--rangefinder-amber); padding: 5px 12px; border-radius: 999px;
  font-size: 0.74rem; display: flex; align-items: center; gap: 7px; pointer-events: none; z-index: 20;
}
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rangefinder-amber); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.75); } }

/* Bottom Machined Leica Deck */
.camera-bottombar {
  height: 92px;
  background: linear-gradient(180deg, #252421 0%, #141311 100%);
  border-top: 1px solid var(--border-strong);
  padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; z-index: 20;
}

.deck-group { display: flex; flex-direction: column; gap: 5px; }
.deck-label { font-size: 0.62rem; color: var(--silver-mid); }

.film-dots { display: flex; gap: 7px; }
.film-slot {
  width: 40px; height: 28px; border: 1px solid var(--border-strong); border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.03); color: var(--silver-dim); transition: all 0.2s ease;
}
.film-slot.active { border-color: var(--rangefinder-amber); color: var(--rangefinder-amber); box-shadow: 0 0 10px rgba(232, 185, 73, 0.28); }
.film-slot.exposed { background: var(--bg-paper); border-color: var(--bg-paper); color: var(--ink-black); font-weight: 700; }

.focus-ring-group { flex: 1; max-width: 310px; }
.focus-header { display: flex; justify-content: space-between; align-items: center; }
.focus-slider-wrap { display: flex; align-items: center; gap: 8px; }
.focus-scale-marks { display: flex; justify-content: space-around; padding: 0 28px; font-size: 0.56rem; color: var(--silver-dim); }

#focus-slider {
  -webkit-appearance: none; appearance: none; flex: 1; height: 22px;
  background: repeating-linear-gradient(90deg, #32302c 0px, #32302c 2px, #171614 2px, #171614 5px);
  border: 1px solid var(--border-strong); border-radius: 3px; outline: none; cursor: ew-resize;
}
#focus-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 26px;
  background: linear-gradient(180deg, #f3ce70 0%, #c9942a 100%);
  border: 1px solid #fff3d1; border-radius: 2px; cursor: ew-resize;
  box-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

.dials-group { flex-direction: row; gap: 12px; align-items: center; }
.dial-control { display: flex; flex-direction: column; gap: 5px; }

.segmented-dial {
  display: inline-flex; background: #100f0e;
  border: 1px solid var(--border-subtle); border-radius: 3px; overflow: hidden;
}
.segmented-dial button {
  background: transparent; border: none; border-right: 1px solid var(--border-subtle);
  color: var(--silver-mid); font-family: var(--font-mono); font-size: 0.68rem;
  padding: 6px 8px; cursor: pointer; transition: all 0.14s ease; white-space: nowrap;
}
.segmented-dial.compact button { padding: 4px 7px; font-size: 0.64rem; }
.segmented-dial button:last-child { border-right: none; }
.segmented-dial button:hover { color: #fff; }
.segmented-dial button.active { background: var(--rangefinder-amber); color: #121110; font-weight: 700; }

.shutter-group { align-items: center; }
.shutter-release-btn {
  width: 50px; height: 50px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6e6a63, #24221f 70%);
  border: 2px solid #8a847a; display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.75), inset 0 1px 2px rgba(255,255,255,0.3);
  transition: transform 0.08s ease;
}
.shutter-release-btn:active { transform: scale(0.92); }
.shutter-inner {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e53a33, #8f1610 80%);
  border: 1px solid rgba(255,255,255,0.3);
}

/* ==================== 3. DARKROOM TRANSITION ==================== */
#screen-darkroom { background: #120202; align-items: center; justify-content: center; }
.darkroom-safelight { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.safelight-glow {
  position: absolute; width: 760px; height: 760px; border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 37, 30, 0.45) 0%, rgba(18, 2, 2, 0) 70%);
  animation: safelightBreath 2.4s ease-in-out infinite;
}
@keyframes safelightBreath { 0%, 100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.12); opacity: 1; } }
.darkroom-content { position: relative; z-index: 2; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.darkroom-title { font-family: var(--font-serif); font-size: 2rem; color: #ffd7d4; letter-spacing: 0.16em; }
.tray-preview { display: flex; gap: 18px; }
.tray-frame {
  width: 170px; height: 113px; background: #2b0b0a;
  border: 2px solid rgba(255, 110, 100, 0.35); background-size: cover; background-position: center;
  filter: sepia(1) hue-rotate(-50deg) saturate(2.2) brightness(0.15);
  transition: filter 1.6s ease;
}
.tray-frame.developed { filter: sepia(0.35) hue-rotate(-40deg) saturate(1.5) brightness(0.95) contrast(1.15); }

/* ==================== 4. CONTACT SHEET LIGHT-TABLE ==================== */
#screen-contact { background: #100f0e; }

.contact-topbar {
  min-height: 56px; background: #1a1917; border-bottom: 1px solid var(--border-subtle);
  padding: 8px 16px; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; flex-shrink: 0;
}
.contact-left, .contact-center, .contact-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.primary-export-btn {
  background: var(--bg-paper); color: var(--ink-black); border: none;
  padding: 8px 15px; border-radius: 3px; font-family: var(--font-sans);
  font-size: 0.82rem; font-weight: 700; cursor: pointer; transition: all 0.2s ease;
}
.primary-export-btn:hover { background: var(--rangefinder-amber); transform: translateY(-1px); }

.contact-scroll-area { flex: 1; overflow-y: auto; padding: 24px 20px 48px; }

.contact-sheet-paper {
  max-width: 1160px; margin: 0 auto; background: var(--bg-paper); color: var(--ink-black);
  border-radius: 2px; padding: 32px 34px 36px; box-shadow: 0 24px 64px rgba(0,0,0,0.75);
  display: flex; flex-direction: column; gap: 22px;
}

.cs-header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--ink-black); padding-bottom: 16px; gap: 20px; }
.cs-stamp {
  display: inline-block; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em;
  color: var(--grease-red); border: 1.5px solid var(--grease-red); padding: 2px 8px; margin-bottom: 8px; font-weight: 700;
}
.cs-title { font-family: var(--font-serif); font-size: 1.8rem; font-weight: 900; color: var(--ink-black); line-height: 1.25; }
.cs-subtitle { margin-top: 6px; color: var(--ink-muted); }

.cs-verdict-box {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-paper-dim); padding: 12px 18px; border: 1px solid rgba(18, 17, 16, 0.16);
}
.cs-grade-badge {
  width: 54px; height: 54px; border: 2.5px solid var(--grease-red); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 1.65rem; font-weight: 900; color: var(--grease-red);
  transform: rotate(-8deg);
}
.cs-valuation { display: flex; flex-direction: column; gap: 2px; }
.cs-valuation strong { font-family: var(--font-mono); font-size: 1.06rem; color: var(--ink-black); }

.film-strip-container { background: #0f0e0d; padding: 12px 16px; border-radius: 2px; color: #d9a441; display: flex; flex-direction: column; gap: 8px; }
.sprocket-row {
  height: 14px;
  background-image: repeating-linear-gradient(90deg, transparent 0px, transparent 10px, #f3efe6 10px, #f3efe6 26px, transparent 26px, transparent 38px);
  opacity: 0.88;
}
.film-edge-markings { display: flex; justify-content: space-between; font-size: 0.65rem; color: rgba(232, 185, 73, 0.82); padding: 0 6px; }

.cs-frames-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cs-frame-box {
  position: relative; background: #1a1918; aspect-ratio: 3 / 2; overflow: hidden;
  cursor: zoom-in; border: 1px solid #2b2926;
}
.cs-frame-box.grease-active { cursor: crosshair; }
.cs-frame-box canvas { width: 100%; height: 100%; display: block; }
.cs-frame-box.best-select { outline: 3px solid var(--grease-red); outline-offset: 2px; }
.cs-grease-tag {
  position: absolute; top: 8px; right: 8px; font-family: var(--font-mono); font-size: 0.66rem; font-weight: 700;
  color: #fff; background: var(--grease-red); padding: 2px 7px; transform: rotate(3deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.45); pointer-events: none;
}
.cs-pin-btn {
  position: absolute; bottom: 7px; left: 7px;
  background: rgba(14,13,12,0.82); color: #f3efe6; border: 1px solid rgba(232,185,73,0.45);
  font-family: var(--font-sans); font-size: 0.68rem; padding: 3px 8px; border-radius: 2px;
  cursor: pointer; transition: all 0.16s ease;
}
.cs-pin-btn:hover, .cs-pin-btn.pinned { background: var(--rangefinder-amber); color: #121110; font-weight: 700; }

.cs-critiques-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.critique-card {
  background: var(--bg-paper-dim); border: 1px solid rgba(18, 17, 16, 0.14);
  padding: 15px; display: flex; flex-direction: column; gap: 9px;
}
.critique-card-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px dashed rgba(18, 17, 16, 0.22); padding-bottom: 7px; }
.critique-frame-num { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; color: var(--ink-black); }
.critique-score { font-family: var(--font-mono); font-size: 0.84rem; font-weight: 700; color: var(--grease-red); }
.critique-work-title { font-family: var(--font-serif); font-size: 1rem; font-weight: 700; color: var(--ink-black); }
.critique-body { font-size: 0.84rem; line-height: 1.65; color: #2b2926; flex-grow: 1; }
.critique-metrics { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 8px; border-top: 1px solid rgba(18, 17, 16, 0.1); }
.metric-pill { font-family: var(--font-mono); font-size: 0.64rem; background: rgba(18, 17, 16, 0.08); color: var(--ink-black); padding: 2px 6px; border-radius: 2px; }
.metric-pill.hit { background: rgba(217, 48, 37, 0.14); color: var(--grease-red); font-weight: 700; }

.cs-assignments-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 10px 14px; background: var(--bg-paper-dim); border: 1px dashed rgba(18,17,16,0.22);
}
.assign-pill {
  font-size: 0.78rem; padding: 4px 10px; border-radius: 2px;
  background: rgba(18,17,16,0.06); color: var(--ink-muted);
}
.assign-pill.done { background: #191816; color: var(--rangefinder-amber); font-weight: 600; }

.cs-curator-summary { background: #181715; color: var(--bg-paper); padding: 18px 22px; display: flex; flex-direction: column; gap: 8px; }
.curator-seal { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; color: var(--rangefinder-amber); }
.curator-text { font-family: var(--font-serif); font-size: 0.98rem; line-height: 1.72; color: #e9e4da; }
.unlocked-banner {
  margin-top: 6px; padding: 8px 12px; background: rgba(232, 185, 73, 0.15);
  border-left: 3px solid var(--rangefinder-amber); color: var(--rangefinder-amber); font-size: 0.84rem;
}

/* ==================== 5. MODALS (LOUPE, CODEX & GALLERY) ==================== */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 8, 7, 0.86); backdrop-filter: blur(6px); }
.loupe-dialog, .codex-dialog {
  position: relative; z-index: 2; background: #1a1917; border: 1px solid var(--border-strong);
  border-radius: 4px; padding: 20px; max-width: 980px; width: 100%; max-height: 90vh;
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 24px 60px rgba(0,0,0,0.82);
}
.loupe-header, .codex-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-subtle); padding-bottom: 10px; }
.codex-header h3 { font-family: var(--font-serif); font-size: 1.35rem; color: var(--bg-paper); margin-top: 2px; }
.loupe-canvas-wrap { width: 100%; aspect-ratio: 3 / 2; background: #000; border: 1px solid #333; }
#loupe-canvas { width: 100%; height: 100%; display: block; }
.loupe-meta { font-size: 0.88rem; line-height: 1.6; color: #d6d0c5; }

.codex-list { overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding-right: 4px; }
.codex-item {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border-subtle);
  padding: 12px 14px; border-radius: 3px; display: flex; flex-direction: column; gap: 5px;
}
.codex-item.unlocked { border-color: rgba(232, 185, 73, 0.55); background: rgba(232, 185, 73, 0.06); }
.codex-item-head { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.66rem; color: var(--silver-mid); }
.codex-item.unlocked .codex-item-head { color: var(--rangefinder-amber); }
.codex-item-name { font-family: var(--font-serif); font-size: 0.96rem; color: var(--bg-paper); }
.codex-item-desc { font-size: 0.77rem; color: var(--silver-mid); line-height: 1.45; }

.gallery-grid {
  overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; padding-right: 4px;
}
.gallery-empty { grid-column: 1 / -1; text-align: center; padding: 48px 16px; color: var(--silver-mid); font-size: 0.9rem; }
.gallery-card {
  background: var(--bg-paper); color: var(--ink-black); padding: 12px; border-radius: 2px;
  display: flex; flex-direction: column; gap: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}
.gallery-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid #121110; }
.gallery-card-head { display: flex; justify-content: space-between; align-items: baseline; }
.gallery-card-title { font-family: var(--font-serif); font-size: 0.94rem; font-weight: 700; }
.gallery-card-meta { font-family: var(--font-mono); font-size: 0.66rem; color: var(--ink-muted); }
.gallery-del-btn {
  align-self: flex-end; background: none; border: 1px solid rgba(18,17,16,0.22);
  color: var(--ink-muted); font-size: 0.68rem; padding: 2px 8px; cursor: pointer;
}
.gallery-del-btn:hover { background: var(--grease-red); color: #fff; border-color: var(--grease-red); }

@media (max-width: 960px) {
  .camera-bottombar { height: auto; flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .cs-frames-row, .cs-critiques-grid { grid-template-columns: 1fr; }
  .contact-sheet-paper { padding: 20px 16px; }
  .cs-header { flex-direction: column; }
}
