/* The manor's formal typography, softer spoken text, and quiet geometric ornament. */
:root {
  --font-dialogue: "Shippori Mincho", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --reader-size: clamp(18px, 1.35vw, 21px);
  --conversation-size: clamp(22px, 1.85vw, 32px);
  --ui-ivory: #ece7d9;
  --ui-metal: #ad9b76;
  --ui-hairline: rgba(194, 180, 150, .24);
}
body[data-reading-size="large"] {
  --reader-size: clamp(21px, 1.6vw, 24px);
  --conversation-size: clamp(25px, 2.05vw, 36px);
}
button, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 1px solid #e9d4a4; outline-offset: 5px;
}
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.ui-icon { display: inline-block; flex: 0 0 auto; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.quiet-icon-button {
  position: relative; display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 46px; height: 46px; padding: 10px; border: 1px solid transparent;
  border-radius: 0; background: transparent; color: #b6b4a6; cursor: pointer;
  transition: color .18s, border-color .18s, background-color .18s;
}
.quiet-icon-button:hover, .quiet-icon-button:focus-visible { color: #f5e6c6; border-color: var(--ui-hairline); background: rgba(191,170,129,.06); }
[data-tooltip]::after {
  content: attr(data-tooltip); position: absolute; z-index: 12; top: calc(100% + 9px); right: 0;
  width: max-content; max-width: 210px; padding: 9px 12px; border: 1px solid #655e4d;
  color: #e3ddca; background: #111b20; font-family: var(--font-ui); font-size: 11px;
  line-height: 1.5; letter-spacing: .03em; opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-3px); transition: opacity .15s, transform .15s, visibility .15s;
}
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { opacity: 1; visibility: visible; transform: none; }
.sound-off, .is-muted .sound-waves { display: none; }
.is-muted .sound-off { display: initial; }
.case-header > .quiet-icon-button { align-self: center; width: 50px; height: 50px; margin-right: 8px; padding: 9px; }
.case-header > .quiet-icon-button .ui-icon { width: 28px; height: 28px; }
.casebook-count { position: absolute; right: 3px; top: 1px; min-width: 13px; color: #d4bf91; background: #112024; font-family: var(--font-display); font-size: 9px; font-weight: 400; line-height: 1.4; text-align: center; }
.objective-stack { width: min(390px, calc(100vw - 40px)); }
.objective-card { border: 1px solid rgba(210,170,97,.14); border-left: 2px solid var(--gold); background: linear-gradient(105deg, rgba(7,12,18,.95), rgba(8,13,19,.34)); }
.objective-label { display: none; }
.objective-card p { margin: 0; color: #deddd1; font-family: var(--font-story); font-size: 16px; line-height: 1.7; letter-spacing: .025em; }
.return-hub-button {
  display: flex; align-items: center; gap: 9px; min-height: 39px; padding: 9px 14px;
  border: 1px solid rgba(210,170,97,.5); background: rgba(8,14,21,.78);
  font-family: var(--font-story); font-size: 12px; letter-spacing: .075em;
  box-shadow: 0 4px 10px rgba(0,0,0,.23), inset 0 1px rgba(238,218,173,.035);
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
  transition: background-color .18s, color .18s, border-color .18s, box-shadow .18s;
}
.return-hub-button:hover { color: #f1dfb8; border-color: #d2aa61; background: rgba(59,47,30,.9); box-shadow: 0 5px 13px rgba(0,0,0,.3); }
.return-hub-button:active { box-shadow: inset 0 2px 5px rgba(0,0,0,.25); }
.return-hub-button .ui-icon { width: 17px; height: 17px; }
.desktop-help { color: #a5aaa4; font-size: 11px; letter-spacing: .035em; }
.save-note, .trial-center-card > small, .pointer-status { color: #a4b0aa; }

/* Character colour is confined to the ornament behind an ivory name. */
.nameplate { --speaker-accent: #a58f6b; position: relative; isolation: isolate; display: flex; align-items: baseline; gap: 15px; min-height: 38px; }
.nameplate-emblem {
  position: absolute; z-index: -1; top: 50%; left: 0; width: 62px; height: 62px;
  border: 1px solid rgba(199,186,160,.32); transform: translate(-10%, -50%) rotate(45deg);
  background: repeating-linear-gradient(37deg, transparent 0 5px, rgba(236,224,201,.04) 5px 6px),
    radial-gradient(ellipse at 32% 35%, color-mix(in srgb, var(--speaker-accent) 56%, transparent), transparent 80%),
    color-mix(in srgb, var(--speaker-accent) 19%, #121b20 81%);
  box-shadow: 0 0 26px color-mix(in srgb, var(--speaker-accent) 14%, transparent);
  pointer-events: none;
}
.nameplate-emblem::before { content: ""; position: absolute; inset: 7px; border: 1px solid color-mix(in srgb, var(--speaker-accent) 52%, transparent); }
.nameplate-emblem::after { content: ""; position: absolute; inset: -6px; border-top: 1px solid rgba(226,210,177,.22); border-bottom: 1px solid rgba(226,210,177,.22); }
.nameplate > b, .nameplate > strong { position: relative; color: #f3eedf; font-family: var(--font-story); font-weight: 500; letter-spacing: .075em; text-shadow: 0 2px 8px #071014; }
.nameplate > small { position: relative; color: #c6c0b1; font-family: var(--font-story); font-size: 12px; font-weight: 500; letter-spacing: .08em; }

.is-in-dialogue #hud { visibility: hidden; }
.dialogue-layer::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4,9,16,.28), rgba(4,9,16,.38)); pointer-events: none; }
.dialogue-actions { position: absolute; z-index: 4; top: max(8px, calc(4vh - 30px)); right: max(20px, 4vw); }
.dialogue-actions .quiet-icon-button { width: 60px; height: 60px; padding: 10px; }
.dialogue-actions .quiet-icon-button .ui-icon { width: 36px; height: 36px; }
.dialogue-shell {
  --speaker-accent: #a58f6b;
  --dialogue-rows: 3;
  --dialogue-screen-height: 30dvh;
  --dialogue-text-size: var(--conversation-size);
  --dialogue-leading: 1.8;
  --dialogue-pad-top: 42px;
  --dialogue-pad-bottom: 34px;
  --dialogue-pad-side: clamp(40px, 4.5vw, 76px);
  --dialogue-text-pad-side: clamp(64px, 8vw, 140px);
  --dialogue-crown-height: clamp(56px, 4.5vw, 68px);
  --dialogue-crown-width: min(clamp(300px, 26vw, 400px), calc(100% - 90px));
  --dialogue-name-offset: 10px;
  --frame-shape: polygon(
    0 20px, 20px 0, var(--dialogue-crown-width) 0,
    calc(var(--dialogue-crown-width) + var(--dialogue-crown-height)) var(--dialogue-crown-height),
    calc(100% - 24px) var(--dialogue-crown-height), 100% calc(var(--dialogue-crown-height) + 24px),
    100% calc(100% - 20px), calc(100% - 20px) 100%, 20px 100%, 0 calc(100% - 20px)
  );
  /* Give dialogue a stable share of the screen while reserving enough complete text lines. */
  position: absolute; z-index: 2; left: 50%; right: auto; transform: translateX(-50%);
  width: 94vw; bottom: max(20px, env(safe-area-inset-bottom));
  height: max(var(--dialogue-screen-height), calc(var(--dialogue-text-size) * var(--dialogue-leading) * var(--dialogue-rows) + var(--dialogue-pad-top) + var(--dialogue-pad-bottom) + 2px));
  max-height: calc(100dvh - 130px); pointer-events: none;
}
.dialogue-frame {
  position: absolute; z-index: 0; inset: calc(-1 * var(--dialogue-crown-height)) 0 0;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.27)); pointer-events: none;
}
.dialogue-frame::before, .dialogue-frame::after { content: ""; position: absolute; inset: 0; }
.dialogue-frame::before {
  clip-path: var(--frame-shape);
  background: #000;
}
.dialogue-frame::after {
  /* A transparent, one-pixel outline follows the entire silhouette, including the shoulder. */
  clip-path: polygon(evenodd,
    0 20px, 20px 0, var(--dialogue-crown-width) 0,
    calc(var(--dialogue-crown-width) + var(--dialogue-crown-height)) var(--dialogue-crown-height),
    calc(100% - 24px) var(--dialogue-crown-height), 100% calc(var(--dialogue-crown-height) + 24px),
    100% calc(100% - 20px), calc(100% - 20px) 100%, 20px 100%, 0 calc(100% - 20px), 0 20px,
    1px 20.414px, 1px calc(100% - 20.414px), 20.414px calc(100% - 1px),
    calc(100% - 20.414px) calc(100% - 1px), calc(100% - 1px) calc(100% - 20.414px),
    calc(100% - 1px) calc(var(--dialogue-crown-height) + 24.414px),
    calc(100% - 24.414px) calc(var(--dialogue-crown-height) + 1px),
    calc(var(--dialogue-crown-width) + var(--dialogue-crown-height) - .414px) calc(var(--dialogue-crown-height) + 1px),
    calc(var(--dialogue-crown-width) - .414px) 1px, 20.414px 1px, 1px 20.414px
  );
  background: linear-gradient(115deg, #b8a079, rgba(184,166,130,.38) 29%, rgba(161,181,191,.25) 60%, #a18a67);
}
.dialogue-shell::after {
  content: ""; position: absolute; z-index: 1; left: 27px; bottom: 5px;
  width: clamp(68px, 12vw, 150px); height: 1px;
  background: linear-gradient(90deg, rgba(208,179,124,.58), rgba(208,179,124,.06));
  pointer-events: none;
}
.dialogue-box {
  display: block; position: absolute; z-index: 1; inset: calc(-1 * var(--dialogue-crown-height)) 0 0;
  width: 100%; height: calc(100% + var(--dialogue-crown-height)); min-height: 0; padding: 0;
  border: 1px solid transparent; border-radius: 0; pointer-events: auto;
  background: transparent; box-shadow: none; backdrop-filter: none; clip-path: var(--frame-shape);
}
.dialogue-box::before, .dialogue-box::after { display: none; }
.dialogue-box:focus-visible { outline: none; }
.dialogue-shell:has(.dialogue-box:focus-visible) .dialogue-frame::after { background: #e6ce9d; }
.speaker-row {
  --speaker-accent: inherit; position: absolute; z-index: 2; left: 0; top: calc(-1 * var(--dialogue-crown-height)); bottom: auto;
  width: var(--dialogue-crown-width); height: var(--dialogue-crown-height); min-height: 0; max-width: none;
  transform: translateY(var(--dialogue-name-offset));
  align-items: center; margin: 0; padding: 0 12px 0 calc(var(--dialogue-pad-side) + 12px); gap: 17px; flex-wrap: nowrap;
  border: 0; background: none; box-shadow: none; backdrop-filter: none;
  white-space: nowrap; text-shadow: 0 2px 7px rgba(0,0,0,.8);
}
.speaker-row .nameplate-emblem { left: calc(var(--dialogue-pad-side) + 1px); width: 64px; height: 64px; }
.speaker-row .speaker-role-ja { align-self: center; padding-top: .5em; }
.speaker-row strong { font-family: var(--font-story); font-size: clamp(34px, 2.8vw, 44px); font-weight: 500; letter-spacing: .08em; }
.speaker-role-ja { align-self: baseline; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; font-family: var(--font-story); font-size: 12px; font-weight: 500; line-height: 1.5; }
.dialogue-box p {
  position: absolute; inset: calc(var(--dialogue-crown-height) + var(--dialogue-pad-top)) var(--dialogue-text-pad-side) var(--dialogue-pad-bottom);
  min-height: 0; max-height: none; max-width: none;
  overflow-y: auto; margin: 0; padding: 0; text-align: left;
  color: #f0eddf; font-family: var(--font-dialogue); font-size: var(--dialogue-text-size);
  font-weight: 500; line-height: var(--dialogue-leading); letter-spacing: .025em;
  white-space: pre-wrap; line-break: strict; overflow-wrap: anywhere; text-wrap: wrap;
  scrollbar-width: thin; scrollbar-color: #8e998b transparent;
}
.dialogue-layer.is-narration .nameplate-emblem { opacity: .45; }
.dialogue-layer.is-narration .dialogue-box p { font-family: var(--font-story); font-weight: 500; }
.advance-mark { right: 20px; bottom: 7px; color: #a3997f; opacity: .35; transition: opacity .25s; }
.advance-mark .ui-icon { width: 30px; height: 30px; stroke-width: 1.15; }
.dialogue-box.is-text-complete .advance-mark { opacity: 1; }
.dialogue-box.is-text-complete .advance-mark .ui-icon { animation: reading-diamond 2.6s ease-in-out infinite; }
@keyframes reading-diamond { 0%,100% { transform: translateY(0); } 50% { transform: translateY(3px); } }

.dialogue-log-entry { padding: 25px 16px; margin: 0; grid-template-columns: 155px minmax(0,1fr); gap: 26px; border: 0; border-bottom: 1px solid rgba(174,169,151,.12); background: transparent; }
.dialogue-log-entry .nameplate { --speaker-accent: inherit; align-self: start; padding: 1px 0 0 6px; min-height: 36px; }
.dialogue-log-entry .nameplate-emblem { width: 35px; height: 35px; opacity: .72; }
.dialogue-log-entry .nameplate-emblem::before { inset: 4px; }
.dialogue-log-entry b { color: #e9e4d4; font-family: var(--font-story); font-weight: 500; font-size: 17px; line-height: 1.8; letter-spacing: .03em; }
.dialogue-log-entry p { max-width: 72ch; color: #dadccc; font-family: var(--font-dialogue); font-weight: 500; font-size: var(--reader-size); line-height: 1.85; letter-spacing: .02em; }
.dialogue-log-entry p, .duel-fixed-rebuttal blockquote, .duel-exchange-line p, .deduction-feedback { white-space: pre-line; }
.dialogue-log-entry.is-narration p { font-family: var(--font-story); font-weight: 500; }
.dialogue-log-entry.is-narration .nameplate-emblem { opacity: .35; }
.profile-cutin-copy p { font-family: var(--font-dialogue); font-size: var(--reader-size); font-weight: 500; line-height: 1.85; letter-spacing: .025em; }
.evidence-grid { grid-template-columns: 1fr; }
.evidence-card { min-height: 0; padding: 24px; border-color: rgba(194,180,150,.18); background: rgba(16,28,33,.48); }
.evidence-card h3 { margin: 12px 0 10px; font-family: var(--font-story); font-weight: 500; font-size: 21px; }
.evidence-card p, .case-insight-card p { font-family: var(--font-dialogue); font-weight: 500; font-size: var(--reader-size); line-height: 1.8; letter-spacing: .015em; }
.panel-header { align-items: center; }
.display-settings-heading { margin: 29px 0 4px; }
.display-setting { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 0; border-top: 1px solid rgba(232,224,205,.12); }
.display-setting label { display: grid; gap: 6px; }
.display-setting b { color: #dedfd6; font-family: var(--font-story); font-size: 16px; font-weight: 500; }
.display-setting small { font-size: 11px; color: #9ca9a2; letter-spacing: .015em; }
.display-setting select { min-width: 150px; max-width: 50%; padding: 11px 12px; border: 1px solid #746f5d; border-radius: 0; color: #efead8; background: #172427; font-family: var(--font-story); font-size: 14px; color-scheme: dark; }

/* The active argument is the hierarchy. No stage ribbon, counters, or repeated instructions. */
.deduction-header { height: 90px; padding: 0 max(3vw, 22px); border-color: var(--ui-hairline); }
.deduction-header h2 { font-family: var(--font-story); font-size: clamp(24px, 2.15vw, 33px); font-weight: 500; letter-spacing: .08em; }
.deduction-header > div:first-child { min-width: 0; }
.overlay-header-actions { gap: 9px; }
.deduction-body, .deduction-body.is-late-stage {
  grid-template-columns: minmax(0, 1fr) minmax(235px, 28%); gap: 28px;
  width: min(1360px, 94vw); height: calc(100vh - 90px); height: calc(100dvh - 90px);
  padding: 30px 0; align-items: center;
}
.deduction-body .question-card { grid-column: 1; min-width: 0; max-height: calc(100dvh - 150px); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #a2977d transparent; }
.deduction-body .clue-rail { grid-column: 2; min-width: 0; max-height: calc(100dvh - 150px); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #7d887f transparent; }
.question-card { padding: clamp(27px, 3vw, 42px); border-color: var(--ui-hairline); background: linear-gradient(135deg, rgba(15,29,33,.98), rgba(8,18,25,.96)); box-shadow: 0 28px 70px rgba(0,0,0,.2); }
.question-card::before, .question-card::after { width: 16px; height: 16px; border-color: #a29371; border-width: 1px; }
.question-card h3 { margin: 0 0 29px; font-family: var(--font-story); font-size: clamp(24px, 2.3vw, 33px); font-weight: 500; line-height: 1.65; letter-spacing: .035em; color: #ebe5d5; }
.answer-list, .claim-list, .evidence-bullet-list { gap: 10px; }
.answer-button, .claim-button, .evidence-bullet {
  min-height: 65px; padding: 15px 19px; gap: 17px; border: 1px solid rgba(187,184,158,.19); border-radius: 1px;
  color: #dedfd1; background: rgba(20,35,40,.44); box-shadow: none;
  transition: border-color .18s, background-color .18s, color .18s;
}
.answer-button::after, .claim-button::after { display: none; }
.answer-button .choice-label, .claim-button .choice-label,
.evidence-bullet .choice-label, .evidence-bullet.is-long .choice-label, .evidence-bullet.is-very-long .choice-label {
  font-family: var(--font-dialogue); font-size: var(--reader-size); line-height: 1.7; font-weight: 500; letter-spacing: .02em;
}
.answer-button.is-suspect-answer .choice-label { font-family: var(--font-story); font-size: 21px; font-weight: 500; letter-spacing: .055em; }
.choice-key, .claim-button .choice-key, .evidence-bullet .choice-key {
  flex-basis: 27px; width: 27px; height: 27px; border: 0; border-right: 1px solid rgba(203,193,166,.27);
  color: #a99a79; background: transparent; font-family: var(--font-display); font-size: 13px; font-weight: 400;
}
.answer-button:hover, .claim-button:hover, .evidence-bullet:hover { transform: none; border-color: #b3a281; background: rgba(106,94,67,.14); color: #f3ead6; box-shadow: none; }
.answer-button.is-correct, .evidence-bullet.is-loaded { border-color: #c6b087; color: #f0e9d3; background: rgba(133,114,76,.16); box-shadow: none; }
.answer-button.is-correct .choice-key { color: #edd5a0; background: transparent; border-color: rgba(237,213,160,.45); }
.answer-button.is-eliminated, .claim-button.is-eliminated, .evidence-bullet.is-eliminated { color: #9a9390; opacity: .55; border-color: rgba(155,111,109,.25); box-shadow: none; }
.deduction-feedback { min-height: 0; margin: 21px 0 0; color: #b2bdb3; font-family: var(--font-dialogue); font-size: var(--reader-size); font-weight: 500; line-height: 1.8; letter-spacing: .015em; }
.deduction-feedback:empty { display: none; }
.deduction-feedback.is-correct, .deduction-feedback.is-countered { padding: 19px 0 0; border-top: 1px solid #7d7055; color: #e1d5b2; font-family: var(--font-dialogue); font-size: var(--reader-size); font-weight: 500; line-height: 1.85; letter-spacing: .015em; }
.deduction-feedback.is-error { padding: 13px 16px; border: 1px solid rgba(187,124,128,.25); color: #e2babb; background: rgba(105,55,65,.16); }
.question-advance, .duel-advance {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; width: 100%; min-height: 53px; padding: 12px 17px; margin-top: 22px;
  border: 1px solid #a39370; border-radius: 0; color: #eaddbc; background: rgba(151,128,79,.1);
  font-family: var(--font-story); font-size: 17px; font-weight: 500; letter-spacing: .1em; cursor: pointer;
  transition: background-color .2s, border-color .2s;
  box-shadow: 0 5px 14px rgba(0,0,0,.2), inset 0 1px rgba(229,215,183,.04);
  text-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.question-advance .ui-icon, .duel-advance .ui-icon { width: 27px; height: 27px; stroke-width: 1.1; transition: transform .2s; }
.question-advance:hover, .duel-advance:hover { background: rgba(180,154,99,.2); border-color: #d0ba8e; }
.question-advance:hover .ui-icon, .duel-advance:hover .ui-icon { transform: translateX(3px); }
.clue-chip { padding: 19px 21px; border: 0; border-top: 1px solid var(--ui-hairline); border-radius: 0; background: rgba(16,28,31,.35); box-shadow: none; }
.clue-chip span { font-family: var(--font-story); font-size: 13px; color: #bbae91; letter-spacing: .055em; }
.clue-chip b { margin-top: 10px; font-family: var(--font-dialogue); font-size: var(--reader-size); font-weight: 500; line-height: 1.75; color: #c4ccbf; }

/* Pressure appears as a fractured ornament, without adding another meter. */
.deduction-body.is-interrogation { grid-template-columns: minmax(0, 1fr); }
.deduction-body.is-interrogation .interrogation-stage { grid-template-columns: minmax(225px, .58fr) minmax(0, 1.5fr); }
.interrogation-stage { --speaker-accent: #967b74; gap: 30px; height: min(820px, calc(100dvh - 150px)); max-height: calc(100dvh - 150px); }
.duel-suspect-panel { --pressure: 0; border: 0; background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--speaker-accent) 20%, transparent), transparent 70%), linear-gradient(0deg, rgba(8,16,21,.85), transparent 70%); box-shadow: none; }
.duel-suspect-panel::before { content: ""; position: absolute; inset: 0; opacity: var(--pressure); background: linear-gradient(0deg, rgba(100,40,49,.32), transparent 70%); transition: opacity .55s; pointer-events: none; }
.duel-suspect-panel::after { display: none; }
.duel-suspect-panel img { bottom: 58px; width: 117%; height: calc(100% - 50px); object-position: center bottom; filter: drop-shadow(0 18px 27px rgba(0,0,0,.5)); }
.duel-suspect-panel h3 { bottom: 43px; font-family: var(--font-story); font-size: 29px; font-weight: 500; letter-spacing: .12em; color: #ece6d8; }
.duel-suspect-panel p { bottom: 19px; font-family: var(--font-story); font-size: 12px; font-weight: 500; letter-spacing: .065em; color: #b4b3a5; }
.duel-sigil { position: absolute; inset: 16% 5% 23%; transform: rotate(45deg); opacity: .62; pointer-events: none; }
.duel-sigil i { position: absolute; inset: 0; border: 1px solid color-mix(in srgb, var(--speaker-accent) 45%, transparent); transition: transform .8s cubic-bezier(.2,.7,.2,1), opacity .8s; }
.duel-sigil i:nth-child(1) { clip-path: polygon(0 0,100% 0,0 100%); }
.duel-sigil i:nth-child(2) { clip-path: polygon(100% 0,100% 100%,0 100%); }
.duel-sigil i:nth-child(3) { inset: 9%; border-color: rgba(193,181,150,.16); }
.has-crack .duel-sigil i:nth-child(1) { transform: translate(-7px,-7px); }
.has-crack .duel-sigil i:nth-child(2) { transform: translate(7px,7px); }
.is-cornered .duel-sigil i:nth-child(1) { transform: translate(-19px,-19px) rotate(-4deg); opacity: .35; }
.is-cornered .duel-sigil i:nth-child(2) { transform: translate(19px,19px) rotate(4deg); opacity: .35; }
.is-cornered .duel-sigil i:nth-child(3) { transform: scale(.94); opacity: .25; }
.duel-card { min-width: 0; overflow-y: auto; overflow-x: hidden; border: 1px solid var(--ui-hairline); background: linear-gradient(135deg, rgba(14,27,32,.98), rgba(8,17,24,.97)); box-shadow: 0 24px 70px rgba(0,0,0,.22); scrollbar-width: thin; scrollbar-color: #a79979 transparent; }
.duel-fixed-rebuttal { flex: 0 0 auto; padding: 33px 32px 0; border: 0; background: transparent; box-shadow: none; }
.duel-speaker { --speaker-accent: inherit; min-height: 41px; margin: 0 0 17px 15px; padding: 0 0 0 5px; border: 0; }
.duel-speaker .nameplate-emblem { width: 47px; height: 47px; }
.duel-speaker b { color: #eee8d8; font-family: var(--font-story); font-size: 23px; font-weight: 500; letter-spacing: .08em; }
.duel-fixed-rebuttal blockquote { margin: 0; padding: 12px 0 19px; border: 0; border-bottom: 1px solid rgba(178,166,140,.2); color: #e6e1d3; background: transparent; font-family: var(--font-dialogue); font-weight: 500; font-size: var(--reader-size); line-height: 1.85; letter-spacing: .02em; }
.duel-card h3 { margin: 21px 0 0; color: #dbd4bd; font-family: var(--font-story); font-size: clamp(20px, 1.7vw, 26px); font-weight: 500; line-height: 1.7; letter-spacing: .035em; }
.duel-scroll-area { flex: 0 0 auto; padding: 22px 32px 30px; overflow: visible; }
.duel-card.is-evidence-view .claim-list { display: none; }
.evidence-bullet-panel { margin: 0; padding: 0; border: 0; }
.evidence-bullet-list { grid-template-columns: 1fr; }
.argument-target { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; margin-bottom: 21px; border: 1px solid rgba(175,147,144,.2); background: rgba(92,64,70,.12); }
.argument-target .ui-icon { flex-basis: 18px; width: 18px; height: 18px; margin-top: 6px; color: #ad9691; }
.argument-target p { margin: 0; color: #cfc8bd; font-family: var(--font-dialogue); font-size: var(--reader-size); font-weight: 500; line-height: 1.75; }
.duel-exchange { flex: 1 0 auto; min-height: 100%; padding: 28px 30px; overflow: visible; background: transparent; }
.duel-exchange::after { display: none; }
.duel-exchange-list { flex: 1 0 auto; padding: 0 0 8px; gap: 28px; overflow: visible; }
.duel-exchange-line, .duel-exchange-line.is-detective, .duel-exchange-line.is-culprit { width: 95%; padding: 20px 22px; border: 1px solid rgba(184,177,151,.17); background: rgba(22,37,40,.4); box-shadow: none; }
.duel-exchange-line.is-culprit { margin-top: 0; background: rgba(61,43,48,.24); }
.duel-exchange-line header.nameplate { --speaker-accent: inherit; flex-direction: row; gap: 13px; min-height: 39px; padding-left: 4px; }
.duel-exchange-line .nameplate-emblem { width: 40px; height: 40px; }
.duel-exchange-line header b { color: #eae5d7; font-family: var(--font-story); font-size: 21px; font-weight: 500; letter-spacing: .06em; }
.duel-exchange-line header small { font-family: var(--font-story); font-size: 12px; color: #b8b5a8; }
.duel-exchange-line p { margin-top: 14px; font-family: var(--font-dialogue); font-size: var(--reader-size); font-weight: 500; line-height: 1.85; letter-spacing: .02em; }
.duel-exchange .duel-advance { margin-top: 19px; }

/* Wordless cut-in: a shutter, offset rings, a portrait, and one decisive sweep. */
.deduction-cutin { --cue-accent: #91a1a0; --cue-duration: 1450ms; --cue-direction: 1; position: fixed; inset: 0; z-index: 88; overflow: hidden; isolation: isolate; }
.cutin-scrim { position: absolute; inset: 0; background: rgba(3,8,14,.82); animation: cue-scrim var(--cue-duration) linear both; }
.cutin-stage { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.cutin-band { position: absolute; z-index: 1; inset: 21% -8% 20%; border-block: 1px solid color-mix(in srgb, var(--cue-accent) 65%, #d1c09b); background: repeating-linear-gradient(118deg, transparent 0 100px, rgba(238,223,192,.025) 101px 102px), linear-gradient(115deg, #17272e, #0c1822 60%, #1c2e32); box-shadow: 0 30px 90px #05090f; transform: skewY(-7deg); animation: cue-shutter var(--cue-duration) cubic-bezier(.18,.78,.22,1) both; }
.cutin-band::before { content: ""; position: absolute; inset: 10px 0; border-block: 1px solid rgba(200,184,151,.1); }
.cutin-band::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, color-mix(in srgb, var(--cue-accent) 22%, transparent), transparent 60%); }
.cutin-portrait-wrap { position: absolute; z-index: 4; left: 50%; bottom: 0; width: min(730px, 66vw); height: 100%; transform: translateX(-50%); mask-image: linear-gradient(#000 0 86%, transparent 100%); }
.cutin-portrait-wrap img { position: absolute; left: 0; bottom: -50%; width: 100%; height: 150%; object-fit: contain; object-position: center; filter: drop-shadow(0 12px 18px rgba(0,0,0,.7)); animation: cue-portrait var(--cue-duration) cubic-bezier(.16,.72,.2,1) both; }
.cutin-portrait-halo { position: absolute; inset: 2% -10% 0; background: radial-gradient(ellipse at 50% 45%, color-mix(in srgb, var(--cue-accent) 37%, transparent), transparent 65%); animation: cue-halo var(--cue-duration) ease both; }
.cutin-geometry { position: absolute; z-index: 2; top: 50%; left: 50%; width: min(57vw, 600px); aspect-ratio: 1; transform: translate(-50%,-50%); }
.cutin-geometry i { position: absolute; inset: 0; border: 1px solid color-mix(in srgb, var(--cue-accent) 60%, #c0ad85); animation: cue-ring var(--cue-duration) cubic-bezier(.18,.78,.2,1) both; }
.cutin-geometry i:nth-child(2) { inset: 8%; border-color: rgba(226,205,162,.36); animation-name: cue-inner-ring; }
.cutin-geometry i:nth-child(3) { inset: -7%; border-width: 1px; border-color: rgba(185,178,157,.12); clip-path: polygon(0 0,35% 0,35% 8%,8% 8%,8% 35%,0 35%,0 0,100% 100%,65% 100%,65% 92%,92% 92%,92% 65%,100% 65%,100% 100%); }
.cutin-blade { position: absolute; z-index: 5; left: -10%; top: 50%; width: 120%; height: 1px; background: linear-gradient(90deg, transparent, #ebd8b0 36%, #f1e9cd 50%, transparent 87%); box-shadow: 0 0 10px color-mix(in srgb, var(--cue-accent) 70%, transparent); transform: rotate(-7deg); animation: cue-blade var(--cue-duration) cubic-bezier(.16,.8,.2,1) both; }
.cutin-streaks { position: absolute; z-index: 3; inset: 0; }
.cutin-streaks i { position: absolute; top: 28%; left: -20%; width: 74%; height: 1px; transform: rotate(-7deg); background: linear-gradient(90deg, transparent, rgba(212,193,153,.45), transparent); animation: cue-streak var(--cue-duration) ease-out both; }
.cutin-streaks i:nth-child(2) { top: 72%; left: 48%; width: 65%; animation-direction: reverse; opacity: .7; }
.cutin-streaks i:nth-child(3) { top: 77%; left: 32%; width: 52%; opacity: .35; }
.cutin-dust { position: absolute; z-index: 5; inset: 0; }
.cutin-dust i { position: absolute; left: 30%; top: 40%; width: 3px; height: 3px; background: #ccb991; transform: rotate(45deg); animation: cue-dust var(--cue-duration) ease-out both; }
.cutin-dust i:nth-child(2) { left: 69%; top: 31%; --dust-x: 22px; --dust-y: -25px; width: 2px; height: 2px; }
.cutin-dust i:nth-child(3) { left: 73%; top: 68%; --dust-x: 32px; --dust-y: 19px; }
.cutin-dust i:nth-child(4) { left: 26%; top: 72%; --dust-x: -27px; --dust-y: 28px; width: 2px; height: 2px; }
.cutin-dust i:nth-child(5) { left: 59%; top: 21%; --dust-x: 11px; --dust-y: -30px; width: 2px; height: 2px; }
.cutin-dust i:nth-child(6) { left: 36%; top: 24%; --dust-x: -20px; --dust-y: -22px; width: 2px; height: 2px; }
.cutin-skip { position: absolute; z-index: 8; right: max(28px, 4vw); bottom: 26px; color: #c9b891; border-color: rgba(211,194,158,.2); background: rgba(9,17,23,.64); opacity: .65; }
.cutin-skip:hover, .cutin-skip:focus-visible { opacity: 1; }
.is-rebuttal { --cue-direction: -1; }
.is-rebuttal .cutin-band { background: repeating-linear-gradient(65deg, transparent 0 100px, rgba(229,189,196,.024) 101px 102px), linear-gradient(65deg, #111924, #2c202c 68%, #1a1c29); transform: skewY(7deg); }
.is-rebuttal .cutin-portrait-wrap { left: 54%; }
.is-rebuttal .cutin-geometry { left: 54%; }
.is-rebuttal .cutin-blade { transform: rotate(7deg); }
.is-rebuttal .cutin-streaks { transform: scaleX(-1); }
.is-finale .cutin-band { background: linear-gradient(115deg, #202f2d, #18262c 60%, #2c312c); border-color: #cfbc91; transform: skewY(0); }
.is-finale .cutin-geometry i { border-color: rgba(231,207,151,.72); }
.is-finale .cutin-geometry i:nth-child(2) { border-color: rgba(227,204,155,.48); }
.is-finale .cutin-blade { transform: rotate(0); }
.has-no-portrait .cutin-portrait-wrap { display: none; }
.is-subtle .cutin-stage *, .is-subtle .cutin-scrim { animation: none; }
.is-subtle .cutin-scrim { background: rgba(3,8,14,.65); }
.is-subtle .cutin-streaks, .is-subtle .cutin-blade, .is-subtle .cutin-dust { display: none; }
.is-subtle .cutin-band { clip-path: none; }
.is-subtle .cutin-geometry i { transform: rotate(45deg); opacity: .45; }
.is-subtle .cutin-geometry i:nth-child(2) { transform: rotate(45deg); }
@keyframes cue-scrim { 0% { opacity: 0; } 12%,83% { opacity: 1; } 100% { opacity: 0; } }
@keyframes cue-shutter { 0% { clip-path: inset(49.8% 0); opacity: .3; } 16%,83% { clip-path: inset(0); opacity: 1; } 100% { clip-path: inset(49.8% 0); opacity: 0; } }
@keyframes cue-portrait { 0%,5% { opacity: 0; transform: translateX(calc(-100px * var(--cue-direction))) scale(1.035); } 24% { opacity: 1; transform: translateX(calc(5px * var(--cue-direction))) scale(1.01); } 76% { opacity: 1; transform: translateX(0) scale(1); } 100% { opacity: 0; transform: translateX(calc(35px * var(--cue-direction))) scale(1); } }
@keyframes cue-halo { 0%,5% { opacity: 0; } 28%,76% { opacity: 1; } 100% { opacity: 0; } }
@keyframes cue-ring { 0% { opacity: 0; transform: rotate(27deg) scale(.82); } 28% { opacity: .8; transform: rotate(43deg) scale(1); } 77% { opacity: .6; transform: rotate(45deg) scale(1.01); } 100% { opacity: 0; transform: rotate(47deg) scale(1.06); } }
@keyframes cue-inner-ring { 0% { opacity: 0; transform: rotate(63deg) scale(.86); } 32% { opacity: .7; transform: rotate(47deg) scale(1); } 78% { opacity: .5; transform: rotate(45deg) scale(1); } 100% { opacity: 0; transform: rotate(43deg) scale(.96); } }
@keyframes cue-blade { 0%,6% { opacity: 0; clip-path: inset(0 100% 0 0); } 12% { opacity: .9; clip-path: inset(0 0 0 0); } 27%,100% { opacity: 0; clip-path: inset(0 0 0 100%); } }
@keyframes cue-streak { 0% { opacity: 0; translate: -70px 0; } 20% { opacity: .8; } 66% { opacity: .35; translate: 75px 0; } 100% { opacity: 0; translate: 160px 0; } }
@keyframes cue-dust { 0%,15% { opacity: 0; translate: 0 0; } 31% { opacity: .8; } 83%,100% { opacity: 0; translate: var(--dust-x, -35px) var(--dust-y, -18px); } }

@media (max-width: 1050px) {
  .dialogue-shell { --dialogue-pad-top: 38px; }
  .deduction-body, .deduction-body.is-late-stage { grid-template-columns: minmax(0, 1fr) minmax(205px, 27%); gap: 18px; }
  .deduction-body.is-interrogation .interrogation-stage { grid-template-columns: minmax(195px, .5fr) minmax(0,1.5fr); gap: 20px; }
  .duel-fixed-rebuttal { padding: 28px 25px 0; }
  .duel-scroll-area { padding: 20px 25px 26px; }
  .duel-exchange { padding: 25px; }
  .case-id { min-width: 240px; }
  .case-progress { padding-inline: 17px; }
}
@media (max-width: 760px) {
  .case-header > .quiet-icon-button { width: 39px; height: 42px; margin-right: 1px; padding: 8px; }
  .case-header .case-id { min-width: 0; }
  .case-header .case-progress { display: none; }
  .objective-stack { width: min(330px, calc(100vw - 24px)); }
  .dialogue-shell { --dialogue-pad-side: 30px; --dialogue-text-pad-side: 46px; --dialogue-crown-width: min(340px, calc(100% - 70px)); width: calc(100% - 24px); bottom: max(12px, env(safe-area-inset-bottom)); }
  .dialogue-actions { top: max(5px, calc(4vh - 26px)); right: 12px; }
  .dialogue-actions .quiet-icon-button { width: 52px; height: 52px; padding: 9px; }
  .dialogue-actions .quiet-icon-button .ui-icon { width: 32px; height: 32px; }
  .speaker-row { gap: 13px; }
  .speaker-row .nameplate-emblem { width: 56px; height: 56px; }
  .speaker-row strong { font-size: 32px; }
  .speaker-role-ja { font-size: 10px; letter-spacing: .035em; }
  .advance-mark { right: 13px; bottom: 5px; }
  .advance-mark .ui-icon { width: 27px; height: 27px; }
  .dialogue-log-entry { grid-template-columns: 1fr; gap: 9px; padding: 19px 10px; }
  .dialogue-log-entry .nameplate { margin-left: 7px; }
  .display-setting { gap: 12px; }
  .display-setting select { min-width: 125px; font-size: 13px; }
  .display-setting small { font-size: 10px; }
  .deduction-header { height: 78px; padding: 10px 14px; gap: 12px; }
  .deduction-header h2 { font-size: 21px; line-height: 1.4; letter-spacing: .05em; }
  .overlay-header-actions { gap: 2px; }
  .overlay-header-actions .quiet-icon-button { width: 37px; height: 39px; padding: 7px; }
  .deduction-body, .deduction-body.is-late-stage, .deduction-body.is-interrogation { display: block; width: calc(100% - 24px); height: calc(100dvh - 78px); padding: 16px 0 27px; overflow-y: auto; }
  .deduction-body .question-card, .deduction-body .clue-rail { max-height: none; overflow: visible; }
  .question-card { padding: 25px 20px; }
  .question-card h3 { margin-bottom: 23px; font-size: 24px; line-height: 1.65; }
  .answer-button, .claim-button, .evidence-bullet { min-height: 61px; padding: 13px 14px; gap: 13px; }
  .choice-key, .claim-button .choice-key, .evidence-bullet .choice-key { flex-basis: 23px; width: 23px; }
  .clue-rail { margin-top: 23px; }
  .interrogation-stage { display: block; height: auto; max-height: none; }
  .duel-suspect-panel { height: 155px; min-height: 0; margin-bottom: 17px; }
  .duel-suspect-panel img { left: 5%; bottom: 0; width: 45%; height: 180px; transform: none; object-position: center top; }
  .duel-suspect-panel h3 { left: 49%; right: 5px; bottom: 58px; font-size: 26px; }
  .duel-suspect-panel p { left: 49%; right: 5px; bottom: 31px; font-size: 11px; }
  .duel-sigil { inset: 13px 53% 0 13%; }
  .duel-card { height: auto; min-height: 0; overflow: visible; }
  .duel-fixed-rebuttal { padding: 27px 20px 0; }
  .duel-scroll-area { padding: 19px 20px 24px; }
  .duel-exchange { min-height: 0; padding: 24px 16px; }
  .duel-exchange-line, .duel-exchange-line.is-detective, .duel-exchange-line.is-culprit { width: 97%; padding: 17px; }
  .cutin-band { inset: 28% -10% 24%; }
  .cutin-portrait-wrap { width: min(720px, 120vw); }
  .cutin-portrait-wrap img { bottom: -44%; height: 139%; width: 100%; }
  .cutin-geometry { width: 86vw; }
  .cutin-skip { bottom: 20px; right: 20px; }
}
@media (max-height: 650px) and (min-width: 761px) {
  .deduction-body, .deduction-body.is-late-stage, .deduction-body.is-interrogation { align-items: start; overflow-y: auto; padding: 22px 0; }
  .deduction-body .question-card, .deduction-body .clue-rail { max-height: none; overflow: visible; }
  .interrogation-stage { height: auto; max-height: none; align-items: start; }
  .duel-suspect-panel { height: 380px; position: sticky; top: 0; }
  .duel-card { height: auto; overflow: visible; }
  .dialogue-shell { --dialogue-pad-top: 36px; bottom: 12px; }
  .cutin-portrait-wrap { width: min(600px, 55vw); }
  .cutin-geometry { width: 65vh; }
}
@media (max-width: 520px) and (max-aspect-ratio: 3/4) {
  .dialogue-shell { --dialogue-rows: 4; --dialogue-screen-height: 34dvh; }
}
@media (max-height: 450px) {
  .dialogue-shell { --dialogue-rows: 2; --dialogue-screen-height: 30dvh; --dialogue-text-size: 22px; --dialogue-leading: 1.65; --dialogue-pad-top: 26px; --dialogue-pad-bottom: 29px; --dialogue-crown-height: 48px; --dialogue-name-offset: 6px; bottom: 10px; }
  body[data-reading-size="large"] .dialogue-shell { --dialogue-text-size: 25px; }
  .speaker-row strong { font-size: 30px; }
  .speaker-row .nameplate-emblem { width: 50px; height: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  .deduction-cutin *, .deduction-cutin *::before, .deduction-cutin *::after,
  .nameplate *, .advance-mark .ui-icon, .duel-sigil i { animation: none !important; transition: none !important; }
}
