/* Source-document treatments. All words remain in the authored, selectable HTML.
   Decoration occupies paper margins, including E-04's missing lower-right corner. */
body .vault-record:where([class*="vault-record--"]) {
    --document-ink:#26251f;
    --document-paper:#f4ead2;
    --document-accent:#2e4b43;
    --document-rule:rgba(67,64,49,.28);
    background:
        linear-gradient(105deg,rgba(255,255,255,.23),transparent 45%,rgba(99,78,40,.035)),
        repeating-linear-gradient(0deg,transparent 0 3px,rgba(94,76,38,.018) 3px 4px),
        var(--document-paper);
    border:1px solid #c9bea5;
    border-top:6px solid var(--document-accent);
    box-shadow:0 2px 0 #c9bda4,0 4px 0 #eee3cb,0 12px 26px rgba(0,0,0,.26);
    box-sizing:border-box;
    color:var(--document-ink);
    font:1rem/1.7 Arial,Helvetica,sans-serif;
    isolation:isolate;
    letter-spacing:normal;
    margin:0 auto;
    max-width:44rem;
    min-width:0;
    overflow:visible;
    overflow-wrap:break-word;
    padding:clamp(1.2rem,4vw,2.3rem);
    position:relative;
    text-align:left;
    text-transform:none;
    width:100%;
}
body .vault-record:where([class*="vault-record--"]) > :first-child { margin-top:0; }
body .vault-record:where([class*="vault-record--"]) > :last-child { margin-bottom:0; }
body .vault-record:where([class*="vault-record--"]) p {
    color:inherit;
    font:inherit;
    letter-spacing:normal;
    margin:0 0 1rem;
    text-transform:none;
    white-space:pre-line;
}
body .vault-record:where([class*="vault-record--"]) h3,
body .vault-record:where([class*="vault-record--"]) .record-heading {
    color:var(--document-ink);
    font:400 clamp(1.35rem,3vw,1.8rem)/1.23 Georgia,'Times New Roman',serif;
    letter-spacing:-.025em;
    margin:.25rem 0 1.2rem;
}
body .vault-record:where([class*="vault-record--"]) .record-kicker,
body .vault-record:where([class*="vault-record--"]) .record-letterhead {
    color:var(--document-accent);
    font:700 .72rem/1.45 Arial,Helvetica,sans-serif;
    letter-spacing:.11em;
    margin:0 0 .75rem;
    text-transform:uppercase;
}
body .vault-record:where([class*="vault-record--"]) .record-meta {
    border-block:1px solid var(--document-rule);
    color:var(--document-ink);
    display:grid;
    font:.82rem/1.6 Arial,Helvetica,sans-serif;
    gap:.7rem 1.2rem;
    grid-template-columns:repeat(auto-fit,minmax(min(10rem,100%),1fr));
    margin:0 0 1.4rem;
    padding:.85rem 0;
}
body .vault-record:where([class*="vault-record--"]) .record-label {
    color:var(--document-accent);
    font:700 .67rem/1.45 Arial,Helvetica,sans-serif;
    letter-spacing:.08em;
    text-transform:uppercase;
}
body .vault-record:where([class*="vault-record--"]) .record-note,
body .vault-record:where([class*="vault-record--"]) .record-provenance {
    color:#5d594e;
    font:italic .88rem/1.6 Georgia,'Times New Roman',serif;
}
body .vault-record:where([class*="vault-record--"]) table {
    border-collapse:collapse;
    display:table;
    font:.88rem/1.55 Arial,Helvetica,sans-serif;
    margin:1rem 0;
    overflow-wrap:break-word;
    table-layout:fixed;
    white-space:normal;
    width:100%;
}
body .vault-record:where([class*="vault-record--"]) th,
body .vault-record:where([class*="vault-record--"]) td {
    border:1px solid var(--document-rule);
    padding:.7rem .55rem;
    text-align:left;
    vertical-align:top;
}
body .vault-record:where([class*="vault-record--"]) th {
    background:#dfe4d9;
    color:var(--document-accent);
    font:700 .65rem/1.5 Arial,Helvetica,sans-serif;
    letter-spacing:.06em;
    text-transform:uppercase;
}

/* Show the source sheet itself rather than a second cream frame around it. */
body .archive-viewer-paper:has(.vault-record:where([class*="vault-record--"])) {
    background:transparent;
    box-shadow:none;
    max-width:48rem;
    padding:clamp(.2rem,1vw,.75rem);
}
body .archive-viewer-stage:has(.vault-record:where([class*="vault-record--"])) {
    align-items:safe center;
    overflow-x:hidden;
}
body .archive-viewer-stage.image-stage:has(.vault-record:where([class*="vault-record--"])) {
    align-items:center;
    gap:1.4rem;
}
body .archive-viewer-stage.image-stage:not(.zoomed):has(.vault-record:where([class*="vault-record--"])) > img {
    flex-shrink:0;
    max-height:65dvh;
    width:min(100%,64rem);
}
body .story-reveal-body:has(> .vault-record[class*="vault-record--"]) { min-width:0; padding:.3rem .1rem .7rem; }

/* E-04: a genuinely absent corner, with all surviving text above the tear. */
body .vault-record--torn {
    background:none;
    border:0;
    box-shadow:none;
    padding:0;
}
body .vault-record--torn .record-sheet {
    box-sizing:border-box;
    filter:drop-shadow(0 9px 9px rgba(0,0,0,.3));
    isolation:isolate;
    padding:clamp(1.4rem,4vw,2.6rem) clamp(1.4rem,4vw,2.6rem) 7rem;
    position:relative;
}
body .vault-record--torn .record-sheet::before {
    background:
        linear-gradient(76deg,transparent 0 36%,rgba(120,95,50,.075) 36.3%,rgba(255,255,255,.35) 36.6%,transparent 37%),
        linear-gradient(173deg,transparent 0 69%,rgba(120,95,50,.06) 69.3%,rgba(255,255,255,.4) 69.6%,transparent 70%),
        repeating-linear-gradient(0deg,transparent 0 3px,rgba(88,66,32,.025) 3px 4px),
        linear-gradient(100deg,#eadebf,#f4ead2 45%,#eee0bf);
    clip-path:polygon(0 .7%,9% .1%,18% .5%,31% 0,43% .4%,56% .1%,69% .5%,82% .1%,94% .5%,100% 0,
        99.6% 17%,100% 36%,99.5% 55%,100% 73%,100% calc(100% - 103px),
        calc(100% - 19px) calc(100% - 94px),calc(100% - 27px) calc(100% - 77px),
        calc(100% - 46px) calc(100% - 73px),calc(100% - 50px) calc(100% - 58px),
        calc(100% - 69px) calc(100% - 52px),calc(100% - 73px) calc(100% - 36px),
        calc(100% - 91px) calc(100% - 29px),calc(100% - 96px) calc(100% - 13px),
        calc(100% - 117px) 100%,79% 99.5%,63% 100%,46% 99.6%,29% 100%,13% 99.6%,0 100%,.4% 81%,0 60%,.3% 39%,0 19%);
    content:'';
    inset:0;
    pointer-events:none;
    position:absolute;
    z-index:-1;
}
body .vault-record--torn .record-provenance {
    color:#c5bdaf;
    margin-bottom:1rem;
    padding:0 .2rem;
}
body .vault-record--torn .record-letterhead {
    border-bottom:3px double var(--document-accent);
    font-size:.82rem;
    letter-spacing:.12em;
    padding-bottom:.8rem;
}
body .vault-record--torn .record-heading { max-width:26rem; }
body .vault-record--torn .record-date {
    color:#5d594e;
    font:.8rem/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;
    margin-bottom:1.5rem;
}
body .vault-record--torn .record-field {
    border-bottom:1px solid var(--document-rule);
    font:.95rem/1.7 ui-monospace,SFMono-Regular,Consolas,monospace;
    margin-bottom:0;
    padding:.65rem 0;
}
body .vault-record--torn .record-distribution {
    font:700 .7rem/1.55 Arial,Helvetica,sans-serif;
    letter-spacing:.07em;
    margin:1.3rem 0;
    text-transform:uppercase;
}
body .vault-record--torn .record-initials {
    border-left:1px solid rgba(128,77,54,.4);
    color:#655845;
    font:italic .94rem/1.55 Georgia,'Times New Roman',serif;
    margin:1.7rem 0 0 38%;
    padding:.25rem 0 .25rem .8rem;
}

/* Ledger: the masthead is the existing publication title, not new evidence. */
body .vault-record--press {
    --document-paper:#f1eee3;
    --document-accent:#26251f;
    background:
        repeating-linear-gradient(0deg,rgba(68,60,42,.018) 0 1px,transparent 1px 3px),
        linear-gradient(105deg,#e9e5d9,#f1eee3 38%,#ebe7dc);
    border:0;
    box-shadow:0 9px 20px rgba(0,0,0,.25);
    clip-path:polygon(.3% 0,16% .25%,31% 0,48% .15%,63% 0,79% .2%,100% 0,99.6% 17%,100% 36%,99.7% 57%,100% 78%,99.7% 100%,83% 99.7%,66% 100%,49% 99.8%,32% 100%,16% 99.7%,0 100%,.2% 78%,0 58%,.3% 37%,0 17%);
    color:#26251f;
    font:1.05rem/1.65 Georgia,'Times New Roman',serif;
    padding:clamp(1.25rem,4vw,2.2rem);
}
body .vault-record--press::before {
    border-top:2px solid currentColor;
    border-bottom:4px double currentColor;
    color:inherit;
    content:attr(data-publication);
    display:block;
    font:700 clamp(1.7rem,4.2vw,2.8rem)/1.05 Georgia,'Times New Roman',serif;
    letter-spacing:-.06em;
    margin:0 0 1.4rem;
    padding:.7rem 0 .85rem;
    text-align:center;
    text-transform:none;
}
body .vault-record--press .record-headline {
    border-bottom:1px solid var(--document-rule);
    font:700 clamp(1.3rem,3vw,1.9rem)/1.15 Georgia,'Times New Roman',serif;
    letter-spacing:-.025em;
    margin:0 0 1.1rem;
    padding-bottom:1rem;
    text-align:center;
    text-wrap:balance;
}
body .vault-record--press .record-columns {
    column-count:2;
    column-fill:balance;
    column-gap:1.6rem;
    column-rule:1px solid #b5b0a0;
    font:inherit;
    text-align:left;
    white-space:normal;
}
body .vault-record--press .record-columns::first-letter {
    float:left;
    font-size:3.2em;
    line-height:.84;
    margin:.08em .08em 0 0;
}

/* Ruled registers retain real tables and wrap each cell at narrow widths. */
body .vault-record--log {
    background:
        linear-gradient(90deg,transparent 0 13px,rgba(75,98,81,.15) 13px 14px,transparent 14px),
        linear-gradient(110deg,#f6edda,#ece6d3);
    border-left:8px solid #d1c9b4;
}
body .vault-record--log h3 { border-bottom:2px solid var(--document-accent); padding-bottom:.8rem; }
body .vault-record--log td { font:.83rem/1.6 ui-monospace,SFMono-Regular,Consolas,monospace; }
body .vault-record--log tr:nth-child(odd) td { background:rgba(75,98,81,.045); }
body .vault-record--log p:first-child:not(.record-kicker) {
    color:var(--document-accent);
    font:700 .72rem/1.4 Arial,Helvetica,sans-serif;
    letter-spacing:.1em;
    text-transform:uppercase;
}
body .vault-record--log p:nth-child(2):not(.record-note) { font:1.4rem/1.3 Georgia,'Times New Roman',serif; }

/* Clinical and legal records use sober source-specific rules, never fake seals. */
body .vault-record--medical {
    --document-paper:#f0efe5;
    --document-accent:#405665;
    border-top:9px solid var(--document-accent);
}
body .vault-record--medical .record-kicker { border-bottom:1px solid var(--document-accent); padding-bottom:.7rem; }
body .vault-record--medical .record-note { border-top:1px solid var(--document-rule); padding-top:.9rem; }
body .vault-record--official {
    --document-accent:#61433d;
    border:1px solid #ad9b89;
    border-top:7px double var(--document-accent);
}
body .vault-record--official h3 { border-bottom:1px solid var(--document-accent); padding-bottom:1rem; }
body .vault-record--official > p:has(.record-label) { border-bottom:1px solid var(--document-rule); padding-bottom:.9rem; }
body .vault-record--audit { border-left:5px solid #ad9464; border-top:0; }
body .vault-record--audit::before { content:none; }
body .vault-record--audit > p:has(.record-label) { border-top:1px dashed #a99c80; margin-bottom:0; padding:.8rem 0; }
body .vault-record--corporate { border-top:9px solid var(--document-accent); }
body .vault-record--corporate::before {
    background:var(--document-accent);
    content:'';
    display:block;
    height:2px;
    margin:0 0 1.5rem;
    width:3.2rem;
}
body .vault-record--corporate > p { font:1.05rem/1.85 Georgia,'Times New Roman',serif; }
body .vault-record--corporate > p::first-line { font-weight:700; }

/* Narrow thermal-paper confirmation; the original qualification stays visible. */
body .vault-record--receipt {
    --document-paper:#eee9d9;
    background:linear-gradient(90deg,#e1daca,#f4f0e4 12%,#eee9d9 85%,#e2dbcb);
    border:0;
    border-top:2px dashed #777064;
    box-shadow:0 10px 20px rgba(0,0,0,.26);
    font:.95rem/1.85 ui-monospace,SFMono-Regular,Consolas,monospace;
    max-width:25rem;
    padding-bottom:3rem;
}
body .vault-record--receipt::after {
    background:linear-gradient(135deg,transparent 7px,var(--document-paper) 0) 0 0/14px 14px repeat-x;
    bottom:-8px;
    content:'';
    height:14px;
    inset-inline:0;
    pointer-events:none;
    position:absolute;
    transform:rotate(180deg);
}
body .vault-record--transcript { border-top:2px solid var(--document-accent); font:.95rem/1.8 ui-monospace,SFMono-Regular,Consolas,monospace; }
body .vault-record--transcript > p:not(:last-child) { border-bottom:1px solid var(--document-rule); margin:0; padding:.55rem 0; }
body .vault-record--transcript > p:last-child { border-left:2px solid var(--document-accent); font:italic 1.1rem/1.75 Georgia,'Times New Roman',serif; margin-top:1.5rem; padding-left:1rem; }
body .vault-record--photo { --document-paper:#eee9dd; border:0; border-top:1px solid #d5ccba; box-shadow:0 6px 16px rgba(0,0,0,.2); font:.95rem/1.7 Georgia,'Times New Roman',serif; padding:1.2rem 1.5rem; }

@media (max-width:560px) {
    body .vault-record:where([class*="vault-record--"]) { font-size:.96rem; padding:1.2rem; }
    body .vault-record--torn { padding:0; }
    body .vault-record--torn .record-sheet { padding:1.3rem 1.3rem 7rem; }
    body .vault-record--torn .record-initials { margin-left:22%; }
    body .vault-record--press .record-columns { column-count:1; }
    body .vault-record--press::before { font-size:1.8rem; }
    body .vault-record:where([class*="vault-record--"]) table { font-size:.8rem; }
    body .vault-record:where([class*="vault-record--"]) th,body .vault-record:where([class*="vault-record--"]) td { padding:.6rem .35rem; }
    body .vault-record:where([class*="vault-record--"]) th { font-size:.56rem; letter-spacing:.02em; }
    body .vault-record--log td { font-size:.74rem; }
    body .vault-record:where([class*="vault-record--"]) .record-meta { grid-template-columns:1fr; }
    body .vault-record--receipt { padding-bottom:2.5rem; }
}
