/* =========================================================
   Lo-fi wireframe system — PLI deck
   Sketchy, paper-on-desk, consistent across all phases.
   ========================================================= */

:root {
  --paper: #FBF8F2;
  --paper-2: #F3EEE2;
  --ink: #1B1B1B;
  --ink-soft: #3A3A3A;
  --ink-faint: #8A8580;
  --rule: #1B1B1B;

  --lawyer: #D97706;        /* amber */
  --lawyer-soft: #FCD9A5;
  --gc: #2563EB;           /* blue — distinct from system-prompt dot */
  --gc-soft: #BFDBFE;
  --system-prompt-dot: #4B5563;

  --hi: #9CD892;            /* confidence green */
  --lo: #F0A3A3;            /* uncertain red */
  --neutral: #FDE68A;       /* highlighter yellow */

  /* Left-edge offset for layout (persona chrome removed — keep 0 for full-bleed beige) */
  --stripe: 0px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  font-family: "Kalam", "Caveat", system-ui, sans-serif;
  color: var(--ink);
}

deck-stage > section {
  background: var(--paper);
  overflow: hidden;
}

/* ---------- SLIDE FRAME ---------- */

.slide {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 60px 80px;
  font-family: "Kalam", sans-serif;
  color: var(--ink);
}

/* Persona stripe removed — full-bleed workspace; role shown via header badge only */
.slide[data-persona="LAWYER"] { --stripe-color: var(--lawyer); }
.slide[data-persona="GC"] { --stripe-color: var(--gc); }
.slide[data-persona="SYSTEM"] { --stripe-color: #6B7280; }
.slide[data-persona="NONE"] { --stripe-color: transparent; }

/* ---------- HEADER ---------- */

.slide-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 14px;
  margin-bottom: 24px;
  position: relative;
  min-height: 200px;
  gap: 40px;
}
.slide-head .title-block { max-width: 1240px; }

.slide-head .title-block { display: flex; flex-direction: column; gap: 4px; }

.slide-head.slide-head--no-rule {
  border-bottom: none;
  padding-bottom: 10px;
}

.phase-tag {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.phase-title {
  font-family: "Caveat", cursive;
  font-size: 58px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.phase-purpose {
  font-family: "Kalam", sans-serif;
  font-size: 22px;
  color: var(--ink-soft);
  margin-top: 8px;
  max-width: 900px;
}

/* Badge (persona) — the variable piece */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--paper-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  position: relative;
}
.badge .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--stripe-color);
  border: 1.5px solid var(--ink);
}
.badge.badge--system-prompt .dot {
  background: var(--system-prompt-dot);
}

/* Badge variants (tweak) */
.slide[data-badge="pill-left"] .badge {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: var(--stripe-color);
  color: var(--paper);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
}
.slide[data-badge="pill-left"] .badge .dot { display: none; }

.slide[data-badge="corner"] .badge {
  position: absolute;
  top: -34px;
  right: -20px;
  transform: rotate(3deg);
  background: var(--stripe-color);
  color: var(--paper);
  font-size: 18px;
  padding: 10px 22px;
  border-radius: 2px;
}
.slide[data-badge="corner"] .badge .dot { display: none; }

/* stripe-label is default (dot next to label in header badge) */

/* ---------- SKETCHY REGIONS ---------- */

.region {
  position: absolute;
  border: 1.8px solid var(--ink);
  border-radius: 3px;
  padding: 14px 16px;
  background: var(--paper);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.06);
}
.region:nth-of-type(odd) { transform: rotate(-0.15deg); }
.region:nth-of-type(even) { transform: rotate(0.12deg); }

.region-label {
  position: absolute;
  top: -12px;
  left: 14px;
  background: var(--paper);
  padding: 0 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.region-title {
  font-family: "Caveat", cursive;
  font-size: 32px;
  line-height: 1.1;
  margin: 4px 0 10px;
  font-weight: 700;
}

.region-body {
  font-family: "Kalam", sans-serif;
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* ---------- UI PRIMITIVES ---------- */

.ui-box {
  border: 1.5px solid var(--ink);
  padding: 8px 12px;
  border-radius: 2px;
  background: var(--paper);
  font-family: "Kalam", sans-serif;
  font-size: 16px;
}

.ui-input {
  border: 0;
  border-bottom: 1.5px dashed var(--ink);
  padding: 4px 2px;
  font-family: "Kalam", sans-serif;
  font-size: 18px;
  color: var(--ink-faint);
  background: transparent;
  min-height: 28px;
}

.ui-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1.8px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font-family: "Kalam", sans-serif;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}
.side-panel .sug .mini-btn { white-space: nowrap; }
.ui-btn.primary { background: var(--ink); color: var(--paper); }
.ui-btn.accept { background: var(--hi); }
.ui-btn.reject { background: var(--lo); }
.ui-btn.ghost { background: transparent; border-style: dashed; color: var(--ink-soft); }

.ui-list { list-style: none; margin: 0; padding: 0; }
.ui-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--ink-faint);
  font-size: 17px;
}
.ui-list li:last-child { border-bottom: 0; }
.ui-list .dot-box {
  width: 12px; height: 12px;
  border: 1.5px solid var(--ink);
  margin-top: 5px;
  flex-shrink: 0;
}

/* Highlighter swipes — used to shade provisions */
.hi-swipe, .lo-swipe, .n-swipe {
  position: relative;
  padding: 4px 8px;
  display: inline-block;
}
.hi-swipe::before, .lo-swipe::before, .n-swipe::before {
  content: "";
  position: absolute;
  inset: 2px -2px 2px -2px;
  z-index: -1;
  border-radius: 4px;
}
.hi-swipe::before { background: var(--hi); opacity: 0.55; }
.lo-swipe::before { background: var(--lo); opacity: 0.55; }
.n-swipe::before  { background: var(--neutral); opacity: 0.55; }

/* Data-source tag (mono, small, tape-like) */
.src-tag {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--ink);
  padding: 2px 6px;
  border-radius: 2px;
  margin: 2px 4px 2px 0;
  transform: rotate(-0.8deg);
}
.src-tag::before { content: "src ▸ "; color: var(--ink-faint); }

/* Prior-deal reference pills (Phase 02 — open matched § in context) */
.match-pill {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--ink);
  background: var(--paper-2);
  border: 1.5px solid var(--ink);
  padding: 4px 10px;
  border-radius: 999px;
  margin: 4px 8px 4px 0;
  cursor: pointer;
  transform: rotate(-0.4deg);
}
.match-pill:hover {
  background: var(--paper);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.06);
}
.match-pill-hint {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 6px;
}

.lawyer-reasoning-box {
  margin-top: 6px;
  min-height: 72px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-soft);
  resize: vertical;
  font-family: "Kalam", sans-serif;
  width: 100%;
  box-sizing: border-box;
}
.lawyer-reasoning-box::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}

.deeper-review-body {
  max-height: 472px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Arrow (hand-drawn-ish) */
.arrow {
  position: absolute;
  font-family: "Caveat", cursive;
  color: var(--ink);
  font-size: 24px;
  pointer-events: none;
  text-decoration: none;
  filter: none;
  line-height: 1.15;
}
.ui-btn, .mini-btn, .ui-btn *, .mini-btn * { text-decoration: none !important; }
.region-title, .phase-title, .phase-tag { text-decoration: none !important; filter: none !important; }

/* Footnote strip */
.slide-foot {
  position: absolute;
  left: 80px;
  right: 80px;
  bottom: 28px;
  display: flex;
  justify-content: space-between;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Open questions block (for phase slides) */
.oq {
  position: absolute;
  border: 1.5px dashed var(--ink-faint);
  padding: 10px 14px;
  border-radius: 3px;
  background: transparent;
}
.oq-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.oq ul { margin: 0; padding-left: 18px; font-size: 15px; color: var(--ink-soft); }
.oq li { margin-bottom: 4px; }

/* Decision fork */
.fork {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Caveat", cursive;
  font-size: 22px;
}
.fork .branch {
  border: 1.5px solid var(--ink);
  padding: 4px 10px;
  border-radius: 3px;
  background: var(--paper);
}

/* Cover slide */
.cover {
  padding: 72px 120px 84px;
}
.cover .eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 16px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.cover .cover-eyebrow-row {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: 108px;
  max-width: 1400px;
}
.cover .cover-eyebrow-row .eyebrow-version {
  letter-spacing: 0.12em;
}
.cover .cover-eyebrow-row .eyebrow-title {
  letter-spacing: 0.2em;
  margin-left: -12px;
}
.cover h1 {
  font-family: "Caveat", cursive;
  font-size: 80px;
  line-height: 0.92;
  margin: 14px 0 20px;
  font-weight: 700;
  max-width: 1400px;
}
.cover .subtitle {
  font-size: 32px;
  color: var(--ink-soft);
  max-width: 1200px;
  line-height: 1.3;
}

.cover-system-prompt {
  margin-top: 30px;
  max-width: 1100px;
  border: 1.8px solid var(--ink);
  border-radius: 3px;
  padding: 16px 18px;
  background: var(--paper-2);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.06);
  transform: rotate(-0.12deg);
}
.cover-system-prompt .csp-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}
.cover-system-prompt .csp-body {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-soft);
  white-space: pre-wrap;
}

.folder-tree {
  margin-top: 22px;
  max-width: 520px;
  border: 1.8px solid var(--ink);
  border-radius: 3px;
  padding: 14px 16px 14px 12px;
  background: var(--paper);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.06);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  transform: rotate(0.1deg);
}
.folder-tree .ft-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}
.folder-tree .ft-row { display: flex; align-items: baseline; gap: 8px; padding: 2px 0; }
.folder-tree .ft-indent-1 { padding-left: 22px; }
.folder-tree .ft-indent-2 { padding-left: 44px; }
.folder-tree .ft-ico { flex-shrink: 0; opacity: 0.85; }

.cover-global-rules {
  margin-top: 22px;
  max-width: 1100px;
  border: 1.8px dashed var(--ink-faint);
  border-radius: 3px;
  padding: 14px 18px;
  background: var(--paper);
}
.cover-global-rules .cgr-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}
.cover-global-rules ul {
  margin: 0;
  padding-left: 20px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.cover-global-rules li { margin-bottom: 8px; }
.cover-global-rules b {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

.cover-visual-layout {
  margin-top: 16px;
  max-width: 1100px;
  border: 1.8px solid var(--ink-faint);
  border-radius: 3px;
  padding: 14px 18px;
  background: var(--paper-2);
}
.cover-visual-layout .cvl-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}
.cover-visual-layout ul {
  margin: 0;
  padding-left: 20px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.cover-visual-layout li { margin-bottom: 8px; }

.word-frame .doc-body.doc-body--phase-img {
  padding: 0;
  flex: 1;
  min-height: 0;
  line-height: 0;
}
.word-frame .doc-body.doc-body--phase-img .phase-doc-img {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

/* Mini Word-doc frame (used in lawyer phases) */
.word-frame {
  position: relative;
  border: 1.8px solid var(--ink);
  border-radius: 3px;
  background: var(--paper);
  display: flex;
  flex-direction: column;
}
.word-frame .tabs {
  display: flex;
  gap: 0;
  border-bottom: 1.5px solid var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.word-frame .tabs span {
  padding: 6px 12px;
  border-right: 1px solid var(--ink-faint);
}
.word-frame .tabs span:first-child { color: var(--ink); font-weight: 700; }
.word-frame .doc-body {
  flex: 1;
  padding: 18px 22px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-soft);
  overflow: hidden;
}
.word-frame .doc-body .ph {
  display: block;
  height: 7px;
  background: var(--paper-2);
  border-radius: 2px;
  margin-bottom: 9px;
}
.word-frame .doc-body .ph.short { width: 40%; }
.word-frame .doc-body .ph.med   { width: 70%; }
.word-frame .doc-body .ph.full  { width: 100%; }
.word-frame .doc-body h4 {
  font-family: "Caveat", cursive;
  font-size: 26px;
  margin: 6px 0 10px;
  color: var(--ink);
}

/* Prior deal reference — read-only archive shell */
.word-frame.word-frame--prior-deal {
  background: #e8e2d6;
  border-style: dashed;
  border-color: var(--ink-soft);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(27, 27, 27, 0.08);
}
.word-frame.word-frame--prior-deal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(120, 90, 50, 0.06);
  pointer-events: none;
  z-index: 1;
}
.word-frame.word-frame--prior-deal .prior-deal-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Caveat", cursive;
  font-size: 72px;
  font-weight: 700;
  color: var(--ink);
  opacity: 0.07;
  pointer-events: none;
  z-index: 2;
  transform: rotate(-12deg);
  user-select: none;
}
.word-frame.word-frame--prior-deal .prior-deal-ribbon {
  position: relative;
  z-index: 3;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  padding: 8px 12px;
  background: #c4a574;
  color: #1a1510;
  border-bottom: 1.5px solid var(--ink);
}
.word-frame.word-frame--prior-deal .tabs {
  position: relative;
  z-index: 3;
  opacity: 0.72;
  background: #dcd5c9;
}
.word-frame.word-frame--prior-deal .tabs .tab-muted {
  opacity: 0.45;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.word-frame.word-frame--prior-deal .doc-body.prior-deal-doc {
  position: relative;
  z-index: 3;
  background: #ebe4d8;
  filter: grayscale(0.35);
  user-select: text;
  cursor: default;
}
.word-frame.word-frame--prior-deal .doc-body .clause.clause--archive {
  border-left-style: dashed;
  border-left-width: 3px;
  background: rgba(255, 255, 255, 0.35);
}

.prior-ro-lock {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7c2d12;
  font-weight: 700;
}
.prior-deal-rules {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--ink-faint);
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.4;
}
.prior-deal-rules strong {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 6px;
}
.prior-deal-rules ul {
  margin: 0;
  padding-left: 18px;
}
.prior-deal-rules li { margin-bottom: 4px; }
.word-frame .doc-body .clause {
  border-left: 3px solid var(--ink-faint);
  padding: 6px 10px;
  margin: 10px 0;
  font-size: 14px;
  color: var(--ink-soft);
  background: var(--paper);
}
.word-frame .doc-body .clause.hi  { border-left-color: #2F7D3A; background: #E8F5E3; }
.word-frame .doc-body .clause.lo  { border-left-color: #B03A3A; background: #FBE3E3; }
.word-frame .doc-body .clause-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 4px;
}

/* Side panel (plugin) */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* Scroll inner body so .region-label (outside scroll) is not clipped */
.side-panel .side-panel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.side-panel .pane-head {
  font-family: "Caveat", cursive;
  font-size: 28px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.side-panel .pane-head .count-pill {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  border: 1.5px solid var(--ink);
  padding: 2px 8px;
  border-radius: 999px;
}
.side-panel .sug {
  border: 1.5px solid var(--ink);
  padding: 10px 12px;
  border-radius: 3px;
  background: var(--paper);
}
.side-panel .sug.hi { border-left: 6px solid #2F7D3A; background: #EFF8EB; }
.side-panel .sug.lo { border-left: 6px solid #B03A3A; background: #FBE8E8; }
.side-panel .sug .sug-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 4px;
}
.side-panel .sug .sug-title {
  font-family: "Kalam", sans-serif;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 4px;
}
.side-panel .sug .sug-body {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.35;
  margin-bottom: 6px;
}
.side-panel .sug .sug-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.side-panel .sug .mini-btn {
  font-family: "Kalam", sans-serif;
  font-size: 12px;
  border: 1.2px solid var(--ink);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--paper);
}
.side-panel .sug .mini-btn.primary { background: var(--ink); color: var(--paper); }

.sug-actions.sug-actions--triple {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
/* More Options (⋯) — same pattern anywhere (side panel, modals, reference) */
.more-options {
  position: relative;
  display: inline-block;
}
.more-options > summary {
  list-style: none;
  cursor: pointer;
}
.more-options > summary::-webkit-details-marker { display: none; }
.more-options > summary::marker { content: ''; }
.more-options .mini-btn--kebab {
  font-family: "Kalam", sans-serif;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0;
  padding: 2px 10px;
  min-width: 36px;
  text-align: center;
  border: 1.2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  display: inline-block;
}
.more-options-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  margin: 0;
  padding: 6px 0;
  min-width: 220px;
  list-style: none;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.08);
  font-family: "Kalam", sans-serif;
  font-size: 14px;
}
.more-options-menu li {
  padding: 6px 12px;
  margin: 0;
  color: var(--ink-soft);
  border-bottom: 1px dashed var(--ink-faint);
}
.more-options-menu li:last-child { border-bottom: 0; }
.more-options[open] > summary { outline: 2px solid var(--ink-faint); }

.side-panel .sug.sug--condensed .sug-body {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.side-panel .sug.sug--condensed {
  opacity: 0.92;
}
.side-panel .sug-condensed-hint {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 8px;
}

.behavior-note {
  font-family: "Kalam", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 900px;
}
.behavior-note strong {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
}

/* Signal bar (passive capture row) */
.signal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-top: 1px dashed var(--ink-faint);
  padding-top: 6px;
  margin-top: 6px;
}

/* ---------- TWEAKS PANEL ---------- */

#tweaks {
  position: fixed;
  right: 20px;
  bottom: 70px;
  z-index: 999999;
  background: #fff;
  border: 2px solid #000;
  border-radius: 6px;
  padding: 14px 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
  display: none;
  min-width: 220px;
}
#tweaks[data-open] { display: block; }
#tweaks h4 {
  margin: 0 0 10px;
  font-family: "Caveat", cursive;
  font-size: 22px;
  letter-spacing: 0;
  text-transform: none;
}
#tweaks .opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
}
#tweaks .opt input { margin: 0; }
#tweaks .opt span { font-family: "Kalam", sans-serif; font-size: 14px; }

/* Don't show tweaks panel in print */
@media print {
  #tweaks { display: none !important; }
}

/* ---------- DECK ARROW NAV ---------- */

.deck-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
  width: 52px;
  height: 52px;
  border: 1.5px solid #1B1B1B;
  background: #FBF8F2;
  color: #1B1B1B;
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  filter: url(#wobble);
  transition: opacity 150ms, background 150ms;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  user-select: none;
}
.deck-arrow:hover:not([disabled]) { background: #F3EEE2; }
.deck-arrow[disabled] { opacity: 0.25; cursor: default; }
.deck-arrow.prev { left: 18px; }
.deck-arrow.next { right: 18px; }

@media print {
  .deck-arrow { display: none !important; }
}

/* ---------- DECK NAVIGATION RAIL ---------- */

#deck-rail {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 200;
  width: 44px;
  overflow: hidden;
  background: #FBF8F2;
  transition: width 220ms ease;
}
#deck-rail.rail-open { width: 240px; }

.rail-border {
  position: absolute;
  right: -1px; top: 0; bottom: 0;
  width: 2px;
  background: #1B1B1B;
  filter: url(#wobble);
  pointer-events: none;
  z-index: 1;
}

#deck-rail-spine {
  position: absolute;
  left: 12px; top: 0; bottom: 0;
  width: 0;
  border-left: 1px dotted #8A8580;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
  filter: url(#wobble);
  z-index: 0;
}
#deck-rail.rail-open #deck-rail-spine { opacity: 1; }

#deck-rail-strip {
  position: absolute;
  inset: 0 2px 36px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 20px 0;
  opacity: 1;
  transition: opacity 100ms ease;
  z-index: 2;
}
#deck-rail.rail-open #deck-rail-strip { opacity: 0; pointer-events: none; }

.rail-strip-item {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8A8580;
  cursor: pointer;
  padding: 5px 2px;
  transition: color 150ms;
  white-space: nowrap;
  user-select: none;
}
.rail-strip-item:hover { color: #1B1B1B; }
.rail-strip-item.active { color: #1B1B1B; font-weight: 700; }

#deck-rail-panel {
  position: absolute;
  inset: 0 2px 36px 0;
  overflow-y: auto;
  padding: 10px 0 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease 60ms;
  scrollbar-width: none;
  z-index: 2;
}
#deck-rail-panel::-webkit-scrollbar { display: none; }
#deck-rail.rail-open #deck-rail-panel { opacity: 1; pointer-events: auto; }

.rail-section { margin-bottom: 2px; }
.rail-section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8A8580;
  padding: 8px 10px 3px 26px;
  display: block;
}
.rail-slide-btn {
  display: block;
  width: 100%;
  text-align: left;
  font-family: 'Kalam', cursive;
  font-size: 13px;
  color: #3A3A3A;
  background: none;
  border: none;
  padding: 2px 10px 2px 32px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 150ms;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  line-height: 1.5;
}
.rail-slide-btn::before {
  content: '·';
  position: absolute;
  left: 24px;
  color: #8A8580;
  transition: color 150ms;
}
.rail-slide-btn:hover { color: #1B1B1B; }
.rail-slide-btn:hover::before { color: #1B1B1B; }
.rail-slide-btn.active { color: #1B1B1B; font-weight: 700; }
.rail-slide-btn.active::before { color: #1B1B1B; }

#deck-rail-toggle {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-top: 1px dashed #8A8580;
  cursor: pointer;
  color: #8A8580;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 0;
  transition: color 150ms;
  z-index: 3;
  line-height: 1;
}
#deck-rail-toggle:hover { color: #1B1B1B; }

@media print {
  #deck-rail { display: none !important; }
}
