/* ==========================================================================
   Case File: a detective's desk. Kraft paper, manila folders, typed records,
   rubber stamps, redaction bars, and an evidence photo for each exhibit.
   Same two inks as Paper Cuts.
   ========================================================================== */

body[data-game="case-file"] {
  --kraft: #b48b5a;
  --manila: #e2ca92;
  --manila-dark: #c9ab6c;
  --typed: 'Special Elite', 'Courier New', monospace;
  --font-display: 'Archivo Black', sans-serif;
  background-color: var(--kraft);
}
body[data-game="case-file"]::before { display: none; }

/* the evidence board behind everything (drawn by casefile.js) */
.cf-desk { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.cf-desk svg { width: 100%; height: 100%; display: block; }
.cf-desk::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(28, 23, 23, 0.35) 100%);
}
body[data-game="case-file"] .topbar { z-index: 10; }

/* the detective's handwriting */
.cf-scrawl, .cf-yours, .cf-photo figcaption span:first-child {
  font-family: var(--font-hand);
}
.cf-scrawl { color: var(--ink-1); font-size: 1.5rem; text-align: center; margin: -4px 0 16px; transform: rotate(-2deg); }
body[data-game="case-file"] .stage { padding-bottom: 56px; max-width: 820px; }

/* ---------- header: a rubber-stamped title ---------- */

.cf-head { position: relative; z-index: 2; text-align: center; margin: 6px 0 34px; }
.cf-head.small { margin-bottom: 18px; }
/* the title is stamped onto a paper label pinned to the board, so it reads against the cork */
.cf-stamp-title {
  display: inline-block;
  padding: 12px 18px;
  background-color: var(--paper-card);
  background-image: var(--fibers-soft);
  box-shadow: 3px 4px 0 var(--shadow);
}
/* ...with a red pushpin at the top, like everything else on the board */
.cf-stamp-title { position: relative; }
.cf-stamp-title::before {
  content: ''; position: absolute; z-index: 3; top: 3px; left: 50%; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%;
  /* the same glossy map pin as on the board: lit from the top left, darker underneath, a crisp highlight */
  background:
    radial-gradient(ellipse 30% 20% at 32% 28%, rgba(255, 255, 255, 0.6) 0 60%, transparent 100%),
    radial-gradient(ellipse 36% 22% at 66% 76%, rgba(255, 157, 150, 0.3) 0 50%, transparent 100%),
    radial-gradient(circle at 36% 32%, #f08480 0%, #d7262e 40%, #a52a2c 84%, #7a2023 100%);
  box-shadow: 4px 6px 5px rgba(28, 23, 23, 0.4), inset 0 0 0 1px rgba(58, 2, 5, 0.3);
}
.cf-head.small .cf-stamp-title { padding: 8px 12px; }
.cf-stamp-title span {
  display: inline-block;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: clamp(2.1rem, 8vw, 3.5rem);
  line-height: 1;
  padding: 0.12em 0.4em 0.06em;
  color: var(--ink-1);
  border: 5px solid currentColor;
  box-shadow: inset 0 0 0 3px var(--paper-card), inset 0 0 0 6px currentColor;
  mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(#000, #000), var(--noise);
  -webkit-mask-composite: source-out;
  mask-image: linear-gradient(#000, #000), var(--noise);
  mask-composite: subtract;
}
.cf-head.small .cf-stamp-title span { font-size: clamp(1.4rem, 5vw, 1.9rem); border-width: 4px; }

/* ---------- exhibit tabs A–E ---------- */

.cf-file-stack { position: relative; }
.cf-tabrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 0 10px 0 18px; position: relative; z-index: 0; margin-bottom: -8px; }
.cf-case-tab {
  padding: 8px 18px 6px;
  background: var(--paper-card);
  font-family: var(--typed);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.9rem;
  white-space: nowrap;
  clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%);
}
.cf-tabs { display: flex; gap: 4px; }
.cf-tab {
  width: 54px;
  padding: 7px 0 5px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.9rem;
  background: var(--manila-dark);
  color: var(--ink-2);
  clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%);
}
.cf-tab.now { background: var(--paper-card); color: var(--ink-1); padding-top: 10px; }
.cf-tab.solved { background: var(--ink-1); color: var(--paper-card); }
.cf-tab.cold { background: var(--ink-2); color: var(--paper-card); }

/* ---------- the folder cover ---------- */

.cf-folder { position: relative; max-width: 600px; margin: 18px auto 0; }
.cf-folder-tab {
  display: inline-block;
  margin-left: 26px;
  padding: 9px 26px 7px;
  background: var(--manila);
  font-family: var(--typed);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  clip-path: polygon(7% 0, 93% 0, 100% 100%, 0 100%);
}
.cf-folder-body {
  position: relative;
  background-color: var(--manila);
  background-image: var(--fibers-soft);
  padding: 34px 30px 30px;
  border-radius: 0 6px 6px 6px;
  box-shadow: 7px 7px 0 var(--manila-dark), 10px 12px 0 var(--shadow);
}
/* a wire paperclip gripping the top edge of the folder */
.cf-clip {
  position: absolute;
  top: -30px; right: 70px;
  width: 26px; height: 80px;
  color: var(--ink-2);
  transform: rotate(8deg);
  filter: drop-shadow(1.5px 2px 0 var(--shadow));
  z-index: 6;
}
.cf-clip svg { width: 100%; height: 100%; display: block; }
/* stamped on the folder itself, below the instructions, never on top of them */
.cf-instructions { background: var(--paper-card); padding: 18px 20px 6px; box-shadow: 2px 3px 0 var(--shadow); margin-bottom: 22px; transform: rotate(0.4deg); }
.cf-instructions h2 { font-family: var(--font-hand); text-transform: uppercase; font-size: 1.4rem; color: var(--ink-1); letter-spacing: 0.08em; margin: 0 0 10px; border-bottom: 2px solid var(--ink-2); padding-bottom: 6px; }
.cf-instructions ol { margin: 0 0 12px; padding-left: 22px; font-family: var(--typed); font-size: 0.98rem; }
.cf-instructions li { margin-bottom: 6px; }
.cf-instructions li::marker { color: var(--ink-1); font-family: var(--font-display); }

/* ---------- the exhibit dossier ---------- */

.cf-dossier {
  position: relative;
  z-index: 1;
  background-color: var(--paper-card);
  background-image: var(--fibers-soft), repeating-linear-gradient(transparent 0 27px, rgba(28, 23, 23, 0.07) 27px 28px);
  padding: 20px 26px 24px 52px;
  box-shadow: 6px 6px 0 var(--manila), 9px 10px 0 var(--shadow);
  animation: card-in 0.45s cubic-bezier(.2,.9,.3,1.2) both;
}
/* punched binder holes down the left margin */
.cf-dossier::before {
  content: '';
  position: absolute;
  left: 16px; top: 40px; bottom: 40px;
  width: 14px;
  background: radial-gradient(circle, var(--kraft) 5px, rgba(28, 23, 23, 0.35) 6px, transparent 7px) center top / 14px 33.3% repeat-y;
}
.cf-dossier::after {
  content: '';
  position: absolute;
  left: 40px; top: 0; bottom: 0;
  border-left: 2px solid rgba(215, 38, 46, 0.45);
}
.cf-dossier-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.cf-exhibit { font-family: var(--font-display); text-transform: uppercase; font-size: 1.5rem; letter-spacing: 0.06em; border-bottom: 4px solid var(--ink-1); line-height: 1.1; }
.cf-photo {
  position: relative;
  margin: 0 0 18px;
  padding: 10px 10px 8px;
  background: #fffaf0;
  box-shadow: 2px 3px 0 var(--shadow), 0 0 0 1px rgba(28, 23, 23, 0.12);
  transform: none;
}
.cf-photo::before {
  content: '';
  position: absolute;
  top: -10px; left: 50%;
  width: 90px; height: 22px;
  transform: translateX(-50%) rotate(2deg);
  background: rgba(255, 250, 238, 0.92);
  box-shadow: 0 1px 3px rgba(28, 23, 23, 0.35);
  clip-path: polygon(2% 0, 98% 0, 96% 50%, 100% 100%, 0 100%, 4% 50%);
  z-index: 2;
}
.cf-photo-pic { position: relative; aspect-ratio: 4.3 / 1; overflow: hidden; background: var(--paper); }
/* two snapshots side by side, each taped down at its own slight angle */
.cf-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 16px 4px 20px; }   /* clear of the exhibit title's red underline */
.cf-photos .cf-photo { margin: 0; padding: 8px 8px 6px; }
.cf-photos .cf-photo:first-child { transform: rotate(-1deg); }
.cf-photos .cf-photo:last-child { transform: rotate(1.3deg) translateY(4px); }
.cf-photos .cf-photo::before { width: 64px; height: 18px; top: -9px; }
.cf-photos .cf-photo:last-child::before { transform: translateX(-50%) rotate(-3deg); }
.cf-photos .cf-photo-pic { aspect-ratio: 3 / 2; }
.cf-photos figcaption span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-photo-pic .scene-svg { width: 100%; height: 100%; display: block; }
.cf-photo figcaption { display: flex; justify-content: space-between; font-family: var(--typed); font-size: 0.8rem; padding-top: 7px; }
.cf-osd {
  position: absolute; top: 18px; left: 20px;
  font-family: 'VT323', monospace; font-size: 1.15rem; letter-spacing: 0.06em;
  color: var(--paper-card);
  text-shadow: 1px 1px 0 var(--ink-2), -1px -1px 0 var(--ink-2);
  display: flex; align-items: center; gap: 6px;
}
.cf-osd i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-1); box-shadow: 0 0 0 1.5px var(--ink-2); animation: rec-blink 1.1s steps(1) infinite; }

.cf-record { display: grid; grid-template-columns: 112px 1fr; gap: 6px 14px; margin: -4px 0 8px; }
.cf-record dt { font-family: var(--font-display); text-transform: uppercase; font-size: 0.74rem; letter-spacing: 0.06em; align-self: center; }
.cf-record dd { margin: 0; font-family: var(--typed); font-size: 1.02rem; min-height: 37px; display: flex; align-items: center; }   /* same height redacted or revealed, so nothing jumps */
.cf-redacted .bar {
  display: inline-block;
  height: 1.1em;
  vertical-align: -0.15em;
  background: var(--ink-2);
  clip-path: polygon(0 8%, 30% 0, 70% 6%, 100% 0, 99% 92%, 66% 100%, 34% 94%, 1% 100%);
}
.cf-redacted.lifted .cf-typed {
  display: inline-block;
  font-size: 1.15rem;
  background: linear-gradient(transparent 62%, rgba(215, 38, 46, 0.35) 62%);
  animation: type-in 0.5s steps(12) both;
  white-space: nowrap;
  overflow: hidden;
}
@keyframes type-in { from { max-width: 0; } to { max-width: 30em; } }

.cf-filed-label { font-family: var(--font-display); text-transform: uppercase; font-size: 0.74rem; letter-spacing: 0.06em; margin: 0 0 8px; }
.cf-tags { list-style: none; margin: 0 0 11px; padding: 0; display: flex; flex-wrap: wrap; gap: 5px 5px; }
.cf-tags li {
  font-family: var(--typed);
  font-size: 0.86rem;
  line-height: 1.2;
  padding: 3px 8px 2px 17px;
  position: relative;
  background: #fffaf0;
  box-shadow: inset 0 0 0 1.5px rgba(28, 23, 23, 0.55), 1.5px 1.5px 0 var(--shadow);
  transform: rotate(var(--r, 0deg));
  animation: card-in 0.3s ease both;
  animation-delay: var(--d, 0s);
}
.cf-tags li::before { content: ''; position: absolute; left: 7px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--ink-1); }

.cf-identify { border-top: 2px dashed var(--ink-2); padding-top: 16px; }
.cf-identify .field { background: #fffdf6; }
.stamp.cf-verdict { top: 70px; right: 24px; font-size: 1.9rem; }

.cf-notes { font-family: var(--typed); }
.cf-notes p { margin: 0 0 8px; }
.cf-notes b { font-family: var(--font-display); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; }
.cf-notes p b + span b { font-family: var(--typed); text-transform: none; font-size: inherit; letter-spacing: 0; color: var(--ink-1); }

/* ---------- the case report ---------- */

.cf-report {
  position: relative;
  z-index: 1;
  background-color: var(--paper-card);
  background-image: var(--fibers-soft);
  padding: 22px 28px 26px;
  box-shadow: 6px 6px 0 var(--manila), 9px 10px 0 var(--shadow);
  font-family: var(--typed);
}
.cf-report-head { display: flex; justify-content: space-between; font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.85rem; border-bottom: 4px double var(--ink-2); padding-bottom: 8px; margin-bottom: 18px; }
.stamp.cf-closed { top: 72px; right: 22px; font-size: 1.7rem; transform: rotate(10deg); }


/* ---------- archive: folders three to a row ---------- */

.view-head.cf-view-head .cf-stamp-title { padding: 12px 18px; }
.view-head.cf-view-head .cf-stamp-title span { font-size: clamp(1.15rem, 3.6vw, 1.7rem); white-space: nowrap; padding: 0.42em 0.62em 0.34em 0.76em; border-width: 4px; }
.cf-file-grid { list-style: none; margin: 0; padding: 22px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px 18px; }
.cf-file {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 112px;
  padding: 16px 14px 12px;
  background-color: var(--manila);
  background-image: var(--fibers-soft);
  color: var(--ink-2);
  text-decoration: none;
  box-shadow: 5px 5px 0 var(--manila-dark), 7px 8px 0 var(--shadow);
  transform: rotate(var(--r, 0deg));
  transition: transform 0.15s ease;
}
.cf-file:hover { transform: rotate(0deg) translateY(-5px); }
.cf-file-tab {
  position: absolute;
  top: -22px; left: 10px;
  padding: 5px 14px 3px;
  background: var(--manila);
  font-family: var(--typed);
  font-size: 0.85rem;
  clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%);
}
.cf-file-date { font-family: var(--typed); font-size: 0.95rem; }
.cf-file-status { margin-top: auto; align-self: flex-start; font-family: var(--font-display); text-transform: uppercase; font-size: 0.66rem; letter-spacing: 0.06em; padding: 4px 8px 3px; border: 2px solid currentColor; transform: rotate(-3deg); white-space: nowrap; }
.cf-file.closed .cf-file-status { color: var(--ink-1); }
.cf-file:not(.closed) .cf-file-status { opacity: 0.6; }
/* the case you're on: a paperclip holding a little slip that says ACTIVE, clipped over the folder's top edge */
.cf-active { position: absolute; z-index: 3; top: -6px; right: -26px; display: block; width: 74px; height: 46px; pointer-events: none; transform: rotate(30deg); transform-origin: 30% 40%; }
.cf-active .slip {
  position: absolute; left: 0; top: 10px; padding: 5px 9px 4px; transform: rotate(-4deg);
  background: var(--paper-card); box-shadow: 1.5px 2px 0 rgba(28, 23, 23, 0.3);
  font-family: 'Archivo Black', sans-serif; font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-1);
}
.cf-active .clip { position: absolute; right: 6px; top: -4px; width: 13px; height: 40px; color: #8c8f96; transform: rotate(8deg); filter: drop-shadow(1px 2px 0 rgba(28, 23, 23, 0.3)); }
.cf-active .clip svg { width: 100%; height: 100%; display: block; }
/* ---------- stats: the service record ---------- */

.cf-service { display: grid; grid-template-columns: 1fr auto; gap: 0; margin: 4px 0 22px; }
.cf-service dt, .cf-service dd { margin: 0; padding: 10px 2px 8px; border-bottom: 1.5px dotted var(--ink-2); }
.cf-service dt { font-family: var(--typed); font-size: 1.05rem; }
.cf-service dd { font-family: var(--font-hand); font-size: 1.7rem; line-height: 1; color: var(--ink-1); text-align: right; }
.cf-sub { font-family: var(--font-display); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.06em; margin: 0 0 10px; }
.cf-bars { display: grid; gap: 7px; margin-bottom: 8px; }
.cf-bar-row { display: grid; grid-template-columns: 22px 1fr 30px; align-items: center; gap: 10px; font-family: var(--typed); }
.cf-bar-row .track { height: 14px; border-bottom: 1px solid rgba(28, 23, 23, 0.25); }
.cf-bar-row .bar { display: block; height: 100%; background: var(--ink-2); }
.cf-bar-row.today .bar { background: var(--ink-1); }
.cf-bar-row .v { text-align: right; }

@media (max-width: 560px) {
  .cf-dossier { padding: 18px 16px 20px 38px; }
  .cf-dossier::before { left: 9px; }
  .cf-dossier::after { left: 28px; }
  .cf-record { grid-template-columns: 1fr; gap: 2px; }
  .cf-record dt { padding-top: 8px; }
  .cf-tab { width: 34px; }
  .stamp.cf-verdict { top: 50px; font-size: 1.4rem; }
}

/* no dashed scissors line here: a red string runs under the nav to the board's top-right pin (casefile.js navString) */
body[data-game="case-file"] .topbar { border-bottom-color: transparent; }
body[data-game="case-file"] .topbar::after { display: none; }
.cf-navstring { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 11; pointer-events: none; }

@media (max-width: 560px) {
  .cf-file-grid { grid-template-columns: repeat(2, 1fr); }
  .cf-tab { width: 34px; }
  .cf-case-tab { font-size: 0.75rem; padding: 7px 12px 5px; }
}

/* close leads (half a point) */
.cf-tab.close { background-color: var(--paper-card); background-image: radial-gradient(var(--ink-1) 38%, transparent 41%); background-size: 6px 6px; color: var(--ink-2); }
.cf-yours.close { color: var(--ink-1); font-size: 1.15rem; }

/* ---------- exhibit tabs: a stack of divider tabs ----------
   Every tab sits behind the pages with only its top showing; the current
   exhibit's tab is the only one in front, joined to its page. */
.cf-tabrow { z-index: auto; }
.cf-case-tab { position: relative; z-index: 0; background: var(--manila); }
.cf-tabs { position: relative; gap: 3px; margin-bottom: -8px; }
.cf-tab {
  position: relative; z-index: 0;
  width: 50px;
  padding: 6px 0 14px;
  font-family: var(--font-hand);
  font-size: 1.35rem;
  line-height: 1;
  border-radius: 0;
  box-shadow: none;
  background: var(--manila-dark);
  color: var(--ink-2);
  clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%);
}
.cf-tab.solved { background: var(--manila); color: var(--ink-1); }
.cf-tab.close { background-color: var(--manila); background-image: radial-gradient(rgba(215, 38, 46, 0.45) 30%, transparent 33%); background-size: 6px 6px; color: var(--ink-1); }
.cf-tab.cold { background: var(--manila); color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--ink-1); text-decoration-thickness: 2px; }
.cf-tab.now { z-index: 2; background: var(--paper-card); color: var(--ink-1); padding-top: 9px; }
/* the verdict stamp sits beside the title and year, under the photo */
.cf-record { position: relative; }
.cf-record .stamp.cf-verdict { top: 50%; right: 0; margin-top: -26px; }   /* centred on the title / released rows, clear of the photo */

/* room on the right of the title/year for the verdict stamp, so a long revealed title never runs under it */
.cf-record { padding-right: 200px; }
/* the revealed notes stay compact so the page doesn't grow past the screen */
.cf-notes p { margin: 0 0 6px; font-size: 0.92rem; }
.cf-notes .center { margin-top: 10px !important; }

/* case report: ledger stamps tilt the other way and sit centred in their rows */
.stamp.cf-closed { top: 50px; right: 26px; }
/* letter tabs: plain rectangles; the current one is the page's paper, the others grey paper with a shadow */
.cf-tab { clip-path: none; border-radius: 2px 2px 0 0; background-color: #d6d1c7; box-shadow: 0 -1px 3px rgba(28, 23, 23, 0.28); }
.cf-tab.solved, .cf-tab.cold { background-color: #d6d1c7; }
.cf-tab.close { background-color: #d6d1c7; background-image: radial-gradient(rgba(215, 38, 46, 0.45) 30%, transparent 33%); background-size: 6px 6px; }
.cf-tab.now { background: var(--paper-card); box-shadow: 0 -1px 3px rgba(28, 23, 23, 0.18); }
/* the notes after a reveal take at least the space the answer box had, so the file does not shrink */
.cf-identify .cf-notes { min-height: 129px; display: flex; flex-direction: column; justify-content: space-between; }

/* ---------- case report (results) ---------- */
.cf-report-head { font-size: 0.72rem; }
.cf-report-title { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.12em; font-size: 1.7rem; margin: 0 0 14px; }
.cf-fields { display: grid; grid-template-columns: repeat(4, auto) 1fr; gap: 0; border: 2px solid var(--ink-2); margin: 0 0 22px; }
.cf-field { padding: 6px 12px 8px; border-right: 1px solid rgba(28, 23, 23, 0.4); }
.cf-field:last-child { border-right: 0; }
.cf-field .k { display: block; font-family: var(--font-display); text-transform: uppercase; font-size: 0.62rem; letter-spacing: 0.08em; opacity: 0.75; }
.cf-field .v { font-size: 1rem; }
.cf-field.big .v { font-family: var(--font-display); font-size: 1.35rem; color: var(--ink-1); }
.cf-section { font-family: var(--font-display); text-transform: uppercase; font-size: 0.74rem; letter-spacing: 0.1em; margin: 0 0 4px; padding-bottom: 6px; border-bottom: 2px solid var(--ink-2); }
.cf-findings { list-style: none; margin: 0; padding: 0; }
.cf-findings li { display: grid; grid-template-columns: 30px 1fr 120px; gap: 10px; align-items: center; padding: 10px 2px; border-bottom: 1px dashed rgba(28, 23, 23, 0.35); font-size: 0.92rem; }
.cf-findings .ex { font-family: var(--font-display); font-size: 1.1rem; align-self: start; }
.cf-findings .lead { font-size: 0.85rem; margin-top: 2px; }
.cf-findings .note { font-size: 0.82rem; opacity: 0.85; margin-top: 4px; }
.cf-findings .note b { color: var(--ink-1); font-weight: normal; }
/* result stamps carry the same emoji the copied result uses */
.cf-findings .res {
  justify-self: end; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-display); text-transform: uppercase; font-size: 0.66rem; letter-spacing: 0.06em;
  padding: 4px 9px 3px 6px; border: 2px solid currentColor; transform: rotate(5deg); color: var(--ink-2);
  background: rgba(255, 250, 240, 0.6);
}
.cf-findings .res-emoji { font-size: 1.25rem; line-height: 1; }
.cf-findings li.solved .res { color: var(--ink-1); }
.cf-findings li.close .res { color: var(--ink-1); border-style: dashed; }.cf-signoff { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.cf-sign { display: flex; flex-direction: column; min-width: 180px; }
.cf-sign .scrawl { font-family: var(--font-hand); font-size: 1.7rem; color: var(--ink-2); transform: rotate(-3deg); margin-left: 10px; line-height: 1; }
.cf-sign .line { border-top: 1.5px solid var(--ink-2); padding-top: 3px; font-family: var(--font-display); text-transform: uppercase; font-size: 0.6rem; letter-spacing: 0.08em; opacity: 0.75; }
@media (max-width: 560px) {
  .cf-fields { grid-template-columns: 1fr 1fr; }
  .cf-field:nth-child(2n) { border-right: 0; }
  .cf-field:not(:last-child) { border-bottom: 1px solid rgba(28, 23, 23, 0.4); }
  .cf-field.big { grid-column: 1 / -1; }
  .cf-findings li { grid-template-columns: 24px 1fr; }
  .cf-findings .res { grid-column: 2; justify-self: start; }
}

/* intro: the date sits to the right of the heading, typed like a file stamp */
.cf-instr-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 2px solid var(--ink-2); padding-bottom: 6px; margin-bottom: 10px; }
.cf-instr-head h2 { margin: 0; border: 0; padding: 0; }
.cf-instr-date { font-family: var(--typed); font-size: 0.9rem; white-space: nowrap; padding: 2px 8px 1px; border: 1.5px solid rgba(28, 23, 23, 0.55); transform: rotate(2deg); }

/* on the cork the unselected chip needs its own paper to be readable */
body[data-game="case-file"] .mode-switch button:not(.on) { background: var(--paper-card); }

/* ---------- phones ---------- */
@media (max-width: 560px) {
  /* less space around the title, more under the folder */
  body[data-game="case-file"] .stage { padding-bottom: 64px; }
  .cf-head { margin: 0 0 16px; }
  .cf-head.small { margin-bottom: 10px; }
  /* exhibit tabs small enough that A to E fit beside the case tab */
  .cf-tabrow { gap: 6px; padding: 0 4px 0 8px; }
  .cf-case-tab { font-size: 0.66rem; padding: 6px 9px 5px; letter-spacing: 0.03em; }
  .cf-tabs { gap: 2px; }
  .cf-tab { width: 30px; font-size: 1.05rem; padding: 5px 0 12px; }
  .cf-tab.now { padding-top: 7px; }
}

/* the signature sits a little higher and further left */
/* the signature block sits level with the Copy result button, the scrawl with room above its line */
.cf-signoff { margin-top: 14px; align-items: center; }
.cf-sign { transform: translateX(-8px); }
.cf-sign .scrawl { margin-left: 0; margin-bottom: 10px; }
/* findings notes wrap a few characters before the edge */
.cf-findings .note { padding-right: 3ch; }
/* letter tabs in the same face as the findings' A, B, C column */
.cf-tab { font-family: var(--font-display); font-size: 1.02rem; line-height: 1.2; padding: 9px 0 17px; }
.cf-tab.now { padding-top: 11px; }
@media (max-width: 560px) { .cf-tab { font-size: 0.82rem; } }

/* the page is masked just below the red string under the nav, not at the nav's edge (quiz.js lockTopBar) */
body[data-game="case-file"] { --clip-extra: 5px; }

/* archive note under the title, like Paper Cuts *//* the ACTIVE slip sits further right; its paperclip comes straight down over the slip's top edge */
.cf-active { right: -40px; }
.cf-active .clip { right: 14px; top: -10px; transform: rotate(-30deg); transform-origin: 50% 30%; }
/* a manila back button here: the black one is too stark against the cork board */
body[data-game="case-file"] .btn.back-btn { --bg: #e2ca92; --fg: var(--ink-2); }
/* the active folder sits above its neighbour, so the slip and clip aren't tucked under the next folder */
.cf-file-grid li:has(.cf-file.current) { position: relative; z-index: 2; }

/* an old case: a red ARCHIVED rubber stamp across the folder's top edge, next to the case-number tab */
.cf-folder { position: relative; }
.cf-archived {
  position: absolute; z-index: 4; top: 0; left: 190px; transform: rotate(-4deg);
  font-family: 'Archivo Black', sans-serif; font-size: 0.95rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-1); padding: 4px 12px 3px; border: 3px solid currentColor; box-shadow: inset 0 0 0 2px var(--manila, #e2ca92), inset 0 0 0 3.5px currentColor;
  background: rgba(247, 241, 227, 0.55); mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(#000, #000), var(--noise); -webkit-mask-composite: source-out;
  mask-image: linear-gradient(#000, #000), var(--noise); mask-composite: subtract;
}
@media (max-width: 560px) { .cf-archived { left: auto; right: 10px; font-size: 0.75rem; } }

/* the ARCHIVED stamp sits on the folder cover, bottom-left (the CLASSIFIED stamp takes bottom-right) */
.cf-archived { top: auto; left: 18px; bottom: 14px; transform: rotate(-6deg); }
@media (max-width: 560px) { .cf-archived { left: 14px; right: auto; bottom: 16px; } }
/* a case in progress: the exhibit sheets' letter tabs poke up out of the folder, behind its front */
.cf-folder-body { z-index: 1; }
.cf-peek { position: absolute; z-index: 0; top: 10px; left: 220px; display: flex; gap: 4px; }
.cf-peek .cf-tab { width: 44px; padding: 6px 0 14px; font-size: 0.85rem; }
.cf-peek .cf-tab.now { padding-top: 6px; transform: translateY(-4px); }
@media (max-width: 560px) { .cf-peek { left: auto; right: 54px; top: 12px; } .cf-peek .cf-tab { width: 28px; font-size: 0.7rem; } }

/* intro day row: as wide as the folder (like Paper Cuts' row matches its sheet), and clear of the folder's shadow */
body[data-game="case-file"] .end-wrap.intro-row { max-width: 612px; margin: 0 auto; padding-top: 30px; }
body[data-game="case-file"] .end-wrap.intro-row .end-links { margin-top: 30px; }

/* the ARCHIVED stamp straddles the instruction card's top-left corner: half on the manila, half on the white card */
.cf-archived { left: 2px; top: 11px; bottom: auto; z-index: 7; transform: rotate(-9deg); background: none; box-shadow: inset 0 0 0 2px transparent, inset 0 0 0 3.5px currentColor; }
@media (max-width: 560px) { .cf-archived { left: -4px; right: auto; top: 14px; bottom: auto; } }

/* ---------- the folder, more like the real thing ---------- */
/* the back panel carries the tab and stands a little taller than the front cover, so a strip of it shows along the top;
   it's a shade darker, as the back of a folder sits in the cover's shadow */
.cf-folder::before {
  content: ''; position: absolute; z-index: 0; left: 3px; right: -3px; top: 34px; height: 26px;
  background-color: #d6bb7f; background-image: var(--fibers-soft), var(--noise);
  border-radius: 7px 7px 0 0; box-shadow: inset 0 1.5px 0 rgba(255, 248, 225, 0.45), 0 -1px 0 rgba(120, 86, 36, 0.25);
}
.cf-folder-tab {
  position: relative; z-index: 0; background-color: #d6bb7f; background-image: var(--fibers-soft), var(--noise);
  box-shadow: inset 0 1.5px 0 rgba(255, 248, 225, 0.5);
  text-shadow: 0 1px 0 rgba(255, 248, 225, 0.45);   /* typed into the card, very slightly pressed in */
}
/* the front cover: fibres and grain, edges a touch grubbier from handling, a faint coffee ring, a crisp cut edge
   with a lit top lip, and two scored fold lines near the bottom */
.cf-folder-body {
  margin-top: 12px; border-radius: 3px 7px 7px 7px;
  background-image:
    radial-gradient(ellipse 75% 70% at 50% 42%, transparent 60%, rgba(122, 86, 32, 0.2) 100%),
    radial-gradient(circle at 86% 80%, transparent 0 33px, rgba(138, 92, 38, 0.16) 34px 37px, rgba(138, 92, 38, 0.06) 38px 40px, transparent 41px),
    var(--fibers-soft), var(--noise);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 248, 225, 0.6),
    inset 0 0 0 1px rgba(140, 104, 48, 0.28),
    4px 5px 0 #c4a466,
    4px 5px 0 1px rgba(110, 78, 32, 0.3),
    8px 14px 18px rgba(20, 12, 6, 0.38);
}
.cf-folder-body::after {
  content: ''; position: absolute; z-index: -1; left: 0; right: 0; bottom: 9px; height: 9px; pointer-events: none;
  background:
    linear-gradient(rgba(118, 84, 34, 0.32), rgba(118, 84, 34, 0.32)) 0 0 / 100% 1px no-repeat,
    linear-gradient(rgba(255, 248, 225, 0.55), rgba(255, 248, 225, 0.55)) 0 1px / 100% 1px no-repeat,
    linear-gradient(rgba(118, 84, 34, 0.32), rgba(118, 84, 34, 0.32)) 0 6px / 100% 1px no-repeat,
    linear-gradient(rgba(255, 248, 225, 0.55), rgba(255, 248, 225, 0.55)) 0 7px / 100% 1px no-repeat;
}

/* folder, round two: back to the richer manila (no grey grain, no grubby vignette), no coffee ring or fold scores,
   a clean right edge, and the paperclip a little lower on the folder */
.cf-folder::before { left: 0; right: 0; background-color: #d9bb78; background-image: var(--fibers-soft); }
.cf-folder-tab { background-color: #d9bb78; background-image: var(--fibers-soft); }
.cf-folder-body {
  background-image: var(--fibers-soft);
  box-shadow: inset 0 1.5px 0 rgba(255, 248, 225, 0.55), 6px 6px 0 var(--manila-dark), 9px 13px 16px rgba(20, 12, 6, 0.35);
}
.cf-folder-body::after { display: none; }
.cf-clip { top: -16px; }

/* folder, round three: the back panel is one piece. Its top strip sits offset to the right by the same 6px
   that it shows past the cover's right and bottom edges, in the same colour, so the right edge reads as a single panel */
.cf-folder::before { left: 6px; right: -6px; background-color: #d2b26e; }
.cf-folder-tab { background-color: #d2b26e; }
.cf-folder-body { box-shadow: inset 0 1.5px 0 rgba(255, 248, 225, 0.55), 6px 0 0 #d2b26e, 9px 13px 16px rgba(20, 12, 6, 0.35); }
/* the fold along the bottom, where the cover and the back are one sheet: a rounded spine under both */
.cf-folder-body::after { display: block; content: ''; position: absolute; left: 0; right: -6px; top: calc(100% - 3px); height: 9px; z-index: -1;
  bottom: auto; background: linear-gradient(180deg, #c7a560 0%, #d6b774 55%, #c09c58 100%); border-radius: 0 0 7px 7px; }

/* the unselected Classic / Popular chip here: a solid, fully opaque paper chip, not a dashed see-through one */
body[data-game="case-file"] .mode-switch button:not(.on) { border-style: solid; border-color: rgba(28, 23, 23, 0.45); opacity: 1; }

/* previous / next day buttons in the case file's typewriter face */
body[data-game="case-file"] .end-links .btn { font-family: var(--typed); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }

/* the back panel's top strip runs down far enough to fill the corner notch beside the cover's rounded top-right corner */
.cf-folder::before { height: 44px; }
/* intro day row: the same gap under the folder as Paper Cuts leaves under its sheet (about 15px past the back panel's edge) */
body[data-game="case-file"] .end-wrap.intro-row { padding-top: 0; }
body[data-game="case-file"] .end-wrap.intro-row .end-links { margin-top: 21px; }

/* ---------- the case report fits one screen ---------- */
/* tighter spacing throughout; the tally joins the sign-off row instead of taking its own line */@media (min-width: 561px) {
  .cf-report { padding: 16px 26px 16px; }
  .cf-report-head { padding-bottom: 6px; margin-bottom: 10px; }
  .cf-report-title { font-size: 1.5rem; margin: 0 0 10px; }
  .stamp.cf-closed { top: 54px; font-size: 1.5rem; }
  .cf-fields { margin: 0 0 14px; }
  .cf-findings li { padding: 6px 2px; line-height: 1.35; }
  .cf-findings .note { margin-top: 2px; }
  .cf-findings .lead { margin-top: 1px; }
  .cf-signoff { margin-top: 10px; flex-wrap: nowrap; }
  .cf-sign .scrawl { font-size: 1.5rem; margin-bottom: 6px; }
}

/* in-progress exhibit tabs: their bottoms run down behind the front cover, so they're tucked inside the folder */
.cf-peek { top: 24px; }
.cf-peek .cf-tab { padding-bottom: 26px; }
/* the paperclip: the short inner leg ends right at the cover's top edge, so it reads as tucked behind it */
.cf-clip { top: -25px; }
/* the signature sits a touch lower in the sign-off row */
.cf-sign { transform: translate(-8px, 5px); }

/* a little more air between the folder / report and the day row (Paper Cuts' torn edge makes its gap read bigger) */
body[data-game="case-file"] .end-wrap.intro-row .end-links { margin-top: 32px; }
body[data-game="case-file"] .end-wrap:not(.intro-row) .end-links { margin-top: 36px; }

/* a case with three or more cold exhibits is stamped STILL OPEN, in black ink rather than red */
.stamp.cf-closed.cold { color: var(--ink-2); transform: rotate(-8deg); }

/* the case report sits on the board with a soft shadow under it */
.cf-report { box-shadow: 6px 6px 0 var(--manila), 9px 10px 0 var(--shadow), 10px 16px 22px rgba(20, 12, 6, 0.4); }
/* STILL OPEN leans the same way as CASE CLOSED */
.stamp.cf-closed.cold { transform: rotate(9deg); }.stamp.cf-verdict { transform: rotate(8deg); }
/* the ARCHIVED stamp a touch lower and further left */
.cf-archived { left: -3px; top: 16px; }
.cf-archived { left: 7px; }

/* the main CASE FILES stamp: its capitals sit centred in the frame */
.cf-stamp-title span { padding: 0.06em 0.4em 0.12em; }
/* the ACTIVE slip sits on the folder's corner, its clip higher up the slip */
.cf-active { right: -14px; top: -10px; }
.cf-active .clip { top: -18px; right: 16px; }

/* ---------- the connection ---------- */
.cf-connect-ask { font-family: var(--typed); font-size: 1.05rem; margin: 6px 0 14px; }
.cf-connect .stamp.cf-verdict { top: 44px; right: 20px; }
.cf-connect-films { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cf-connect-films li {
  position: relative; padding: 12px 12px 10px 38px; background: #f5eedd; transform: rotate(var(--r, 0deg));
  box-shadow: 2px 3px 0 var(--shadow); font-family: var(--typed); line-height: 1.25;
}
.cf-connect-films b { display: block; font-family: 'Archivo Black', sans-serif; font-weight: normal; font-size: 0.98rem; }
.cf-connect-year { font-size: 0.85rem; opacity: 0.7; }
.cf-connect-letter { position: absolute; left: 10px; top: 10px; width: 20px; height: 20px; display: grid; place-items: center; background: var(--ink-2); color: var(--paper-card); font-family: var(--font-display); font-size: 0.8rem; }
@media (max-width: 560px) { .cf-connect-films { grid-template-columns: 1fr; } }

/* the tip: a scrap of lined notepad paper slipped to you, which you can push around the desk */
.cf-tip {
  position: fixed; z-index: 30; width: 190px; padding: 18px 16px 14px; cursor: grab; touch-action: none; user-select: none;
  background-color: #fbf6e6; background-image: repeating-linear-gradient(transparent 0 21px, rgba(60, 110, 160, 0.22) 21px 22px);
  background-position: 0 10px; box-shadow: 3px 5px 0 var(--shadow), 6px 12px 18px rgba(20, 12, 6, 0.3);
  transform: rotate(-4deg); font-family: var(--font-hand); color: var(--ink-2); animation: tip-in 0.35s cubic-bezier(.2, 1.4, .4, 1);
}
.cf-tip.held { cursor: grabbing; transform: rotate(-1deg) scale(1.04); box-shadow: 4px 8px 0 var(--shadow), 10px 20px 26px rgba(20, 12, 6, 0.35); }
.cf-tip-pin { position: absolute; left: 50%; top: -9px; width: 34px; height: 16px; margin-left: -17px; background: rgba(226, 202, 146, 0.75); transform: rotate(3deg); }
.cf-tip-head { margin: 0; font-size: 1.15rem; line-height: 22px; }
.cf-tip-cat { margin: 0; font-size: 1.7rem; line-height: 30px; color: var(--ink-1); }
.cf-tip-line { margin: 0; font-size: 1.05rem; line-height: 22px; }
.cf-tip-sign { margin: 6px 0 0; font-size: 0.95rem; line-height: 22px; opacity: 0.75; text-align: right; }
@keyframes tip-in { from { opacity: 0; transform: translate(40px, -20px) rotate(10deg); } }

/* the hardware-store receipt pinned at the divider's right end */
.cf-receipt .rc-h { font-family: 'Archivo Black', sans-serif; font-size: 7px; fill: #1c1717; letter-spacing: 0.5px; }
.cf-receipt .rc-t { font-family: "Special Elite", monospace; font-size: 4.8px; fill: #1c1717; opacity: 0.8; }
/* the ACTIVE slip's paperclip grips the middle of its top edge */
.cf-active .clip { right: 30px; top: -16px; }

/* the conclusion page is the same size as an exhibit page: the four cards up top, the answer at the foot */
@media (min-width: 561px) {
  .cf-dossier.cf-connect { min-height: 740px; display: flex; flex-direction: column; }
  .cf-connect .cf-identify, .cf-connect .cf-notes { margin-top: auto; }
  .cf-connect-films { gap: 22px 18px; margin: 18px 0 24px; }
  .cf-connect-films li { padding: 26px 16px 24px 46px; }
  .cf-connect-films b { font-size: 1.15rem; }
}

/* in-progress tabs on the folder sit a little further right */
.cf-peek { left: 240px; }

/* the conclusion's four films: handwritten sticky notes, each labelled with its exhibit */
.cf-connect-films li {
  padding: 30px 16px 18px; min-height: 104px; background-color: #f2dc86;
  background-image: linear-gradient(rgba(120, 90, 20, 0.12), transparent 22px);
  box-shadow: 1px 2px 0 rgba(28, 23, 23, 0.18), 3px 8px 10px -4px rgba(20, 12, 6, 0.4);
  font-family: var(--font-hand); color: var(--ink-2); text-align: center;
}
.cf-connect-films b { font-family: var(--font-hand); font-weight: normal; font-size: 1.55rem; line-height: 1.1; color: var(--ink-2); }
.cf-connect-year { display: block; margin-top: 4px; font-size: 1.15rem; opacity: 0.75; }
.cf-connect-letter {
  position: absolute; left: 10px; top: 8px; width: auto; height: auto; display: block; background: none;
  color: var(--ink-1); font-family: var(--font-hand); font-size: 1.05rem; transform: rotate(-3deg);
}
@media (min-width: 561px) { .cf-connect-films li { padding: 32px 18px 20px; } .cf-connect-films b { font-size: 1.7rem; } }

/* the small buttons on a case page (exact year, tip, can't identify) are manila card, edged in ink, so they stand off the white paper */
.cf-dossier .btn.paper { --bg: var(--manila); --fg: var(--ink-2); box-shadow: inset 0 0 0 1.5px rgba(28, 23, 23, 0.55), 2px 2px 0 var(--shadow); }
.cf-dossier .q-actions .used .btn { box-shadow: inset 0 0 0 1.5px rgba(28, 23, 23, 0.25); }
/* no ink edge on them after all: manila card with just its shadow */
.cf-dossier .btn.paper { box-shadow: 2px 2px 0 var(--shadow); }
.cf-dossier .q-actions .used .btn { box-shadow: none; }

/* ---------- the case page's small buttons are desk things ---------- */
/* the hint (exact year / tip) is a strip of masking tape stuck on the page: see-through, crimped ends, a little crooked */
.cf-dossier .q-actions > :first-child { filter: drop-shadow(0 1px 1px rgba(28, 23, 23, 0.25)); }
.cf-dossier .q-actions > :first-child .btn {
  --bg: rgba(226, 202, 146, 0.78); --fg: var(--ink-2); box-shadow: none;
  font-family: var(--font-hand); text-transform: none; letter-spacing: 0; font-size: 1.15rem; padding: 7px 20px 5px;
  background-image: linear-gradient(rgba(255, 250, 235, 0.35), transparent 40%, rgba(120, 90, 30, 0.08));
  clip-path: polygon(0 8%, 3% 0, 6% 9%, 9% 0, 12% 8%, 88% 6%, 91% 0, 94% 9%, 97% 0, 100% 7%, 100% 93%, 97% 100%, 94% 91%, 91% 100%, 88% 93%, 12% 94%, 9% 100%, 6% 91%, 3% 100%, 0 92%);
  transform: rotate(-2deg);
}
.cf-dossier .q-actions > :first-child .btn:hover { transform: rotate(-1deg) translateY(-1px); }
/* "Can't identify" is a pencil eraser: pink rubber at both ends, a paper sleeve round the middle, a darker bottom edge for its thickness */
.cf-dossier .q-actions > :last-child { filter: drop-shadow(1px 3px 2px rgba(28, 23, 23, 0.3)); }
.cf-dossier .q-actions > :last-child .btn {
  --fg: var(--ink-2); clip-path: none; border-radius: 7px 7px 6px 6px; box-shadow: inset 0 -4px 0 rgba(120, 40, 40, 0.28);
  background: linear-gradient(90deg, #dd8f87 0 16px, #f5eedd 16px calc(100% - 16px), #dd8f87 calc(100% - 16px));
  font-family: var(--typed); letter-spacing: 0.04em; font-size: 0.78rem; padding: 9px 26px 11px; transform: rotate(1.5deg);
}
.cf-dossier .q-actions > :last-child .btn:hover { transform: rotate(0.5deg) translateY(-1px); }

/* ---------- desk things, take two ---------- */
/* masking tape: matte cream crepe paper, a little see-through, fibres in it, both ends torn by hand, written on in marker */
.cf-dossier .q-actions > :first-child { filter: drop-shadow(0 1px 0.5px rgba(28, 23, 23, 0.28)); }
.cf-dossier .q-actions > :first-child .btn {
  --bg: #eadfbf; --fg: #3b2f2a;
  background-color: rgba(234, 223, 191, 0.92);
  background-image:
    linear-gradient(rgba(255, 252, 240, 0.5), transparent 30%, transparent 75%, rgba(140, 110, 50, 0.12)),
    repeating-linear-gradient(90deg, rgba(140, 110, 50, 0.05) 0 1px, transparent 1px 3px),
    var(--noise);
  font-family: var(--font-hand); font-size: 1.2rem; letter-spacing: 0.01em; padding: 8px 24px 6px;
  clip-path: polygon(2% 10%, 0 26%, 3% 41%, 1% 58%, 3% 77%, 0 92%, 50% 100%, 97% 94%, 100% 80%, 98% 63%, 100% 45%, 97% 28%, 100% 9%, 50% 0);
  transform: rotate(-3deg);
}
.cf-dossier .q-actions > :first-child .btn:hover { transform: rotate(-2deg) translateY(-1px); }
/* the eraser: a pink rubber block with slanted ends, matte, its name pressed into it, a thicker shade along the bottom, one corner rubbed grey */
.cf-dossier .q-actions > :last-child { filter: drop-shadow(1px 3px 1.5px rgba(28, 23, 23, 0.32)); }
.cf-dossier .q-actions > :last-child .btn {
  --fg: #a2504b; border-radius: 3px;
  background:
    radial-gradient(ellipse 28px 16px at 100% 0, rgba(80, 70, 70, 0.28), transparent 70%),
    linear-gradient(#efafa8, #e49b93 70%, #c97b74 70%, #c97b74);
  clip-path: polygon(9% 0, 100% 0, 91% 100%, 0 100%);
  box-shadow: none;
  font-family: 'Archivo Black', sans-serif; font-size: 0.72rem; letter-spacing: 0.12em; padding: 9px 30px 13px;
  text-shadow: 0 1px 0 rgba(255, 225, 220, 0.6), 0 -1px 0 rgba(120, 40, 40, 0.25);
  transform: rotate(2deg);
}
.cf-dossier .q-actions > :last-child .btn:hover { transform: rotate(1deg) translateY(-1px); }

/* the case page's small buttons match Paper Cuts': ordinary torn-paper buttons in the tape colour, a shade darker than the page
   (replacing the masking-tape and eraser looks above) */
.cf-dossier .q-actions > :first-child, .cf-dossier .q-actions > :last-child { filter: drop-shadow(2px 3px 0 var(--shadow)); }
.cf-dossier .q-actions > :first-child .btn, .cf-dossier .q-actions > :last-child .btn {
  --bg: #e6dcc2; --fg: var(--ink-2); background: var(--bg); box-shadow: none; text-shadow: none; border-radius: 0;
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; padding: 9px 16px 7px;
  clip-path: polygon(0 4%, 6% 0, 18% 3%, 34% 0, 52% 4%, 70% 0, 86% 3%, 100% 0, 99% 30%, 100% 62%, 98% 100%, 82% 96%, 64% 100%, 46% 97%, 28% 100%, 12% 96%, 0 100%, 1% 66%, 0 34%);
  transform: rotate(-0.6deg);
}
.cf-dossier .q-actions > :first-child .btn:hover, .cf-dossier .q-actions > :last-child .btn:hover { transform: rotate(-0.6deg) translateY(-1px); }

/* the conclusion's sticky notes are square, four in a row (two by two on a phone) */
.cf-connect-films { grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cf-connect-films li { aspect-ratio: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; padding: 26px 10px 12px; }
@media (min-width: 561px) { .cf-connect-films li { padding: 28px 10px 12px; } .cf-connect-films b { font-size: 1.45rem; } }
@media (max-width: 560px) { .cf-connect-films { grid-template-columns: 1fr 1fr; } }

/* the answer on the conclusion: big, typed onto the page */
.cf-thread { margin: 0 0 12px; text-align: center; }
.cf-thread-k { display: block; font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem; opacity: 0.7; }
.cf-thread-v { display: block; margin-top: 4px; font-family: var(--typed); font-weight: 700; font-size: clamp(1.3rem, 3.2vw, 1.8rem); line-height: 1.2; color: var(--ink-1); }
/* two by two, square, centred on the page */
.cf-connect-films { grid-template-columns: repeat(2, minmax(0, 200px)); justify-content: center; gap: 22px 26px; }
@media (max-width: 560px) { .cf-connect-films { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }

/* exhibits: less empty space under the answer box so a whole exhibit fits on one screen */
.cf-identify { padding-top: 12px; }
.cf-identify .q-form .q-note { margin-top: 4px; }
.cf-identify .q-hint { min-height: 0; margin: 2px 0 0; }
.cf-identify .q-hint:empty { display: none; }
.cf-identify .q-actions { margin-top: 8px; }
.cf-dossier { padding-bottom: 16px; }
.cf-identify .cf-notes { min-height: 0; }
/* no dashed rule between the exhibit and the answer box */
.cf-identify { border-top: 0; padding-top: 6px; }
/* the signature line starts flush with the report's other lines */
.cf-sign { transform: translate(0, 5px); }
/* a bit more room between the answer box and the buttons under it (on the conclusion, whose answer area sits at the
   foot of the page, this lifts the box rather than lowering the buttons) */
.cf-identify .q-actions { margin-top: 18px; }
/* the case report's stamp (Case closed / Cold case): 15px lower, 5px further right */
.stamp.cf-closed { margin-top: 15px; margin-right: -5px; }

/* the status box: the last of the six, holding the stamp */
.cf-fields { grid-template-columns: repeat(5, auto) 1fr; }
.cf-status { display: flex; flex-direction: column; align-items: flex-start; }
.cf-status .stamp.cf-closed {
  position: static; display: inline-block; margin: 3px 0 0; font-size: 1.05rem; padding: 3px 9px 1px; border-width: 3px;
  box-shadow: inset 0 0 0 1.5px var(--paper-card), inset 0 0 0 3px currentColor; transform: rotate(5deg);
}
@media (max-width: 560px) { .cf-fields { grid-template-columns: 1fr 1fr; } }
/* the status stamp: bigger, slapped in off-centre to the right, a little crooked, overlapping the box's edges */
.cf-status { position: relative; min-width: 150px; }
.cf-status .stamp.cf-closed { position: absolute; right: -8px; top: 2px; margin: 0; font-size: 1.45rem; padding: 4px 11px 2px; border-width: 3.5px; transform: rotate(8deg); }
@media (max-width: 560px) { .cf-status { min-height: 58px; } .cf-status .stamp.cf-closed { right: 6px; font-size: 1.2rem; } }
/* the status box holds only the stamp: big, nearly straight, pressed into the box a moment after the report appears */
.cf-status { display: flex; align-items: center; justify-content: center; min-width: 170px; padding: 4px 8px; }
.cf-status .stamp.cf-closed {
  position: static; margin: 0; font-size: 1.7rem; padding: 4px 12px 2px; border-width: 4px;
  box-shadow: inset 0 0 0 2px var(--paper-card), inset 0 0 0 4px currentColor;
  transform: rotate(3deg); animation: status-stamp 0.42s cubic-bezier(.3, 1.5, .5, 1) 0.55s both;
}
@keyframes status-stamp {
  0% { opacity: 0; transform: scale(2.3) rotate(10deg); }
  60% { opacity: 1; transform: scale(0.94) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(3deg); }
}
@media (max-width: 560px) { .cf-status { min-height: 0; } .cf-status .stamp.cf-closed { font-size: 1.3rem; } }
/* the status stamp sits almost straight */
.cf-status .stamp.cf-closed { transform: rotate(1.5deg); }
@keyframes status-stamp {
  0% { opacity: 0; transform: scale(2.3) rotate(7deg); }
  60% { opacity: 1; transform: scale(0.94) rotate(1deg); }
  100% { opacity: 1; transform: scale(1) rotate(1.5deg); }
}
.cf-status .stamp.cf-closed { transform: rotate(0.6deg); }
@keyframes status-stamp {
  0% { opacity: 0; transform: scale(2.3) rotate(5deg); }
  60% { opacity: 1; transform: scale(0.94) rotate(0.2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0.6deg); }
}

/* wrong theories on the conclusion, struck out, with how many of the four films each one fits */
.cf-tries { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cf-tries:empty { display: none; }
.cf-tries li { display: flex; justify-content: space-between; gap: 12px; font-family: var(--typed); font-size: 0.95rem; }
.cf-tries s { text-decoration-color: var(--ink-1); text-decoration-thickness: 2px; }
.cf-fits { font-family: var(--font-hand); color: var(--ink-1); font-size: 1.15rem; white-space: nowrap; }
/* the status stamp always fits on one line ("Case closed") */
.cf-status { min-width: 200px; }
.cf-status .stamp.cf-closed { white-space: nowrap; }
@media (max-width: 560px) { .cf-status { min-width: 0; } .cf-status .stamp.cf-closed { font-size: 1.15rem; } }
.cf-notes .cf-yours.center { text-align: center; }

/* the tip is taped to the case page: it moves with the page, no dragging */
.cf-tip { position: absolute; z-index: 5; left: -170px; top: 220px; cursor: default; touch-action: auto; }
.cf-tip-pin { background: rgba(236, 226, 196, 0.85); width: 44px; height: 18px; margin-left: -22px; top: -10px; box-shadow: 0 1px 1px rgba(28, 23, 23, 0.15); }
@media (max-width: 1100px) { .cf-tip { left: auto; right: 10px; top: 54px; width: 168px; transform: rotate(3deg); } }

/* ---------- the text-message hint ---------- */
/* a phone tucked behind the right edge of the case page, just its corner showing; the hint slides it out */
.cf-file-stack.q { position: relative; }
.cf-phone {
  position: absolute; z-index: 0; right: -30px; top: 330px; width: 200px; height: 360px; padding: 34px 12px 40px;
  background: #1f1b1b; border-radius: 26px; box-shadow: inset 0 0 0 3px #3b3434, 4px 8px 16px rgba(20, 12, 6, 0.4);
  transform: rotate(8deg); transition: transform 0.6s cubic-bezier(.2, 1.2, .4, 1);
}
.cf-phone::before { content: ''; position: absolute; left: 50%; top: 14px; width: 54px; height: 8px; margin-left: -27px; border-radius: 4px; background: #3b3434; }
.cf-phone-screen { height: 100%; border-radius: 6px; background: #f1ece2; padding: 12px 10px; overflow: hidden; opacity: 0; transition: opacity 0.3s 0.35s; }
.cf-phone-from { margin: 0 0 8px; font-family: 'Archivo Black', sans-serif; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.6; text-align: center; }
.cf-phone-msg {
  position: relative; margin: 0; padding: 9px 11px; border-radius: 14px 14px 14px 4px; background: #d9d2c3;
  font-family: var(--font-body, Georgia, serif); font-size: 0.86rem; line-height: 1.35; color: var(--ink-2);
}
.cf-phone-msg.emoji { font-size: 1.9rem; line-height: 1.25; letter-spacing: 0.05em; text-align: center; }
.cf-phone.out { transform: translate(190px, -10px) rotate(5deg); z-index: 3; }
.cf-phone.out .cf-phone-screen { opacity: 1; }
/* no room beside the page: the phone lies on the page under the answer box once used */
@media (max-width: 1150px) {
  .cf-phone { display: none; position: relative; right: auto; top: auto; width: auto; max-width: 300px; height: auto; margin: 14px auto 0; transform: rotate(-1.5deg); }
  .cf-phone.out { display: block; transform: rotate(-1.5deg); }
  .cf-phone .cf-phone-screen { opacity: 1; }
}
/* a bigger phone, in scale with the polaroids on the board */
@media (min-width: 1151px) {
  .cf-phone { width: 250px; height: 450px; top: 290px; right: -40px; padding: 42px 14px 48px; border-radius: 32px; }
  .cf-phone::before { top: 18px; width: 64px; height: 9px; margin-left: -32px; }
  .cf-phone-screen { padding: 16px 13px; }
  .cf-phone-from { font-size: 0.78rem; margin-bottom: 10px; }
  .cf-phone-msg { font-size: 1rem; padding: 11px 13px; }
  .cf-phone-msg.emoji { font-size: 2.3rem; }
  .cf-phone.out { transform: translate(235px, -10px) rotate(5deg); }
}
/* sliding out, the phone stays behind the case page (and its manila edge), still a little tucked under it */
.cf-phone.out { z-index: 0; }
@media (min-width: 1151px) { .cf-phone.out { transform: translate(185px, -10px) rotate(5deg); } }
/* the screen wakes up as it comes out: dark, then lit */
.cf-phone-screen { background: #2a2525; transition: opacity 0.3s 0.35s, background-color 0.4s 0.45s; }
.cf-phone.out .cf-phone-screen { background: #f1ece2; }

/* the phone's screen reads like a messaging app: the text at the top, a reply bar along the bottom */
.cf-phone-screen { display: flex; flex-direction: column; }
.cf-phone-bar { margin-top: auto; display: flex; align-items: center; gap: 6px; padding-top: 10px; }
.cf-phone-field {
  flex: 1; padding: 6px 11px; border-radius: 999px; border: 1.5px solid rgba(28, 23, 23, 0.25); background: #fbf8f1;
  font-family: var(--font-body, Georgia, serif); font-size: 0.78rem; color: rgba(28, 23, 23, 0.4);
}/* and it comes further out from behind the page */
@media (min-width: 1151px) { .cf-phone.out { transform: translate(222px, -10px) rotate(5deg); } }

/* a long message scrolls inside the phone, with a slim red-ink scroll bar on a cream track */
.cf-phone-thread { flex: 1; min-height: 0; overflow-y: auto; padding-right: 4px; }
@supports not selector(::-webkit-scrollbar) { .cf-phone-thread { scrollbar-width: thin; scrollbar-color: var(--ink-1) rgba(28, 23, 23, 0.08); } }
.cf-phone-thread::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.cf-phone-thread::-webkit-scrollbar { width: 6px; }
.cf-phone-thread::-webkit-scrollbar-track { background: rgba(28, 23, 23, 0.08); border-radius: 3px; }
.cf-phone-thread::-webkit-scrollbar-thumb { background: var(--ink-1); border-radius: 3px; }
.cf-phone-thread::-webkit-scrollbar-thumb:hover { background: #a91d24; }
@media (max-width: 1150px) { .cf-phone-thread { max-height: 260px; } }
.cf-phone-field { min-height: 28px; }
/* the tip sits further right, its tape strip running down the page's red margin line */
@media (min-width: 980px) { .cf-tip { left: -52px; right: auto; top: 220px; width: 190px; transform: rotate(-4deg); } }

/* the second conclusion tip, taped under the first */
.cf-tip.second { top: 400px; transform: rotate(3deg); }
.cf-tip-shape { white-space: pre-wrap; margin: 6px 0 0; font-family: var(--typed); font-size: 0.9rem; line-height: 22px; letter-spacing: 1px; color: var(--ink-1); overflow-wrap: anywhere; }
.cf-tip b { font-weight: normal; color: var(--ink-1); }
@media (min-width: 980px) { .cf-tip.second { left: auto; right: -56px; top: 290px; transform: rotate(2deg); } }
@media (max-width: 979px) { .cf-tip.second { top: 250px; transform: rotate(-2deg); } }

/* the phone: a rounded screen, a fake back chevron beside the sender, a slimmer chin under the reply bar */
.cf-phone-screen { border-radius: 16px; }
.cf-phone { padding-bottom: 11px; }
@media (min-width: 1151px) { .cf-phone { padding-bottom: 13px; } .cf-phone-screen { border-radius: 20px; } }
.cf-phone-top { position: relative; }
.cf-phone-back { position: absolute; left: 4px; top: 50%; width: 9px; height: 9px; margin-top: -7px; border-left: 2.5px solid var(--ink-1); border-bottom: 2.5px solid var(--ink-1); transform: rotate(45deg); }
.cf-phone-bar { padding-bottom: 2px; }
/* the phone's side buttons: volume up and down on the left edge, power on the right */
.cf-phone::after { content: ''; position: absolute; left: -3px; top: 78px; width: 3px; height: 30px; border-radius: 2px 0 0 2px; background: #2e2828;
  box-shadow: 0 40px 0 #2e2828, 203px 10px 0 #2e2828, 203px 22px 0 #2e2828; }
@media (min-width: 1151px) { .cf-phone::after { top: 96px; height: 36px; box-shadow: 0 48px 0 #2e2828, 253px 12px 0 #2e2828, 253px 30px 0 #2e2828; } }
@media (max-width: 979px) { .cf-phone::after { display: none; } }
/* the first tip sits on the page, its tape stuck near its left end, right over the red margin line */
@media (min-width: 980px) { .cf-tip:not(.second) .cf-tip-pin { left: 94px; } }
/* the "Copied to clipboard" toast: Archivo Black runs much wider than Paper Cuts' font, so it's set smaller to match */
.toast { font-size: 0.7rem; padding: 9px 14px 8px; }

.cf-tip-not { margin: 2px 0 0; font-family: var(--typed); font-size: 0.82rem; line-height: 20px; color: var(--ink-2); }/* less room under the phone's text field */
.cf-phone-screen { padding-bottom: 6px; }
.cf-phone-bar { padding-bottom: 0; }
@media (min-width: 1151px) { .cf-phone-screen { padding-bottom: 7px; } }
/* the screen lights up first, then the chat fades in on it */
.cf-phone-screen > * { opacity: 0; transition: opacity 0.25s; }
.cf-phone.out .cf-phone-screen > * { opacity: 1; transition: opacity 0.3s 0.9s; }
/* the report's top row: the status box keeps a fixed width; the scores before it shrink (--fit, set by fitFields)
   rather than squeezing it */
@media (min-width: 561px) {
  .cf-fields { grid-template-columns: repeat(5, auto) var(--status-w, 240px); }
  .cf-field .v, .cf-field .k { white-space: nowrap; }
  .cf-field.big .v { font-size: calc(1.35rem * var(--fit, 1)); }
}
/* the "of" in a score shrinks fastest when space runs short */
.cf-field .of { font-size: max(0.6em, calc(1em - (1 - var(--fit, 1)) * 1.6em)); }
/* each finding's points, in red pen, circled like a graded paper (a column of its own, so rows don't grow) */.cf-mark {
  justify-self: center; position: relative; display: inline-flex; align-items: baseline; justify-content: center;
  min-width: 40px; padding: 3px 6px 1px; font-family: var(--font-hand); font-size: 1.45rem; line-height: 1; color: var(--ink-1);
  transform: rotate(-7deg);
}/* the ring: a quick loop of the pen that doesn't quite close */
.cf-mark::before {
  content: ''; position: absolute; inset: -3px -4px -2px -5px; border: 2px solid currentColor;
  border-radius: 52% 46% 50% 44% / 58% 50% 54% 46%; border-top-color: transparent; transform: rotate(18deg); opacity: 0.85;
}
.cf-mark.zero { color: var(--ink-2); opacity: 0.6; }@media (max-width: 560px) {
  .cf-findings li { grid-template-columns: 24px 1fr auto; }
  .cf-mark { grid-column: 3; grid-row: 1 / span 2; }
}
/* a pen fraction from the marker font's own digits: 1/2 with the 1 raised and the 2 lowered */
.cf-mark .frac { display: inline-flex; align-items: center; font-size: 0.8em; line-height: 1; margin-left: 1px; }
.cf-mark .frac sup, .cf-mark .frac sub { font-size: 0.85em; line-height: 1; position: relative; vertical-align: baseline; }
.cf-mark .frac sup { top: -0.32em; }
.cf-mark .frac sub { top: 0.3em; }
/* a fraction on its own (½ point) is the whole mark, so it keeps more size */
.cf-mark .frac:first-child { font-size: 0.95em; margin-left: 0; }
/* only the total is circled; the finding scores are just written in */
.cf-mark::before { display: none; }
.cf-mark.ring::before { display: block; }
/* the total sits in the sign-off row, in line with the finding scores above it; the stamp column is as wide as the
   copy button so the two never meet */
.cf-findings li { grid-template-columns: 30px 1fr 50px 156px; }
.cf-signoff { position: relative; }
.cf-total { position: absolute; right: 168px; top: 50%; width: 50px; display: flex; justify-content: center; transform: translateY(-50%); }
.cf-total .k { position: absolute; right: 100%; top: 50%; transform: translateY(-50%); margin-right: 4px; font-family: var(--font-display); text-transform: uppercase; font-size: 0.66rem; letter-spacing: 0.08em; opacity: 0.75; }
.cf-mark.zero.line { opacity: 1; color: var(--ink-1); }
.cf-mark.line::after { content: ''; position: absolute; left: 4px; right: 4px; bottom: -3px; height: 2px; background: currentColor; border-radius: 2px; transform: rotate(2deg); }
@media (max-width: 560px) { .cf-findings li { grid-template-columns: 24px 1fr auto; } .cf-total { position: static; transform: none; width: auto; order: 1; margin-left: auto; gap: 6px; align-items: center; } .cf-total .k { position: static; transform: none; } }
/* Copy result: the same size as Paper Cuts' (Archivo Black runs wider than its cut-paper font) */
.cf-copy .btn { font-size: 0.76rem; padding: 12px 17px 11px; }
/* the findings' result stamps sit nearly straight */
.cf-findings .res { transform: rotate(1.5deg); }
/* the findings' results as little rubber stamps: inked double rule, no paper behind, speckled ink pressed into the page */
.cf-findings .res {
  background: none; mix-blend-mode: multiply; border-width: 2.5px; border-radius: 3px;
  box-shadow: inset 0 0 0 1.5px var(--paper-card), inset 0 0 0 2.5px currentColor;
  padding: 5px 9px 4px 7px; font-size: 0.68rem; letter-spacing: 0.1em;
}
.cf-findings li.close .res { box-shadow: none; }
.cf-findings .res-emoji { filter: saturate(0.75) contrast(1.1); }
/* the status stamp (CASE CLOSED / COLD CASE): all capitals, a size smaller */
.cf-status .stamp.cf-closed { text-transform: uppercase; font-size: 1.3rem; letter-spacing: 0.06em; }
@media (max-width: 560px) { .cf-status .stamp.cf-closed { font-size: 1rem; } }
/* a text can come in two bubbles (a lead-in, then the clue) */
.cf-phone-msg + .cf-phone-msg { margin-top: 6px; }
/* each tip's cost, scribbled in red pen in its top corner */
.cf-tip-cost {
  position: absolute; top: 8px; right: 8px; font-family: var(--font-hand); font-size: 0.85rem; line-height: 1; color: var(--ink-1);
  transform: rotate(6deg); padding: 2px 5px 1px; border: 1.5px solid currentColor; border-radius: 48% 52% 46% 54% / 56% 48% 52% 44%;
}

/* no room beside the page (1150px wide or less): the phone lies on the board under the page, but still
   phone-shaped (upright, not stretched into a wide slab), its texts scrolling inside the screen */
@media (max-width: 1150px) {
  .cf-phone, .cf-phone.out { width: 220px; max-width: none; height: 380px; padding: 34px 12px 12px; }
  .cf-phone-thread { max-height: none; }
  .cf-phone::after { box-shadow: 0 40px 0 #2e2828, 223px 10px 0 #2e2828, 223px 22px 0 #2e2828; }   /* the power button on the wider body's edge */
}

/* the service record's footnote, typed small under the bars */
.cf-record-note { margin: 14px 0 0; font-family: var(--typed); font-size: 0.78rem; text-align: center; opacity: 0.7; }
.cf-record-note + .cf-record-note { margin-top: 4px; }

/* the archive's one-line note: a typed slip pinned under the title, so it reads on the cork */
.cf-archive-note {
  display: table; margin: 4px auto 30px; padding: 6px 14px 5px;
  background-color: var(--manila); background-image: var(--fibers-soft); color: var(--ink-2);
  font-family: var(--typed); font-size: 0.85rem; text-align: center;
  box-shadow: 3px 3px 0 var(--shadow); rotate: -0.6deg;
}
