:root{color-scheme:light;--ink:#173538;--muted:#4a6464;--teal:#194e50;--line:#cdd7ce;--paper:#faf9f5;--white:#fffefa;--accent:#a07742;--soft:#eaf0e9;font-family:system-ui,-apple-system,"Segoe UI",Arial,sans-serif;color:var(--ink);background:var(--paper);font-size:100%}
*{box-sizing:border-box}body{margin:0;font-size:1.0625rem;line-height:1.5}button,input,select{font:inherit;color:inherit}button{cursor:pointer}button:disabled{opacity:.55;cursor:default}button:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #ae7b34;outline-offset:3px}button:hover:not(:disabled){filter:brightness(.95)}[hidden]{display:none!important}
h1,h2,p,dl,dd{margin:0}h1,h2,.brand,.signature{font-family:Georgia,"Times New Roman",serif;font-weight:400}h1{font-size:clamp(2.45rem,5vw,3.8rem);line-height:1.08;letter-spacing:-.04em}h2{font-size:clamp(1.65rem,3vw,2.25rem);line-height:1.2;letter-spacing:-.025em}h1:focus{outline:none}
.bar{background:#153a3d;color:#fff}.bar-inner,.wrap{width:min(100% - 2.5rem,1060px);margin:auto}.bar-inner{min-height:68px;display:flex;align-items:center;justify-content:space-between;gap:1rem}.brand{display:flex;align-items:center;gap:.7rem;font-size:1.32rem}
button{min-height:44px}.primary,.secondary,.subtle,.back,.bo-link,.modes button{border-radius:8px;padding:.65rem 1rem;font-weight:600;line-height:1.35}.primary{background:var(--teal);border:1px solid var(--teal);color:white}.secondary,.bo-link{background:var(--white);border:1px solid #acbeb3}.subtle,.back{color:var(--teal);background:none;border:0}.bar .subtle{color:#fff;font-size:1rem}.wrap{padding-bottom:3.5rem}
#gate{min-height:calc(100svh - 110px);display:grid;place-items:center}.gate-card{width:min(100%,520px);background:var(--white);border:1px solid var(--line);border-top:4px solid var(--accent);border-radius:12px;padding:clamp(1.6rem,5vw,3rem);box-shadow:0 12px 36px #253f3310}.gate-card h1{font-size:clamp(2.1rem,4.8vw,2.85rem)}.gate-card>p{margin:1rem 0 1.6rem;color:var(--muted)}label{display:block;font-weight:600;font-size:1rem}.password-wrap{display:flex;align-items:center;border:1px solid #91a59b;background:white;border-radius:6px;margin:.4rem 0 1rem}.password-wrap input{width:100%;min-width:0;padding:.8rem;border:0;background:transparent}.gate-card .primary{width:100%}.gate-card .primary span{margin-left:.4rem}#login-error{color:#9a3631;margin-top:.6rem}#login-error:empty{display:none}
.intro{padding:clamp(2rem,4.8vw,3.7rem) 0 2rem;border-bottom:1px solid var(--line)}.intro .letter{max-width:61ch;margin-top:1.15rem}.intro h1{margin-bottom:1rem}.intro p{font-size:clamp(1.13rem,1.6vw,1.3rem);line-height:1.55}.intro .signature{font-size:1.21rem;margin-top:.65rem;color:#53665e;font-style:italic}.notes summary{cursor:pointer;color:var(--teal);font-size:1rem;font-weight:600;padding:.65rem 0}.case{padding:1rem 1.15rem;background:var(--white);border:1px solid var(--line);border-left:3px solid #cfb98a;border-radius:8px}.case h2{font:650 1.12rem/1.4 system-ui,sans-serif;color:var(--teal)}.case dl{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:.7rem 1.2rem;margin:.7rem 0 0}.case-field{grid-column:span 2}.case-field:nth-child(-n+2){grid-column:span 3}.case dt{font-size:.95rem;color:var(--muted)}.case dd{margin:0;font-weight:550;overflow-wrap:anywhere}
.explore{margin-top:1.8rem}.browse-heading,.results-line,.pages,.dialog-head,.dialog-footer,.small-actions{display:flex;align-items:center;justify-content:space-between;gap:.75rem}.bo-link{color:var(--teal);font-size:1rem}.modes{display:inline-flex;gap:3px;padding:4px;border:1px solid var(--line);background:#e9eee7;border-radius:10px;margin:1.15rem 0 1rem}.modes button{color:var(--teal);background:transparent;border:0}.modes button[aria-pressed=true]{background:var(--teal);color:white}
.choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.65rem .85rem}.choice{display:grid;grid-template-columns:1fr auto;align-items:center;text-align:left;border:1px solid var(--line);background:var(--white);border-radius:8px;gap:1rem;padding:.9rem 1.1rem;min-height:76px}.choice strong,.choice small{display:block}.choice strong{font-size:1.17rem;font-weight:630}.choice small,.file-code,.file-info,.hint,.pages span{font-size:1rem;color:var(--muted)}.choice .arrow{color:var(--teal);font-size:1.35rem}.notes{border-top:1px solid var(--line);margin-top:1.8rem;padding-top:.5rem}.notes p{max-width:70ch;margin:.75rem 0;color:var(--muted)}.small-actions{justify-content:flex-start;flex-wrap:wrap;margin-top:.75rem}
#collection{padding-top:1.2rem}.back{padding-left:0;margin-bottom:.8rem}.hint{margin:.75rem 0 1.25rem}.filters{display:flex;gap:1rem;flex-wrap:wrap}.filters label{flex:1 1 240px}.filters select,.filters input{display:block;width:100%;margin-top:.35rem;background:white;border:1px solid #9eb0a6;border-radius:6px;min-height:46px;padding:.5rem .7rem;font-weight:400}.results-line{margin:1.2rem 0 .65rem}.results-line p{color:var(--muted);font-size:1rem}.files{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}.file{overflow:hidden;border-radius:10px;border:1px solid var(--line);background:var(--white);display:flex;flex-direction:column}.cover{width:100%;aspect-ratio:1.9;background:#e4ebe4;display:grid;place-items:center;color:var(--muted);border:0;border-bottom:1px solid var(--line);position:relative;overflow:hidden}.cover img,.review-thumb img{width:100%;height:100%;object-fit:contain;position:absolute;inset:0}.cover[data-kind=video]::after{content:'▶';background:#153a3dd9;border-radius:50%;color:white;width:42px;height:42px;display:grid;place-items:center;position:absolute}.card-body{padding:1rem;display:flex;flex:1;flex-direction:column;gap:.4rem}.card-title{all:unset;display:block;cursor:pointer;overflow-wrap:anywhere;font-weight:650;font-size:1.12rem;line-height:1.35}.file-info{font-variant-numeric:tabular-nums}.file-actions{margin-top:auto;padding-top:.5rem}.file-actions button{width:100%;font-size:1rem}.select-row{display:flex;align-items:center;gap:.55rem;min-height:44px;cursor:pointer}.select-row input{accent-color:var(--teal);width:21px;height:21px}.file.chosen{border-color:var(--teal);box-shadow:inset 0 0 0 1px var(--teal)}.pages{justify-content:center;margin:1.25rem 0;flex-wrap:wrap}.selection-bar{position:sticky;bottom:.65rem;margin:1rem 0;display:flex;align-items:center;justify-content:space-between;gap:.5rem;background:#173b3e;color:white;border-radius:10px;padding:.7rem 1rem;box-shadow:0 5px 24px #173b3e3a}.selection-bar button{background:#fbfaf2;color:var(--ink)}
dialog{width:min(970px,95vw);max-height:94dvh;border:1px solid var(--line);border-radius:12px;padding:0;color:var(--ink);background:var(--white)}dialog[open]{display:flex;flex-direction:column}dialog::backdrop{background:#102d34c9}.dialog-head,.dialog-footer{padding:1rem 1.25rem;flex-shrink:0}.dialog-head h2{font-size:clamp(1.3rem,3vw,1.85rem);overflow-wrap:anywhere}.dialog-footer{border-top:1px solid var(--line);background:var(--paper)}.dialog-footer>div{min-width:0}.dialog-footer strong,.dialog-footer span{display:block;font-size:1rem;overflow-wrap:anywhere}.dialog-footer span{color:var(--muted)}.dialog-footer .primary{flex-shrink:0}.preview-content{position:relative;min-height:110px;height:min(60dvh,650px);overflow:auto;display:grid;place-items:center;background:#e5ebe4;padding:8px}.preview-content img,.preview-content video,.preview-content iframe{display:block;width:100%;height:100%;max-height:100%;object-fit:contain;border:0}.preview-content iframe{background:white}.preview-content p{padding:1rem}
#review-items{overflow:auto;padding:0 1.25rem}.review-row{width:100%;display:flex;align-items:center;gap:1rem;border-top:1px solid var(--line);padding:.8rem 0}.review-thumb{position:relative;flex:0 0 80px;height:60px;overflow:hidden;background:var(--soft);border-radius:4px}.review-row>div:nth-child(2){flex:1;min-width:0;overflow-wrap:anywhere}.review-row small{display:block;font-size:1rem;color:var(--muted)}.review-row button{font-size:1rem}.review-name{display:block}#progress,#toast{position:fixed;z-index:99;bottom:1rem;left:50%;transform:translateX(-50%);background:#163e42;color:white;border-radius:8px;padding:1rem;width:min(92%,480px)}#progress>div{display:flex;justify-content:space-between;gap:.5rem}progress{width:100%;accent-color:#d2bb89}
@media(max-width:750px){.intro{display:block}.case dl{grid-template-columns:minmax(0,1fr)}.case-field,.case-field:nth-child(-n+2){grid-column:auto}.files{grid-template-columns:repeat(2,minmax(0,1fr))}.bar-inner{min-height:58px}.intro{padding:1.7rem 0 1rem}}
@media(max-width:540px){.bar-inner,.wrap{width:calc(100% - 2rem)}.choices,.files{grid-template-columns:1fr}.choices{gap:.55rem}.choice{min-height:70px}.browse-heading{flex-wrap:wrap;align-items:baseline}.bo-link{padding:.45rem .7rem}.modes{display:flex}.modes button{flex:1;padding:.55rem .35rem}.dialog-head,.dialog-footer{padding:.7rem .85rem}.dialog-footer{flex-wrap:wrap}.dialog-footer .primary{width:100%}.preview-content{height:54dvh}.files{gap:.85rem}.review-thumb{flex-basis:45px;height:45px}.review-row{gap:.5rem}.filters{gap:.6rem}.intro p{font-size:1.15rem}}
@media print{body>*{display:none!important}#print-sheet:not([hidden]){display:block!important;color:#111}#print-sheet h1{font-size:24pt}#print-sheet li{font-size:11pt;margin:.3em 0;overflow-wrap:anywhere}}
.doc-pages{display:flex;flex-direction:column;min-height:0;height:100%;width:100%}.doc-controls{display:flex;align-items:center;justify-content:center;gap:.65rem;padding:.3rem 0 .55rem;flex-shrink:0;font-size:1rem}.doc-controls .secondary{min-height:42px;padding:.35rem .7rem}.document-sheet{min-height:0;flex:1;overflow:auto;text-align:center}.document-sheet img{width:min(100%,800px);height:auto;max-height:none;margin:0 auto}

/* Navegação por toque e leitura em telas pequenas. */
@media screen and (max-width: 640px) {
  .bar-inner, .wrap {width:min(100% - 2rem, 34rem)}
  .file {display:grid;grid-template-columns:clamp(78px,24vw,118px) minmax(0,1fr);align-items:center;gap:.85rem;padding:.75rem}
  .file .cover {aspect-ratio:1;min-height:72px;border:0;border-radius:6px}
  .files {grid-template-columns:minmax(0,1fr);gap:.55rem}
  .card-body {min-width:0;padding:0;gap:.3rem}
  .card-title {line-height:1.45}
  .file-info {line-height:1.4;overflow-wrap:anywhere}
  .file-actions {padding:0;margin:.2rem 0 0}
  .file-actions button {width:auto;min-height:46px}
  .files .select-row {min-height:48px}
  .choice, .modes button, .primary, .secondary {min-height:48px}
  .selection-bar {bottom:max(.5rem,env(safe-area-inset-bottom));flex-wrap:wrap}
  .selection-bar .primary {flex-grow:1}
  .wrap {padding-bottom:max(2rem,env(safe-area-inset-bottom))}
  .filters select,.filters input {min-width:0;min-height:48px;font-size:1rem}
  .filters label,.results-line>* {min-width:0}
  .browse-heading {gap:.5rem}
  .back {position:sticky;top:0;z-index:1;width:100%;text-align:left;background:var(--paper);border-bottom:1px solid var(--line);border-radius:0;min-height:48px}
  .results-line {scroll-margin-top:52px}
  #preview[open], #review-dialog[open] {inset:0;margin:0;width:100%;max-width:none;height:100vh;height:100dvh;max-height:none;border:0;border-radius:0;overflow:hidden}
  .dialog-head {align-items:center;padding: max(.7rem,env(safe-area-inset-top)) 1rem .7rem}
  .dialog-head > div, .dialog-head h2 {min-width:0;overflow-wrap:anywhere}
  .dialog-head button {flex-shrink:0}
  .preview-content, #review-items {flex:1;min-height:0;overscroll-behavior:contain}
  .preview-content {height:auto}
  .dialog-footer {flex-wrap:wrap;gap:.55rem;padding:.7rem 1rem max(.75rem,env(safe-area-inset-bottom))}
  .dialog-footer > div,.dialog-footer > .primary {width:100%}
  #preview-name {max-height:4.5em;overflow:auto}
  .doc-controls .secondary {min-height:44px}
  #review-items {padding:0 .8rem}
}
@media screen and (max-width:640px) and (max-height:450px) {
  .dialog-head,.dialog-footer {padding:.3rem .7rem}
  .dialog-footer {flex-wrap:nowrap}
  .dialog-footer > .primary {width:auto}
}

.case .pending-note{margin-top:.75rem;padding:.65rem 0 0;border-top:1px solid var(--line);font:inherit;font-size:1rem;color:var(--muted)}
