/* Documents: the strip under the request text, the page order of the case page, and the full-screen viewer (DocStrip / DocViewer).
   Tokens only (light + dark); flex/grid children carry min-width:0. */

/* ---------- case page order: header, request text, documents, then the numbers ---------- */
.cd-top{min-width:0}
.cd-top .cd-note{max-width:880px}
@media (max-width:899px){
 .cd:not(.single) .cd-top{order:0}
 .cd:not(.single) .sum{order:2}
 .cd:not(.single) .cd-needs{order:3}
 .cd:not(.single) .cd-fund{order:4}
 .cd:not(.single) .note-warn{order:5}
 .cd:not(.single) .cd-tl{order:6}
 .cd:not(.single) .cta{order:9}
}
@media (min-width:900px){
 .cd:not(.single){grid-template-rows:auto auto 1fr}
 .cd:not(.single) .cd-top{grid-column:1/-1;grid-row:1}
 .cd:not(.single) .cd-main{grid-column:1;grid-row:2/span 2}
 .cd:not(.single) .cd-side{grid-column:2;grid-row:2}
 .cd:not(.single) .cta{grid-column:1/-1;grid-row:4}
 .cd:not(.single) .cd-side .sec:first-child{margin-top:0}
}
@media (min-width:1400px){
 .cd:not(.single){grid-template-rows:auto auto 1fr}
 .cd:not(.single) .cta{grid-column:2;grid-row:2;align-self:start;position:static;max-width:none;margin:0 0 6px}
 .cd:not(.single) .cd-side{grid-row:3}
 .cd:not(.single) .cd-side .sec:first-child{margin-top:14px}
}

/* ---------- the strip ---------- */
.dstrip{margin-bottom:8px}
.dstrip .sec{margin:6px 6px 8px;align-items:center}
.dstrip-add{gap:4px;height:32px;padding:0 14px 0 12px;font-size:13px}
.dstrip-add .i{width:16px;height:16px}
.dtiles{display:flex;gap:12px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;scroll-padding-inline:16px;
 scrollbar-width:none;margin-inline:-16px;padding:4px 16px 16px;-webkit-overflow-scrolling:touch}
.dtiles::-webkit-scrollbar{display:none}
.dt-wrap{position:relative;flex:none;scroll-snap-align:start;min-width:0}
.dt{position:relative;display:block;width:132px;height:132px;border-radius:18px;overflow:hidden;background:var(--card);box-shadow:var(--shadow);
 padding:0;transition:transform .18s cubic-bezier(.2,.8,.2,1),box-shadow .18s}
.dt:active{transform:scale(.97)}
.dt:focus-visible{outline:2px solid var(--em);outline-offset:2px}
@media (hover:hover){ .dt:hover{transform:translateY(-2px);box-shadow:var(--glass-sh)} .dt:active{transform:scale(.97)} }
.dt img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block;-webkit-user-drag:none}
.dt-ph{position:absolute;inset:0;display:grid;place-items:center;color:var(--ink3)}
.dt-ph .i{width:30px;height:30px}
.dt-kind{position:absolute;inset-inline-start:8px;bottom:8px;max-width:calc(100% - 16px);padding:2px 9px;border-radius:99px;font-size:11px;line-height:1.7;
 color:#fff;background:rgba(0,0,0,.45);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dt-pdf{position:absolute;inset:0 0 26px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px}
.dt-pdf svg{width:52px;height:52px;filter:drop-shadow(0 4px 8px rgba(229,72,77,.35))}
.dt-pdf b{font-size:12px;font-weight:600;color:var(--ink2);letter-spacing:.04em}
.dt-more{position:absolute;top:6px;inset-inline-end:6px;width:26px;height:26px;border-radius:50%;background:rgba(0,0,0,.45);color:#fff;display:grid;place-items:center;
 -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:0}
.dt-more::after{content:"";position:absolute;inset:-9px}
.dt-more .i{width:15px;height:15px}
.dt-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;box-shadow:none;background:transparent;
 border:2px dashed color-mix(in srgb,var(--ink3) 45%,transparent);color:var(--em-t);font-size:14px;font-weight:500}
.dt-empty .i{width:26px;height:26px}
.dt-skel{background:var(--field);box-shadow:none;animation:dt-pulse 1.4s ease-in-out infinite}
@keyframes dt-pulse{50%{opacity:.55}}
@media (min-width:900px){
 .dtiles{display:grid;grid-template-columns:repeat(auto-fill,150px);gap:12px;overflow:visible;scroll-snap-type:none;margin-inline:0;padding:4px 0 10px}
 .dt{width:150px;height:150px}
 .dt-more{width:28px;height:28px}
 .dstrip .sec{justify-content:flex-start;gap:14px}
}

/* ---------- the viewer (built by doc-viewer.js on <body>) ---------- */
.dv{position:fixed;inset:0;z-index:200;background:#000;color:#fff;opacity:0;transform:scale(.97);
 transition:opacity .18s cubic-bezier(.2,.8,.2,1),transform .18s cubic-bezier(.2,.8,.2,1);overscroll-behavior:contain;outline:none;
 -webkit-user-select:none;user-select:none}
.dv.in{opacity:1;transform:none}
.dv-stage{position:absolute;inset:0;overflow:hidden;touch-action:none;cursor:default}
.dv-stage.zoomed{cursor:grab}
.dv-stage.panning{cursor:grabbing}
.dv-slide{position:absolute;inset:0;display:grid;place-items:center}
.dv-img{width:100%;height:100%;object-fit:contain;display:block;will-change:transform;transform-origin:50% 50%;-webkit-user-drag:none;max-width:100vw;max-height:100dvh}
.dv-img.snap{transition:transform .22s cubic-bezier(.2,.8,.2,1)}
.dv-pdf{position:absolute;inset:64px 0 0 0;width:100%;height:calc(100% - 64px);border:0;background:#fff}
.dv-msg{position:absolute;inset:0;display:grid;place-items:center;font-size:16px;color:rgba(255,255,255,.75);pointer-events:none;text-align:center;padding:0 24px}
.dv-spin{position:absolute;top:50%;left:50%;width:26px;height:26px;margin:-13px;border-radius:50%;border:3px solid rgba(255,255,255,.25);border-top-color:#fff;animation:dv-rot .8s linear infinite;pointer-events:none}
@keyframes dv-rot{to{transform:rotate(360deg)}}
.dv-top{position:absolute;top:0;inset-inline:0;z-index:3;display:flex;align-items:center;gap:8px;padding:max(10px,env(safe-area-inset-top)) 12px 10px;
 background:rgba(30,30,32,.62);-webkit-backdrop-filter:blur(22px) saturate(1.6);backdrop-filter:blur(22px) saturate(1.6);min-height:64px;box-sizing:border-box}
.dv-count{flex:1;min-width:0;text-align:center;font-size:14px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dv-btn{width:44px;height:44px;border-radius:50%;flex:none;display:grid;place-items:center;color:#fff;background:rgba(255,255,255,.12);padding:0;border:0;cursor:pointer;transition:background .15s}
.dv-btn:hover{background:rgba(255,255,255,.22)}
.dv-btn:focus-visible,.dv-nav:focus-visible,.dv-menu button:focus-visible{outline:2px solid #fff;outline-offset:2px}
.dv-btn svg,.dv-nav svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.dv-nav{position:absolute;top:50%;margin-top:-22px;z-index:2;width:44px;height:44px;border-radius:50%;display:none;place-items:center;color:#fff;padding:0;border:0;cursor:pointer;
 background:rgba(30,30,32,.62);-webkit-backdrop-filter:blur(22px);backdrop-filter:blur(22px);transition:background .15s,opacity .15s}
.dv-nav:hover{background:rgba(60,60,64,.8)}
.dv-nav[hidden]{display:none}
.dv-prev{right:16px}
.dv-next{left:16px}
@media (min-width:900px) and (hover:hover){ .dv-nav:not([hidden]){display:grid} }
.dv-menu{position:absolute;top:calc(max(10px,env(safe-area-inset-top)) + 50px);inset-inline-end:12px;min-width:170px;padding:6px;border-radius:20px;
 background:rgba(44,44,46,.88);-webkit-backdrop-filter:blur(22px);backdrop-filter:blur(22px);box-shadow:0 12px 36px -8px rgba(0,0,0,.6);display:flex;flex-direction:column}
.dv-menu[hidden]{display:none}
.dv-menu button{height:46px;border-radius:14px;padding:0 14px;display:flex;align-items:center;gap:10px;color:#fff;font:inherit;font-size:15px;text-align:start;border:0;background:none;cursor:pointer}
.dv-menu button:hover{background:rgba(255,255,255,.1)}
.dv-menu button.danger{color:#ff6b6e}
.dv-menu svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
@media (prefers-reduced-motion:reduce){ .dv,.dv-img.snap,.dt{transition:none} .dv{transform:none} }
