/* Four scanned-paper-like vector borders; decorations stay outside text margins.
   border-image keeps corners/tears intact as a document grows, instead of
   stretching a burn across the writing or clipping content and focus rings. */
:root{
 --paper-1:url('./assets/paper-torn.webp');
 --paper-2:url('./assets/paper-singed.webp');
 --paper-3:url('./assets/paper-clipped.webp');
 --paper-4:url('./assets/paper-fieldnotes.webp');
 --sheet-image:var(--paper-1);
}
.workspace[data-paper-style='1'],.paper-style-1{--sheet-image:var(--paper-1)}
.workspace[data-paper-style='2'],.paper-style-2{--sheet-image:var(--paper-2)}
.workspace[data-paper-style='3'],.paper-style-3{--sheet-image:var(--paper-3)}
.workspace[data-paper-style='4'],.paper-style-4{--sheet-image:var(--paper-4)}
:root body :is(.case-card,.hero-copy,.deduction,.result-panel,.casework,dialog,.briefing,.crime-brief,.inquiry-pane,.inquiry-fieldnotes,.notebook-paper,.evidence-card,.dossier-evidence,.record-reader,.interview-desk,.inquiry-record,.casework-plan,.casework-task,.dossier-intro,.dossier-board,.dossier-report,.accusation-questions,.case-argument,.tutorial-shell,.tutorial-file,.account-card,.team-room-card,.journal-entry,.progress-row){
 background:transparent;border:1px solid transparent;border-radius:0;
 border-image-source:var(--sheet-image);border-image-slice:54 fill;
 border-image-width:14px;border-image-outset:1px;border-image-repeat:stretch;
 box-shadow:1px 3px 5px #33231529;
}
:root body .case-card{border-image-width:18px;border-image-outset:2px;overflow:visible}
:root body .case-card.case-row{border-image-width:13px;border-image-outset:1px;background:transparent;border-left:1px solid transparent}
.case-card::before{top:7px}
.case-card:focus-visible{outline:3px solid #e5b467;outline-offset:4px}
.case-card:hover{transform:none}
.case-card .card-content{position:relative;padding:21px 23px 23px;background:transparent}
.case-card .card-content::before{content:'';position:absolute;top:0;left:23px;right:23px;height:1px;background:#9b694230;pointer-events:none}
.case-card.paper-style-2 .card-content .eyebrow{color:#873d27}
.case-card.paper-style-3 .card-content .eyebrow{color:#4b6673}
.case-card.paper-style-4 .card-content .eyebrow{color:#6f6337}
.card-art{margin:19px 17px 0;height:168px;border:5px solid #fff5dc;border-bottom-width:14px;background:#d6b47c;box-shadow:1px 2px 4px #402c1b38;overflow:hidden}
.card-art.medium,.card-art.hard,.card-art.expert{background:#d6b47c}
.card-art>svg,.row-case-art>svg{filter:none;opacity:1}
.card-badge{top:7px;right:7px;background:#f4e3a6f2;max-width:calc(100% - 106px);font-size:8px;line-height:1.5;text-align:right}
.card-number{background:#fff0cedb;border-color:#ba9361;color:#5e3b24;font-weight:700}
.row-case-art,.row-case-art.medium,.row-case-art.hard,.row-case-art.expert{background:#d6b47c;border:3px solid #fff4d8;border-bottom-width:7px;overflow:hidden}
.row-case-art>svg{width:100%;height:100%;transform:scale(1.2);transform-origin:center}
.paper-style-2 .card-footer{border-top-style:dotted}.paper-style-3 .card-footer{border-top-style:solid}.paper-style-4 .card-footer{border-top-style:dashed}
:root body .hero-copy{padding:35px 32px;border-image-width:17px;box-shadow:3px 0 6px #241a1233}
:root body .inquiry-pane{--sheet-image:var(--paper-1);border-image-width:15px}
:root body .evidence-card:nth-child(4n+1),:root body .dossier-evidence:nth-child(4n+1),:root body .inquiry-record:nth-child(4n+1),:root body .casework-task:nth-child(4n+1){--sheet-image:var(--paper-1)}
:root body .evidence-card:nth-child(4n+2),:root body .dossier-evidence:nth-child(4n+2),:root body .inquiry-record:nth-child(4n+2),:root body .casework-task:nth-child(4n+2){--sheet-image:var(--paper-2)}
:root body .evidence-card:nth-child(4n+3),:root body .dossier-evidence:nth-child(4n+3),:root body .inquiry-record:nth-child(4n+3),:root body .casework-task:nth-child(4n+3){--sheet-image:var(--paper-3)}
:root body .evidence-card:nth-child(4n+4),:root body .dossier-evidence:nth-child(4n+4),:root body .inquiry-record:nth-child(4n+4),:root body .casework-task:nth-child(4n+4){--sheet-image:var(--paper-4)}
:root body .record-reader,:root body .interview-desk{--sheet-image:var(--paper-1);border-image-width:12px}
:root body .inquiry-fieldnotes,:root body .notebook-paper{--sheet-image:var(--paper-4);border-image-width:13px}
/* Cheap opaque backing under writing while the border image is being decoded.
   Clip to the content box so the worn transparent edges keep their shape. */
:root body :is(.inquiry-pane,.briefing,.crime-brief,.casework,.dossier-board,.dossier-report,.record-reader,.interview-desk,.notebook-paper,.inquiry-fieldnotes){background-color:#f5ecd5;background-clip:content-box}
.evidence-head,.dossier-evidence summary{background:#cbb58529;border-radius:0;border-bottom:1px dashed #aa80583d}
.evidence-body{padding-top:9px}.document-stamp{border-top-style:dashed}
.evidence-select,.dossier-source-actions{background:#cbb08a25;border-top:1px solid #ac815342;border-radius:0}
.evidence-card.chosen,.dossier-evidence.chosen{outline:2px solid #8b392c;outline-offset:1px}
.dossier-source-body{background:transparent}
.conversation-turn{background:#fff6e1!important;border-left:3px solid #9b5c40!important;box-shadow:inset 0 -1px #c1a1762e}
.question-prompt{background:linear-gradient(100deg,#e7d5b3,#f3e4c8);border-radius:0;border-bottom-style:dashed}
.evidence-envelope{background:linear-gradient(100deg,#e4d0aa,#f0dfbb);border-radius:0;box-shadow:1px 2px 4px #5a351d24}
.evidence-envelope::after{content:'';position:absolute;inset:7px;pointer-events:none;border:1px dashed #98714840}
.case-argument,.accusation-questions{padding:22px}.inquiry-record{padding:24px 22px}
.inquiry-record.pinned::before{top:8px;right:12px}
.task-heading>span,.finding-number{box-shadow:1px 2px 1px #4f2c1d1c}
@media(max-width:600px){
 :root body .case-card{border-image-width:16px}
 .case-card .card-content{padding:20px 23px 24px}.card-art{height:181px;margin:18px 16px 0}
 .card-badge{font-size:8px;max-width:calc(100% - 100px)}
 :root body .hero-copy{padding:25px 22px 24px;border-image-width:13px}
 :root body .case-card.case-row{padding:13px 16px;border-image-width:11px;gap:12px}
 .row-case-art{flex-basis:65px;width:65px;height:70px}
 :root body .inquiry-pane{padding:21px 17px;border-image-width:13px}
 :root body .interview-desk{padding:17px 14px;border-image-width:11px}
 .case-argument,.accusation-questions{padding:20px 16px}.inquiry-record{padding:23px 18px}
}
@media print{
 :root body :is(.case-card,.hero-copy,.deduction,.result-panel,.casework,dialog,.briefing,.crime-brief,.inquiry-pane,.inquiry-fieldnotes,.notebook-paper,.evidence-card,.dossier-evidence,.record-reader,.interview-desk,.inquiry-record,.casework-plan,.casework-task,.dossier-intro,.dossier-board,.dossier-report,.accusation-questions,.case-argument,.tutorial-shell,.tutorial-file,.account-card,.team-room-card,.journal-entry,.progress-row){background:#fff!important;border-image:none!important;box-shadow:none!important;border:1px solid #aaa}
}
