/* NOBAR-MVP-264 · ADR-0164 — papan detektif Studio Penulisan (kanvas "Penulisan papan detektif"). Semua di bawah `.pp*`.
   Papan = benda fisik (peta cokelat, kertas, foto): warnanya TETAP di tema terang & gelap, seperti di kanvas. */
.pp-alih { display: inline-flex; gap: 0; margin: 4px 0 12px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.pp-alih-b { min-height: 40px; padding: 0 16px; border: 0; border-radius: 0; background: transparent; color: var(--text-2); font-size: 14px; font-weight: 700; cursor: pointer; }
.pp-alih-b.aktif { background: var(--text); color: var(--surface); }
.pp-alih-b:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* NOBAR-MVP-271: peta = latar yang BERULANG tanpa ujung (empat lapis berukuran beda supaya ulangannya tidak kentara; tiap lapis menyambung
   di tepi ubinnya). Ikut kamera lewat --pp-x / --pp-y / --pp-z yang diisi ppTerap(). */
/* tinggi diisi ppUkur() (NOBAR-MVP-308: sisa layar); nilai CSS ini hanya sebelum skrip berjalan */
.pp { position: relative; height: min(760px, 80vh); min-height: 360px; overflow: hidden; border-radius: 12px; border: 1px solid #3a4048;
  --pp-x: 0px; --pp-y: 0px; --pp-z: 1; background-color: #b8976a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cpath d='M0 120H240M120 0V240' fill='none' stroke='%236e5636' stroke-width='1' stroke-dasharray='2 10'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1800' height='1000' viewBox='0 0 1800 1000'%3E%3Cg fill='none' stroke='%23d9c39a'%3E%3Cpath d='M0 250C220 250 420 340 760 300S1400 160 1600 210S1740 250 1800 250' stroke-width='9'/%3E%3Cpath d='M0 640C240 640 430 720 720 690S1180 560 1480 600S1720 640 1800 640' stroke-width='4'/%3E%3Cpath d='M520 0C520 170 650 300 610 500S520 880 520 1000' stroke-width='7'/%3E%3Cpath d='M1260 0C1260 150 1390 290 1350 470S1260 870 1260 1000' stroke-width='5'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1300' height='900' viewBox='0 0 1300 900'%3E%3Cg fill='none' stroke='%239c7f55' stroke-width='1.5'%3E%3Cpath d='M120 180c80-70 220-70 300 0s60 190-60 220-260-10-300-90 0-90 60-130z'/%3E%3Cpath d='M170 210c60-50 160-50 220 0s40 130-40 150-190-10-220-60 0-60 40-90z'/%3E%3Cpath d='M700 520c70-60 200-50 250 20s10 170-90 190-210-30-230-100 20-80 70-110z'/%3E%3Cpath d='M760 560c40-30 110-30 140 10s10 90-50 100-120-20-130-50 10-40 40-60z'/%3E%3Cpath d='M960 140c50-40 150-30 180 30s-10 120-80 130-150-30-160-80 20-50 60-80z'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1500' height='1100' viewBox='0 0 1500 1100'%3E%3Cg fill='%23a98a5c'%3E%3Cpath d='M150 240c120-90 330-70 420 40s40 260-130 300-360-20-400-150 30-130 110-190z'/%3E%3Cpath d='M900 620c140-80 340-40 400 90s-40 250-220 270-330-70-340-190 60-110 160-170z'/%3E%3C/g%3E%3Cg fill='%23c4a578'%3E%3Cpath d='M820 120c90-60 250-50 300 40s-10 180-130 200-240-30-260-110 30-90 90-130z'/%3E%3Cpath d='M260 760c70-50 190-40 230 30s0 140-100 150-190-30-200-90 20-60 70-90z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: calc(240px * var(--pp-z)) calc(240px * var(--pp-z)), calc(1800px * var(--pp-z)) calc(1000px * var(--pp-z)), calc(1300px * var(--pp-z)) calc(900px * var(--pp-z)), calc(1500px * var(--pp-z)) calc(1100px * var(--pp-z));
  background-position: var(--pp-x) var(--pp-y); background-repeat: repeat;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; color: #1b1f24; }
.pp.pp-seret { cursor: grabbing; }
.pp:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pp-panggung { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.pp-peta { position: absolute; left: 0; top: 0; pointer-events: none; }
.pp-vinyet { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(40, 24, 8, 0) 45%, rgba(40, 24, 8, .55) 100%); pointer-events: none; }
.pp-benang { position: absolute; height: 3px; background: #b3101c; transform-origin: 0 50%; box-shadow: 0 2px 3px rgba(0, 0, 0, .35); border-radius: 2px; pointer-events: none; }
.pp-pin { position: absolute; left: calc(50% - 8px); top: -6px; width: 16px; height: 16px; border-radius: 50%; background: #b3101c; box-shadow: 0 2px 3px rgba(0, 0, 0, .4); z-index: 2; }
.pp-b-besar { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; background: transparent; cursor: grab; padding: 0; z-index: 1; }
/* NOBAR-MVP-271: benda sedang diangkat (diseret) */
.pp-angkat { z-index: 6; box-shadow: 0 20px 34px rgba(0, 0, 0, .5); }
.pp-angkat .pp-pin { top: -12px; box-shadow: 0 8px 8px rgba(0, 0, 0, .35); }
.pp-seret .pp-b-besar { cursor: grabbing; }
.pp-b-besar:focus-visible { outline: 3px solid #1d5fb3; outline-offset: 3px; }
.pp-jml { position: absolute; right: -10px; top: -10px; min-width: 30px; height: 30px; padding: 0 6px; box-sizing: border-box; border-radius: 999px; background: #1b1f24; color: #fff;
  font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; z-index: 2; }
.pp-kertas.pp-tumpuk, .pp-gambar.pp-tumpuk, .pp-tokoh.pp-tumpuk { box-shadow: 8px 8px 0 #e9dfc9, 16px 16px 0 #dccfb2, 18px 22px 14px rgba(0, 0, 0, .28); }

.pp-kertas { position: absolute; box-sizing: border-box; padding: 22px 14px 14px; background: #f1e6cf; color: #1b1f24; box-shadow: 0 6px 14px rgba(0, 0, 0, .28);
  display: flex; flex-direction: column; gap: 6px; isolation: isolate; }
.pp-kertas.pp-kuning { background: #fff3b0; }
.pp-kertas.pp-merah { background: #ffd9cf; }
.pp-k-n { font-family: 'Courier New', Courier, monospace; font-size: 17px; font-weight: 700; line-height: 1.2; }
.pp-k-t { font-size: 13px; line-height: 1.45; color: #2f353c; overflow-wrap: anywhere; }
.pp-k-f { font-size: 12px; font-weight: 700; color: #4a3c22; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-cap { align-self: flex-start; display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; color: #fff; background: #4a515a; letter-spacing: .02em; }
.pp-cap-hijau { background: #1f7a3a; } .pp-cap-biru { background: #1d5fb3; } .pp-cap-kuning { background: #8a5a00; } .pp-cap-ungu { background: #5b3fa8; } .pp-cap-abu { background: #4a515a; }
.pp-baca { position: relative; z-index: 2; margin-top: 4px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; background: #1b1f24; color: #fff;
  font-size: 13px; font-weight: 650; text-decoration: none; align-self: flex-start; }
.pp-baca:hover { background: #2f353c; color: #fff; }

.pp-gambar { position: absolute; box-sizing: border-box; padding: 6px; background: #fff; color: #1b1f24; box-shadow: 0 6px 14px rgba(0, 0, 0, .28); isolation: isolate; }
.pp-g-f { display: block; background: #2f353c; overflow: hidden; }
.pp-g-n { font-size: 12px; padding-top: 5px; color: #2f353c; }
.pp-img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
.pp-tanpa { display: flex; align-items: center; justify-content: center; background: #8a939b; color: #fff; font-size: 34px; font-weight: 800; }

.pp-tokoh { position: absolute; box-sizing: border-box; padding: 8px 8px 10px; background: #fbfaf6; color: #1b1f24; box-shadow: 0 6px 14px rgba(0, 0, 0, .3);
  display: flex; flex-direction: column; gap: 2px; isolation: isolate; }
.pp-t-f { display: block; height: 108px; background: #8a939b; overflow: hidden; }
.pp-t-n { font-family: 'Caveat NOBAR', 'Segoe Print', 'Bradley Hand', cursive; font-size: 24px; line-height: 1.1; padding-top: 4px; overflow-wrap: anywhere; }
.pp-t-a { font-size: 11px; color: #2f353c; overflow-wrap: anywhere; }

.pp-zoom { position: absolute; left: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.pp-zoom button { width: 44px; height: 44px; border-radius: 8px; border: 1px solid #4a515a; background: #20252b; color: #f2f2ee; font-size: 22px; font-weight: 700; padding: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer; }
.pp-zoom button:hover { background: #2c3239; }
.pp-zoom button:focus-visible { outline: 3px solid #9fd0ff; outline-offset: 2px; }
.pp-petunjuk, .pp-ket { position: absolute; font-size: 12px; color: #f2f2ee; background: rgba(27, 31, 36, .8); padding: 6px 10px; border-radius: 8px; pointer-events: none; z-index: 3; }
.pp-petunjuk { right: 12px; top: 12px; max-width: calc(100% - 96px); }
.pp-ket { left: 68px; top: 12px; }
/* NOBAR-MVP-308: bilah atas papan = Papan | Daftar · status simpan + tombolnya · atribusi TMDB (dulu di bawah papan) */
.pp-atas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 10px; min-width: 0; }
.pp-atas .pp-alih { margin: 0; flex: none; }
.pp-atribusi { flex: 0 1 auto; min-width: 0; }
.pp-simpan { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; flex: 1 1 360px; min-width: 0; font-size: 14px; color: var(--text-2); }
.pp-simpan-t { flex: 1 1 220px; min-width: 0; }
.pp-simpan-p { color: var(--text-3); }
.pp-simpan-b { min-height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 700; cursor: pointer; }
.pp-simpan-b:hover { border-color: var(--accent); }
.pp-simpan-b:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.pp-kosong { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; color: #1b1f24; padding: 16px;
  cursor: default; z-index: 2; }
.pp-plus { width: 76px; height: 76px; border-radius: 50%; border: 0; background: #b3101c; color: #fff; display: flex; align-items: center; justify-content: center; padding: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3); cursor: pointer; transition: transform .15s; }
.pp-plus:hover { transform: scale(1.05); }
.pp-plus.buka { transform: rotate(45deg); }
.pp-plus:focus-visible, .pp-ko-lain:focus-visible { outline: 3px solid #1b1f24; outline-offset: 3px; }
.pp-ko-j { font-family: 'Courier New', Courier, monospace; font-size: 22px; font-weight: 700; }
.pp-ko-s { font-size: 14px; max-width: 420px; line-height: 1.5; }
.pp-ko-lain { min-height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid #5a4326; background: rgba(241, 230, 207, .7); color: #1b1f24; font-size: 13px; font-weight: 700; cursor: pointer; }

/* diperbesar */
.pp-bs { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
.pp-bs-latar { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; background: rgba(10, 8, 5, .78); cursor: zoom-out; padding: 0; }
.pp-bs-kertas { position: relative; width: 680px; max-width: 100%; max-height: 100%; overflow: auto; overscroll-behavior: contain; box-sizing: border-box; background: #f1e6cf; color: #1b1f24;
  padding: 28px 28px 24px; box-shadow: 0 16px 50px rgba(0, 0, 0, .6); display: flex; flex-direction: column; gap: 14px; }
.pp-bs-kertas .pp-pin { top: 8px; }
.pp-bs-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pp-bs-j { margin: 0; font-family: 'Courier New', Courier, monospace; font-size: 24px; font-weight: 700; color: #1b1f24; overflow-wrap: anywhere; }
.pp-bs-x, .pp-bs-b { min-height: 44px; padding: 0 14px; border-radius: 8px; border: 0; background: #1b1f24; color: #fff; font-size: 14px; font-weight: 650; cursor: pointer;
  display: inline-flex; align-items: center; text-decoration: none; flex: none; }
.pp-bs-x:hover, .pp-bs-b:hover { background: #2f353c; color: #fff; }
.pp-bs-x:focus-visible, .pp-bs-b:focus-visible { outline: 3px solid #1d5fb3; outline-offset: 2px; }
.pp-bs-daftar { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pp-bs-berkas { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed #b9a57c; }
.pp-bs-nama { font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.pp-bs-arahan { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.5; }
.pp-bs-muat { font-size: 14px; color: #4a3c22; }
.pp-bs-md { font-size: 14.5px; line-height: 1.55; color: #1b1f24; background: rgba(255, 255, 255, .35); padding: 12px 14px; border-radius: 6px; overflow-wrap: anywhere; }
.pp-bs-md :is(h1, h2, h3, h4) { color: #1b1f24; font-size: 16px; margin: 10px 0 4px; }
.pp-bs-md :is(a, code, strong, em, li, p, td, th, blockquote) { color: #1b1f24; }
.pp-bs-md table { display: block; overflow-x: auto; max-width: 100%; }
.pp-bs-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.pp-bs-grid.banyak { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.pp-bs-grid.tegak { justify-items: center; }
.pp-bs-grid.tegak .pp-bs-fig { width: min(342px, 100%); }
.pp-bs-grid.tokoh { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); justify-items: center; }
.pp-bs-fig { margin: 0; background: #fff; padding: 6px; box-shadow: 0 4px 10px rgba(0, 0, 0, .25); }
.pp-bs-fig .pp-img { height: auto; min-height: 60px; background: #2f353c; }
.pp-bs-fig figcaption { font-size: 12px; padding-top: 5px; color: #2f353c; }
.pp-bs-tokoh { margin: 0; width: 100%; max-width: 220px; background: #fbfaf6; padding: 8px 8px 12px; box-shadow: 0 4px 10px rgba(0, 0, 0, .25); box-sizing: border-box; }
.pp-bs-tf { display: block; aspect-ratio: 4 / 5; background: #8a939b; overflow: hidden; }
.pp-bs-tokoh figcaption { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: #2f353c; padding-top: 4px; }
.pp-bs-tn { font-family: 'Caveat NOBAR', 'Segoe Print', 'Bradley Hand', cursive; font-size: 26px; line-height: 1.1; font-weight: 400; color: #1b1f24; }
.pp-bs-alias { color: #4a3c22; }

@media (max-width: 640px) {
  .pp { height: min(520px, 66vh); }
  .pp-petunjuk { display: none; }
  .pp-bs { padding: 8px; }
  .pp-bs-kertas { padding: 24px 16px 18px; }
  .pp-bs-j { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .pp-plus { transition: none; } }

/* NOBAR-MVP-267: centang "Simpan otomatis" */
.pp-oto { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 650; cursor: pointer; }
.pp-oto-k { width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--text-3); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; line-height: 1; font-weight: 800; }
.pp-oto.nyala .pp-oto-k { border-color: var(--good-text); background: var(--good-text); color: var(--surface); }
.pp-oto:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pp-oto:disabled { opacity: .65; cursor: default; }

/* NOBAR-MVP-327 (SESI-Cu179B): alur naskah ① → ④ di papan + tumpukan naskah lama. Warna benda fisik tetap di tema terang & gelap. */
.pp-kertas.pp-pudar { background: #e6dcc4; color: #3a3833; }
.pp-kertas.pp-pudar.pp-tumpuk { box-shadow: 8px 8px 0 #dcd0b4, 16px 16px 0 #cfc1a0, 18px 22px 14px rgba(0, 0, 0, .28); }
.pp-kertas.pp-merah.pp-tumpuk { box-shadow: 8px 8px 0 #f4c8bc, 16px 16px 0 #e8b6a8, 18px 22px 14px rgba(0, 0, 0, .28); }
.pp-kertas.pp-kosongk { background: #f6eedc; opacity: .86; box-shadow: 0 6px 14px rgba(0, 0, 0, .22); }
.pp-k-tangan { font-family: 'Caveat NOBAR', 'Segoe Print', 'Bradley Hand', cursive; font-size: 21px; line-height: 1.15; color: #3b2a12; }
.pp-k-b { display: flex; align-items: center; gap: 6px; font-size: 12.5px; line-height: 1.35; color: #2f353c; min-width: 0; }
.pp-k-m { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-k-v { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 22px; padding: 0 4px; box-sizing: border-box; border-radius: 6px;
  background: #4a515a; color: #fff; font-size: 12px; font-weight: 700; }
.pp-k-b1 .pp-k-v { background: #5b3fa8; }
.pp-k-s { flex: none; font-size: 11px; font-weight: 700; }
.pp-k-s.s-sedang { color: #1d5fb3; } .pp-k-s.s-selesai { color: #1f7a3a; } .pp-k-s.s-ungu { color: #5b3fa8; } .pp-k-s.s-abu { color: #4a515a; }
.pp-cap-oranye { background: #a3470a; } .pp-cap-teal { background: #0b6b6b; } .pp-cap-cokelat { background: #7a5400; }
.pp-stempel { align-self: flex-start; font-family: 'Courier New', Courier, monospace; font-size: 13px; font-weight: 700; letter-spacing: .08em; color: #8f1418;
  border: 3px solid #8f1418; padding: 1px 7px; transform: rotate(-8deg); margin: 0 0 2px; }
.pp-aksi { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.pp-aksi .pp-baca { margin-top: 0; }
.pp-baca.pp-baca-2 { background: rgba(255, 255, 255, .45); color: #1b1f24; border: 1px solid #5a4326; }
.pp-baca.pp-baca-2:hover { background: rgba(255, 255, 255, .7); color: #1b1f24; }
.pp-bs-nama { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.pp-bs-meta { flex-basis: 100%; font-size: 13px; font-weight: 400; color: #4a3c22; }
.pp-bs-tb { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; flex: none; }
.pp-bs-b.pp-bs-b2 { background: rgba(255, 255, 255, .45); color: #1b1f24; border: 1px solid #5a4326; }
.pp-bs-b.pp-bs-b2:hover { background: rgba(255, 255, 255, .7); color: #1b1f24; }
.pp-bs-pend .pp-bs-nama { font-weight: 500; }
@media (max-width: 640px) { .pp-bs-berkas { flex-wrap: wrap; } .pp-bs-tb { justify-content: flex-start; } }
