/* mod-files: project files (folder tree + list + viewer) */
/* On the job page the Files tab gets the full width (side card moves below). */
.row:has(.fl){grid-template-columns:1fr}
.card:has(> .fl){z-index:2}

.fl{display:flex;flex-direction:column;gap:14px;min-width:0}
.fl [hidden]{display:none!important}
.fl-sr{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.fl-made{display:flex;align-items:center;gap:8px;color:var(--ok)}
.fl-made svg{width:16px;height:16px}

.fl-grid{display:grid;grid-template-columns:minmax(220px,280px) minmax(0,1fr);gap:18px;align-items:start}

/* ---------- tree ---------- */
.fl-tree{position:sticky;top:12px;padding:10px 8px;border-radius:14px;background:rgba(0,0,0,.18);border:1px solid var(--line);max-height:calc(100vh - 40px);overflow:auto;font-size:13.5px}
.fl-ul{list-style:none;margin:0;padding:0}
.fl-sub .fl-ul{padding-left:14px;margin-left:11px;border-left:1px solid rgba(255,255,255,.07)}
.fl-node{display:flex;align-items:center;gap:2px;border-radius:9px;min-height:36px}
.fl-node a{flex:1;min-width:0;display:flex;align-items:center;gap:8px;padding:7px 8px;border-radius:9px;color:var(--silver);transition:background .15s,color .15s}
.fl-node a:hover{background:rgba(255,255,255,.06);color:#fff}
.fl-node a svg{width:16px;height:16px;flex:none;color:#7cc4ff;opacity:.85}
.fl-node.on a{background:linear-gradient(90deg,rgba(30,155,255,.26),rgba(30,155,255,.06));color:#fff;box-shadow:inset 0 0 0 1px rgba(79,180,255,.35)}
.fl-nm{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fl-n{margin-left:auto;flex:none;font:600 11px/1 var(--mono);padding:3px 7px;border-radius:20px;background:rgba(255,255,255,.09);color:var(--silver)}
.fl-tw,.fl-tw-sp{flex:none;width:22px;height:30px}
.fl-tw{display:none;place-items:center;border-radius:7px;color:var(--muted)}
.fl-js .fl-tw{display:grid}
.fl-js .fl-tw-sp{display:block}
.fl-tw-sp{display:none}
.fl-tw::before{content:"";width:7px;height:7px;border-right:1.6px solid currentColor;border-bottom:1.6px solid currentColor;transform:rotate(-45deg);transition:transform .15s}
.fl-tw[aria-expanded=true]::before{transform:rotate(45deg) translate(-1px,-1px)}
.fl-tw:hover{background:rgba(255,255,255,.08);color:#fff}
.fl-root{margin-bottom:4px}
.fl-reset{margin:12px 8px 4px;padding-top:10px;border-top:1px solid var(--line)}
.fl-reset .link{font-size:12.5px;min-height:32px}

/* ---------- main ---------- */
.fl-main{min-width:0;display:flex;flex-direction:column;gap:14px}
.fl-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px}
.fl-crumb{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:14px;min-width:0}
.fl-crumb a{color:var(--blue-2);padding:4px 2px}
.fl-crumb a:hover{text-decoration:underline}
.fl-crumb span{color:var(--dim)}
.fl-crumb b{font-weight:600;overflow-wrap:anywhere}
.fl-acts{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.fl-acts .btn svg{width:15px;height:15px}

/* <details> popovers (work without JS) */
.fl-more{position:relative}
.fl-acts{position:relative}
.fl-pop{position:static}
.fl-pop>summary,.fl-more>summary{list-style:none;cursor:pointer;user-select:none}
.fl-pop>summary::-webkit-details-marker,.fl-more>summary::-webkit-details-marker{display:none}
.fl-pop[open]>summary,.fl-more[open]>summary{background:rgba(30,155,255,.2);box-shadow:inset 0 0 0 1px rgba(79,180,255,.5)}
.fl-popbox{position:absolute;right:0;top:calc(100% + 6px);z-index:30;width:min(320px,calc(100vw - 48px));padding:14px;border-radius:14px;background:rgba(12,24,46,.97);border:1px solid var(--line-2);box-shadow:0 24px 50px -16px rgba(0,0,0,.8);display:flex;flex-direction:column;gap:12px;text-align:left;cursor:default}
.fl-popbox form{display:flex;flex-direction:column;gap:8px}
.fl-popbox label{font-size:12.5px;color:var(--muted);font-weight:600}
.fl-popbox .actions{justify-content:flex-start}
.fl-inl{display:flex;gap:8px}
.fl-inl .input{flex:1;min-width:0;height:38px;font-size:13.5px}
.fl-inl select.input{background-position:calc(100% - 18px) 16px,calc(100% - 13px) 16px}
.fl-inl .btn{height:38px}
.fl-mrow{display:flex;flex-wrap:wrap;gap:8px}
.fl-mrow .btn svg{width:15px;height:15px}
.fl-delf{padding-top:10px;border-top:1px solid var(--line)}

.fl-hint{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border-radius:12px;font-size:13.5px;color:#ffe2a8;background:rgba(255,194,75,.08);border:1px solid rgba(255,194,75,.28)}
.fl-hint svg{width:18px;height:18px;flex:none;margin-top:1px;color:var(--warn)}
.fl-hint b{font-weight:600;color:#fff}

/* drop zone */
.fl-drop{position:relative;border-radius:14px;border:1.5px dashed rgba(124,196,255,.35);background:rgba(30,155,255,.05);padding:14px 16px;transition:background .15s,border-color .15s}
.fl-drop.over{background:rgba(30,155,255,.16);border-color:var(--blue-2)}
.fl-drop.busy{border-style:solid}
.fl-drop-in{display:flex;flex-wrap:wrap;align-items:center;gap:12px}
.fl-drop-ic{width:40px;height:40px;flex:none;border-radius:12px;display:grid;place-items:center;background:rgba(30,155,255,.15);color:var(--blue-2);box-shadow:inset 0 0 0 1px rgba(79,180,255,.25)}
.fl-drop-ic svg{width:19px;height:19px}
.fl-drop-t{flex:1;min-width:180px;display:flex;flex-direction:column;gap:2px}
.fl-drop-t b{font-size:14px;font-weight:600}
.fl-pick{cursor:pointer}
.fl-pick svg{width:15px;height:15px}
.fl-input{max-width:100%;font-size:13px;color:var(--muted)}
.fl-pick{display:none}
.fl-js .fl-pick{display:inline-flex}
.fl-js .fl-input{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;clip:rect(0 0 0 0)}
.fl-js .fl-send{display:none}
.fl-js .fl-go{display:none}
.fl-pick:has(+ .fl-input:focus-visible){outline:2px solid var(--blue-2);outline-offset:2px}
.fl-prog{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.fl-prog:not(:empty){margin-top:12px}
.fl-pi{display:flex;flex-direction:column;gap:6px;padding:8px 10px;border-radius:10px;background:rgba(0,0,0,.2);font-size:13px}
.fl-pt{display:flex;justify-content:space-between;gap:10px}
.fl-pt b{font-weight:600;overflow-wrap:anywhere;min-width:0}
.fl-ps{flex:none;color:var(--muted);font-family:var(--mono);font-size:12px;text-align:right}
.fl-pi.ok .fl-ps{color:var(--ok)}
.fl-pi.err{background:rgba(255,107,107,.08);box-shadow:inset 0 0 0 1px rgba(255,107,107,.3)}
.fl-pi.err .fl-ps{color:#ffb3b3;flex:0 1 auto;font-family:var(--font)}
.fl-pi.err .fl-pt{flex-wrap:wrap}
.fl-pdone{background:none;padding:4px 0}
.fl-pdone .btn{align-self:flex-start}

/* list */
.fl-empty{padding:28px 20px}
.fl-scroll{margin:0 -10px}
.fl-table{table-layout:fixed}
.fl-table th:nth-child(2){width:90px}
.fl-table th:nth-child(3){width:150px}
.fl-table th.fl-dt{width:110px}
.fl-table th:last-child{width:64px}
.fl-table th a{color:inherit;display:inline-flex;align-items:center;min-height:32px}
.fl-table th a:hover{color:var(--text)}
.fl-table td{padding:8px 10px}
.fl-table tbody tr.fl-row{cursor:default}
.fl-table tbody tr.fl-row:hover{background:rgba(255,255,255,.035)}
.fl-table td.fl-dt{white-space:nowrap;font-size:12.5px}
.fl-name{display:flex;align-items:center;gap:10px;min-width:0;min-height:40px;color:var(--text)}
.fl-name:hover b{color:var(--blue-2);text-decoration:underline}
.fl-txt{min-width:0;display:flex;flex-direction:column}
.fl-txt b{font-weight:600;font-size:14px;overflow-wrap:anywhere;line-height:1.35}
.fl-subl{display:none;color:var(--muted);font-size:12px}
.fl-fic{width:34px;height:34px;flex:none;display:grid;place-items:center;border-radius:9px;background:rgba(30,155,255,.12);color:#7cc4ff}
.fl-fic svg{width:18px;height:18px}

/* file type tags */
.fl-ft{width:34px;height:34px;flex:none;display:grid;place-items:center;border-radius:9px;font:700 9.5px/1 var(--mono);letter-spacing:.02em;border:1px solid;position:relative}
.fl-ft-pdf{color:#ffb0a8;background:rgba(255,99,82,.14);border-color:rgba(255,99,82,.42)}
.fl-ft-cad{color:#8fd0ff;background:rgba(30,155,255,.16);border-color:rgba(79,180,255,.45)}
.fl-ft-img{color:#8ef0c4;background:rgba(61,220,151,.12);border-color:rgba(61,220,151,.38)}
.fl-ft-doc{color:#b9c9ff;background:rgba(110,140,255,.14);border-color:rgba(130,155,255,.4)}
.fl-ft-xls{color:#9df2a8;background:rgba(70,200,100,.12);border-color:rgba(90,210,120,.38)}
.fl-ft-vid{color:#e3b6ff;background:rgba(180,110,255,.13);border-color:rgba(190,130,255,.4)}
.fl-ft-oth{color:var(--silver);background:rgba(201,211,223,.08);border-color:rgba(201,211,223,.3)}

.fl-more .fl-popbox{width:min(340px,calc(100vw - 48px))}
.fl-more>summary{min-width:44px;justify-content:center;letter-spacing:.08em}

/* ---------- viewer ---------- */
.fv{display:flex;flex-direction:column;gap:14px}
.fv-bar{display:flex;flex-wrap:wrap;align-items:center;gap:12px}
.fv-title{flex:1;min-width:220px}
.fv-title h2{display:flex;align-items:center;gap:10px;font-size:16px}
.fv-name{overflow-wrap:anywhere;min-width:0}
.fv-title small{display:block;margin-top:4px;font-size:12.5px}
.fv-acts{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.fv-acts .btn svg{width:15px;height:15px}
.fv-pos{font-size:12px;color:var(--muted);padding:0 2px}
.fv-off{opacity:.4;cursor:default}
.fv-frame{display:block;width:100%;height:calc(100vh - 220px);min-height:420px;border:1px solid var(--line);border-radius:12px;background:#2a2f38}
.fv-note{margin-top:-4px}
.fv-img{display:grid;place-items:center;padding:12px;border-radius:12px;background:repeating-conic-gradient(rgba(255,255,255,.04) 0 25%,transparent 0 50%) 0 0/24px 24px,rgba(0,0,0,.25);border:1px solid var(--line);min-height:300px}
.fv-img img{display:block;max-width:100%;max-height:calc(100vh - 240px);height:auto;border-radius:6px}

/* ---------- responsive ---------- */
.fl-jump{display:none}
.fl-reset-m{display:none}
.fl-used{margin:0 0 8px;color:var(--muted);line-height:1.4;max-width:280px}
@media (max-width:860px){
  .fl-grid{grid-template-columns:1fr}
  .fl-tree{display:none}
  .fl-reset-m{display:block;margin:14px 0 0;padding-top:6px}
  .fl-reset-m .link{min-height:44px;font-size:13px}
  .fl-jump{display:flex;gap:8px}
  .fl-jump .input{flex:1;min-width:0}
  .fl-subl{display:block}
  .fl-table th:last-child{width:56px}
  .fl-table th.fl-dt{width:92px}
  .fv-frame{height:calc(100vh - 260px)}
}
@media (max-width:520px){
  .fl-table th.fl-dt,.fl-table td.fl-dt{display:none}
  .fl-drop-in{gap:10px}
  .fl-drop-ic{display:none}
  .fl-drop-t{min-width:0;flex-basis:100%}
  .fv-acts{width:100%}
  .fv-title{min-width:0;flex-basis:100%}
}
/* v0.13.0: on mid-size screens (job page with its side box) the file names keep room: hide "Uploaded by" and narrow the folder tree */
@media (min-width:861px) and (max-width:1240px){
  .fl-grid{grid-template-columns:minmax(190px,220px) minmax(0,1fr)}
  .fl-table th:nth-child(3),.fl-table td:nth-child(3){display:none}
}
