/* THE GOD TERMINAL — the costume's Photos app (js/costume-photos.js).
 * Off-palette like the rest of the costume: an XP task pane, a print on a light table, a film strip,
 * and a TOP SECRET album of typewritten paper on a walnut desk. Documents are sized in em from --fs
 * (set by the app to fit the view), so every stamp, clip and coffee ring scales with the page. */

.cs-photos .cs-app-body { background: var(--cs-face); }

.csp {
  --csp-spring: cubic-bezier(.2, 1.6, .4, 1);
  --csp-type: 'Courier New', Courier, 'Nimbus Mono PS', 'Liberation Mono', monospace;
  --csp-hand: 'Segoe Print', 'Bradley Hand', 'Ink Free', 'Comic Sans MS', cursive;
  --csp-stamp: 'Arial Black', Impact, 'Helvetica Neue', Arial, sans-serif;
  --csp-pen: #1f3c9c;
  --csp-red: #c3202b;
  /* Speckled alpha: rubber-stamp ink that didn't quite take. */
  --csp-grunge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='70'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.32' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -3.2 0 0 0 2.55'/%3E%3C/filter%3E%3Crect width='140' height='70' filter='url(%23g)'/%3E%3C/svg%3E");
  --csp-paper:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .26 0 0 0 0 .16 .42 0 0 0 -.15'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(172deg, #fffdf7 0%, #f8f3e5 55%, #f0e8d3 100%);
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto auto;
  grid-template-areas: 'side view' 'side bar' 'side strip';
  overflow: hidden;
  outline: none;
}
.csp-ico { display: block; width: 100%; height: 100%; overflow: visible; }

/* ───────── task pane ───────── */
.csp-side {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
  padding: 0.85rem 0.75rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, #7ba2e7 0%, #6a8ae0 50%, #6375d6 100%);
  border-right: 1px solid #4b5fb8;
}
.csp-group { flex: none; border-radius: 0.4rem 0.4rem 0 0; box-shadow: 0 1px 3px rgba(18, 38, 120, 0.35); }
.csp-group-head {
  display: flex;
  align-items: center;
  min-height: 1.85rem;
  margin: 0;
  padding: 0.2rem 0.75rem;
  border-radius: 0.4rem 0.4rem 0 0;
  background: linear-gradient(90deg, #ffffff 0%, #ffffff 30%, #c6d3f7 100%);
  color: #215dc6;
  font-size: 0.875rem;
  font-weight: 700;
}
.csp-group-body { padding: 0.55rem; border: 1px solid #fff; border-top: 0; background: #d6dff7; }

/* Albums: a little stack of prints (or a folder) and a name. */
.csp-albums .csp-group-body { display: flex; flex-direction: column; gap: 0.3rem; }
.csp-album {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 3.6rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid transparent;
  border-radius: 0.3rem;
  background: none;
  color: #0c2f8f;
  text-align: left;
  transition: transform 140ms var(--csp-spring), background-color 140ms;
  transform-origin: 30% 50%;
}
.csp-album:hover { background: rgba(255, 255, 255, 0.45); border-color: rgba(255, 255, 255, 0.7); }
.csp-album:hover b { text-decoration: underline; }
.csp-album.is-on { border-color: #1d4fb3; background: linear-gradient(180deg, #3f7ee0, #2b62c6); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 2px rgba(10, 30, 100, 0.35); }
.csp-album.is-on:hover b { text-decoration: none; }
.csp-album.is-pressed { transform: scale(1.06); }
.csp-album:focus-visible { outline: 1px dotted #0c2f8f; outline-offset: 1px; }
.csp-album-icon { position: relative; flex: none; width: 3.6rem; aspect-ratio: 4 / 3; }
.csp-album-icon::before, .csp-album-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid #fff;
  background: #c9d2e4;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.csp-album-icon::before { rotate: -9deg; translate: -2px 1px; }
.csp-album-icon::after { rotate: 6deg; translate: 2px 0; background: #e5e9f2; }
.csp-album-art {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  image-rendering: pixelated;
}
.csp-album[data-album='secret'] .csp-album-icon::before,
.csp-album[data-album='secret'] .csp-album-icon::after { content: none; }
.csp-album[data-album='secret'] .csp-album-art { border-color: #5b3424; }
.csp-album-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.csp-album-text b { font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.csp-album-text small { font-size: 0.8125rem; opacity: 0.8; }
.csp-album[data-album='secret'] b { color: var(--csp-red); letter-spacing: 0.05em; }
.csp-album[data-album='secret'].is-on b { color: #fff; }
.csp-album[data-album='secret'] { position: relative; }
.csp-album[data-album='secret'] .csp-album-icon { position: static; }
/* Stamped over the document count, so the album's name still shows. */
.csp-declass {
  position: absolute;
  left: 64%;
  top: 68%;
  z-index: 2;
  padding: 0.1rem 0.35rem;
  border: 2px solid #1f8f45;
  border-radius: 3px;
  background: rgba(240, 255, 242, 0.92);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  color: #1f8f45;
  font: 900 0.875rem/1 var(--csp-stamp);
  letter-spacing: 0.04em;
  white-space: nowrap;
  transform: translate(-50%, -50%) rotate(-12deg);
  opacity: 0;
  pointer-events: none;
}
.csp-album.is-declassified .csp-declass { opacity: 1; }

/* Codes found: an XP progress bar, one green block per cracked document. */
.csp-codes-row { display: flex; align-items: center; gap: 0.6rem; }
.csp-meter {
  flex: 1;
  display: flex;
  gap: 2px;
  height: 1.35rem;
  padding: 2px;
  border: 1px solid #5a6a8e;
  border-radius: 3px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
}
.csp-seg { position: relative; flex: 1; overflow: hidden; border-radius: 1px; background: #e9edf5; }
.csp-seg::before, .csp-seg b {
  content: '';
  position: absolute;
  inset: 0;
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.csp-seg::before { background: #fff; box-shadow: 0 0 6px #fff; }
.csp-seg b {
  background: linear-gradient(180deg, #e2fbe2 0%, #7de57d 22%, #33c033 52%, #22a822 78%, #6bd86b 100%);
  transition: transform 420ms cubic-bezier(.3, .9, .3, 1);
}
.csp-seg.is-white::before, .csp-seg.is-on::before { transform: none; }
.csp-seg.is-on b { transform: none; }
.csp-count { flex: none; min-width: 3.1em; color: #0c2a7a; font-size: 1rem; text-align: right; font-variant-numeric: tabular-nums; }

/* Details: the deadpan EXIF. */
.csp-exif { margin: 0; font-size: 0.875rem; line-height: 1.35; color: #000; }
.csp-exif-name { display: flex; flex-direction: column; margin-bottom: 0.45rem; }
.csp-exif-name b { font-size: 0.9375rem; overflow-wrap: anywhere; }
.csp-exif-name small { color: #4a5a7e; font-size: 0.8125rem; }
.csp-exif-row { margin-top: 0.25rem; }
.csp-exif-row dt { display: inline; color: #1d3f9a; font-weight: 700; }
.csp-exif-row dt::after { content: ': '; }
.csp-exif-row dd { display: inline; margin: 0; }

/* ───────── the viewer ───────── */
.csp-view {
  grid-area: view;
  position: relative;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 75% 70% at 50% 42%, #ffffff 0%, #f2f4f8 55%, #dfe4ec 100%);
}
.csp-stage { position: absolute; inset: 0; display: grid; overflow: hidden; }
/* Auto margins centre the item but never push it off the top or left when it overflows. */
.csp-stage > * { margin: auto; }

.csp-print {
  position: relative;
  width: calc(var(--pw, 400px) * 1.08);
  margin: auto;
  padding: calc(var(--pw, 400px) * 0.04) calc(var(--pw, 400px) * 0.04) 0;
  background: linear-gradient(170deg, #ffffff, #f7f5ee);
  rotate: var(--tilt, 0deg);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 0.15rem 0.3rem rgba(0, 0, 0, 0.18),
    0 1.2rem 2.4rem -0.8rem rgba(20, 30, 60, 0.45);
}
/* Two strips of tape hold it to the table. */
.csp-print::before, .csp-print::after {
  content: '';
  position: absolute;
  top: calc(var(--pw, 400px) * -0.025);
  z-index: 2;
  width: calc(var(--pw, 400px) * 0.17);
  height: calc(var(--pw, 400px) * 0.055);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 2px, rgba(255, 255, 255, 0) 2px 5px),
    linear-gradient(180deg, rgba(250, 244, 214, 0.92), rgba(232, 222, 186, 0.86));
  box-shadow: 0 1px 2px rgba(60, 40, 0, 0.25);
  clip-path: polygon(0 8%, 6% 0, 12% 10%, 20% 0, 100% 0, 96% 50%, 100% 100%, 8% 100%, 0 88%, 4% 50%);
}
.csp-print::before { left: calc(var(--pw, 400px) * -0.03); rotate: -32deg; }
.csp-print::after { right: calc(var(--pw, 400px) * -0.03); rotate: 30deg; }
.csp-frame { position: relative; width: var(--pw, 400px); aspect-ratio: 4 / 3; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); }
.csp-photo {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  cursor: pointer;
  touch-action: manipulation;
}
.csp-date {
  position: absolute;
  right: 3.5%;
  bottom: 2.5%;
  color: #ffa43a;
  font-family: var(--font-display);
  font-size: max(1.1rem, calc(var(--pw, 400px) * 0.052));
  line-height: 1;
  letter-spacing: 0.06em;
  text-shadow: 0 0 2px #ff6a00, 0 0 8px rgba(255, 106, 0, 0.75);
  pointer-events: none;
}
.csp-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.csp-caption {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.15rem 0.4rem 0.25rem;
  color: var(--csp-pen);
  font-family: var(--csp-hand);
  font-size: clamp(0.9rem, calc(var(--pw, 400px) * 0.034), 1.3rem);
  line-height: 1.2;
  text-align: center;
}

.csp-toast {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.9rem;
  z-index: 6;
  width: fit-content;
  margin: 0 auto;
  padding: 0.55rem 0.9rem;
  border: 1px solid #000;
  border-radius: 0.5rem;
  background: #ffffe1;
  box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.4);
  color: #000;
  font-size: 0.9375rem;
  text-align: center;
  pointer-events: none;
}

/* ───────── controls ───────── */
.csp-bar {
  grid-area: bar;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 0.45rem 0.75rem;
  border-top: 1px solid #c3bfae;
  background: linear-gradient(180deg, #fdfcf8 0%, #f1efe6 55%, #e3e0d1 100%);
  box-shadow: inset 0 1px 0 #fff;
}
.csp-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex: none;
  padding: 0;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
  transition: transform 140ms var(--csp-spring), filter 140ms;
}
.csp-btn:hover { filter: brightness(1.1) saturate(1.1); }
.csp-btn.is-pressed { transform: scale(1.14); filter: brightness(0.95); }
.csp-btn:focus-visible { outline: 2px dotted #1d3f9a; outline-offset: 3px; }
.csp-btn-ico { width: 1.35rem; height: 1.35rem; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45)); }
/* Explorer's glossy green arrow balls. */
.csp-btn.is-round {
  width: 2.9rem;
  height: 2.9rem;
  border: 1px solid #17631a;
  border-radius: 50%;
  background:
    radial-gradient(ellipse 62% 42% at 50% 22%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 70%),
    radial-gradient(circle at 50% 78%, #8af07a 0%, #3cae35 48%, #1e7a1f 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), inset 0 -3px 5px rgba(0, 60, 0, 0.3);
}
.csp-btn.is-pill {
  height: 2.9rem;
  padding: 0 1.25rem 0 0.95rem;
  border: 1px solid #0b3a9c;
  border-radius: 1.45rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.12) 48%, rgba(255, 255, 255, 0) 52%),
    linear-gradient(180deg, #5ea4ff 0%, #2f7ae8 50%, #1a5cd0 52%, #2c79ea 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), inset 0 -2px 4px rgba(0, 20, 90, 0.3);
}
.csp-btn.is-info { display: none; }
.csp[data-mode='doc'] .csp-btn.is-pill { filter: grayscale(0.9) brightness(1.05); }

/* ───────── the film strip ───────── */
.csp-strip {
  --holes: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='8'%3E%3Crect x='4' y='1' width='8' height='6' rx='1.6' fill='%23e9ebef'/%3E%3C/svg%3E");
  grid-area: strip;
  position: relative;
  display: flex;
  gap: 0.55rem;
  padding: 1rem 0.9rem;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #6a6d75 #1b1c1f;
  background:
    var(--holes) 0 0.2rem / 1rem 0.5rem repeat-x,
    var(--holes) 0 calc(100% - 0.2rem) / 1rem 0.5rem repeat-x,
    linear-gradient(180deg, #2a2b2f, #1a1b1e 50%, #232428);
  background-attachment: local, local, scroll;
  border-top: 1px solid #0d0d0f;
}
/* Short albums sit centred; long ones scroll from the first frame. */
.csp-strip::before, .csp-strip::after { content: ''; flex: 1 0 0; }
.csp-thumb {
  position: relative;
  flex: none;
  width: 5.8rem;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 2px solid #0e0e10;
  border-radius: 2px;
  background: #0e0e10;
  opacity: 0.72;
  transition: transform 160ms var(--csp-spring), opacity 160ms, border-color 160ms, box-shadow 160ms;
}
.csp-thumb:hover { opacity: 1; transform: translateY(-2px); }
.csp-thumb.is-on {
  border-color: #fff;
  opacity: 1;
  box-shadow: 0 0 0 2px #4f97ff, 0 0 14px rgba(79, 151, 255, 0.8);
}
.csp-thumb.is-pressed { transform: scale(1.12); }
.csp-thumb:focus-visible { outline: 2px dotted #fff; outline-offset: 3px; }
.csp-thumb-art { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.csp-thumb-ok {
  position: absolute;
  right: -0.45rem;
  top: -0.45rem;
  width: 1.35rem;
  height: 1.35rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #8af07a, #26a32b 60%, #17631a);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.csp-thumb-ok::after {
  content: '';
  position: absolute;
  left: 30%;
  top: 18%;
  width: 28%;
  height: 50%;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  rotate: 42deg;
}

/* ───────── celebration bits ───────── */
.csp-fx { position: absolute; inset: 0; z-index: 20; width: 100%; height: 100%; pointer-events: none; }
.csp-spark {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 40;
  width: 1.8rem;
  height: 1.8rem;
  margin: -0.9rem 0 0 -0.9rem;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 14%, rgba(255, 244, 160, 0.95) 24%, rgba(255, 196, 40, 0.5) 42%, rgba(255, 196, 40, 0) 68%);
  pointer-events: none;
}
.csp-spark::before {
  content: '';
  position: absolute;
  inset: -40%;
  background:
    linear-gradient(transparent 47%, #fff 47% 53%, transparent 53%),
    linear-gradient(90deg, transparent 47%, #fff 47% 53%, transparent 53%);
  -webkit-mask-image: radial-gradient(circle, #000 0 18%, transparent 62%);
  mask-image: radial-gradient(circle, #000 0 18%, transparent 62%);
}
.csp-spark.is-trail { width: 0.9rem; height: 0.9rem; margin: -0.45rem 0 0 -0.45rem; opacity: 0.75; }
.csp-spark.is-trail::before { content: none; }

/* ───────── slide show ───────── */
.csp-show { position: absolute; inset: 0; z-index: 30; overflow: hidden; background: #000; container-type: size; }
.csp-show:not(.is-awake) { cursor: none; }
.csp-show-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  opacity: 0;
}
@container (max-aspect-ratio: 6 / 5) { .csp-show-img { object-fit: contain; } }
.csp-show::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}
.csp-show-cap {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1.4rem;
  z-index: 2;
  width: fit-content;
  margin: 0 auto;
  padding: 0.45rem 1rem;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-family: var(--csp-hand);
  font-size: 1.3rem;
  line-height: 1.25;
  text-align: center;
  text-shadow: 0 1px 3px #000;
}
.csp-show-prog {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: 3px;
  background: linear-gradient(90deg, #3d7ce0, #9fd0ff);
  box-shadow: 0 0 8px rgba(110, 170, 255, 0.85);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}
.csp-show.is-paused .csp-show-prog { background: #c8ccd4; box-shadow: none; }
.csp-show-ctrl {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 2;
  display: flex;
  gap: 0.4rem;
  padding: 0.35rem;
  border-radius: 2rem;
  background: rgba(24, 26, 32, 0.72);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  opacity: 0;
  transform: translateY(-0.4rem);
  transition: opacity 300ms ease, transform 300ms ease;
}
.csp-show.is-awake .csp-show-ctrl { opacity: 1; transform: none; }
.csp-show-btn {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #4a4f5c, #23262d 70%);
  color: #fff;
  transition: transform 140ms var(--csp-spring), background-color 140ms;
}
.csp-show-btn:hover { background: radial-gradient(circle at 50% 30%, #6a7ea8, #2b3c66 70%); }
.csp-show-btn.is-pressed { transform: scale(1.18); }

/* ═════════════════════════ TOP SECRET ═════════════════════════ */
.csp[data-mode='doc'] .csp-view {
  background:
    radial-gradient(ellipse 65% 60% at 50% 40%, rgba(255, 214, 150, 0.24), rgba(255, 214, 150, 0) 72%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='240'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006 .22' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .16 0 0 0 0 .08 0 0 0 0 .03 1.1 0 0 0 -.4'/%3E%3C/filter%3E%3Crect width='480' height='240' filter='url(%23w)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #7a4b2b 0%, #6a3f23 60%, #58331c 100%);
}
.csp-stage.is-doc { overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #a07a55 transparent; }

.csp-desk {
  position: relative;
  width: max-content;
  padding: 1.6em 3.4em;
  font-size: var(--fs, 15px);
}
.csp-desk button { font-family: inherit; cursor: pointer; }
.csp-pair { display: flex; align-items: center; gap: 2.6em; }
.csp.is-narrow .csp-pair { flex-direction: column; gap: 1.8em; }

.csp-paper {
  position: relative;
  padding: 3.6em 2.6em 4.6em;
  background: var(--csp-paper);
  color: #26231d;
  rotate: var(--tilt, 0deg);
  box-shadow:
    0 0 0 1px rgba(60, 40, 10, 0.12),
    0 0.12em 0.25em rgba(0, 0, 0, 0.35),
    0 1.4em 2.6em -0.9em rgba(0, 0, 0, 0.65);
}
.csp-type {
  font-family: var(--csp-type);
  font-size: 1em;
  font-weight: 700;
  line-height: 1.4;
  white-space: pre;
  text-shadow: 0 0 0.6px rgba(30, 25, 15, 0.55);
}
.csp-line { min-height: 1.4em; }
.csp-rule { height: 0.3em; margin: 0.5em 0 0.8em; border: solid #26231d; border-width: 1.5px 0; opacity: 0.75; }

/* Rubber stamps: blotchy ink pressed into the paper. */
.csp-stamp {
  position: absolute;
  z-index: 3;
  padding: 0.12em 0.45em 0.08em;
  border: 0.13em solid currentColor;
  border-radius: 0.22em;
  box-shadow: inset 0 0 0 0.08em #f6f0df, inset 0 0 0 0.15em currentColor;
  color: #c3202b;
  font: 900 1.55em/1.15 var(--csp-stamp);
  letter-spacing: 0.07em;
  white-space: nowrap;
  opacity: 0.86;
  mix-blend-mode: multiply;
  pointer-events: none;
  -webkit-mask-image: var(--csp-grunge);
  mask-image: var(--csp-grunge);
}
.csp-stamp.is-tr { top: 0.85em; right: 1.2em; font-size: 1.3em; transform: rotate(5deg); }
.csp-stamp.is-tl { top: 0.85em; left: 1.6em; font-size: 1.3em; transform: rotate(-5deg); }
.csp-stamp.is-small { font-size: 1.05em; }
/* Slammed across the middle of the page once it's cracked; the ink multiplies over the type. */
.csp-stamp.is-decoded {
  left: 50%;
  top: 48%;
  z-index: 6;
  color: #1c8a43;
  font-size: 2.5em;
  translate: -50% -50%;
  transform: rotate(-14deg);
  opacity: 0.82;
}

/* Handwriting: ballpoint margin notes and the scrawled answer. */
.csp-hand {
  position: absolute;
  z-index: 4;
  color: var(--csp-pen);
  font-family: var(--csp-hand);
  font-size: 1.15em;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
}
.csp-answer {
  left: 1.1em;
  right: 1.1em;
  bottom: 0.45em;
  z-index: 6;
  color: var(--csp-red);
  font-size: 1.3em;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  white-space: normal;
  rotate: -2deg;
  text-shadow: 0 0 1px rgba(195, 32, 43, 0.4);
}

/* A sticky note, clipped on. */
.csp-sticky {
  position: absolute;
  z-index: 5;
  width: 9.5em;
  padding: 1.5em 0.9em 1em;
  background: linear-gradient(180deg, #fff59a 0%, #fde968 100%);
  color: var(--csp-pen);
  font-family: var(--csp-hand);
  font-size: 1.05em;
  line-height: 1.25;
  white-space: normal;
  box-shadow: 0 0.08em 0.15em rgba(0, 0, 0, 0.25), 0.3em 0.7em 1em -0.35em rgba(0, 0, 0, 0.45);
}
.csp-sticky::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1.3em;
  height: 1.3em;
  background: linear-gradient(315deg, transparent 50%, rgba(0, 0, 0, 0.12) 50%, #f3dc55 60%);
}
.csp-clip-wrap { position: absolute; left: 1.3em; top: -1.15em; width: 1em; height: 2.9em; filter: drop-shadow(0.06em 0.1em 0.06em rgba(0, 0, 0, 0.4)); }
.csp-clip { display: block; width: 100%; height: 100%; }

/* ── memo: the acrostic ── */
.csp-memo { padding-right: 3.4em; padding-bottom: 3.8em; }
.csp-memo-head .csp-line:first-child { margin-bottom: 0.35em; font-size: 1.2em; letter-spacing: 0.12em; }
.csp-memo .csp-line:has(.csp-acro) { cursor: pointer; }
.csp-desk .csp-acro {
  position: relative;
  display: inline-block;
  margin: 0 -0.08em;
  padding: 0 0.08em;
  border: 0;
  border-radius: 0.1em;
  background: linear-gradient(176deg, transparent 12%, rgba(255, 224, 0, 0.16) 14% 86%, transparent 88%);
  color: inherit;
  font: inherit;
  text-shadow: inherit;
  transition: transform 160ms var(--csp-spring);
}
.csp-desk .csp-acro.is-pressed { transform: scale(1.4); }
.csp-acro.is-lit {
  background: linear-gradient(176deg, transparent 6%, rgba(255, 222, 0, 0.88) 9% 90%, transparent 93%);
  color: #7a1b00;
  animation: csp-lit 340ms cubic-bezier(.2, 1.6, .4, 1);
}
@keyframes csp-lit { from { transform: scale(1.8) rotate(-8deg); } }
.csp-memo .csp-sticky { right: -2.6em; bottom: -1.2em; rotate: 4deg; }

/* ── incident report: the redactions ── */
.csp-report { padding-right: 9.5em; }
.csp-desk .csp-redact {
  position: relative;
  display: inline-block;
  padding: 0;
  border: 0;
  background: none;
  color: #8f1720;
  font: inherit;
  text-shadow: inherit;
  vertical-align: baseline;
}
.csp-ink {
  position: absolute;
  inset: 0.04em -0.2em -0.02em;
  border-radius: 0.14em 0.06em 0.18em 0.08em;
  background: linear-gradient(178deg, #19191b 0%, #0c0c0d 55%, #1d1d20 100%);
  box-shadow: 0 0.04em 0 rgba(0, 0, 0, 0.25);
  transform-origin: 0 50%;
  transition: transform 180ms var(--csp-spring), box-shadow 180ms;
}
.csp-redact:hover .csp-ink, .csp-redact:focus-visible .csp-ink {
  transform: rotate(-4deg) translateY(-0.1em);
  box-shadow: 0.1em 0.25em 0.35em rgba(0, 0, 0, 0.35);
}
.csp-redact.is-peeled { background: rgba(0, 0, 0, 0.07); border-radius: 0.1em; }
.csp-redact:focus-visible { outline: 1px dotted #000; outline-offset: 2px; }
.csp-mug {
  position: absolute;
  top: 3.4em;
  right: -1.6em;
  z-index: 2;
  margin: 0;
  padding: 0.45em 0.45em 1.5em;
  background: #fdfdfb;
  rotate: 5deg;
  box-shadow: 0 0.1em 0.2em rgba(0, 0, 0, 0.3), 0.3em 0.8em 1.2em -0.4em rgba(0, 0, 0, 0.45);
}
.csp-mug-art { display: block; width: 7.6em; height: 9.5em; image-rendering: pixelated; }
.csp-staple {
  position: absolute;
  left: 50%;
  top: 0.15em;
  width: 2em;
  height: 0.32em;
  border-radius: 0.1em;
  background: linear-gradient(180deg, #f4f6f9, #9aa2ad 60%, #6e7580);
  box-shadow: 0 0.06em 0.08em rgba(0, 0, 0, 0.45);
  transform: translateX(-50%) rotate(-7deg);
}
.csp-report-note { right: 0.9em; bottom: 5.7em; color: var(--csp-red); rotate: -7deg; }
.csp-report-note::before { content: '↖'; position: absolute; left: -0.9em; top: -0.55em; font-size: 1.3em; }

/* ── telegram + decoder wheel ── */
.csp-telegram {
  width: 24em;
  padding: 0 0 4.6em;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .26 0 0 0 0 .1 .45 0 0 0 -.15'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(170deg, #f7e9bf 0%, #efdca6 100%);
}
.csp-tg-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.55em 1.2em 0.45em;
  border-bottom: 0.25em double #f7e9bf;
  background: linear-gradient(180deg, #2a4d9e, #1d3a80);
  color: #f7e9bf;
  font-family: var(--csp-stamp);
}
.csp-tg-head b { font-size: 1.35em; letter-spacing: 0.08em; }
.csp-tg-head span { font-size: 0.95em; letter-spacing: 0.3em; }
.csp-tg-meta { padding: 0.8em 1.4em 0.2em; font-size: 0.85em; color: #4a3d22; }
.csp-tapes { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5em; padding: 0.7em 1.2em 0.4em; }
.csp-tape {
  padding: 0.18em 0.6em;
  background: #fbfaf3;
  color: #1b1b1b;
  font-family: var(--csp-type);
  font-size: 1.15em;
  font-weight: 700;
  letter-spacing: 0.14em;
  white-space: pre;
  box-shadow: 0 0.06em 0.12em rgba(0, 0, 0, 0.25);
}
.csp-tape:nth-child(1) { rotate: -0.8deg; }
.csp-tape:nth-child(2) { rotate: 0.6deg; margin-left: 0.4em; }
.csp-decoded {
  margin: 0.9em 1.2em 0;
  padding: 0.55em 0.8em 0.6em;
  border: 2px dashed rgba(90, 70, 30, 0.55);
  border-radius: 0.3em;
  color: #6a5a3a;
  font-family: var(--csp-type);
  font-weight: 700;
  letter-spacing: 0.1em;
  white-space: pre;
  transition: background-color 250ms, border-color 250ms, color 250ms;
}
.csp-decoded b { display: block; margin-bottom: 0.15em; font-family: var(--csp-stamp); font-size: 0.75em; letter-spacing: 0.2em; opacity: 0.8; }
.csp-decoded .csp-line { font-size: 1.1em; }
.csp-decoded.is-right {
  border-style: solid;
  border-color: #2e9e4f;
  background: rgba(80, 200, 110, 0.18);
  color: #146b30;
  box-shadow: 0 0 0.8em rgba(60, 200, 100, 0.35);
}
.csp-tg-note { right: -2.4em; top: 4.2em; width: auto; padding: 1em 1em 0.8em; rotate: 6deg; }

.csp-wheel-box { display: flex; flex-direction: column; align-items: center; gap: 0.8em; }
.csp-wheel {
  width: 15em;
  height: 15em;
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
  filter: drop-shadow(0 0.2em 0.25em rgba(0, 0, 0, 0.45)) drop-shadow(0 0.9em 1.2em rgba(0, 0, 0, 0.35));
  transition: transform 160ms var(--csp-spring);
}
.csp-wheel:focus-visible { outline: 2px dotted #ffe9a8; outline-offset: 4px; }
.csp-wheel.is-dragging { cursor: grabbing; transform: scale(1.03); }
.csp-wheel svg { display: block; width: 100%; height: 100%; overflow: visible; }
.csp-wheel text { text-anchor: middle; dominant-baseline: central; font-family: var(--csp-stamp); font-weight: 900; }
.csp-wheel-card { fill: #ecdcae; stroke: #8b6b2e; stroke-width: 2; }
.csp-wheel-edge { fill: none; stroke: #b8935a; stroke-width: 1.5; stroke-dasharray: 3 3; }
.csp-wheel-tick { stroke: #a8854a; stroke-width: 1.2; }
.csp-wheel-plain { fill: #2b1d0e; }
.csp-wheel-inner { fill: #b8302a; stroke: #6f1a14; stroke-width: 2; }
.csp-wheel-core { fill: #8f241f; stroke: #e7b54a; stroke-width: 1.5; }
.csp-wheel-code { fill: #fff6dc; }
.csp-wheel-brand { fill: #f3c85a; letter-spacing: 0.12em; }
.csp-wheel-window { fill: rgba(255, 236, 120, 0.3); stroke: #e0ad1f; stroke-width: 2.5; stroke-linejoin: round; }
.csp-wheel-hub { fill: #c9ced6; stroke: #5d6572; stroke-width: 2; }
.csp-wheel-rivet { fill: #8d95a0; }
.csp-wheel-disc { transform-box: view-box; transform-origin: 0 0; }
.csp-wheel-row { display: flex; align-items: center; gap: 0.7em; }
.csp-wheel-btn {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.55rem;
  border: 1px solid #6b4f1f;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #fff3cf, #e3c47c 60%, #b8914a);
  color: #4a320c;
  box-shadow: 0 0.1em 0.25em rgba(0, 0, 0, 0.45);
  transition: transform 140ms var(--csp-spring), filter 140ms;
}
.csp-wheel-btn:hover { filter: brightness(1.08); }
.csp-wheel-btn.is-pressed { transform: scale(1.18); }
.csp-wheel-shift {
  min-width: 5.2em;
  padding: 0.35em 0.6em;
  border-radius: 0.3em;
  background: #241a10;
  box-shadow: inset 0 0.1em 0.2em rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.15);
  color: #ffd98a;
  font-family: var(--csp-type);
  font-size: 1.1em;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

/* ── lunch order: invisible ink under a UV lamp ── */
.csp-lunch { overflow: clip; cursor: crosshair; }
.csp-lunch.is-uv { touch-action: none; }
.csp-lunch .csp-stamp.is-tr { top: 1.1em; right: 1.2em; transform: rotate(4deg); }
.csp-coffee {
  position: absolute;
  right: 3.2em;
  top: 8.4em;
  width: 6.8em;
  height: 6.4em;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, transparent 78%, rgba(122, 72, 28, 0.42) 83%, rgba(122, 72, 28, 0.16) 89%, transparent 95%),
    radial-gradient(closest-side, rgba(150, 95, 40, 0.07), transparent);
  rotate: 14deg;
  pointer-events: none;
}
.csp-coffee::after {
  content: '';
  position: absolute;
  left: -1.6em;
  top: 2.6em;
  width: 5.6em;
  height: 5.3em;
  border-radius: 50%;
  background: radial-gradient(closest-side, transparent 80%, rgba(122, 72, 28, 0.22) 86%, transparent 93%);
  -webkit-mask-image: linear-gradient(200deg, #000 30%, transparent 60%);
  mask-image: linear-gradient(200deg, #000 30%, transparent 60%);
}
.csp-lunch.is-uv::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(24, 12, 48, 0.3);
  pointer-events: none;
}
.csp-uv-glow {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: inherit;
  background: radial-gradient(ellipse at 50% 40%, #2c1462, #170833);
  color: #7a68c8;
  clip-path: circle(0 at 50% 50%);
  visibility: hidden;
  pointer-events: none;
}
.csp-lunch.is-uv .csp-uv-glow { visibility: visible; }
.csp-uv-glow .csp-type { text-shadow: 0 0 0.3em rgba(140, 110, 255, 0.5); }
.csp-uv-glow .csp-stamp { color: #ff71d8; opacity: 1; mix-blend-mode: normal; box-shadow: inset 0 0 0 0.08em #2c1462, inset 0 0 0 0.15em currentColor, 0 0 0.6em rgba(255, 110, 220, 0.6); }
.csp-uv-glow .csp-coffee { filter: brightness(0.4); }
.csp-uv-msg {
  position: absolute;
  left: 2.6em;
  top: 7.3em;
  color: #c8ff5a;
  font-family: var(--csp-hand);
  font-size: 2.25em;
  font-weight: 700;
  line-height: 1;
  white-space: pre;
  rotate: -9deg;
  text-shadow: 0 0 0.12em #f4ffcf, 0 0 0.35em #7dff3a, 0 0 0.9em rgba(120, 255, 60, 0.7);
}
.csp-uv-msg span { display: inline-block; transition: transform 200ms var(--csp-spring); }
.csp-uv-msg span.is-seen { color: #f1ffb8; transform: translateY(-0.04em); }
.csp-uv-note {
  position: absolute;
  right: 5.6em;
  bottom: 3.3em;
  color: #6ff6ff;
  font-family: var(--csp-hand);
  font-size: 1.05em;
  rotate: -4deg;
  text-shadow: 0 0 0.3em #2ad7ff, 0 0 0.8em rgba(40, 200, 255, 0.6);
}
.csp-uv-bird {
  position: absolute;
  right: 1.4em;
  bottom: 1.9em;
  width: 3.8em;
  height: 3.5em;
  color: #ff71d8;
  filter: drop-shadow(0 0 0.2em #ff40c8) drop-shadow(0 0 0.5em rgba(255, 64, 200, 0.6));
}
.csp-uv-print {
  position: absolute;
  width: 2.6em;
  height: 3.2em;
  border-radius: 50%;
  background: repeating-radial-gradient(ellipse 50% 58% at 50% 55%, rgba(140, 255, 236, 0.6) 0 0.07em, transparent 0.07em 0.24em);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000 40%, transparent 70%);
  mask-image: radial-gradient(ellipse at 50% 50%, #000 40%, transparent 70%);
  filter: drop-shadow(0 0 0.2em rgba(90, 255, 230, 0.7));
}
.csp-uv-print.is-a { left: 1.2em; top: 13.5em; rotate: -24deg; }
.csp-uv-print.is-b { right: 6.4em; top: 2.6em; rotate: 32deg; }
.csp-uv-beam {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  display: none;
  border: 2px solid rgba(214, 176, 255, 0.75);
  border-radius: 50%;
  box-shadow: inset 0 0 1.4em rgba(170, 90, 255, 0.75), 0 0 1.2em rgba(150, 80, 255, 0.6), 0 0 3em rgba(120, 60, 255, 0.35);
  pointer-events: none;
}
.csp-lunch.is-uv .csp-uv-beam { display: block; }

.csp-torch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
  padding: 0.4em 0.6em;
  border: 0;
  background: none;
  color: #f6e7c8;
  transition: transform 150ms var(--csp-spring);
}
.csp-torch:hover { transform: rotate(-5deg); }
.csp-torch.is-pressed { transform: scale(1.14) rotate(-5deg); }
.csp-torch:focus-visible { outline: 2px dotted #ffe9a8; outline-offset: 3px; }
.csp-torch-body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5em;
  height: 6.6em;
  margin-top: 1.5em;
  border-radius: 0.35em 0.35em 0.6em 0.6em;
  background: linear-gradient(90deg, #2a2236 0%, #6a5a86 30%, #3a2f4c 55%, #1c1626 100%);
  box-shadow: 0 0.3em 0.6em rgba(0, 0, 0, 0.5);
}
.csp-torch-body b {
  color: #e8d8ff;
  font-family: var(--csp-stamp);
  font-size: 0.85em;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
  text-orientation: upright;
}
.csp-torch-head {
  position: absolute;
  left: 50%;
  top: -1.5em;
  width: 3.6em;
  height: 1.7em;
  border-radius: 0.3em 0.3em 0.15em 0.15em;
  background: linear-gradient(90deg, #3a2f4c, #8a7aa8 35%, #4a3d60 60%, #241c30);
  clip-path: polygon(0 0, 100% 0, 82% 100%, 18% 100%);
  transform: translateX(-50%);
}
.csp-torch-lens {
  position: absolute;
  left: 50%;
  top: -1.85em;
  width: 3.1em;
  height: 0.75em;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #6c5a8c, #2b2140);
  transform: translateX(-50%);
  transition: background-color 200ms, box-shadow 200ms;
}
.csp-torch.is-on .csp-torch-lens {
  background: radial-gradient(ellipse at 50% 40%, #ffffff, #d7b4ff 40%, #9a55ff);
  box-shadow: 0 0 0.8em #b06bff, 0 0 2em rgba(160, 90, 255, 0.8), 0 -1.4em 2.4em rgba(160, 90, 255, 0.55);
}
.csp-torch-label {
  padding: 0.2em 0.6em;
  border-radius: 0.3em;
  background: rgba(0, 0, 0, 0.35);
  font-family: var(--cs-font);
  font-size: 0.95em;
  font-weight: 700;
  white-space: nowrap;
}
.csp-torch.is-on .csp-torch-label { background: #6d32c9; color: #fff; box-shadow: 0 0 0.8em rgba(160, 90, 255, 0.7); }

/* ── staff notice: a fold-in ── */
.csp-notice { position: relative; padding: 0.4em 0 3.4em; }
.csp-fold {
  --k: 0;
  --th: 0rad;
  --shade: 0;
  display: flex;
  perspective: 60em;
  font-family: var(--csp-type);
  font-size: 1.05em;
  font-weight: 700;
  line-height: 1.5;
  color: #26231d;
  filter: drop-shadow(0 0.12em 0.18em rgba(0, 0, 0, 0.4)) drop-shadow(0 0.9em 1.2em rgba(0, 0, 0, 0.35));
  transform: translateX(calc(var(--k) * 14ch));
}
.csp-fold-col {
  position: relative;
  padding: 2.2em 0 2.4em;
  background: var(--csp-paper);
  white-space: pre;
  text-shadow: 0 0 0.6px rgba(30, 25, 15, 0.55);
}
.csp-fold-col.is-l { padding-left: 1.8em; }
.csp-fold-col.is-r { padding-right: 1.8em; transform: translateX(calc(var(--k) * -28ch)); cursor: grab; touch-action: none; }
.csp-fold-col.is-m1, .csp-fold-col.is-m2 { width: 14ch; }
/* The right column tucks 1px under its neighbour, so no hairline of desk shows at the seam. */
.csp-fold-col.is-r { margin-left: -1px; }
.csp-notice.is-folded .csp-fold-col.is-m1, .csp-notice.is-folded .csp-fold-col.is-m2 { visibility: hidden; }
.csp-fold-col.is-m1 { transform-origin: 0 50%; transform: rotateY(var(--th)); }
.csp-fold-col.is-m2 { transform-origin: 100% 50%; transform: translateX(calc(var(--k) * -28ch)) rotateY(calc(-1 * var(--th))); }
.csp-fold-col.is-m1::after, .csp-fold-col.is-m2::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(40, 25, 5, var(--shade)));
  pointer-events: none;
}
.csp-fold-col.is-m2::after { background: linear-gradient(90deg, rgba(40, 25, 5, calc(var(--shade) * 0.6)), rgba(0, 0, 0, 0)); }
/* A dog-eared corner says "pull me". */
.csp-fold-col.is-r::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1.6em;
  height: 1.6em;
  background: linear-gradient(315deg, #6a3f23 50%, rgba(0, 0, 0, 0.2) 50%, #e9e0c6 56%, #fbf7ea 100%);
}
.csp-fold-col.is-r:focus-visible { outline: 2px dotted #26231d; outline-offset: -4px; }
/* Exactly one character wide, so the outer columns still meet letter to letter. */
.csp-ab {
  display: inline-block;
  width: 1ch;
  padding: 0.06em 0;
  border-radius: 0.12em;
  background: var(--csp-red);
  color: #fff;
  text-align: center;
  text-shadow: none;
}
.csp-line.is-mark { position: relative; }
.csp-stamp.is-fold { top: 0.9em; right: 0.4em; font-size: 0.9em; transform: rotate(8deg); }
.csp-fold-hint { right: 0.4em; bottom: 0.4em; color: var(--csp-red); rotate: -3deg; }
.csp-notice.is-folded .csp-fold-hint { opacity: 0; transition: opacity 200ms; }
/* Cracked, the answer is scrawled into the empty foot of the folded strip. */
.csp-notice .csp-answer { left: 50%; right: auto; bottom: 4.6em; width: 10.5em; translate: -50% 0; font-size: 1.15em; }
.csp-notice .csp-stamp.is-decoded { top: 27%; font-size: 1.4em; }

/* ───────── narrow windows (phones): albums across the top, details on demand ───────── */
.csp.is-narrow {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  grid-template-areas: 'albums' 'codes' 'view' 'bar' 'strip';
}
.csp.is-narrow .csp-side { display: contents; }
.csp.is-narrow .csp-group { border-radius: 0; box-shadow: none; }
.csp.is-narrow .csp-group-head { display: none; }
.csp.is-narrow .csp-group-body { border: 0; }
.csp.is-narrow .csp-albums { grid-area: albums; }
.csp.is-narrow .csp-albums .csp-group-body {
  flex-direction: row;
  gap: 0.3rem;
  padding: 0.4rem;
  background: linear-gradient(180deg, #7ba2e7 0%, #6375d6 100%);
}
.csp.is-narrow .csp-album {
  flex: 1 1 0;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  min-height: 0;
  padding: 0.35rem 0.2rem 0.3rem;
  color: #fff;
  text-align: center;
  transform-origin: 50% 50%;
}
.csp.is-narrow .csp-album:not(.is-on) { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.3); }
.csp.is-narrow .csp-album-icon { width: 3rem; }
.csp.is-narrow .csp-album-text { align-items: center; max-width: 100%; }
.csp.is-narrow .csp-album-text b { max-width: 100%; font-size: 0.8125rem; }
.csp.is-narrow .csp-album-text small { display: none; }
.csp.is-narrow .csp-album[data-album='secret'] b { color: #ffe0e0; }
.csp.is-narrow .csp-codes { grid-area: codes; }
.csp.is-narrow .csp-codes .csp-group-body { padding: 0.35rem 0.6rem; border-bottom: 1px solid #a9b8e0; }
.csp.is-narrow .csp-codes-row::before { content: 'Codes found'; flex: none; color: #215dc6; font-size: 0.8125rem; font-weight: 700; }
.csp.is-narrow .csp-meter { height: 1.1rem; }
.csp.is-narrow .csp-btn.is-info { display: inline-flex; }
.csp.is-narrow .csp-btn.is-info {
  width: 2.6rem;
  height: 2.6rem;
  border-color: #173f88;
  background:
    radial-gradient(ellipse 62% 42% at 50% 22%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 70%),
    radial-gradient(circle at 50% 78%, #7db8ff 0%, #2f74e0 50%, #163f98 100%);
}
.csp.is-narrow .csp-bar { gap: 0.6rem; padding: 0.4rem 0.5rem; }
.csp.is-narrow .csp-strip { padding: 0.9rem 0.6rem; gap: 0.45rem; }
.csp.is-narrow .csp-thumb { width: 4.6rem; }
/* Details become a sheet over the photo, opened from the (i) button. */
.csp.is-narrow .csp-details {
  grid-area: view;
  align-self: end;
  z-index: 8;
  max-height: calc(100% - 1rem);
  margin: 0.5rem;
  overflow-y: auto;
  border-radius: 0.45rem;
  box-shadow: 0 0.4rem 1.4rem rgba(10, 20, 60, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(1rem) scale(0.97);
  transition: opacity 200ms ease, transform 260ms var(--csp-spring), visibility 0s 260ms;
}
.csp.is-narrow.is-info .csp-details { opacity: 1; visibility: visible; transform: none; transition: opacity 200ms ease, transform 260ms var(--csp-spring); }
.csp.is-narrow .csp-details .csp-group-head { display: flex; border-radius: 0.45rem 0.45rem 0 0; }
.csp.is-narrow .csp-details .csp-group-body { border-radius: 0 0 0.45rem 0.45rem; }
.csp.is-narrow .csp-desk { padding: 1.6em 1.6em 2.4em; }
.csp.is-narrow .csp-memo .csp-sticky { right: -0.8em; }
.csp.is-narrow .csp-report { padding-top: 9.6em; padding-right: 2.6em; }
.csp.is-narrow .csp-mug { top: 0.9em; right: 1.2em; padding: 0.35em 0.35em 1em; }
.csp.is-narrow .csp-mug-art { width: 5.6em; height: 7em; }
.csp.is-narrow .csp-report .csp-stamp.is-tl { top: 2.2em; }
.csp.is-narrow .csp-pair { position: relative; }
/* The lamp lies on the page's lower corner, clear of the hidden message. */
.csp.is-narrow .csp-torch { position: absolute; right: 1.2em; bottom: -4.4em; z-index: 7; rotate: -14deg; touch-action: none; }
.csp.is-narrow .csp-stage.is-doc { overflow-x: hidden; }
.csp.is-narrow .csp-desk:has(.csp-notice) { padding-inline: 0.6em; }
.csp.is-narrow .csp-fold-col.is-l { padding-left: 1.1em; }
.csp.is-narrow .csp-fold-col.is-r { padding-right: 1.1em; }
.csp.is-narrow .csp-wheel { width: 13em; height: 13em; }
.csp.is-narrow .csp-declass { left: 50%; top: 42%; font-size: 0.75rem; }
.csp.is-narrow .csp-tg-note { right: -0.6em; }

@media (pointer: coarse) {
  .csp-album { min-height: 3.9rem; }
  .csp-btn.is-round, .csp-btn.is-pill { height: 3rem; }
  .csp-btn.is-round { width: 3rem; }
}

html[data-reduced-motion='on'] .csp-acro.is-lit { animation: none; }
