/* ═══════════════════════════════════════════════════════════
   CRACKODILE & FRIENDS — PRODUCTION BOOK
   Wally's Storybook Aesthetic
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Patrick+Hand&family=Permanent+Marker&family=Schoolbell&display=swap');

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
  --cream:       #f5e6c8;
  --cream2:      #efe0b4;
  --cream3:      #e8d4a0;
  --ink:         #2a1a0e;
  --ink2:        #4a3220;
  --ink-light:   #7a6040;
  --red:         #c23b28;
  --red2:        #9b2218;
  --green:       #2d5a2e;
  --green2:      #1e3e1f;
  --gold:        #d4a017;
  --gold2:       #b8860b;
  --blue:        #1a3a6b;
  --cover-green: #2a5c2e;
  --cover-dark:  #162e18;
  --spine-gold:  #c9960e;

  --font-display: 'Fredoka One', cursive;
  --font-hand:    'Patrick Hand', cursive;
  --font-marker:  'Permanent Marker', cursive;
  --font-school:  'Schoolbell', cursive;

  --page-w: min(640px, 96vw);
  --page-h: min(860px, 88vh);
  --radius: 6px;

  --shadow-book: 0 30px 80px rgba(0,0,0,.7), 0 8px 20px rgba(0,0,0,.5);
  --shadow-page: 4px 0 18px rgba(0,0,0,.22), -2px 0 8px rgba(0,0,0,.1);
}

/* ── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

/* ── BODY ───────────────────────────────────────────────── */
body {
  font-family: var(--font-hand);
  background: radial-gradient(ellipse at 40% 20%, #5c3a1e, #2d1a0a 50%, #0e0805);
  color: var(--ink);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0;
  min-height: 100%;
  overflow: hidden;
}

/* ── TOP NAV ────────────────────────────────────────────── */
.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.25));
  border-bottom: 1px solid rgba(210,160,23,.25);
  gap: 16px;
  flex-wrap: wrap;
  z-index: 10;
}

.nav-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-eyebrow {
  font-family: var(--font-hand);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: .8;
}

.nav-bookname {
  font-family: var(--font-display);
  font-size: clamp(14px, 2vw, 20px);
  color: #f5e6c8;
  letter-spacing: .01em;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-nav {
  font-family: var(--font-hand);
  font-size: 14px;
  background: rgba(244,230,200,.12);
  border: 1px solid rgba(210,160,23,.3);
  border-radius: 999px;
  color: #f5e6c8;
  padding: 6px 14px;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.btn-nav:hover { background: rgba(244,230,200,.22); transform: translateY(-1px); }
.btn-nav:disabled { opacity: .3; cursor: not-allowed; transform: none; }

.page-label {
  font-family: var(--font-hand);
  font-size: 13px;
  color: rgba(245,230,200,.6);
  min-width: 160px;
  text-align: center;
}

/* ── STAGE ──────────────────────────────────────────────── */
.stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  min-height: 0;
  perspective: 2000px;
}

/* ── BOOK SHELL ─────────────────────────────────────────── */
.book {
  position: relative;
  width: var(--page-w);
  max-width: var(--page-w);
  height: var(--page-h);
  filter: drop-shadow(var(--shadow-book));
  transform-style: preserve-3d;
  transition: transform .5s ease;
}

/* Closed = tilted like a physical book on a table */
.book.closed {
  transform: rotateX(8deg) rotateZ(-1.5deg) scale(.97);
}

.book.opening {
  animation: bookOpen .5s ease forwards;
}

.book.closing {
  animation: bookClose .5s ease forwards;
}

@keyframes bookOpen {
  from { transform: rotateX(8deg) rotateZ(-1.5deg) scale(.97); }
  to   { transform: rotateX(0)    rotateZ(0)        scale(1); }
}

@keyframes bookClose {
  from { transform: rotateX(0)    rotateZ(0)        scale(1); }
  to   { transform: rotateX(8deg) rotateZ(-1.5deg) scale(.97); }
}

/* ── PAGE BASE ───────────────────────────────────────────── */
.page {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  display: none; /* JS controls visibility */

  /* Paper texture */
  background-color: var(--cream);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.055'/%3E%3C/svg%3E"),
    repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(100,70,30,.06) 27px, rgba(100,70,30,.06) 28px);

  box-shadow: var(--shadow-page);
}

.page-active {
  display: block;
  animation: pageReveal .28s ease forwards;
}

@keyframes pageReveal {
  from { opacity: 0; transform: translateX(18px) scale(.99); }
  to   { opacity: 1; transform: translateX(0)    scale(1); }
}

.page-enter-right {
  display: block;
  animation: enterRight .28s ease forwards;
}

.page-enter-left {
  display: block;
  animation: enterLeft .28s ease forwards;
}

@keyframes enterRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes enterLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── COVER PAGE ─────────────────────────────────────────── */
.cover-page {
  background: var(--cover-green) !important;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='80' height='80' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E") !important;
  border-radius: var(--radius);
}

.cover-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 40px 36px;
  position: relative;
  text-align: center;

  /* Inset border like a real book cover */
  box-shadow:
    inset 0 0 0 10px rgba(10,28,12,.7),
    inset 0 0 0 14px rgba(201,150,14,.65),
    inset 0 0 0 18px rgba(10,28,12,.4);
}

/* Corner ornaments */
.cover-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: rgba(201,150,14,.7);
  border-style: solid;
}
.cover-corner.tl { top: 24px;    left: 24px;   border-width: 3px 0 0 3px; }
.cover-corner.tr { top: 24px;    right: 24px;  border-width: 3px 3px 0 0; }
.cover-corner.bl { bottom: 24px; left: 24px;   border-width: 0 0 3px 3px; }
.cover-corner.br { bottom: 24px; right: 24px;  border-width: 0 3px 3px 0; }

/* Stars scattered on cover */
.cover-stars {
  position: absolute;
  inset: 28px;
  pointer-events: none;
}
.star {
  position: absolute;
  font-size: 18px;
  color: rgba(201,150,14,.55);
}
.s1 { top: 8%;  left: 8%;  font-size: 22px; }
.s2 { top: 12%; right: 10%; font-size: 14px; }
.s3 { bottom: 18%; left: 6%; font-size: 16px; }
.s4 { bottom: 12%; right: 8%; font-size: 20px; }
.s5 { top: 45%; left: 5%; font-size: 12px; }

.cover-badge {
  font-family: var(--font-hand);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1.5px solid rgba(201,150,14,.5);
  border-radius: 999px;
  padding: 3px 14px;
  margin-bottom: 22px;
  opacity: .85;
}

.cover-logo {
  color: #f5e6c8;
  line-height: 1;
  text-shadow: 0 4px 0 rgba(0,0,0,.35), 0 0 30px rgba(0,0,0,.4);
  margin-bottom: 18px;
}

.cover-logo-top {
  font-family: var(--font-display);
  font-size: clamp(38px, 8vw, 62px);
  letter-spacing: .02em;
  color: #f5e6c8;
}

.cover-logo-amp {
  font-family: var(--font-marker);
  font-size: clamp(28px, 5vw, 42px);
  color: var(--gold);
  margin: -4px 0;
}

.cover-logo-bottom {
  font-family: var(--font-display);
  font-size: clamp(38px, 8vw, 62px);
  letter-spacing: .02em;
  color: #f5e6c8;
}

.cover-subtitle-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.cover-rule {
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(201,150,14,.6), transparent);
}

.cover-subtitle {
  font-family: var(--font-school);
  font-size: clamp(16px, 2.8vw, 22px);
  color: rgba(245,230,200,.85);
  white-space: nowrap;
}

.cover-tag {
  font-family: var(--font-hand);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(245,230,200,.55);
  margin-bottom: 28px;
}

.cover-worm {
  background: rgba(10,28,12,.5);
  border: 1px solid rgba(201,150,14,.3);
  border-radius: 12px;
  padding: 10px 20px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.worm-body { font-size: 28px; }

.worm-text {
  font-family: var(--font-marker);
  font-size: 15px;
  color: rgba(245,230,200,.8);
}

.btn-open-book {
  font-family: var(--font-display);
  font-size: 18px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--cover-dark);
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,.35), 0 8px 20px rgba(0,0,0,.3);
  transition: transform .15s, filter .15s;
  letter-spacing: .01em;
}

.btn-open-book:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* ── TITLE / STORY PAGES ─────────────────────────────────── */
.story-page {
  /* inherits paper from .page */
}

.page-inner {
  height: 100%;
  padding: 40px 44px 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  position: relative;
}

/* Worn page edge effect */
.page-inner::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 22px;
  background: linear-gradient(90deg,
    rgba(100,65,25,.18) 0%,
    rgba(100,65,25,.06) 40%,
    transparent);
  pointer-events: none;
}

.stamp-corner {
  position: absolute;
  top: 28px; right: 28px;
  font-family: var(--font-hand);
  font-size: 9px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--red);
  border: 2px solid var(--red);
  border-radius: 4px;
  padding: 3px 8px;
  opacity: .55;
  transform: rotate(8deg);
}

.chapter-eyebrow {
  font-family: var(--font-hand);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
  margin-top: 6px;
}

.story-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 64px);
  line-height: .9;
  color: var(--ink);
  margin-bottom: 16px;
}

.story-title em {
  font-style: normal;
  color: var(--green);
}

.title-rule {
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--red));
  border-radius: 2px;
  margin-bottom: 20px;
}

.title-episode {
  font-family: var(--font-hand);
  font-size: 18px;
  line-height: 1.35;
  color: var(--red);
  margin-bottom: 22px;
  letter-spacing: .02em;
}

.title-episode span {
  font-style: italic;
  color: var(--ink);
}

.title-deck {
  font-family: var(--font-hand);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink2);
  margin-bottom: 24px;
}

.title-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.info-block {
  background: rgba(42,26,14,.05);
  border: 1px solid rgba(42,26,14,.12);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-label {
  font-family: var(--font-hand);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-light);
}

.info-val {
  font-family: var(--font-hand);
  font-size: 15px;
  color: var(--ink);
  font-weight: bold;
}

.title-notice {
  background: rgba(194,59,40,.08);
  border: 1.5px solid rgba(194,59,40,.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--font-hand);
  font-size: 13px;
  color: var(--red2);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.notice-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── CHAPTER TITLE PAGES ─────────────────────────────────── */
.chapter-page {
  background: var(--cream) !important;
}

.chapter-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.chapter-number-big {
  font-family: var(--font-display);
  font-size: clamp(140px, 28vw, 220px);
  line-height: 1;
  color: rgba(42,26,14,.06);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.chapter-stripe {
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, transparent, var(--chapter-color, #c23b28), transparent);
  margin-bottom: 28px;
  border-radius: 2px;
}

.chapter-content {
  position: relative;
  z-index: 2;
}

.chapter-eyebrow {
  font-family: var(--font-hand);
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--chapter-color, var(--red));
  margin-bottom: 8px;
}

.chapter-title {
  font-family: var(--font-display);
  font-size: clamp(52px, 10vw, 82px);
  line-height: .88;
  color: var(--ink);
  margin-bottom: 10px;
}

.chapter-location {
  display: block;
  font-family: var(--font-school);
  font-size: clamp(20px, 3.5vw, 30px);
  color: var(--green);
  margin-bottom: 16px;
  line-height: 1.2;
}

.chapter-beat {
  font-family: var(--font-hand);
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink2);
  max-width: 380px;
  margin: 0 auto 20px;
  font-style: italic;
}

.chapter-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-overhead  { background: var(--blue); }
.dot-art       { background: var(--red); }
.dot-shotlist  { background: var(--green); }
.dot-callsheet { background: var(--gold2); }
.dot-reference { background: var(--ink-light); }
.dot-coming    { font-family: var(--font-hand); font-size: 12px; color: var(--ink-light); }

.chapter-doodles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ch-star {
  position: absolute;
  color: rgba(42,26,14,.1);
}
.ch-star.s1 { font-size: 60px; top: 8%;  left: 6%;  }
.ch-star.s2 { font-size: 36px; top: 10%; right: 8%; }
.ch-star.s3 { font-size: 50px; bottom: 10%; right: 6%; }

/* ── ASSET / PNG PAGES ──────────────────────────────────── */
.asset-page {
  background: #1a1208 !important;
  background-image: none !important;
}

.asset-inner {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.asset-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0,0,0,.4);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.asset-scene-tag {
  font-family: var(--font-hand);
  font-size: 11px;
  font-weight: bold;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.asset-type-tag {
  font-family: var(--font-hand);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}

.asset-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
  padding: 8px;
}

.asset-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
  border-radius: 4px;
  transition: transform .2s;
}

.asset-img:hover {
  transform: scale(1.01);
}

.asset-footer {
  font-family: var(--font-hand);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: 8px 14px;
  text-align: center;
  background: rgba(0,0,0,.3);
  border-top: 1px solid rgba(255,255,255,.06);
}

/* ── PLACEHOLDER PAGES ───────────────────────────────────── */
.placeholder-page {
  background: var(--cream2) !important;
}

.placeholder-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  position: relative;
  gap: 16px;
}

.placeholder-number {
  font-family: var(--font-display);
  font-size: 120px;
  line-height: 1;
  color: rgba(42,26,14,.08);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  user-select: none;
}

.placeholder-label {
  font-family: var(--font-display);
  font-size: clamp(24px, 5vw, 40px);
  color: var(--ink2);
  position: relative;
  z-index: 2;
}

.placeholder-msg {
  position: relative;
  z-index: 2;
  background: rgba(42,26,14,.06);
  border: 2px dashed rgba(42,26,14,.2);
  border-radius: 12px;
  padding: 24px 32px;
  max-width: 340px;
}

.placeholder-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 10px;
}

.placeholder-msg p {
  font-family: var(--font-hand);
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink-light);
}

.placeholder-lines {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 80%;
  max-width: 300px;
}

.placeholder-lines div {
  height: 2px;
  background: rgba(42,26,14,.1);
  border-radius: 1px;
}

.placeholder-lines div:nth-child(2) { width: 85%; }
.placeholder-lines div:nth-child(3) { width: 70%; }
.placeholder-lines div:nth-child(4) { width: 55%; }

/* ── DOCUMENTS PAGE ─────────────────────────────────────── */
.doc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(42,26,14,.06);
  border: 1.5px solid rgba(42,26,14,.14);
  border-radius: 10px;
  padding: 14px 18px;
  text-decoration: none;
  color: var(--ink);
  transition: background .15s, border-color .15s;
}

.doc-item:hover {
  background: rgba(42,26,14,.1);
  border-color: rgba(42,26,14,.25);
}

.doc-icon { font-size: 26px; flex-shrink: 0; }

.doc-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.doc-text b {
  font-family: var(--font-hand);
  font-size: 16px;
  color: var(--ink);
}

.doc-text small {
  font-family: var(--font-hand);
  font-size: 13px;
  color: var(--ink-light);
}

.doc-arrow {
  font-size: 18px;
  color: var(--ink-light);
}

.doc-empty {
  font-family: var(--font-hand);
  font-size: 14px;
  color: var(--ink-light);
  font-style: italic;
  padding: 20px;
  text-align: center;
  border: 2px dashed rgba(42,26,14,.2);
  border-radius: 10px;
}

/* ── BACK COVER ─────────────────────────────────────────── */
.back-cover-page {
  background: var(--cover-dark) !important;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='80' height='80' filter='url(%23n)' opacity='.1'/%3E%3C/svg%3E") !important;
}

.back-cover-page .cover-inner {
  box-shadow:
    inset 0 0 0 10px rgba(10,28,12,.7),
    inset 0 0 0 14px rgba(201,150,14,.5),
    inset 0 0 0 18px rgba(10,28,12,.4);
  justify-content: center;
  gap: 18px;
}

.back-stars {
  display: flex;
  gap: 14px;
  font-size: 18px;
  color: rgba(201,150,14,.45);
}

.back-logo {
  font-family: var(--font-display);
  font-size: 72px;
  color: rgba(245,230,200,.15);
  line-height: 1;
}

.back-tagline {
  font-family: var(--font-school);
  font-size: clamp(22px, 4vw, 32px);
  color: rgba(245,230,200,.8);
  line-height: 1.3;
  text-align: center;
}

.back-rule {
  width: 60px;
  height: 2px;
  background: rgba(201,150,14,.4);
  border-radius: 1px;
}

.back-studio {
  font-family: var(--font-hand);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(245,230,200,.35);
}

/* ── DOODLES (decorative) ───────────────────────────────── */
.page-doodles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.doodle {
  position: absolute;
  color: rgba(42,26,14,.08);
  font-size: 42px;
}

.doodle.d1 { bottom: 30px; right: 24px; font-size: 52px; }
.doodle.d2 { top: 60%;    left: 18px;  font-size: 28px; }
.doodle.d3 { bottom: 70px; left: 28px; font-size: 20px; }

/* ── CHAPTER DRAWER ─────────────────────────────────────── */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto;
}

.drawer[hidden] { display: none !important; }

.drawer-backdrop {
  background: rgba(0,0,0,.5);
  cursor: pointer;
}

.drawer-panel {
  width: min(340px, 90vw);
  height: 100%;
  background: var(--cream);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='80' height='80' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
  box-shadow: -20px 0 60px rgba(0,0,0,.45);
  padding: 28px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: drawerSlide .25s ease forwards;
}

@keyframes drawerSlide {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.drawer-close {
  position: absolute;
  top: 16px; right: 16px;
  font-family: var(--font-hand);
  font-size: 24px;
  background: rgba(42,26,14,.1);
  border: none;
  border-radius: 50%;
  width: 36px; height: 36px;
  cursor: pointer;
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

.drawer-eyebrow {
  font-family: var(--font-hand);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--red);
  display: block;
}

.drawer-title {
  font-family: var(--font-display);
  font-size: 36px;
  color: var(--ink);
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-entry {
  font-family: var(--font-hand);
  font-size: 15px;
  text-align: left;
  background: transparent;
  border: 1px solid rgba(42,26,14,.12);
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  color: var(--ink2);
  transition: background .15s;
}

.drawer-entry:hover { background: rgba(42,26,14,.07); }
.drawer-entry.active { background: var(--green); color: #f5e6c8; border-color: var(--green); }

.drawer-scene {
  font-weight: bold;
  border-color: rgba(42,26,14,.18);
}

/* ── LIGHTBOX ───────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 14px;
  cursor: pointer;
}

.lightbox[hidden] { display: none !important; }

.lightbox-close {
  position: absolute;
  top: 18px; right: 18px;
  font-size: 28px;
  background: rgba(255,255,255,.12);
  border: none;
  border-radius: 50%;
  width: 44px; height: 44px;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 201;
}

.lightbox-img-wrap {
  max-width: 94vw;
  max-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.lightbox-img-wrap img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,.8);
}

.lightbox-caption {
  font-family: var(--font-hand);
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  text-align: center;
}

/* ── CHAPTER PAGE override for .chapter-eyebrow ─────────── */
/* (chapter-eyebrow defined above, this rule re-asserts it
   because .chapter-inner might reset margin context) */
.chapter-inner .chapter-eyebrow {
  margin-bottom: 8px;
  margin-top: 0;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 700px) {
  :root {
    --page-w: 98vw;
    --page-h: 80vh;
  }

  .page-inner { padding: 28px 24px 22px; }

  .topnav { padding: 8px 12px; }

  .stage { padding: 8px; }

  .cover-logo-top,
  .cover-logo-bottom { font-size: 36px; }

  .cover-logo-amp { font-size: 26px; }

  .chapter-title { font-size: 52px; }
}

@media (max-width: 480px) {
  .page-label { display: none; }
  .nav-bookname { font-size: 14px; }
  .title-info-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════════════
   V3 ADDITIONS — gate, screenplay, legend, cast, ribbons
   ════════════════════════════════════════════════════════════════════════ */

/* extra dot colors */
.dot-storyboard { background: var(--gold); }
.dot-camera     { background: #2a7a8a; }

/* lock the book behind the gate */
body.locked .topnav,
body.locked .stage { display: none !important; }
body:not(.locked) .gate { display: none; }

/* ── NDA GATE ──────────────────────────────────────────────── */
.gate {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow: auto;
  background:
    radial-gradient(120% 90% at 50% 0%, #2f6a33 0%, #1c3d1f 55%, #122a14 100%);
  background-attachment: fixed;
}
.gate.gate-gone { opacity: 0; transition: opacity .45s ease; pointer-events: none; }
.gate-card {
  width: min(1060px, 100%);
  margin: auto;
  display: grid; grid-template-columns: 310px 1fr;
  background: var(--cream);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.3), inset 0 0 0 6px rgba(212,160,23,.25);
}

/* gate aside */
.gate-aside {
  background: linear-gradient(170deg, #2a5c2e, #162e18);
  color: #f5e6c8; padding: 30px 26px;
  display: flex; flex-direction: column; gap: 16px;
  position: relative;
}
.gate-aside::after {
  content:""; position:absolute; inset:10px; border:1px solid rgba(245,230,200,.18); border-radius:8px; pointer-events:none;
}
.gate-crest { text-align: center; line-height: .9; margin-top: 6px; }
.crest-top, .crest-bot { font-family: var(--font-display); font-size: 30px; color: var(--gold); text-shadow: 2px 2px 0 rgba(0,0,0,.4); }
.crest-amp { font-family: var(--font-display); font-size: 18px; color: #f5e6c8; margin: 2px 0; }
.gate-aside-rule { height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); margin: 4px 0; }
.gate-aside-kicker { font-family: var(--font-marker); font-size: 18px; line-height: 1.3; color: #fff; }
.gate-aside-note { font-family: var(--font-hand); font-size: 15px; line-height: 1.45; color: rgba(245,230,200,.8); }
.gate-aside-foot { margin-top: auto; font-family: var(--font-hand); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: rgba(245,230,200,.5); }

/* gate main */
.gate-main { padding: 26px 28px; display: flex; flex-direction: column; min-height: 0; }
.gate-eyebrow { font-family: var(--font-hand); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--red); }
.gate-title { font-family: var(--font-display); font-size: clamp(24px, 3.4vw, 34px); line-height: 1.02; color: var(--ink); margin: 4px 0 6px; }
.gate-sub { font-family: var(--font-hand); font-size: 15px; color: var(--ink2); margin-bottom: 12px; }

.gate-scrollwrap { position: relative; flex: none; min-height: 0; }
.gate-scroll {
  height: auto; max-height: 46vh; overflow-y: auto; padding: 16px 18px;
  background: #fffdf5; border: 1px solid var(--cream3); border-radius: 8px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.06);
  font-family: 'Special Elite', Georgia, serif;
  -webkit-overflow-scrolling: touch;
}
.gate-scroll .g-h { font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--red2); margin: 16px 0 5px; border-bottom: 1px solid var(--cream3); padding-bottom: 3px; }
.gate-scroll .g-h:first-child { margin-top: 0; }
.gate-scroll .g-p { font-size: 12.5px; line-height: 1.6; color: #2a2218; margin: 6px 0; }
.gate-scroll .g-list { margin: 6px 0 6px 18px; }
.gate-scroll .g-list li { font-size: 12.5px; line-height: 1.55; color: #2a2218; margin: 3px 0; }
.g-endmark { text-align: center; font-size: 12px; color: var(--ink-light); margin: 18px 0 4px; letter-spacing: .1em; }

.scroll-hint {
  position: absolute; left: 0; right: 0; bottom: 0;
  text-align: center; font-family: var(--font-hand); font-size: 12px;
  padding: 8px; color: var(--red); pointer-events: none;
  background: linear-gradient(transparent, #fffdf5 60%);
  transition: opacity .3s;
}
.scroll-hint.done { color: var(--green); background: none; }

/* gate form */
.gate-form { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.gf-row { display: grid; grid-template-columns: 1fr 1fr .8fr; gap: 12px; }
.gf-field { display: flex; flex-direction: column; gap: 3px; }
.gf-field span { font-family: var(--font-hand); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-light); }
.gf-field input {
  font-family: var(--font-hand); font-size: 16px; color: var(--ink);
  padding: 8px 10px; border: 1.5px solid var(--cream3); border-radius: 6px; background: #fffdf5;
}
.gf-field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,160,23,.18); }

.gf-sign-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.gf-sign-head span { font-family: var(--font-hand); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-light); }
.gf-clear { font-family: var(--font-hand); font-size: 12px; color: var(--red); background: none; border: none; cursor: pointer; text-decoration: underline; }
.sigpad-wrap {
  position: relative; height: 110px; border: 1.5px dashed var(--ink-light); border-radius: 8px;
  background: repeating-linear-gradient(0deg, #fffdf5, #fffdf5 26px, rgba(0,0,0,.04) 27px);
  overflow: hidden;
}
.sigpad { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
.sigpad-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-hand); color: var(--ink-light); opacity: .6; pointer-events: none; }
.sigpad-wrap.has-sig .sigpad-ph { display: none; }

.gf-agree { display: flex; gap: 10px; align-items: flex-start; font-family: var(--font-hand); font-size: 14px; color: var(--ink2); line-height: 1.4; cursor: pointer; }
.gf-agree input { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--green); }

.gf-submit {
  font-family: var(--font-display); font-size: 17px; color: #fff;
  background: linear-gradient(135deg, var(--red), var(--red2));
  border: none; border-radius: 8px; padding: 13px 20px; cursor: pointer;
  box-shadow: 0 6px 16px rgba(155,34,24,.35); transition: transform .12s, box-shadow .12s, opacity .2s;
}
.gf-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(155,34,24,.45); }
.gf-submit:disabled { opacity: .45; cursor: not-allowed; background: var(--ink-light); box-shadow: none; }
.gf-submit.alt { background: linear-gradient(135deg, var(--green), var(--green2)); box-shadow: 0 6px 16px rgba(30,62,31,.3); }
.gf-fineprint { font-family: var(--font-hand); font-size: 11.5px; color: var(--ink-light); text-align: center; line-height: 1.4; }

/* gate confirm */
.gate-confirm { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; margin: auto 0; padding: 20px 0; }
.confirm-seal {
  width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #3a7a3e, #1e3e1f); color: var(--gold);
  font-size: 40px; box-shadow: 0 0 0 4px rgba(212,160,23,.3), 0 8px 20px rgba(0,0,0,.25);
}
.confirm-status { font-family: var(--font-hand); font-size: 14px; line-height: 1.4; padding: 8px 14px; border-radius: 8px; max-width: 460px; }
.confirm-status.ok { color: var(--green); background: rgba(45,90,46,.1); border: 1px solid rgba(45,90,46,.28); }
.confirm-status.warn { color: var(--red2); background: rgba(155,34,24,.08); border: 1px solid rgba(155,34,24,.25); }
.confirm-sigbox { border: 1px solid var(--cream3); border-radius: 8px; background: #fffdf5; padding: 8px 14px; }
.confirm-sigbox img { display: block; max-width: 260px; max-height: 90px; }
.confirm-sigbox span { font-family: var(--font-hand); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-light); }
.confirm-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* signed badge in nav */
.signed-badge {
  font-family: var(--font-hand); font-size: 12px; color: var(--green);
  background: rgba(45,90,46,.12); border: 1px solid rgba(45,90,46,.3);
  padding: 4px 10px; border-radius: 999px; margin-right: 8px; white-space: nowrap;
}

/* ── LEGEND / FIELD GUIDE ──────────────────────────────────── */
.legend-page { background: var(--cream2) !important; }
.legend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 18px 0 22px; }
.lg-item { display: flex; align-items: center; gap: 10px; font-family: var(--font-hand); font-size: 16px; color: var(--ink2); }
.lg-item .dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.legend-tip { font-family: var(--font-hand); font-size: 14px; color: var(--ink-light); margin-top: 8px; }
.legend-tip span { display: inline-block; min-width: 20px; color: var(--red); font-weight: bold; }
.legend-tip.flag span { color: var(--gold2); }

/* ── CHAPTER additions ─────────────────────────────────────── */
.chapter-slug { font-family: 'Special Elite', Georgia, serif; font-size: 14px; letter-spacing: .04em; color: var(--ink-light); margin: 4px 0 10px; }
.chapter-meta { font-family: var(--font-hand); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-light); margin-top: 12px; }

/* ── SCRIPT PAGE ───────────────────────────────────────────── */
.script-page { background: #faf3e2 !important; }
.script-inner { height: 100%; display: flex; flex-direction: column; }
.script-head {
  padding: 14px 18px 10px; border-bottom: 2px solid var(--chapter-color, var(--red));
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; background: rgba(0,0,0,.02);
}
.script-scene { font-family: var(--font-display); font-size: 16px; color: var(--chapter-color, var(--red)); }
.script-slug { font-family: 'Special Elite', Georgia, serif; font-size: 13px; letter-spacing: .03em; color: var(--ink2); }
.sp-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 20px clamp(20px, 7%, 64px);
  font-family: 'Special Elite', Georgia, serif; color: #1f1a12; font-size: 14px; line-height: 1.5;
}
.sp-action { margin: 0 0 12px; }
.sp-center { text-align: center; margin: 14px 0; letter-spacing: .04em; }
.sp-trans { text-align: right; margin: 10px 0 16px; letter-spacing: .06em; color: var(--ink2); }
.sp-dia { margin: 0 0 12px; padding-left: 12%; }
.sp-char { margin: 0; padding-left: 14%; font-size: 14px; letter-spacing: .04em; }
.sp-paren { text-transform: none; color: var(--ink-light); font-size: 13px; }
.sp-line { margin: 0; padding-right: 6%; }
.sp-end { text-align: center; color: var(--ink-light); margin: 18px 0 6px; }

/* ── SECTION COVERS (Cast / Reference) ─────────────────────── */
.section-cover { background: var(--cream2) !important; }
.section-title { color: var(--chapter-color, var(--red)); }

/* ── CAST PAGES ────────────────────────────────────────────── */
.cast-page { background: #1a1208 !important; background-image: none !important; }
.cast-inner { height: 100%; display: grid; grid-template-rows: 1fr auto; }
.cast-img-wrap { display: flex; align-items: center; justify-content: center; overflow: hidden; min-height: 0; padding: 14px; }
.cast-img-wrap .asset-img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.cast-meta { padding: 14px 20px 18px; background: rgba(0,0,0,.4); border-top: 1px solid rgba(255,255,255,.08); text-align: center; }
.cast-name { font-family: var(--font-display); font-size: 24px; color: var(--gold); margin: 0; }
.cast-role { font-family: var(--font-hand); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.55); margin: 2px 0 8px; }
.cast-blurb { font-family: var(--font-hand); font-size: 15px; line-height: 1.45; color: rgba(245,230,200,.85); max-width: 520px; margin: 0 auto; }

/* ── TENTATIVE RIBBON ──────────────────────────────────────── */
.tentative-ribbon {
  position: absolute; top: 14px; right: -34px; z-index: 5;
  transform: rotate(45deg); background: repeating-linear-gradient(45deg, var(--gold2), var(--gold2) 8px, #a8780a 8px, #a8780a 16px);
  color: #fff; font-family: var(--font-hand); font-size: 10px; letter-spacing: .14em;
  padding: 4px 40px; box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.asset-inner { position: relative; }

/* ── DRAWER GROUP LABEL ────────────────────────────────────── */
.drawer-group { font-family: var(--font-hand); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin: 16px 0 4px; padding-left: 4px; }

/* ── GATE RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 760px) {
  .gate { padding: 0; }
  .gate-card { grid-template-columns: 1fr; min-height: 100vh; height: auto; border-radius: 0; }
  .gate-aside { flex-direction: row; align-items: center; gap: 14px; padding: 14px 18px; }
  .gate-aside::after { display: none; }
  .gate-crest { margin: 0; flex-shrink: 0; }
  .crest-top, .crest-bot { font-size: 20px; }
  .gate-aside-rule, .gate-aside-foot { display: none; }
  .gate-aside-kicker { font-size: 14px; }
  .gate-aside-note { display: none; }
  .gf-row { grid-template-columns: 1fr; }
  .gate-main { padding: 18px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   DEPARTMENT VIEW — the Production Hub's second reading of the same material.

   Deliberately NOT styled as a page of the book. The book is a paged, sequential
   object you read; this is a reference surface you scan and scroll, often on a
   phone on set. Making it look like another chapter would have implied a
   reading order that doesn't exist here.
   ══════════════════════════════════════════════════════════════════════════ */
.dept-view{
  position:fixed; inset:0; z-index:60; overflow-y:auto; -webkit-overflow-scrolling:touch;
  background:radial-gradient(120% 80% at 50% 0%, #2f6a33, #142a16 72%);
  padding:78px 16px 60px;
}
.dept-view[hidden]{ display:none; }
body.dept-mode{ overflow:hidden; }

.dept-inner{ max-width:1080px; margin:0 auto; }

.dept-head{
  display:flex; justify-content:space-between; align-items:flex-start;
  gap:18px; flex-wrap:wrap; margin-bottom:26px;
}
.dept-eyebrow{
  display:block; font-family:var(--font-hand); color:var(--gold);
  font-size:.9rem; letter-spacing:.1em; text-transform:uppercase; margin-bottom:4px;
}
.dept-title{
  font-family:var(--font-display); color:var(--cream); font-size:2rem;
  margin:0 0 6px; line-height:1.1;
}
.dept-sub{ color:rgba(245,230,200,.7); font-family:var(--font-hand); font-size:1.02rem; margin:0; max-width:60ch; }
.dept-headbtns{ display:flex; gap:8px; flex-wrap:wrap; }
.dept-close{
  background:rgba(0,0,0,.3); color:var(--cream); border:1px solid rgba(212,160,23,.4);
  border-radius:6px; padding:9px 16px; font-family:var(--font-hand); font-size:.98rem;
  cursor:pointer; white-space:nowrap;
}
.dept-close:hover{ background:rgba(212,160,23,.2); }
.dept-close.alt{ border-color:rgba(245,230,200,.25); }

/* ── Index grid ─────────────────────────────────────────────────────────── */
.dept-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:16px; }
.dept-card{
  --dept:#7a6a4a;
  display:flex; flex-direction:column; align-items:flex-start; gap:5px;
  background:var(--cream); border:0; border-top:5px solid var(--dept);
  border-radius:var(--radius); padding:20px 20px 18px; cursor:pointer;
  text-align:left; box-shadow:0 10px 28px rgba(0,0,0,.35); transition:transform .13s ease;
}
.dept-card:hover{ transform:translateY(-3px); }
.dept-icon{ font-size:1.5rem; color:var(--dept); line-height:1; }
.dept-name{ font-family:var(--font-display); font-size:1.16rem; color:var(--ink); line-height:1.2; }
.dept-tag{ font-family:var(--font-hand); font-size:.96rem; color:var(--ink-light); line-height:1.35; }
.dept-count{
  margin-top:6px; font-family:var(--font-hand); font-size:.85rem; color:var(--dept);
  text-transform:uppercase; letter-spacing:.07em;
}

/* ── Detail ─────────────────────────────────────────────────────────────── */
.dept-block{ margin-bottom:34px; }
.dept-h3{
  font-family:var(--font-marker); color:var(--gold); font-size:1.05rem;
  letter-spacing:.03em; margin:0 0 14px; padding-bottom:7px;
  border-bottom:1px solid rgba(212,160,23,.28);
}

.dept-assets{ display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:14px; }
.dept-asset{
  margin:0; background:var(--cream); border-radius:var(--radius); overflow:hidden;
  box-shadow:0 8px 22px rgba(0,0,0,.3);
}
.dept-asset img{ width:100%; display:block; cursor:zoom-in; background:#e8d4a0; }
.dept-asset figcaption{ padding:10px 12px 12px; font-family:var(--font-hand); font-size:.92rem; color:var(--ink); }
.dept-asset figcaption strong{ display:block; line-height:1.25; }
.dept-note{ display:block; color:var(--ink-light); margin-top:3px; line-height:1.35; }
.dept-asset.tentative{ opacity:.9; }
.dept-tentative{
  display:inline-block; margin-top:5px; font-size:.72rem; text-transform:uppercase;
  letter-spacing:.08em; color:var(--red2); border:1px solid rgba(194,59,40,.4);
  border-radius:3px; padding:1px 6px;
}

/* ── Scene grouping: keeps department items in shoot order ──────────────── */
.dept-scenegroup{ margin-bottom:24px; }
.dept-scenehead, .dept-sceneline{
  width:100%; display:flex; align-items:center; gap:12px; cursor:pointer;
  background:rgba(0,0,0,.26); border:1px solid rgba(212,160,23,.18);
  border-radius:var(--radius); padding:10px 14px; margin-bottom:12px; text-align:left;
}
.dept-scenehead:hover, .dept-sceneline:hover{ background:rgba(212,160,23,.14); }
.dept-sceneline{ margin-bottom:8px; }
.dept-scenenum{
  flex:0 0 auto; width:30px; height:30px; border-radius:50%; color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-size:.9rem;
}
.dept-scenettl{ flex:1 1 auto; font-family:var(--font-hand); color:var(--cream); line-height:1.25; }
.dept-scenettl strong{ display:block; font-size:1rem; }
.dept-go{ flex:0 0 auto; font-family:var(--font-hand); color:var(--gold); font-size:.9rem; white-space:nowrap; }

.dept-docs{ display:flex; flex-wrap:wrap; gap:10px; }
.dept-doc{
  display:inline-flex; align-items:center; gap:9px; background:var(--cream);
  color:var(--ink); text-decoration:none; border-radius:var(--radius);
  padding:12px 16px; font-family:var(--font-hand); font-size:1rem;
  box-shadow:0 6px 16px rgba(0,0,0,.28);
}
.dept-doc:hover{ background:#fff; }

/* ── Empty and forthcoming states ───────────────────────────────────────── */
.dept-empty, .dept-coming{
  border-radius:var(--radius); padding:16px 20px; font-family:var(--font-hand);
  line-height:1.5; margin-top:8px;
}
.dept-empty{ background:rgba(0,0,0,.28); border:1px dashed rgba(245,230,200,.3); color:rgba(245,230,200,.8); }
.dept-coming{ background:rgba(212,160,23,.1); border-left:3px solid var(--gold); color:rgba(245,230,200,.78); }
.dept-empty strong, .dept-coming strong{ display:block; color:var(--cream); margin-bottom:4px; }
.dept-empty p, .dept-coming p{ margin:0; }

@media (max-width:640px){
  .dept-view{ padding:70px 12px 48px; }
  .dept-title{ font-size:1.55rem; }
  .dept-grid{ grid-template-columns:1fr; }
  .dept-assets{ grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; }
  .dept-go{ display:none; }
}
