/* Files' screens over the shared shell. Plain, tappable, and honest about what
   was read by the model and what a person decided. The bar, tabs, footer and
   identity chip come from the shell. */
:root{--ink:var(--px-fg,#1E2126);--muted:var(--px-muted,#6B7079);--line:var(--px-rule,#DDD5C5);
  --bg:var(--px-bg,#F5F0E6);--accent:var(--px-accent,#2450B8);--accent-fg:var(--px-accent-fg,#F5F0E6);
  --bad:#B3261E;--wash:var(--px-tint,#DCE6FA);--card:var(--px-card,#FFFFFF);
  --bad-bg:#FDF3F2;--bad-line:#E9C2BE;--good:#2F6B37;--good-bg:#EFF6EE;--good-line:#CFE3D0;
  --junk:#7A5A20;--junk-bg:#F4EFE6;--junk-line:#E2D6BF;--meter:#D5DBE2}
/* Dark: the chips were light-only literals (a DUE or INSERT chip glowed on the dark page). */
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--bad:#F2877F;--bad-bg:#3A1F1E;--bad-line:#6B3430;
  --good:#8FCB97;--good-bg:#1D3221;--good-line:#36573B;--junk:#E2BF7A;--junk-bg:#342A19;--junk-line:#5E4C2A;--meter:#39404A}}
:root[data-theme="dark"]{--bad:#F2877F;--bad-bg:#3A1F1E;--bad-line:#6B3430;
  --good:#8FCB97;--good-bg:#1D3221;--good-line:#36573B;--junk:#E2BF7A;--junk-bg:#342A19;--junk-line:#5E4C2A;--meter:#39404A}
*{box-sizing:border-box}
[hidden]{display:none !important}
/* The column, the title and the panels are the shell's (.px-page, .px-head, .px-panel,
   .px-cols; loop 392): one 1,320px column like every section, the tabs inside it. */
.gate h1{font-size:1.75rem;margin:0 0 8px}
h2{font-size:13px;margin:0;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.sub{color:var(--muted);font-size:14px;margin:0 0 20px}
.sub.small{font-size:13px;margin:8px 0 0}
/* main + the attribute so a closed tab stays closed over the shell's .px-cols{display:grid} */
main section[data-tab]{display:none}
main section[data-tab].on{display:block}
main section[data-tab].px-cols.on{display:grid}
.px-cols>.side{min-width:0}
.px-panel h2.px-label{display:block}
.grades-box>.px-panel{margin:0 0 16px}
.head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:10px}
.head.next{margin-top:24px}
ul{list-style:none;margin:0;padding:0}
button{font:inherit;font-weight:600;padding:7px 12px;border:1px solid var(--line);background:var(--card);color:var(--ink);border-radius:calc(var(--px-radius,10px) - 2px);cursor:pointer}
button:hover{border-color:var(--accent)}
button.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-fg)}
button.link{border:0;background:none;padding:4px 6px;font-weight:500;font-size:13px;color:var(--muted);text-decoration:underline}
button.link.danger:hover{color:var(--bad)}
button[disabled]{opacity:.5;cursor:default}
form.row{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-end;padding:12px;margin-top:10px;background:var(--wash);border:1px solid var(--line);border-radius:var(--px-radius,10px)}
/* A form that IS the panel (Cabinet's search) takes the panel's card, not the wash. */
form.row.px-panel{margin:0 0 16px;padding:14px 20px;background:var(--px-card,var(--card));border-color:var(--px-rule,var(--line))}
.px-panel>form.row{margin-top:12px}
label{display:flex;flex-direction:column;gap:3px;font-size:12px;font-weight:600;color:var(--muted);flex:1;min-width:9rem}
label.wide{flex:1 0 100%}
label.grow{flex:2 1 12rem}
/* "font:15px/1.4 inherit" is not a valid shorthand, so the whole line was dropped and fields fell back to
   the browser's 13px system font; spelled out, they match the page. */
input,select,textarea{font:400 15px/1.4 var(--px-font-ui,system-ui,sans-serif);padding:8px 9px;border:1px solid var(--line);border-radius:6px;background:var(--card);color:var(--ink);width:100%}
input[type=file]{padding:6px}
.msg{padding:9px 11px;margin:10px 0 0;border-left:3px solid var(--line);background:var(--wash);font-size:14px}
.msg.bad{border-left-color:var(--bad);color:var(--bad)}
.empty{color:var(--muted);font-size:14px;padding:10px 0}
.gate{padding-top:48px}
body.px .btn{display:inline-block;padding:8px 14px;background:var(--accent);color:var(--accent-fg);text-decoration:none;font-weight:600;border-radius:var(--px-radius,10px)}

/* A document: what it is, what the verdict says, what you can do. */
.doc{padding:14px 0;border-bottom:1px solid var(--line)}
.doc:last-child{border-bottom:0}
.doc .top{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 10px}
.doc .title{font-weight:600;font-size:16px;overflow-wrap:anywhere}
.doc .title a{color:inherit;text-decoration:none}
.doc .title a:hover{text-decoration:underline}
.doc .sender{color:var(--muted);font-size:13px}
.chip{flex:none;font:600 11px var(--px-font-mono,monospace);letter-spacing:.04em;text-transform:uppercase;padding:2px 7px;border:1px solid var(--line);border-radius:5px;background:var(--wash);color:var(--accent)}
.chip.action{background:var(--bad-bg);color:var(--bad);border-color:var(--bad-line)}
.chip.person{background:var(--good-bg);color:var(--good);border-color:var(--good-line)}
.chip.junk{background:var(--junk-bg);color:var(--junk);border-color:var(--junk-line)}
.verdict{margin:6px 0 0;font-size:14px}
.verdict b{font-weight:600}
.why{margin:4px 0 0;font-size:13px;color:var(--muted);line-height:1.45}
.route{margin:4px 0 0;font-size:12px;color:var(--muted)}
.acts{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:10px}
/* "Open" beside the buttons: the same size as their words, not the page's 16px. */
.acts a.link{font-size:13px;font-weight:600;padding:0 6px}
.acts button{padding:6px 11px;font-size:13px}
form.edit{margin-top:10px;width:100%}
form.edit label{min-width:8rem}
.conf{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--muted)}
.conf .bar{width:46px;height:6px;background:var(--meter);border-radius:3px;overflow:hidden}
.conf .bar i{display:block;height:100%;background:var(--accent)}

/* Adding: one line per step. */
.progress{margin:12px 0 0;padding:0 0 0 18px;font-size:14px}
.progress li{padding:2px 0}
.progress li.bad{color:var(--bad)}
.batch{padding:10px 0;border-bottom:1px solid var(--line);display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.batch .grow{flex:1 1 12rem}
.batch .meta{display:block;color:var(--muted);font-size:13px}

/* The cabinet: drawers as counts, then the list; a document opens in place. */
.drawers{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0 4px}
.drawers button{font-size:13px;padding:5px 10px}
.drawers button.on{background:var(--accent);border-color:var(--accent);color:var(--accent-fg)}
/* Opening a document hides the list and the drawers; their panels go with them. */
.cab-cols:has(#cabinet[hidden]){display:none}
/* Pictures of the pages sit side by side across the wide column, a PDF takes all of it. */
#detail .pages{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:12px;margin:12px 0;align-items:start}
#detail .pages img{width:100%;height:auto;border:1px solid var(--line)}
#detail .pages iframe{grid-column:1 / -1}
#detail .pages iframe{width:100%;height:70vh;border:1px solid var(--line)}
#detail pre{white-space:pre-wrap;font:13px/1.5 var(--px-font-mono,monospace);background:var(--wash);padding:10px;max-height:40vh;overflow:auto}
details summary{cursor:pointer;font-weight:600;font-size:14px;margin:10px 0 4px}
.history li{padding:6px 0;border-top:1px solid var(--line);font-size:13px}
.filed{font-size:13px;color:var(--muted);margin:6px 0 0}

/* The profile: one question per line. */
/* At full width the questions run two abreast, so an answer sits near its question. */
.profile{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,440px),1fr));column-gap:40px}
.profile>.sub{grid-column:1 / -1;margin-bottom:8px}
.profile>.sub.small{margin:14px 0 0}
.profile .q{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:10px 0;border-bottom:1px solid var(--line)}
.profile .q span{flex:1 1 14rem;font-size:15px}
.profile .q select,.profile .q input{width:auto;min-width:7rem}
@media (max-width:560px){ form.row label{min-width:100%} }

/* Needs you's side panel: what is in the cabinet, one line each, each a way in. */
.tally li{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-top:1px solid var(--line);font-size:14px}
.tally li:first-child{border-top:0}
body.px .tally a{color:var(--ink);text-decoration:none}
body.px .tally a:hover{color:var(--accent)}
.tally b{font:500 14px var(--px-font-mono,monospace);color:var(--ink)}
#detail>p:first-child{margin-top:0}
.batch:last-child{border-bottom:0}

/* On the document itself, "Open" would open what is already open. */
#detail .acts a.link[href^="#document/"]{display:none}

/* Find (31 Oct 2026): one row per document, its retention on the second line, the
   line the words were on under it. Today's box is the same form as Find's, smaller. */
.hit{padding:12px 0;border-bottom:1px solid var(--line)}
.hit:last-child{border-bottom:0}
.hit .top{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 10px}
body.px .hit a.title{font-weight:600;font-size:16px;color:var(--ink);text-decoration:none;overflow-wrap:anywhere}
body.px .hit a.title:hover{text-decoration:underline}
.hit .sender{color:var(--muted);font-size:13px}
.line{margin:6px 0 0;font-size:13px;color:var(--ink);background:var(--wash);border-left:3px solid var(--line);padding:5px 9px;overflow-wrap:anywhere}
.line mark{background:none;color:var(--accent);font-weight:700}
#todayFind{margin-bottom:16px}

/* Retention (31 Oct 2026): a missing rule is a problem, so it leads in the alarm colour;
   each drawer's rules fold, one line each, the rule's own words under it. */
.problems{margin-bottom:16px;border-color:var(--bad-line)}
.route.problem{color:var(--bad)}
.drawer-rules{border-top:1px solid var(--line);padding:2px 0}
.drawer-rules:first-child{border-top:0}
.drawer-rules summary{text-transform:capitalize;display:flex;flex-wrap:wrap;align-items:baseline;gap:8px}
.drawer-rules summary .meta{text-transform:none;font-weight:400;color:var(--muted);font-size:13px}
.drawer-rules li{padding:8px 0;border-top:1px solid var(--line);font-size:14px}
.drawer-rules li .why{display:block}

/* The track record (31 Oct 2026): two small tables side by side, the threshold under them. */
.cal{margin-top:16px}
.cal .big{font-size:15px;margin:0 0 12px}
.cal .big b{font:600 22px var(--px-font-mono,monospace);margin-right:4px}
.cal-cols{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),1fr));gap:12px 40px}
.cal h3{font-size:13px;margin:8px 0 4px;color:var(--muted)}
.cal table{width:100%;border-collapse:collapse;font-size:14px}
.cal th{text-align:left;font-weight:600;color:var(--muted);font-size:12px;border-bottom:1px solid var(--line);padding:4px 6px 4px 0}
.cal td{padding:5px 6px 5px 0;border-bottom:1px solid var(--line);text-transform:capitalize}
.cal td+td{font-family:var(--px-font-mono,monospace);text-transform:none}
.cal .implied,.cal .mode{font-size:14px;margin:14px 0 0}
.cal .mode .chip{margin-right:6px}

/* Sharing (0004): whose it is on every card; who has it on the document. The shell's
   control brings its own .px-share* styles; these are for the plain one beside it. */
.chip.shared{color:var(--muted);text-transform:none;letter-spacing:0}
.shared-with{margin-top:18px;padding-top:12px;border-top:1px solid var(--line)}
.shared-with ul.people{list-style:none;margin:8px 0 0;padding:0}
.shared-with ul.people li{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;padding:8px 0;border-top:1px solid var(--line);font-size:14px}
.shared-with .grow{flex:1 1 12rem;min-width:0;overflow-wrap:anywhere}
.shared-with .meta{color:var(--muted);font-size:13px}
.shared-with .invite .row{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.shared-with .invite input{flex:1 1 14rem;min-width:0}
.shared-with a.link{font-size:13px;font-weight:600}

/* The phone door (wave 2): big buttons for a thumb, then the pages in order, each
   with its picture (what will actually go up), its size, Retake, Earlier, Remove. */
.adds{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0 4px}
.adds button{flex:1 1 12rem;min-height:48px;font-size:15px}
.stack{list-style:none;margin:10px 0 0;padding:0}
.stack li.page{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;padding:8px 0;border-top:1px solid var(--line)}
.stack li.page:first-child{border-top:0}
.stack .thumb{flex:none;width:64px;height:84px;object-fit:cover;border:1px solid var(--line);border-radius:6px;background:var(--wash)}
.stack .thumb.pdf{display:flex;align-items:center;justify-content:center;font:600 12px var(--px-font-mono,monospace);color:var(--muted)}
.stack .grow{flex:1 1 9rem;min-width:0;overflow-wrap:anywhere}
.stack .meta{display:block;color:var(--muted);font-size:13px}
.stack .page-acts{display:flex;flex-wrap:wrap;gap:2px}
.stack .page-acts button.link{min-height:36px}
#addForm button.link{align-self:center}

/* A document's own page (wave 2): what it is, how long it is kept, every page, how it
   was decided (newest first, so a person's word sits over the reader's), where it is
   filed, who has it, Send a copy. */
#detail .back{display:flex;justify-content:space-between;align-items:center;gap:8px}
.docpage header{margin-bottom:4px}
.docpage .doc-title{font:600 22px/1.25 var(--px-font-serif,Georgia,serif);margin:0 0 4px;overflow-wrap:anywhere}
.docpage header .sub{margin:0 0 8px}
.docpage header .top{display:flex;flex-wrap:wrap;gap:6px}
.docpage>section{margin-top:18px;padding-top:12px;border-top:1px solid var(--line)}
.docpage>section.doc{padding:12px 0 0;border-bottom:0}
.docpage h3.px-label{display:block;margin:0 0 6px}
#detail .pages figure{margin:0}
#detail .pages figure a{display:block}
#detail .pages figcaption{font-size:12px;color:var(--muted);margin-top:4px}
.docpage .history{list-style:none;padding:0;margin:0}
.docpage .history li{padding:8px 0 8px 10px;border-top:1px solid var(--line);border-left:3px solid transparent}
.docpage .history li.now{border-left-color:var(--accent)}
.docpage .history .said{display:block;font-size:13px;margin-top:2px}
.docpage .history .why{display:block}
.filed-list{list-style:none;padding:0;margin:0}
.filed-list li{padding:6px 0;border-top:1px solid var(--line);font-size:14px;overflow-wrap:anywhere}
.filed-list li:first-child{border-top:0}
.copies .msg.made input{width:100%;margin:6px 0 0}
.copy-list{list-style:none;padding:0;margin:10px 0 0}
.copy-list li{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;padding:8px 0;border-top:1px solid var(--line);font-size:14px}
.copy-list li.ended{color:var(--muted)}
.copy-list .grow{flex:1 1 14rem;min-width:0;overflow-wrap:anywhere}

/* Printed: the document and its pages, nothing to press. Each picture on its own sheet. */
@media print{
  .px-bar,.px-tabs,#tabs,.px-head,.px-foot,footer,#detail .back,#detail .line,.acts,form,.shared-with,.copies,.msg,details.read-text,#detail .pages-wrap>.route{display:none!important}
  body,.px-panel{background:#fff!important}
  .px-panel{border:0!important;box-shadow:none!important;padding:0!important}
  .docpage>section{border-top:0}
  #detail .pages{display:block}
  #detail .pages figure{break-inside:avoid;break-before:page}
  #detail .pages img{width:auto;max-width:100%;max-height:92vh;border:0}
  #detail .pages a[href]::after{content:none}
  #detail .pages iframe{display:none}
}
/* The shell styles a panel's h2 as a small label; a document's own title is a title. */
.px-panel .docpage h2.doc-title{text-transform:none;letter-spacing:0;color:var(--ink);font:600 22px/1.25 var(--px-font-serif,Georgia,serif)}
/* Today fits one phone screen, problems first (5 Nov 2026): on Today the purpose line gives its room to the dials and what
   waits for your word, and Find a document sits on one line. Every other tab keeps its line. */
@media (max-width:560px){
  body:has(section[data-tab="queue"].on) #tabSub{display:none}
  #todayFind{flex-wrap:nowrap;padding:10px 12px;margin-bottom:10px}
  #todayFind label{min-width:0;flex:1 1 auto}
  #queue .queue-why{display:none}
}
