:root {
  --ink: #252d29;
  --muted: #5e6c63;
  --line: #dce3dc;
  --paper: #fdfdfa;
  --red: #8b302d;
  --green: #293e34;
  --surface: #eff3ed;
  --font: "American Typewriter", "Courier New", serif;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  letter-spacing: 0;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
body { margin: 0; background: #e4eae5; overflow: hidden; }
button, input, textarea { font: inherit; letter-spacing: 0; -webkit-tap-highlight-color: transparent; }
button { border: 0; background: none; color: inherit; cursor: pointer; touch-action: manipulation; transition: background .15s; }
button:disabled { cursor: default; }
button, input, textarea, a, summary { outline-offset: 3px; }
:focus-visible { outline: 2px solid #527b5e; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-weight: 400; overflow-wrap: anywhere; }
svg { width: 22px; height: 22px; flex-shrink: 0; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.skip { position: fixed; top: -80px; background: white; padding: 12px; z-index: 100; }
.skip:focus { top: 0; }

/* A single mobile canvas, including on a desktop. */
#app { width: 100%; max-width: 430px; height: 100dvh; margin: auto; display: grid; grid-template-rows: auto auto minmax(0,1fr) auto; background: var(--paper); overflow: hidden; position: relative; }
.app-scroll { overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; scrollbar-width: none; min-height: 0; -webkit-overflow-scrolling: touch; }
.app-scroll::-webkit-scrollbar { display: none; }
.loading { padding: 64px 24px; text-align: center; }
.loading h1 { font: 26px/1.3 var(--font); margin-bottom: 16px; }
[hidden] { display: none !important; }
body.activation-page { background: #0e211a; }
.activation-page #announcement { position: fixed; top: 0; left: 0; }
#app.activation-screen { max-width: none; height: 100dvh; margin: 0; border: 0; border-radius: 0; background: #0e211a; }
.activation { grid-row: 1 / -1; position: relative; isolation: isolate; display: grid; place-items: center; overflow: hidden; padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(64px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); color: #f3f3e9; }
.activation-scene { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
/* Image and lamp share the same 2:3 plane, including the cover crop on phones. */
.activation-art { position: absolute; width: max(100%, calc(100dvh * 2 / 3)); aspect-ratio: 2 / 3; left: 12%; top: 50%; transform: translate(-12%, -50%); }
.activation-art img { display: block; width: 100%; height: 100%; }
.activation-lamp { position: absolute; left: 9.2%; top: 54.45%; width: 3%; height: 2.6%; background: #14231b; clip-path: polygon(0 0, 100% 6%, 72% 94%, 22% 100%); opacity: 0; animation: lamp-flicker 23s linear infinite; }
.activation-lamp.lower { left: 8.7%; top: 70.85%; width: 2.65%; height: 2.3%; animation-duration: 31s; animation-delay: -7s; }
.falling-star { position: absolute; width: 68px; height: 1px; background: #c8d7cc; top: 12%; left: 44%; opacity: 0; transform: rotate(-36deg); transform-origin: right center; animation: star-fall 29s linear infinite; }
.falling-star.second { top: 20%; left: 70%; width: 40px; animation-duration: 41s; animation-delay: 11s; }
.activation-content { width: 100%; max-width: 340px; text-align: center; }
.activation-emblem { display: flex; align-items: center; justify-content: center; margin-bottom: 20px; color: #becbc0; }
.activation-emblem svg { width: 50px; height: 50px; stroke-width: 1.1; }
.activation h1 { font: 34px/1.2 var(--font); overflow-wrap: normal; }
.activation-intro { font: 17px/1.6 var(--sans); color: #bcc9bf; margin-top: 14px; }
#activation-form { text-align: left; margin-top: 34px; }
#activation-form label { display: block; font: 500 15px/1.5 var(--sans); color: #d2dcd3; margin-bottom: 10px; }
.activation-input { position: relative; }
.activation-input > svg { position: absolute; top: 18px; left: 16px; color: #58675c; pointer-events: none; }
#activation-code { display: block; width: 100%; height: 58px; padding: 14px 16px 14px 48px; border: 1px solid #d8e0d7; border-radius: 12px; background: #f2f3ed; color: #1c2c23; font: 18px/1.5 var(--sans); }
#activation-code::placeholder { color: #626e64; opacity: 1; }
#activation-code[aria-invalid] { border: 2px solid #e1a39a; }
.activation-submit { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 56px; margin-top: 12px; padding: 14px; background: #913d37; color: #fff9f2; border: 1px solid #af5950; border-radius: 12px; font: 500 17px/1.5 var(--sans); }
.activation-submit:hover { background: #a64a42; }
.activation-submit:disabled { background: #693a35; color: #e2c9c2; cursor: wait; }
.activation :focus-visible { outline: 2px solid #e4c392; outline-offset: 4px; }
#activation-feedback { font: 15px/1.5 var(--sans); color: #f1c0b7; min-height: 46px; margin-top: 12px; }
.activation-motion { position: absolute; right: max(20px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); width: 44px; height: 44px; border-radius: 50%; border: 1px solid #96aa9466; background: #11271de6; color: #c2d0c2; display: grid; place-items: center; }
.activation-motion:hover { background: #294337; }
.activation-motion svg { width: 18px; height: 18px; }
.motion-paused .activation-lamp, .motion-paused .falling-star { animation-play-state: paused; }
@keyframes lamp-flicker {
  0%, 17%, 20%, 51%, 60%, 84%, 100% { opacity: 0; }
  18%, 19% { opacity: .45; }
  52%, 54% { opacity: .88; }
  55%, 57% { opacity: .2; }
  58% { opacity: .65; }
  85%, 90% { opacity: .96; }
  93% { opacity: .25; }
}
@keyframes star-fall {
  0%, 79% { opacity: 0; transform: translate(0, 0) rotate(-36deg) scaleX(.2); }
  80% { opacity: .5; }
  83% { opacity: 0; transform: translate(-160px, 116px) rotate(-36deg) scaleX(1); }
  100% { opacity: 0; transform: translate(-160px, 116px) rotate(-36deg) scaleX(1); }
}
@media (max-width: 359px) {
  .activation { padding-inline: 20px; }
}
@media (max-height: 620px) {
  .activation { padding-top: 16px; padding-bottom: 52px; }
  .activation-emblem { margin-bottom: 12px; }
  .activation-emblem svg { width: 32px; height: 32px; }
  .activation h1 { font-size: 29px; }
  .activation-intro { margin-top: 8px; }
  #activation-form { margin-top: 22px; }
}
@media (max-height: 430px) {
  .activation { padding-block: 12px; }
  .activation-emblem, .activation-intro { display: none; }
  .activation h1 { font-size: 26px; }
  #activation-form { margin-top: 14px; }
  #activation-code { height: 50px; }
  .activation-input > svg { top: 14px; }
  .activation-submit { min-height: 50px; padding-block: 10px; }
  #activation-feedback { min-height: 24px; }
}
.topbar { background: var(--green); color: white; padding-top: env(safe-area-inset-top); }
.topbar-inner { min-height: 60px; padding: 4px 12px 4px 20px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wordmark { display: flex; align-items: center; gap: 9px; font: 20px var(--font); padding: 0; min-height: 48px; white-space: nowrap; }
.wordmark svg { width: 28px; height: 28px; }
.icon-btn { width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-btn:hover { background: #e6ece5; }
.topbar .icon-btn:hover { background: #ffffff18; }
.icon-btn:disabled { opacity: .35; }
.current-stop { position: relative; display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 12px 20px 16px; min-height: 84px; background: var(--paper); }
.stop-icon { color: var(--red); }
.stop-copy { flex: 1; min-width: 0; }
.stop-copy small { display: block; font-size: 14px; color: var(--muted); margin-bottom: 2px; }
.stop-copy strong { display: block; font: 18px/1.4 var(--font); overflow-wrap: anywhere; }
.current-stop > svg { color: var(--muted); }
.progress-segments { position: absolute; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(8,1fr); gap: 3px; height: 3px; }
.progress-segments > span { background: #e4e9e1; }
.progress-segments .current { background: var(--red); }
.progress-segments .done { background: #4e785c; }
.case-header { height: 100px; position: relative; display: flex; align-items: center; padding: 0 20px; overflow: hidden; background: var(--surface); }
.case-title { z-index: 1; position: relative; }
.case-title p { font: 14px/1.5 var(--sans); color: var(--muted); }
.case-title h1 { font: 28px/1.3 var(--font); }
.skyline { position: absolute; right: 8px; bottom: 0; width: 170px; height: 84px; background: url('/assets/cover.png') 50% 49%/100% auto no-repeat; mix-blend-mode: multiply; opacity: .45; }
.eyebrow { display: block; font: 14px/1.5 var(--sans); color: var(--muted); margin-bottom: 8px; }
.workspace { padding: 0 20px 32px; }
main { min-width: 0; outline: none; }
main:focus { outline: none; }

.person-intro { display: grid; grid-template-columns: minmax(0,1fr) 78px; gap: 18px; padding: 26px 0; align-items: center; }
.person-heading p { font-size: 14px; color: var(--muted); margin-bottom: 5px; }
.person-heading h2 { font: 25px/1.25 var(--font); }
.portrait { margin: 0; }
.portrait img { width: 78px; height: 90px; object-fit: cover; display: block; border-radius: 8px; background: var(--surface); }
.story { grid-column: 1 / -1; font: 17px/1.65 var(--sans); }
.workflow-task { border-top: 1px solid var(--line); scroll-margin-top: 12px; }
.workflow-summary { display: flex; align-items: center; gap: 12px; padding: 22px 0; list-style: none; cursor: pointer; }
.workflow-summary::-webkit-details-marker { display: none; }
.workflow-heading { min-width: 0; flex: 1; }
.workflow-heading > small { display: block; font: 14px/1.5 var(--sans); color: var(--red); margin-bottom: 5px; }
.workflow-heading > h3 { font: 23px/1.3 var(--serif); }
.workflow-heading > span { display: block; font: 14px/1.5 var(--sans); color: var(--muted); margin-top: 6px; }
.workflow-summary > svg:last-child { color: var(--muted); }
.workflow-task[open]:not(.done) > .workflow-summary > svg:last-child { transform: rotate(180deg); }
.workflow-task.locked .workflow-summary { cursor: default; }
.workflow-task.locked .workflow-heading > small, .workflow-task.locked .workflow-heading > h3 { color: var(--muted); }
.workflow-task.done .workflow-heading > small, .workflow-task.done .workflow-summary > svg { color: #386c4b; }
.workflow-body { padding-bottom: 22px; }
.workflow-body > p, .assignment > p { font: 17px/1.65 var(--sans); }
.task-continue { width: 100%; margin-top: 18px; }
.workflow-body .task-note { font: 14px/1.55 var(--sans); margin-top: 12px; color: var(--muted); }
.workflow-body .task-confirmed { display: flex; gap: 10px; align-items: center; font-size: 16px; color: #386c4b; margin-top: 18px; }

.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 13px 16px; border-radius: 12px; font: 500 16px/1.45 var(--sans); }
.primary { background: var(--red); color: white; border: 1px solid var(--red); }
.primary:hover { background: #742825; }
.secondary { border: 1px solid #b4c2b7; background: var(--paper); }
.secondary:hover { background: var(--surface); }
.primary:disabled, .secondary:disabled { background: #e7ece6; color: #637168; border-color: #e7ece6; }
.answer-form { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 6px; }
.answer-form label, .destination-options legend { display: block; font-size: 17px; font-weight: 600; margin-bottom: 12px; line-height: 1.5; }
.answer-row { display: flex; flex-direction: column; gap: 12px; }
.answer-row input { width: 100%; min-height: 56px; min-width: 0; padding: 14px 16px; font-size: 18px; background: white; border: 1px solid #9dab9f; border-radius: 12px; color: var(--ink); }
.answer-row input::placeholder { color: var(--muted); }
.answer-row input[aria-invalid] { border-color: var(--red); }
.answer-feedback { font-size: 16px; line-height: 1.6; color: var(--red); margin-top: 12px; }
.answer-feedback:empty { display: none; }
.help-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.help-row button { display: flex; align-items: center; gap: 8px; min-height: 48px; font-size: 15px; padding: 6px 0; color: var(--muted); }
.help-row svg { width: 20px; height: 20px; }
.hint-box { border-left: 3px solid #819e86; background: var(--surface); padding: 16px; font: 17px/1.65 var(--sans); border-radius: 0 8px 8px 0; margin-top: 10px; }
.success-block { display: flex; align-items: center; gap: 12px; background: #eaf2e9; padding: 16px; border-radius: 8px; margin-top: 18px; }
.success-block strong { display: block; font-size: 16px; line-height: 1.5; font-weight: 500; }
.success-block span { display: block; font-size: 14px; line-height: 1.5; color: var(--muted); margin-top: 5px; }
.success-block > svg { color: #386c4b; }

/* Puzzle pieces keep their size; longer rows wrap instead of shrinking type. */
.anagram { padding: 24px 0 18px; }
.tile-bank { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.letter-tile { flex: 0 1 48px; min-width: 44px; height: 50px; background: #edf1e9; border: 1px solid #ccd7ca; border-radius: 8px; font: 25px var(--font); }
.letter-tile:not(:disabled):hover { background: #dce8d9; }
.letter-tile:disabled { opacity: .3; }
.slots-row { margin-top: 22px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.letter-slots { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; }
.slot-word { display: flex; gap: 3px; max-width: 100%; }
.letter-slot { width: 26px; min-width: 0; height: 36px; border-bottom: 2px solid #b6c5b5; text-align: center; font: 21px/34px var(--font); color: var(--red); }
.letter-slot.fixed { color: var(--ink); background: var(--surface); border-color: transparent; border-radius: 4px; }
.slots-row .icon-btn { background: var(--surface); }
.roman-key { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); padding: 18px 6px; margin: 24px 0; background: var(--surface); border-radius: 8px; }
.roman-key > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.roman-key strong { font: 28px var(--serif); }
.roman-key span { font: 17px var(--sans); color: var(--muted); }
.riddle { font: 20px/1.8 var(--serif); margin: 24px 0; padding: 8px 0 8px 18px; border-left: 3px solid #9bb39d; }
.riddle > span { display: block; }
.cipher { margin: 24px 0; }
.cipher-key { text-align: center; font: 17px/1.5 var(--font); margin-bottom: 18px; color: var(--muted); }
.cipher-key > span { margin: 0 5px; }
.cipher-words { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.cipher-word { display: flex; justify-content: center; gap: 6px; max-width: 100%; }
.cipher-word > span { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 38px; min-width: 0; height: 66px; background: var(--surface); border-radius: 8px; font: 20px var(--font); }
.cipher-blank { width: 65%; height: 20px; border-bottom: 1px solid #9bb39d; }
.sign-image { display: block; padding: 0; position: relative; width: 100%; margin: 24px auto; }
.sign-image img { display: block; width: 100%; border-radius: 8px; }
.sign-image > span { position: absolute; bottom: 10px; right: 10px; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.anagram-clue { max-width: 280px; padding-bottom: 58px; margin-bottom: 0; }
.anagram-clue > span { bottom: 0; right: 0; }
.equations { font: 20px var(--font); margin: 24px 0; }
.equations > div { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 12px; }
.equations svg { width: 28px; height: 28px; color: #4e6952; }
.equations b { font-weight: 400; white-space: nowrap; }
.equation-question { color: var(--red); border-top: 1px solid var(--line); padding-top: 16px; }
.destination-target { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 16px; margin-top: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.destination-target > strong { font: 30px var(--font); color: var(--red); }
.letter-key { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 6px; margin: 18px 0 24px; }
.letter-key > div { text-align: center; min-width: 0; background: var(--surface); padding: 9px 0; border-radius: 8px; }
.letter-key dt { font: 20px var(--font); }
.letter-key dd { font: 16px var(--sans); margin: 6px 0 0; color: var(--muted); }
.destination-options { padding: 0; border: 0; margin: 0; min-width: 0; }
.destination-options label { display: flex; align-items: center; gap: 14px; min-height: 64px; border-bottom: 1px solid var(--line); margin: 0; padding: 14px 4px; cursor: pointer; }
.destination-options input, .suspects input { width: 22px; height: 22px; flex-shrink: 0; accent-color: var(--red); margin: 0; }
.destination-options label > span { min-width: 0; }
.destination-options small { display: block; color: var(--muted); font: 16px var(--font); margin-bottom: 5px; }
.destination-options strong { font: 18px/1.4 var(--sans); overflow-wrap: anywhere; }
.destination-options label:has(input:checked) { background: var(--surface); border-radius: 8px; }
.route-equation { font: 24px/1.4 var(--font); text-align: center; padding: 24px 0; margin-top: 12px; border-block: 1px solid var(--line); }
.route-equation sup { font-size: 16px; }
.banknote-clue { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 24px 0; color: #4b6c53; }
.banknote-clue > svg { width: 34px; height: 34px; }
.banknote-clue > strong { font: 30px var(--font); }
.banknote-clue > span { font-size: 14px; }
.destination-reveal { border-left: 3px solid #638268; padding-left: 16px; }
.destination-reveal .eyebrow { color: #386c4b; }
.destination-reveal h4 { font: 26px/1.3 var(--font); margin: 8px 0 12px; }
.destination-reveal > p { font-size: 17px; }

.review-files { margin-top: 20px; border-top: 1px solid var(--line); }
.review-files > button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 18px 0; border-bottom: 1px solid var(--line); min-height: 64px; }
.review-files strong { flex: 1; min-width: 0; font: 18px/1.45 var(--sans); overflow-wrap: anywhere; }
.review-files svg { color: var(--muted); }
.review-files .opened > svg:last-child { color: #386c4b; }
.view-heading { padding: 28px 0 0; margin-bottom: 24px; }
.view-heading h2 { font: 27px/1.25 var(--font); }
.view-heading > p { font-size: 16px; color: var(--muted); margin-top: 10px; }
.full-map { display: block; padding: 0; width: 100%; position: relative; background: white; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.full-map > img { display: block; width: 100%; }
.image-zoom { position: absolute; right: 12px; top: 12px; display: flex; gap: 8px; align-items: center; min-height: 48px; background: white; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 16px; }
.mobile-route { padding-top: 24px; }
.route { list-style: none; padding: 0; margin: 0; }
.route li { position: relative; }
.route li:not(:last-child):before { content: ""; position: absolute; left: 19px; top: 53px; bottom: -6px; width: 1px; background: var(--line); }
.route button { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; min-height: 84px; padding: 14px 0; }
.route button > span:nth-child(2) { min-width: 0; flex: 1; }
.route strong { display: block; font: 500 17px/1.4 var(--sans); overflow-wrap: anywhere; }
.route small { display: block; font: 14px/1.5 var(--sans); color: var(--muted); margin-top: 4px; }
.step-number { width: 39px; height: 39px; flex-shrink: 0; border: 1px solid #b8c6b9; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--muted); background: var(--paper); font: 16px var(--font); }
.route button > svg { width: 20px; height: 20px; color: var(--muted); }
.route button:disabled strong { color: var(--muted); }
.route .current .step-number { background: var(--red); color: white; border-color: var(--red); }
.route .current strong, .route .current button > svg { color: var(--red); }
.route .done .step-number { background: #e7f0e3; color: #386c4b; border-color: #c9d7c5; }
.route-summary { font-size: 16px; color: var(--muted); margin-bottom: 10px; }
.outside-note { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--muted); padding-top: 18px; border-top: 1px solid var(--line); margin-top: 18px; }

.empty-envelope { text-align: center; padding: 28px 0 36px; }
.envelope-mark { width: 96px; height: 80px; display: flex; align-items: center; justify-content: center; background: var(--surface); margin: 0 auto 24px; border-radius: 8px; }
.envelope-mark svg { width: 42px; height: 42px; color: #4b6c53; }
.empty-envelope h3 { font: 25px/1.3 var(--serif); margin-bottom: 12px; }
.empty-envelope p { font-size: 17px; color: var(--muted); margin-bottom: 24px; }
.section-title { display: flex; align-items: center; gap: 12px; font: 23px var(--serif); margin: 28px 0 14px; }
.section-title > span { font: 16px var(--sans); color: var(--muted); }
.evidence-grid { border-top: 1px solid var(--line); }
.evidence-card { display: flex; align-items: center; gap: 16px; text-align: left; width: 100%; padding: 16px 0; border-bottom: 1px solid var(--line); }
.evidence-preview { width: 70px; height: 92px; flex-shrink: 0; background: var(--surface); padding: 7px; overflow: hidden; border-radius: 8px; }
.evidence-preview img { width: 100%; height: 100%; object-fit: contain; }
.evidence-copy { flex: 1; min-width: 0; }
.evidence-copy strong { display: block; font: 18px/1.4 var(--sans); overflow-wrap: anywhere; }
.evidence-copy small { display: block; font: 14px/1.5 var(--sans); color: var(--muted); margin-bottom: 6px; }
.evidence-card > svg { width: 20px; height: 20px; color: var(--muted); }
.audio-list { border-top: 1px solid var(--line); }
.audio-list button { display: flex; align-items: center; gap: 16px; text-align: left; width: 100%; padding: 20px 0; border-bottom: 1px solid var(--line); }
.audio-list button > span { flex: 1; min-width: 0; }
.audio-list strong { font-size: 18px; font-weight: 400; overflow-wrap: anywhere; }
.audio-list small { display: block; font-size: 14px; color: var(--muted); margin-top: 5px; }
.verdict-line { margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--line); }
.verdict-line h3 { font: 25px var(--serif); }
.verdict-line p { font-size: 17px; color: var(--muted); margin-top: 12px; }
.verdict-line button { width: 100%; margin-top: 20px; }
.notebook { border-top: 2px solid #8da48d; padding-top: 16px; }
#notes { width: 100%; display: block; resize: vertical; border: 0; border-radius: 0; min-height: 330px; background: repeating-linear-gradient(transparent,transparent 33px,#dce3dc 33px,#dce3dc 34px); background-attachment: local; padding: 0 2px; font-size: 18px; line-height: 34px; color: var(--ink); }
#notes::placeholder { color: var(--muted); }
.notes-status { font-size: 14px; color: var(--muted); margin-top: 16px; }
.notes-tools { margin-top: 20px; }
.notes-tools .secondary { width: 100%; }
.storage-warning { display: flex; align-items: center; gap: 10px; padding: 0 20px 24px; font-size: 14px; color: var(--red); }

.mobile-nav { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); background: var(--paper); border-top: 1px solid var(--line); padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); z-index: 5; }
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; position: relative; height: 64px; min-width: 0; padding: 0; color: var(--muted); border-radius: 12px; }
.nav-symbol { position: relative; display: grid; place-items: center; width: 56px; height: 32px; border-radius: 16px; transition: background .15s; }
.nav-symbol svg { width: 23px; height: 23px; stroke-width: 1.8; }
.nav-label { font: 500 14px/20px var(--sans); white-space: nowrap; }
.nav-item.active { color: var(--red); }
.nav-item.active .nav-symbol { background: #f3e5e1; }
.nav-item.active .nav-symbol svg { stroke-width: 2; }
.nav-item:focus-visible { outline-offset: -2px; }
.nav-item:active .nav-symbol { background: #e5eae2; }
.badge { position: absolute; top: -1px; left: 40px; min-width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #e8eee7; color: var(--green); padding: 0 4px; font: 500 14px/20px var(--sans); font-variant-numeric: tabular-nums; }
.nav-item.active .badge { background: var(--red); color: white; }
@media (hover: hover) {
  .nav-item:not(.active):hover .nav-symbol { background: var(--surface); }
}

dialog { border: 1px solid var(--line); padding: 0; color: var(--ink); background: var(--paper); width: calc(100% - 16px); max-width: 414px; max-height: calc(100dvh - 24px); border-radius: 18px; margin: auto auto 8px; overflow: hidden; }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: #172b238c; }
.dialog-head { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 12px 14px 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font: 23px/1.3 var(--font); }
.dialog-body { padding: 22px 20px; font: 17px/1.65 var(--sans); overflow: auto; overscroll-behavior: contain; min-height: 0; }
.dialog-footer { flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; padding: 16px 20px max(16px,env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.dialog-footer > span { display: flex; align-items: center; gap: 10px; font: 14px var(--sans); color: var(--muted); }
.document-viewport, .zoom-viewport { max-height: min(50dvh,440px); overflow: auto; overscroll-behavior: contain; }
.document-image, .zoom-viewport > img { display: block; width: 100%; max-width: none; }
.document-image.expanded, .zoom-viewport > img.zoomed { width: 200%; }
.reveal-label { display: flex; align-items: center; gap: 10px; font: 16px/1.5 var(--sans); color: #386c4b; margin-bottom: 20px; }
.tape-label { background: var(--surface); text-align: center; padding: 28px 20px; border-radius: 8px; }
.tape-label > span { display: block; font: 16px var(--sans); margin-top: 18px; }
.tape-label > svg { width: 72px; height: 72px; color: #4b6c53; }
audio { display: block; width: 100%; margin-top: 24px; }
.audio-status:empty { display: none; }
.audio-status { color: var(--red); margin-top: 16px; }
.brief h3 { font: 28px/1.3 var(--font); margin-bottom: 22px; }
.brief > p { margin-bottom: 20px; }
.brief-facts { display: flex; flex-direction: column; gap: 14px; border-block: 1px solid var(--line); padding: 20px 0; margin: 24px 0; font: 16px/1.5 var(--sans); }
.brief-facts > span { display: flex; align-items: center; gap: 10px; }
.brief .fiction { font: 14px/1.6 var(--sans); color: var(--muted); margin-bottom: 0; }
.settings-section + .settings-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.settings-section h3 { font: 24px var(--serif); margin-bottom: 12px; }
.settings-section > p { color: var(--muted); }
.toggle-label { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 56px; margin-top: 20px; font-size: 16px; cursor: pointer; }
.toggle-label input { appearance: none; position: relative; width: 50px; height: 30px; border: 1px solid #9fac9f; background: #dce5db; border-radius: 20px; flex-shrink: 0; cursor: pointer; }
.toggle-label input:before { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; background: white; border-radius: 50%; transition: transform .15s; }
.toggle-label input:checked { background: var(--green); border-color: var(--green); }
.toggle-label input:checked:before { transform: translateX(20px); }
.danger-button { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 8px 0; margin-top: 12px; color: var(--red); font: 16px var(--sans); text-align: left; }
.suspects { border: 0; padding: 0; margin: 24px 0; }
.suspects legend { font-size: 16px; margin-bottom: 12px; }
.suspects label { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
#verdict-feedback { color: var(--red); font-size: 16px; margin-bottom: 18px; }

@media (min-width: 500px) {
  #app { height: calc(100dvh - 40px); margin: 20px auto; border: 1px solid #bbc9bc; border-radius: 20px; }
  dialog { margin-bottom: 28px; max-height: calc(100dvh - 64px); }
}
@media (max-width: 359px) {
  .topbar-inner { padding-left: 16px; padding-right: 8px; gap: 6px; }
  .current-stop { padding-left: 16px; padding-right: 16px; }
  .case-header { padding-inline: 16px; }
  .skyline { right: -35px; }
  .workspace { padding-inline: 16px; }
  .tile-bank { gap: 4px; }
  .dialog-head { padding-left: 16px; }
  .dialog-body, .dialog-footer { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .activation-lamp, .falling-star { animation: none; }
  .activation-motion { display: none; }
}
