/* File preview window + upload preview (Oct 14, 2026), both portals. Loaded after modern.css. */
/* Desktop and tablet: the document opens in a box over the page; the dark area around it closes it. Phones: full-screen sheet. */
@media (min-width:601px){
  #docview{padding:5vh max(16px,calc((100vw - 980px) / 2))}
  #docview .dv-bar{border-radius:14px 14px 0 0;border:0}
  #docview .dv-body{background:var(--bg,#F6F4EF);border-radius:0 0 14px 14px;padding:10px;box-shadow:0 24px 60px rgba(0,0,0,.35)}
  #docview iframe{width:100%;min-height:0;height:100%;border-radius:8px}
  #docview .dv-img{max-height:100%;object-fit:contain}
  #docview .dv-body>.empty{color:var(--ink)!important;align-self:center}
}
@media (max-width:600px){#docview .dv-body>.empty{color:#fff}}
.dv-note{align-self:center;text-align:center;max-width:420px;padding:24px}
/* File names that open the preview window */
.dp-open{background:none;border:0;padding:0;font:inherit;color:inherit;text-align:left;cursor:pointer}
.dp-open b,.dp-open{text-decoration:underline;text-decoration-color:var(--line-2,#c9ced8);text-underline-offset:3px}
.dp-open:hover,.dp-open:hover b{text-decoration-color:currentColor}
.dp-open:focus-visible{outline:3px solid var(--focus,#C9A227);outline-offset:2px;border-radius:4px}
/* My file: one aligned date column for both sections */
.mf-docs{width:100%;table-layout:fixed}
.mf-docs td:nth-child(2){width:130px;white-space:nowrap}
.mf-docs td:nth-child(3){width:190px;text-align:right;white-space:nowrap}
.mf-docs .mf-sub td{padding-top:16px;font-weight:600;border-top:0}
@media (max-width:600px){.mf-docs td:nth-child(2){width:auto}.mf-docs td:nth-child(3){width:auto}.mf-docs tr{display:grid;grid-template-columns:1fr auto}.mf-docs td:first-child{grid-column:1/-1}.mf-docs .mf-sub td{grid-column:1/-1}}
/* Upload preview: under the field, and the "Is this the right file?" check for one-click upload buttons */
.dp-inline{margin-top:8px}
.dp-check{margin-bottom:6px;color:var(--muted)}
.dp-cards{display:flex;flex-wrap:wrap;gap:10px}
.dp-card{box-sizing:border-box;display:flex;gap:12px;align-items:center;padding:8px;border:1px solid var(--line,#e3e6ec);border-radius:10px;background:var(--panel,#fff);max-width:100%;min-width:0}
.dp-media{flex:none;width:120px;height:150px;border-radius:6px;overflow:hidden;background:#fff;border:1px solid var(--line,#e3e6ec);display:grid;place-items:center}
.dp-media img{width:100%;height:100%;object-fit:contain}
.dp-media iframe{width:100%;height:100%;border:0;pointer-events:none}
.dp-doc{font:600 12px Manrope,sans-serif;color:#14284B;letter-spacing:.04em}
.dp-info{display:flex;flex-direction:column;gap:2px;min-width:0}
.dp-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:260px}
#dpAsk{position:fixed;inset:0;z-index:240;background:rgba(10,15,25,.6);display:grid;grid-template-columns:minmax(0,1fr);justify-items:center;place-items:center;padding:16px}
#dpAsk .dp-box{box-sizing:border-box;background:var(--panel,#fff);color:var(--ink,#14284B);border-radius:var(--r-sm);padding:20px;width:min(560px,100%);max-height:90vh;overflow:auto;box-shadow:0 24px 60px rgba(0,0,0,.35)}
#dpAsk h2{margin:0 0 4px}
#dpAsk .dp-media{width:180px;height:230px}
#dpAsk .dp-btns{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}
@media (max-width:600px){#dpAsk{align-items:end;justify-items:stretch;padding:0}#dpAsk .dp-box{border-radius:14px 14px 0 0;width:100%}#dpAsk .dp-card{flex-direction:column;align-items:stretch;width:100%}#dpAsk .dp-cards{display:block}#dpAsk .dp-media{width:100%;height:46vh}#dpAsk .dp-btns .btn{flex:1 1 100%;min-height:44px}}
/* Pre-upload check (Oct 14, 2026): one plain sentence, only when something needs fixing */
.dp-msg{margin-top:8px;padding:8px 10px;border-radius:8px;background:var(--gold-l,#f7efd2);color:var(--ink,#14284B);border-left:3px solid #C9A227}
.dp-msg.dp-block{background:#fbeaea;border-left-color:var(--danger,#b42318)}
#dpAsk [data-dp="go"]:disabled{opacity:.45;cursor:not-allowed}
/* One file per person (Oct 14, 2026): document rows. A click anywhere on the row opens the viewer; the download icon is the owner's. */
.pf-list{list-style:none;margin:0;padding:0}
.pf-files{padding:4px 12px 10px}
.pf-row{display:flex;align-items:center;gap:12px;padding:9px 10px;border-radius:10px;cursor:pointer;min-height:44px}
.pf-row+.pf-row{border-top:1px solid var(--line,#e3e6ec)}
.pf-row:hover{background:var(--hover,rgba(20,40,75,.05))}
.pf-row:focus-visible{outline:3px solid var(--focus,#C9A227);outline-offset:1px}
.pf-row.pf-static,.pf-row.pf-q{cursor:default}
.pf-row.pf-static:hover,.pf-row.pf-q:hover{background:none}
.pf-row .grow{flex:1;display:flex;flex-direction:column;gap:1px;min-width:0}
.pf-row .grow b{overflow:hidden;text-overflow:ellipsis}
.pf-row .pf-t{all:unset;font-weight:700;cursor:pointer;overflow:hidden;text-overflow:ellipsis;border-radius:4px}
.pf-row .pf-t:focus-visible{outline:3px solid var(--focus,#C9A227);outline-offset:2px}
.pf-open{flex:none;color:var(--navy,#14284B);font-weight:600}
.pf-row .grow .small{overflow:hidden;text-overflow:ellipsis}
.pf-old{opacity:.7}
.pf-ic{flex:none;width:38px;height:46px;border:1px solid var(--line-2,#c9ced8);border-top:3px solid #C9A227;border-radius:6px;background:#fff;display:grid;place-items:center;font:600 10.5px Manrope,sans-serif;color:#14284B;letter-spacing:.03em}
.pf-dl{flex:none;display:grid;place-items:center;width:34px;height:34px;border-radius:8px;color:var(--muted,#5b6475)}
.pf-dl:hover{background:var(--hover,rgba(20,40,75,.08));color:var(--ink,#14284B)}
.pf-dl .i{width:17px;height:17px}
.pf-hint{color:#8a5a00}
.pf-foot{padding:6px 12px 12px}
.pf-note{padding:0 16px}
.pf-add{margin:6px 12px 12px;padding:8px 12px}
.pf-mine{margin-bottom:16px}
.pf-mine h2{margin-bottom:6px}
/* the viewer: page buttons, saved-response table, ZIP contents */
#docview .dv-bar>.grow{flex:1}
#docview .dv-pages{display:inline-flex;align-items:center;gap:6px}
#docview .dv-pages[hidden]{display:none}
#docview .dv-pg{min-width:84px;text-align:center;white-space:nowrap}
#docview .dv-dl .i{width:16px;height:16px;margin-right:4px;vertical-align:-3px}
#docview .dv-sheet{box-sizing:border-box;width:min(900px,100%);background:var(--panel,#fff);color:var(--ink,#14284B);border-radius:10px;padding:16px 18px;overflow:auto;max-height:100%}
#docview .dv-tbl{width:100%;border-collapse:collapse;font-size:14px}
#docview .dv-tbl th{text-align:left;font-weight:600;width:38%;vertical-align:top;padding:7px 10px 7px 0;color:var(--muted,#5b6475)}
#docview .dv-tbl td{padding:7px 0;white-space:pre-wrap;word-break:break-word}
#docview .dv-tbl tr+tr{border-top:1px solid var(--line,#e3e6ec)}
@media (max-width:600px){
  #docview{padding:0}
  #docview .dv-dlt{display:none}
  #docview .dv-dl .i{margin:0}
  #docview .dv-sheet{border-radius:0;width:100%;min-height:100%}
  #docview .dv-tbl th{width:44%}
  .pf-row{padding:10px 6px}
}
/* Oct 16, 2026: Team list name opens the person's file; document cards with a preview on the person file */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
a.tm-file{color:inherit;text-decoration:none;display:inline-block}
a.tm-file:hover b,a.tm-file:focus-visible b{text-decoration:underline}
.pf-list.pf-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(176px,1fr));gap:12px;padding:4px 0}
.pf-card{display:flex;flex-direction:column;border:1px solid var(--line,#e3e6ec);border-radius:var(--r-sm);overflow:hidden;background:var(--card,#fff);cursor:pointer;min-width:0}
.pf-card:hover{box-shadow:0 2px 10px rgba(20,40,75,.12)}
.pf-card:focus-within{outline:3px solid var(--focus,#C9A227);outline-offset:1px}
.pf-card.pf-old{opacity:.72}
.pf-card.pf-idcard{cursor:default}
.pf-thumb{height:132px;display:grid;place-items:center;background:var(--ivory,#F6F4EF);border-bottom:1px solid var(--line,#e3e6ec);overflow:hidden}
.pf-thumb img{width:100%;height:100%;object-fit:cover;object-position:top center;display:block}
.pf-thumb.pf-blur{filter:blur(6px)}
.pf-idph{width:96px;height:60px;border-radius:8px;background:linear-gradient(90deg,#c9cfdb 0 34%,#e8ebf1 34%);box-shadow:inset 0 0 0 2px #b7bfcd}
.pf-cbody{display:flex;flex-direction:column;gap:3px;padding:9px 11px 10px;min-width:0;flex:1}
.pf-cbody .pf-t,.pf-cbody>b{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal}
.pf-card .pf-t{all:unset;font-weight:700;cursor:pointer;border-radius:4px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.pf-card .pf-t:focus-visible{outline:3px solid var(--focus,#C9A227);outline-offset:2px}
.pf-cmeta{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pf-cfoot{display:flex;align-items:center;gap:8px;margin-top:auto;padding-top:4px;flex-wrap:wrap}
.pf-cfoot .pf-dl{margin-left:auto}
.pf-cfoot .pf-open{margin-left:auto}
.pf-cards .pf-row{grid-column:1/-1}
.pf-cards .pf-earlier{grid-column:1/-1;list-style:none}.pf-earlier summary{cursor:pointer;color:var(--muted,#5b6475);padding:2px 0}.pf-earlier .pf-cards{opacity:.85}
@media (max-width:600px){.pf-list.pf-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.pf-thumb{height:110px}}
/* Oct 23, 2026 (owner: "why is it in the corner"): inside a dialog the preview sits under its field, centred, never wider than the dialog;
   the dialog's own sticky footer keeps Save and Cancel in view */
.dialog .dp-inline{display:flex;flex-direction:column;align-items:center;text-align:center;max-width:100%}
.dialog .dp-cards{justify-content:center;max-width:100%}
.dialog .dp-card{max-width:100%}
.dialog .dp-name{max-width:min(260px,52vw)}
