/* ===========================================================================
   glozar hub — the look of FreeIdP (login.glozar.eu).

   1. Tokens: dark and light, six accent colours (Admin → Branding). The server
      puts data-accent, data-theme-default and data-bg on <html>; theme.js sets
      data-theme before the page is drawn. Nothing below hardcodes a colour.
   2. The shell: header, menu on the left (a strip on a phone), content.
   3. Components: buttons, cards, lists, dialogs — used by every tool.
   ======================================================================== */

/* ---------------------------------------------------------------- 1 tokens */
:root{
  --night:#0f0d18; --night-2:#1b1828; --surface:#16131f; --surface-2:#211d30;
  --ink:#edebf7; --muted:#9c98b2;
  --line:rgba(237,235,247,.09); --line-strong:rgba(237,235,247,.18);
  --live:#38b6f5; --danger:#ff7a8a; --warn:#f5c46b; --ok:#4fbf8f;
  --rgb-night:15,13,24; --rgb-ink:237,235,247; --rgb-live:56,182,245; --rgb-danger:255,122,138; --rgb-warn:245,196,107;
  --shadow:0 20px 50px -22px rgba(0,0,0,.75);
  --band-a:.34;
  --serif:"Fraunces",Georgia,"Times New Roman",serif;
  --sans:"IBM Plex Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  --mono:"IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --gutter:clamp(1rem,3vw,2.5rem); --measure:1440px; --appbar:56px;
  --ease:cubic-bezier(.16,1,.3,1);
  /* accent — violet: fill = buttons and solid marks; accent = text, lines, tints */
  --acc-fill:#6c3bff; --on-acc:#ffffff; --acc2:#188fdc; --accent:#a98bff;
  --rgb-fill:108,59,255; --rgb-acc2:24,143,220; --rgb-accent:169,139,255;
  color-scheme:dark;
}
:root[data-theme="light"]{
  --night:#f5f4f9; --night-2:#ffffff; --surface:#ffffff; --surface-2:#efedf6;
  --ink:#17142a; --muted:#5d5873;
  --line:rgba(23,20,42,.1); --line-strong:rgba(23,20,42,.2);
  --live:#0a78b5; --danger:#c22f4b; --warn:#9a6200; --ok:#1d8a5c;
  --rgb-night:245,244,249; --rgb-ink:23,20,42; --rgb-live:10,120,181; --rgb-danger:194,47,75; --rgb-warn:154,98,0;
  --shadow:0 20px 44px -24px rgba(23,20,42,.38);
  --band-a:.18;
  --acc-fill:#5e28ff; --accent:#4a1fd1; --rgb-fill:94,40,255; --rgb-accent:74,31,209;
  color-scheme:light;
}
:root[data-accent="magenta"]{--acc-fill:#d61f8c;--on-acc:#fff;--acc2:#ff7a45;--accent:#f47ec0;--rgb-fill:214,31,140;--rgb-acc2:255,122,69;--rgb-accent:244,126,192}
:root[data-accent="magenta"][data-theme="light"]{--acc-fill:#c41b80;--accent:#a8126a;--rgb-fill:196,27,128;--rgb-accent:168,18,106}
:root[data-accent="navy"]{--acc-fill:#2f55d4;--on-acc:#fff;--acc2:#38bdf8;--accent:#8aabff;--rgb-fill:47,85,212;--rgb-acc2:56,189,248;--rgb-accent:138,171,255}
:root[data-accent="navy"][data-theme="light"]{--acc-fill:#1e40af;--accent:#1e40af;--rgb-fill:30,64,175;--rgb-accent:30,64,175}
:root[data-accent="emerald"]{--acc-fill:#0f8a5f;--on-acc:#fff;--acc2:#2bb3a0;--accent:#56d3a5;--rgb-fill:15,138,95;--rgb-acc2:43,179,160;--rgb-accent:86,211,165}
:root[data-accent="emerald"][data-theme="light"]{--acc-fill:#0f8a5f;--accent:#0a6b49;--rgb-fill:15,138,95;--rgb-accent:10,107,73}
:root[data-accent="slate"]{--acc-fill:#52688a;--on-acc:#fff;--acc2:#7f97b2;--accent:#aebfd6;--rgb-fill:82,104,138;--rgb-acc2:127,151,178;--rgb-accent:174,191,214}
:root[data-accent="slate"][data-theme="light"]{--acc-fill:#3e5068;--accent:#3e5068;--rgb-fill:62,80,104;--rgb-accent:62,80,104}
:root[data-accent="graphite"]{--acc-fill:#ededf2;--on-acc:#17171c;--acc2:#9a9aa6;--accent:#e6e6ec;--rgb-fill:237,237,242;--rgb-acc2:154,154,166;--rgb-accent:230,230,236}
:root[data-accent="graphite"][data-theme="light"]{--acc-fill:#17171c;--on-acc:#fff;--acc2:#7a7a85;--accent:#17171c;--rgb-fill:23,23,28;--rgb-acc2:122,122,133;--rgb-accent:23,23,28}

/* ------------------------------------------------------------------ base */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth;overflow-x:clip;scroll-padding-top:calc(var(--appbar) + 1rem)}
body{
  margin:0;min-height:100svh;display:flex;flex-direction:column;overflow-x:clip;
  background:var(--night);color:var(--ink);
  font-family:var(--sans);font-weight:400;font-size:.94rem;line-height:1.55;
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
}
canvas,img,svg{display:block;max-width:100%}
h1,h2,h3,p,figure{margin:0}
ul,ol{margin:0;padding:0;list-style:none}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
::selection{background:var(--acc-fill);color:var(--on-acc)}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}
.vh{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

.wrap{width:100%;max-width:var(--measure);margin-inline:auto;padding-inline:var(--gutter)}
.label{font-family:var(--mono);font-size:.69rem;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}

/* --------------------------------------------------------------- 2 shell */
.appbar{position:sticky;top:0;z-index:60;height:var(--appbar);flex:none;display:flex;align-items:center;gap:.6rem;
  padding:0 .9rem 0 1.15rem;background:var(--surface);border-bottom:1px solid var(--line)}
.appbar[hidden]{display:none}
.brand{display:flex;align-items:center;gap:.7rem;min-width:0;color:var(--ink)}
.brand img{width:32px;height:32px;object-fit:contain;flex:none}
.brand b{font-weight:500;font-size:.98rem;white-space:nowrap}
.brand .sep{color:var(--line-strong)}
.brand .area{color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.appbar .grow{flex:1 1 auto}
.ibtn{display:inline-grid;place-items:center;width:36px;height:36px;border-radius:8px;color:var(--muted);flex:none;
  transition:background .2s,color .2s}
.ibtn:hover{background:var(--surface-2);color:var(--ink)}
.ibtn svg{width:18px;height:18px}
.ibtn[hidden]{display:none}
.theme-dark,.theme-light{display:none}
:root[data-theme="dark"] .theme-light,:root[data-theme="light"] .theme-dark{display:block}

.shell{display:flex;flex:1 1 auto;align-items:stretch;min-height:0}
.side{flex:0 0 244px;width:244px;background:var(--surface);border-right:1px solid var(--line);
  position:sticky;top:var(--appbar);height:calc(100svh - var(--appbar));overflow:auto;padding:1rem .7rem 1.5rem}
.side nav{display:flex;flex-direction:column;gap:2px}
.side .sec{display:block;padding:.2rem .7rem .45rem;margin-top:1.1rem}
.side .sec:first-child{margin-top:0}
.nav-item{display:flex;align-items:center;gap:.65rem;min-height:36px;padding:.42rem .7rem;border-radius:8px;
  color:var(--muted);font-size:.9rem;white-space:nowrap;transition:background .15s,color .15s}
.nav-item svg{width:18px;height:18px;flex:none}
.nav-item .ext{margin-left:auto;font-size:.8rem;opacity:.7}
.nav-item:hover{background:var(--surface-2);color:var(--ink)}
.nav-item[aria-current="page"]{background:rgba(var(--rgb-fill),.16);color:var(--accent);font-weight:500}
.side[hidden]{display:none}
.content{flex:1 1 auto;min-width:0;display:flex;flex-direction:column}
.filecount{margin-bottom:.6rem}
.logs-foot{padding-block:.5rem 2rem}
.content > main{flex:1 1 auto}
@media (max-width:860px){
  .shell{flex-direction:column}
  .side{position:static;width:auto;height:auto;flex:none;border-right:0;border-bottom:1px solid var(--line);
    padding:.45rem .5rem;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}
  .side::-webkit-scrollbar{display:none}
  .side nav{flex-direction:row;gap:.25rem}
  .side .sec{display:none}
  .nav-item{min-height:34px;padding:.35rem .75rem;border-radius:999px}
  .nav-item .ext{margin-left:.15rem}
}
@media (max-width:560px){
  .brand .sep,.brand .area{display:none}
  .appbar .pill .txt{display:none}
  .appbar .pill{width:36px;padding:0;justify-content:center}
}

.side .sec[hidden],.nav-item[hidden]{display:none}

/* sections inside a page */
main{flex:1 1 auto;position:relative}
.section{padding-block:clamp(.75rem,2vh,1.25rem) clamp(1.5rem,4vh,2.5rem)}
.sec__head{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;padding-bottom:.85rem;
  border-bottom:1px solid var(--line);margin-bottom:1.1rem}
.sec__head h2{font-family:var(--sans);font-weight:500;font-size:1.05rem;line-height:1.3}
.sec__head .label span.n{color:var(--accent)}
.sec__head .spacer{flex:1 1 auto}
@media (max-width:560px){ .sec__head .spacer{display:none} .sec__head{gap:.35rem .9rem} }
#tools > section + section{margin-top:2rem}

/* page title — the same on every page */
.phead{padding:clamp(1.6rem,4vh,2.6rem) 0 clamp(.75rem,2vh,1.25rem)}
.phead .label{display:block;margin-bottom:.6rem}
.phead .label a{color:var(--muted)}
.phead .label a:hover{color:var(--accent)}
h1{font-family:var(--serif);font-weight:400;font-variation-settings:"opsz" 96,"SOFT" 20;
  font-size:clamp(1.85rem,3.2vw,2.6rem);line-height:1.08;letter-spacing:-.02em;text-wrap:balance}
h1 em{font-style:italic;color:var(--accent)}
.lede{margin-top:.6rem;color:var(--muted);font-size:1rem;line-height:1.5;max-width:62ch}

/* the welcome on the tools page wears the background chosen in Branding */
.band{border-bottom:1px solid var(--line);background:var(--surface)}
:root[data-bg="aurora"] .band{background:
  radial-gradient(55% 150% at 88% 0%,rgba(var(--rgb-acc2),var(--band-a)),transparent 70%),
  radial-gradient(50% 130% at 6% 100%,rgba(var(--rgb-fill),var(--band-a)),transparent 70%),var(--surface)}
:root[data-bg="dusk"] .band{background:
  linear-gradient(160deg,rgba(var(--rgb-fill),calc(var(--band-a) * 1.2)) 0%,rgba(var(--rgb-acc2),calc(var(--band-a) * .3)) 55%,var(--surface) 100%)}
:root[data-bg="grid"] .band{background:
  linear-gradient(var(--line) 1px,transparent 1px) 0 0 / 28px 28px,
  linear-gradient(90deg,var(--line) 1px,transparent 1px) 0 0 / 28px 28px,
  radial-gradient(60% 130% at 82% 0%,rgba(var(--rgb-fill),calc(var(--band-a) * .8)),transparent 70%),var(--surface)}
.band .phead{padding:clamp(2.2rem,6vh,3.5rem) 0 clamp(1.8rem,4vh,2.6rem)}
.search{display:flex;align-items:center;gap:.6rem;max-width:440px;height:42px;margin-top:1.25rem;padding:0 .9rem;
  border-radius:10px;background:var(--surface);border:1px solid var(--line-strong)}
.search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px rgba(var(--rgb-accent),.18)}
.search svg{width:16px;height:16px;color:var(--muted);flex:none}
.search input{flex:1;min-width:0;border:0;background:none;outline:none;color:var(--ink);font:inherit}

/* ------------------------------------------------------------------- tools */
.tgroup{display:flex;align-items:center;gap:.7rem;margin:1.6rem 0 .9rem}
.tgroup:first-child{margin-top:0}
.tgroup h2{font-size:.98rem;font-weight:500}
.tag{font-family:var(--mono);font-size:.7rem;padding:.1rem .55rem;border-radius:999px;border:1px solid var(--line-strong);
  color:var(--muted);white-space:nowrap}
.tools{display:grid;gap:.9rem;grid-template-columns:repeat(auto-fill,minmax(min(100%,250px),1fr))}
.tool{position:relative;display:flex;flex-direction:column;gap:.6rem;padding:1.1rem 1.15rem;
  border:1px solid var(--line);border-radius:12px;background:var(--surface);min-height:158px;
  transition:border-color .2s,transform .3s var(--ease),box-shadow .3s}
.tool:hover,.tool:focus-visible{border-color:var(--accent);transform:translateY(-2px);
  box-shadow:0 12px 30px -20px rgba(var(--rgb-fill),.9)}
.tool__top{display:flex;align-items:center;justify-content:space-between;gap:.75rem}
.tool__badge{display:grid;place-items:center;flex:none;width:40px;height:40px;border-radius:10px;
  font-family:var(--mono);font-size:.74rem;font-weight:500;color:var(--accent);background:rgba(var(--rgb-fill),.16)}
.tool__badge svg{width:20px;height:20px}
.tool__ext{font-family:var(--mono);font-size:.7rem;padding:.1rem .55rem;border-radius:999px;border:1px solid var(--line-strong);
  color:var(--muted);max-width:60%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tool__ext:empty{display:none}
.tool__name{font-weight:500;font-size:1.02rem;line-height:1.3}
.tool__desc{font-size:.86rem;color:var(--muted);line-height:1.5}
.tool__go{margin-top:auto;font-family:var(--mono);font-size:.74rem;color:var(--muted);display:flex;align-items:center;gap:.45rem;
  transition:color .2s,gap .3s var(--ease)}
.tool--local .tool__go{color:var(--accent)}
.tool:hover .tool__go{color:var(--accent);gap:.7rem}
.tools__empty{border:1px dashed var(--line-strong);border-radius:12px;padding:1.5rem;color:var(--muted);font-size:.9rem}
.tools__none{color:var(--muted);padding:1rem 0}

/* ------------------------------------------------------------------- files */
.bar{display:flex;flex-wrap:wrap;align-items:center;gap:.6rem 1rem;margin-bottom:1rem}
.crumbs{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem;
  font-family:var(--mono);font-size:.7rem;letter-spacing:.1em;min-width:0}
.crumbs button,.crumbs span{font-family:inherit;font-size:inherit;letter-spacing:inherit;color:var(--muted)}
.crumbs button{border-bottom:1px solid transparent;padding-bottom:1px}
.crumbs button:hover{color:var(--ink);border-bottom-color:var(--accent)}
.crumbs .sep{opacity:.45}
.crumbs .cur{color:var(--ink)}
.bar .spacer{flex:1 1 auto}
.filter{position:relative;display:flex;align-items:center;gap:.5rem;
  border:1px solid var(--line);border-radius:999px;padding:.4rem .85rem;min-width:min(100%,220px)}
.filter:focus-within{border-color:var(--accent)}
.filter input{width:100%;background:none;border:0;outline:none;color:var(--ink);
  font-family:var(--mono);font-size:.72rem;letter-spacing:.06em}
.filter input::placeholder{color:var(--muted)}
.filter svg{flex:none;opacity:.6}

.list{border-top:1px solid var(--line)}
.row{display:grid;grid-template-columns:44px minmax(0,1fr) 5.5rem 7.5rem auto;
  grid-template-areas:"thumb name size date acts";
  gap:clamp(.6rem,1.4vw,1.1rem);align-items:center;
  padding:.6rem 0;border-bottom:1px solid var(--line);
  transition:background .25s}
.row:hover{background:rgba(var(--rgb-ink),.03)}
.row--up .meta{visibility:hidden}
.thumb{grid-area:thumb;width:40px;height:40px;border-radius:3px;overflow:hidden;flex:none;
  display:grid;place-items:center;border:1px solid var(--line);background:rgba(var(--rgb-ink),.03)}
.thumb .ext{font-family:var(--mono);font-size:.54rem;font-weight:500;letter-spacing:.04em;
  color:var(--muted);text-transform:uppercase;padding:0 2px;text-align:center;line-height:1.1;
  overflow:hidden;max-width:100%}
.thumb--dir{border-color:rgba(var(--rgb-accent),.4);background:rgba(var(--rgb-accent),.1)}
.thumb--dir svg{color:var(--accent)}
.name{grid-area:name;min-width:0;display:flex;align-items:center;gap:.6rem}
.name button{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  text-align:left;font-size:.96rem;border-bottom:1px solid transparent}
.name button:hover{color:var(--accent);border-bottom-color:var(--accent)}
/* The badge opens the row too. It is not a tab stop — the name next to it is
   the one button per row, so keyboard users are not asked to press twice. */
.thumb[data-open]{cursor:pointer}
.row:hover .thumb[data-open]{border-color:var(--accent)}
.row:hover .thumb[data-open] .ext{color:var(--accent)}
.meta{font-family:var(--mono);font-size:.68rem;letter-spacing:.04em;color:var(--muted);
  font-variant-numeric:tabular-nums;white-space:nowrap}
.meta--size{grid-area:size;text-align:right}
.meta--date{grid-area:date}
.acts{grid-area:acts;display:flex;gap:.3rem;justify-content:flex-end;align-items:center}
.act{display:grid;place-items:center;width:30px;height:30px;border:1px solid var(--line);border-radius:3px;
  color:var(--muted);transition:color .25s,border-color .25s,background .25s}
.act:hover{color:var(--accent);border-color:var(--accent);background:rgba(var(--rgb-accent),.08)}
.act[disabled]{opacity:.28;cursor:not-allowed}
.act[disabled]:hover{color:var(--muted);border-color:var(--line);background:none}
.act svg{width:14px;height:14px}
.act[data-copied="true"]{color:var(--live);border-color:var(--live)}
.act[hidden]{display:none}
@media (max-width:820px){
  .row{grid-template-columns:40px minmax(0,1fr) auto;row-gap:.2rem;
    grid-template-areas:"thumb name acts" "thumb info acts"}
  .meta--size{grid-area:info;text-align:left}
  .meta--date{grid-area:info;justify-self:end;padding-right:.5rem}
}

/* ---- signed in: a selection column, a delete icon, confirm in the row ---- */
.list[data-manage="true"] .row{grid-template-columns:22px 44px minmax(0,1fr) 5.5rem 7.5rem auto;
  grid-template-areas:"sel thumb name size date acts"}
@media (max-width:820px){
  .list[data-manage="true"] .row{grid-template-columns:22px 40px minmax(0,1fr) auto;
    grid-template-areas:"sel thumb name acts" "sel thumb info acts"}
}
.sel{grid-area:sel;display:grid;place-items:center}
.check{appearance:none;-webkit-appearance:none;margin:0;width:18px;height:18px;flex:none;cursor:pointer;
  border:1px solid var(--line-strong);border-radius:3px;background:rgba(var(--rgb-ink),.03);
  display:grid;place-items:center;transition:background .2s,border-color .2s}
.check:hover{border-color:var(--accent)}
.check:checked,.check:indeterminate{background:var(--accent);border-color:var(--accent)}
.check:checked::after{content:"";width:9px;height:5px;margin-top:-2px;
  border-left:2px solid var(--night);border-bottom:2px solid var(--night);transform:rotate(-45deg)}
.check:indeterminate::after{content:"";width:9px;height:2px;background:var(--night)}
.row[data-selected="true"]{background:rgba(var(--rgb-accent),.075)}
.row[data-selected="true"]:hover{background:rgba(var(--rgb-accent),.11)}
.act--danger:hover{color:var(--danger);border-color:var(--danger);background:rgba(var(--rgb-danger),.08)}
.row[data-confirm="true"]{background:rgba(var(--rgb-danger),.07)}
.row[data-confirm="true"] .meta--size{color:var(--ink)}
/* the folder's contents need more room than a size does — take the date's place */
.row[data-confirm="true"] .meta--date{display:none}
@media (min-width:821px){
  .row[data-confirm="true"] .meta--size{grid-column:size-start / date-end;overflow:hidden;text-overflow:ellipsis}
}
@media (max-width:820px){
  /* on a phone the two buttons stack, so the name and the count keep their room */
  .row[data-confirm="true"] .acts{flex-direction:column;align-items:stretch;gap:.3rem}
  .row[data-confirm="true"] .btn-s{height:28px}
  .meta--size{min-width:0;overflow:hidden;text-overflow:ellipsis}
}
.row[data-busy="true"]{opacity:.45;pointer-events:none}
.btn-s{height:30px;padding:0 .8rem;border-radius:3px;border:1px solid var(--line-strong);white-space:nowrap;
  font-family:var(--mono);font-size:.62rem;letter-spacing:.14em;text-transform:uppercase;color:var(--ink);
  transition:background .2s,border-color .2s,color .2s}
.btn-s:hover{border-color:var(--ink)}
.btn-s--danger{background:var(--danger);border-color:var(--danger);color:var(--night);font-weight:500}
.btn-s--danger:hover{background:var(--ink);border-color:var(--ink);color:var(--night)}
.btn-s[disabled]{opacity:.45;cursor:wait}
.bar .check{margin-right:.15rem}
.bar .check[hidden]{display:none}
.pill--danger:not([disabled]){border-color:rgba(var(--rgb-danger),.7);color:var(--danger)}
.pill--danger:not([disabled]):hover{background:var(--danger);border-color:var(--danger);color:var(--night)}
.pill .caret{width:9px;height:9px;margin-left:-.1rem;opacity:.8}

/* ---- small popover: delete confirmation, upload menu ---- */
.pop{position:fixed;z-index:110;min-width:220px;max-width:min(340px,calc(100vw - 1.5rem));
  border:1px solid var(--line-strong);border-radius:6px;background:var(--night-2);
  box-shadow:0 20px 50px -14px rgba(0,0,0,.75);padding:.9rem 1rem}
.pop[hidden]{display:none}
.pop__title{font-size:.95rem;color:var(--ink)}
.pop__sub{margin-top:.25rem;font-family:var(--mono);font-size:.64rem;letter-spacing:.05em;color:var(--muted);
  font-variant-numeric:tabular-nums}
.pop__actions{display:flex;justify-content:flex-end;gap:.45rem;margin-top:.9rem}
.pop--menu{padding:.35rem;min-width:200px}
.pop--form{width:min(340px,calc(100vw - 1.5rem))}
.pop .input{height:40px;margin-top:.8rem;font-size:.95rem}
.pop__msg{min-height:1.2em;margin-top:.45rem;font-size:.8rem;color:var(--danger)}
.btn-s--primary{background:var(--accent);border-color:var(--accent);color:var(--night);font-weight:500}
.btn-s--primary:hover{background:var(--ink);border-color:var(--ink)}
.btn-s--primary[disabled]{opacity:.4;cursor:not-allowed}
.btn-s--primary[disabled]:hover{background:var(--accent);border-color:var(--accent)}
/* a freshly created folder lights up once, so the eye finds it */
.row[data-new="true"]{animation:rowNew 2.4s var(--ease)}
@keyframes rowNew{0%,35%{background:rgba(var(--rgb-live),.16)}100%{background:transparent}}
@media (max-width:560px){
  /* three labelled buttons do not fit a phone row — this one keeps its icon */
  .bar #newFolderBtn{width:34px;padding:0;justify-content:center}
  .bar #newFolderBtn .txt{display:none}
}
.menu__item{display:flex;align-items:center;gap:.7rem;width:100%;padding:.6rem .7rem;border-radius:4px;
  text-align:left;font-size:.9rem;color:var(--ink)}
.menu__item:hover,.menu__item:focus-visible{background:rgba(var(--rgb-accent),.12);color:var(--accent);outline:none}
.menu__item svg{width:15px;height:15px;flex:none;color:var(--accent)}
.menu__item small{display:block;font-family:var(--mono);font-size:.6rem;letter-spacing:.05em;color:var(--muted)}

/* ---- toast ---- */
.toast{position:fixed;z-index:115;left:clamp(.75rem,2vw,1.5rem);bottom:clamp(.75rem,2vw,1.5rem);
  max-width:min(440px,calc(100vw - 1.5rem));padding:.75rem 1rem;border-radius:6px;
  border:1px solid var(--line-strong);border-left:3px solid var(--live);background:var(--night-2);
  box-shadow:0 18px 40px -12px rgba(0,0,0,.7);font-size:.9rem;
  transform:translateY(12px);opacity:0;transition:opacity .3s var(--ease),transform .4s var(--ease);pointer-events:none}
.toast[data-on="true"]{opacity:1;transform:none;pointer-events:auto}
.toast[data-kind="error"]{border-left-color:var(--danger)}
.toast small{display:block;margin-top:.2rem;color:var(--muted);font-size:.8rem}
@media (max-width:560px){
  .toast{left:.75rem;right:.75rem;top:.75rem;bottom:auto;max-width:none;transform:translateY(-12px)}
}

/* ---- upload groups: one row per uploaded folder ---- */
.up__item--group .up__ext{color:var(--accent);border-color:rgba(var(--rgb-accent),.4);background:rgba(var(--rgb-accent),.1)}
.up__item--group .up__ext svg{width:15px;height:15px}
.up__acts{display:flex;gap:.25rem}
.up__item--group{grid-template-columns:34px minmax(0,1fr) auto}
.up__sublist{grid-column:1 / -1;margin:.35rem 0 0 calc(34px + .75rem);border-left:1px solid var(--line);
  padding-left:.75rem;display:grid;gap:.35rem}
.up__sub{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.5rem;align-items:center;
  font-family:var(--mono);font-size:.62rem;color:var(--muted)}
.up__sub span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.up__sub[data-state="error"]{color:var(--danger)}
.up__sub .act{width:24px;height:24px}
.up__sub .act svg{width:12px;height:12px}
.state{padding:2.5rem 0;color:var(--muted);font-size:.92rem;text-align:center}
.state code{font-family:var(--mono);font-size:.85em;color:var(--ink);
  background:rgba(var(--rgb-ink),.07);padding:.1em .4em;border-radius:2px}
.state a{color:var(--accent);border-bottom:1px solid currentColor}

/* diagnostic state — shown when neither files.json nor a listing is available */
.diag{max-width:44rem;margin:0 auto;text-align:left}
.diag__head{color:var(--ink);font-size:1rem}
.diag__why{margin-top:.5rem}
.diag__fix{margin-top:1.4rem;padding:1.1rem 1.3rem;border:1px solid var(--line);
  border-radius:4px;background:rgba(var(--rgb-ink),.025)}
.diag__fix ol{margin:.7rem 0 0;padding-left:1.4rem;list-style:decimal}
.diag__fix ol li::marker{font-family:var(--mono);font-size:.85em;color:var(--accent)}
.diag__fix li{margin-top:.45rem;line-height:1.55}
.diag__fix em{color:var(--ink);font-style:normal;
  font-family:var(--mono);font-size:.85em}

/* ----------------------------------------------------------------- preview */
.modal{position:fixed;inset:0;z-index:100;display:none;place-items:center;
  --pad:clamp(.6rem,3vw,2.5rem); --headh:58px; --inset:10px;
  --vmax:calc(100svh - 2 * var(--pad) - var(--headh) - 2 * var(--inset));
  padding:var(--pad);background:rgba(6,5,12,.88);
  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
.modal[data-open="true"]{display:grid}
.modal__box{position:relative;width:min(1400px,100%);max-height:100%;display:flex;flex-direction:column;
  border:1px solid var(--line-strong);border-radius:4px;background:var(--night-2);overflow:hidden}

.modal__head{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;
  border-bottom:1px solid var(--line);min-height:var(--headh)}
.modal__nav{display:flex;gap:.3rem;flex:none;margin-right:.35rem}
.modal__title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.95rem}
.modal__pos{flex:none;font-family:var(--mono);font-size:.68rem;letter-spacing:.1em;color:var(--muted)}
.modal__head .spacer{flex:1 1 auto}
@media (max-width:560px){
  .modal__head{gap:.35rem;padding:.6rem .65rem}
  .modal__pos{display:none}
}

/* The body is a viewport for the file. Nothing is stretched: an image keeps its
   proportions and is never scaled up past its own pixel size, because width and
   height stay auto and only the maxima are capped to the window. */
.modal__body{flex:1 1 auto;min-height:0;overflow:auto;display:grid;place-items:center;
  background:rgba(0,0,0,.25);touch-action:pan-y}
.modal__body img{width:auto;height:auto;max-width:calc(100% - 2 * var(--inset));max-height:var(--vmax);
  margin:var(--inset);object-fit:contain;
  -webkit-user-select:none;user-select:none;-webkit-user-drag:none}
.modal__body iframe,.modal__body embed{width:100%;height:var(--vmax);min-height:320px;border:0;background:#fff}
.modal__body video{width:auto;height:auto;max-width:calc(100% - 2 * var(--inset));max-height:var(--vmax);margin:var(--inset)}
.modal__body audio{width:min(520px,100%);margin:2.5rem 1rem}
.modal__body pre{margin:0;width:100%;max-height:var(--vmax);overflow:auto;padding:1.1rem;
  font-family:var(--mono);font-size:.78rem;line-height:1.6;color:var(--ink);white-space:pre-wrap;word-break:break-word;text-align:left}

/* unsupported type */
.modal__none{padding:clamp(2.5rem,9vh,5rem) 1.5rem;text-align:center;color:var(--muted);max-width:34rem}
.modal__none .ico{display:grid;place-items:center;width:46px;height:46px;margin:0 auto 1.1rem;
  border:1px solid var(--line-strong);border-radius:3px;font-family:var(--mono);font-size:.7rem;color:var(--ink)}
.modal__none strong{display:block;color:var(--ink);font-weight:400;font-size:1rem;margin-bottom:.4rem}

/* ------------------------------------------------------------- login dialog */
.dlg{width:min(400px,calc(100% - 2rem));padding:0;border:1px solid var(--line-strong);border-radius:6px;
  background:var(--night-2);color:var(--ink);box-shadow:0 30px 80px -20px rgba(0,0,0,.7)}
.dlg::backdrop{background:rgba(6,5,12,.78);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
.dlg form{display:grid;gap:1.1rem;padding:clamp(1.3rem,4vw,1.8rem)}
.dlg__title{font-family:var(--serif);font-weight:300;font-variation-settings:"opsz" 96,"SOFT" 10;
  font-size:1.7rem;line-height:1.1;letter-spacing:-.02em}
.dlg__lede{color:var(--muted);font-size:.9rem;margin-top:-.4rem}
.field{display:grid;gap:.45rem}
.input{height:44px;padding:0 .85rem;border:1px solid var(--line-strong);border-radius:3px;
  background:rgba(var(--rgb-ink),.035);color:var(--ink);font:inherit;font-size:1rem;width:100%}
.input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgba(var(--rgb-accent),.18)}
.dlg__msg{min-height:1.35em;font-size:.88rem;color:var(--danger)}
.dlg__msg[data-kind="wait"]{color:var(--muted)}
.dlg__warn{font-size:.8rem;color:var(--muted);border-left:2px solid var(--danger);padding:.1rem 0 .1rem .7rem}
.dlg__warn[hidden]{display:none}
.dlg__actions{display:flex;justify-content:flex-end;gap:.5rem}

/* ------------------------------------------------------------- drop overlay */
.drop{position:fixed;inset:0;z-index:120;display:none;padding:clamp(.75rem,2vw,1.5rem);
  background:rgba(6,5,12,.74);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}
.drop[data-on="true"]{display:block}
.drop__box{height:100%;display:grid;place-content:center;justify-items:center;gap:.7rem;text-align:center;
  padding:1.5rem;border:1.5px dashed rgba(var(--rgb-accent),.85);border-radius:8px;
  background:rgba(var(--rgb-accent),.06);pointer-events:none}
.drop__icon{display:grid;place-items:center;width:66px;height:66px;border-radius:50%;margin-bottom:.4rem;
  background:rgba(var(--rgb-accent),.16);color:var(--accent)}
.drop__icon svg{width:28px;height:28px}
.drop__title{font-family:var(--serif);font-weight:300;font-size:clamp(1.7rem,3.4vw,2.6rem);
  line-height:1.05;letter-spacing:-.02em}
.drop__sub{color:var(--muted);max-width:40ch}
.drop code{font-family:var(--mono);font-size:.85em;color:var(--ink);
  background:rgba(var(--rgb-ink),.08);padding:.1em .4em;border-radius:2px}

/* ------------------------------------------------------------- upload panel */
.up{position:fixed;z-index:90;right:clamp(.75rem,2vw,1.5rem);bottom:clamp(.75rem,2vw,1.5rem);
  width:min(410px,calc(100vw - 1.5rem));max-height:min(62vh,540px);display:flex;flex-direction:column;
  border:1px solid var(--line-strong);border-radius:6px;background:var(--night-2);overflow:hidden;
  box-shadow:0 24px 60px -16px rgba(0,0,0,.7)}
.up[hidden]{display:none}
.up__head{display:flex;align-items:center;gap:.4rem;padding:.8rem .7rem .75rem 1rem;flex:none}
.up__titles{flex:1 1 auto;min-width:0}
.up__title{font-size:.93rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.up__sub{font-family:var(--mono);font-size:.63rem;letter-spacing:.06em;color:var(--muted);
  font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-height:1.1em}
.up__total{height:2px;flex:none;background:rgba(var(--rgb-ink),.08)}
.up__total span{display:block;height:100%;width:0;background:var(--live);
  box-shadow:0 0 10px rgba(var(--rgb-live),.7);transition:width .35s linear}
.up__toggle svg{transition:transform .3s var(--ease)}
.up[data-collapsed="true"] .up__toggle svg{transform:rotate(180deg)}
.up[data-collapsed="true"] .up__list,.up[data-collapsed="true"] .up__note{display:none}
.up__note{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:.5rem .75rem;
  padding:.7rem 1rem;border-top:1px solid var(--line);font-size:.84rem;color:var(--muted)}
.up__note[hidden]{display:none}
.up__note .grow{flex:1 1 12rem}
.link{font-family:var(--mono);font-size:.64rem;letter-spacing:.14em;text-transform:uppercase;
  color:var(--accent);border-bottom:1px solid transparent}
.link:hover{border-bottom-color:currentColor}
.link--danger{color:var(--danger)}
.up__list{overflow:auto;overscroll-behavior:contain;border-top:1px solid var(--line)}
.up__item{display:grid;grid-template-columns:34px minmax(0,1fr) 30px;gap:.75rem;align-items:center;
  padding:.65rem .7rem .65rem 1rem;border-bottom:1px solid var(--line)}
.up__item:last-child{border-bottom:0}
.up__ext{display:grid;place-items:center;width:34px;height:34px;border-radius:3px;border:1px solid var(--line);
  font-family:var(--mono);font-size:.5rem;font-weight:500;letter-spacing:.04em;color:var(--muted);
  overflow:hidden;background:rgba(var(--rgb-ink),.03)}
.up__name{font-size:.86rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.up__prog{height:3px;border-radius:2px;margin:.42rem 0 .32rem;background:rgba(var(--rgb-ink),.08);overflow:hidden}
.up__prog span{display:block;height:100%;width:0;background:var(--live);transition:width .25s linear}
.up__meta{font-family:var(--mono);font-size:.61rem;letter-spacing:.04em;color:var(--muted);
  font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.up__item[data-state="done"] .up__prog span{opacity:.45}
.up__item[data-state="done"] .up__ext{color:var(--live);border-color:rgba(var(--rgb-live),.45)}
.up__item[data-state="error"] .up__prog span{background:var(--danger)}
.up__item[data-state="error"] .up__meta{color:var(--danger)}
.up__item[data-state="canceled"]{opacity:.5}
.up__item[data-state="canceled"] .up__prog{visibility:hidden}
.up__done{display:grid;place-items:center;width:30px;height:30px;color:var(--live)}
.up__done svg{width:16px;height:16px}
@media (max-width:560px){
  .up{left:0;right:0;bottom:0;width:auto;max-height:70vh;border-radius:8px 8px 0 0;
    border-left:0;border-right:0;border-bottom:0;padding-bottom:env(safe-area-inset-bottom)}
}

/* ===========================================================================
   Version 2 — the file page, upload links and the administration.
   ======================================================================== */

a.pill{text-decoration:none}
.pill[aria-current="page"]{border-color:var(--accent);color:var(--accent)}

/* tool tile that stays in this tab */
.tool__go .arrow{display:inline-block;transition:transform .4s var(--ease)}
.tool:hover .tool__go .arrow{transform:translateX(3px)}

/* ---- a line of options to pick one from (validity, filters) ---- */
.chips{display:flex;flex-wrap:wrap;gap:.35rem}
.chip{position:relative;display:inline-flex;align-items:center;gap:.4rem;height:30px;padding:0 .75rem;
  border:1px solid var(--line-strong);border-radius:999px;cursor:pointer;
  font-family:var(--mono);font-size:.62rem;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);
  transition:color .2s,border-color .2s,background .2s}
.chip:hover{color:var(--ink);border-color:var(--ink)}
.chip input{position:absolute;opacity:0;pointer-events:none}
.chip:has(input:checked),.chip[aria-pressed="true"]{background:rgba(var(--rgb-accent),.16);border-color:var(--accent);color:var(--accent)}
.chip:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:2px}
.chip .n{color:var(--ink);opacity:.7}

/* ---- the upload-link card ---- */
.pop--share{width:min(380px,calc(100vw - 1.5rem))}
.pop .fld{display:grid;gap:.4rem;margin-top:.85rem}
.pop .fld > .label{font-size:.6rem}
.pop .fld .input{margin-top:0}
.linkbox{display:flex;gap:.4rem;margin-top:.85rem}
.linkbox .input{margin:0;height:36px;font-family:var(--mono);font-size:.72rem;letter-spacing:.02em;min-width:0}
.linkbox .btn-s{height:36px;flex:none}
.pop__note{margin-top:.6rem;font-size:.8rem;color:var(--muted)}
.pop__note a{color:var(--accent);border-bottom:1px solid currentColor}
.bar #shareBtn .txt{white-space:nowrap}
@media (max-width:560px){
  .bar #shareBtn{width:34px;padding:0;justify-content:center}
  .bar #shareBtn .txt{display:none}
}

/* ---- guest mode: what this page is, and until when ---- */
.notice{display:flex;gap:.9rem;align-items:flex-start;margin-bottom:clamp(1.25rem,3vw,1.75rem);
  padding:.95rem 1.1rem;border:1px solid rgba(var(--rgb-accent),.35);border-left:3px solid var(--accent);
  border-radius:4px;background:rgba(var(--rgb-accent),.06)}
.notice[hidden]{display:none}
.notice svg{width:18px;height:18px;flex:none;color:var(--accent);margin-top:.15rem}
.notice strong{display:block;font-weight:400;color:var(--ink)}
.notice span{display:block;color:var(--muted);font-size:.88rem;margin-top:.15rem}
.notice[data-kind="warn"]{border-color:rgba(var(--rgb-danger),.4);border-left-color:var(--danger);background:rgba(var(--rgb-danger),.06)}
.notice[data-kind="warn"] svg{color:var(--danger)}

/* a link that no longer works: the whole section says so, nothing else */
.gone{max-width:36rem;margin:clamp(1rem,4vh,3rem) auto;text-align:center}
.gone .ico{display:grid;place-items:center;width:58px;height:58px;margin:0 auto 1.2rem;border-radius:50%;
  background:rgba(var(--rgb-danger),.12);color:var(--danger)}
.gone .ico svg{width:24px;height:24px}
.gone h2{font-family:var(--serif);font-weight:300;font-size:clamp(1.6rem,3vw,2.2rem);line-height:1.1;letter-spacing:-.02em}
.gone p{margin-top:.7rem;color:var(--muted)}

/* ---- administration ---- */
.stats{display:grid;gap:clamp(.6rem,1.2vw,.9rem);grid-template-columns:repeat(auto-fill,minmax(min(100%,190px),1fr));
  margin-bottom:clamp(1.5rem,3.4vw,2.25rem)}
.stat{padding:1rem 1.15rem;border:1px solid var(--line);border-radius:3px;background:rgba(var(--rgb-ink),.018)}
.stat__n{font-family:var(--serif);font-weight:300;font-size:clamp(1.6rem,2.6vw,2.1rem);line-height:1;letter-spacing:-.02em;
  font-variant-numeric:tabular-nums}
.stat__l{margin-top:.5rem}
.stat--accent .stat__n{color:var(--accent)}
@media (max-width:560px){ .stats{grid-template-columns:1fr 1fr} .stat{padding:.85rem .9rem} }

.gate{max-width:30rem;padding:clamp(1.4rem,3vw,2rem);border:1px solid var(--line);border-radius:4px;
  background:rgba(var(--rgb-ink),.02)}
.gate p{color:var(--muted);margin:.5rem 0 1.2rem}
.gate[hidden]{display:none}

.tbar{display:flex;flex-wrap:wrap;align-items:center;gap:.6rem 1rem;margin-bottom:1rem}
.tbar .spacer{flex:1 1 auto}

/* links: one row per link, a grid like the file list */
.lrow{display:grid;gap:.4rem clamp(.75rem,1.6vw,1.25rem);align-items:center;
  grid-template-columns:minmax(0,1.6fr) 9.5rem 4.5rem 7.5rem 6.5rem 11rem;
  grid-template-areas:"who state visits ups created acts";
  padding:.8rem 0;border-bottom:1px solid var(--line);transition:background .25s}
.lrow:hover{background:rgba(var(--rgb-ink),.025)}
.lrow--head{padding:.45rem 0;border-bottom:1px solid var(--line-strong)}
.lrow--head:hover{background:none}
.lrow--head .r{text-align:right}
.lrow--head > *{font-family:var(--mono);font-size:.58rem;letter-spacing:.16em;text-transform:uppercase;color:var(--muted)}
.lrow .who{grid-area:who;min-width:0}
.lrow .who b{display:block;font-weight:400;font-size:.95rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lrow .who small{display:block;font-family:var(--mono);font-size:.64rem;letter-spacing:.03em;color:var(--muted);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:.15rem}
.lrow .who small.bad{color:var(--danger)}
.lrow .c-state{grid-area:state}
.lrow .c-visits{grid-area:visits;text-align:right}
.lrow .c-ups{grid-area:ups;text-align:right}
.lrow .c-created{grid-area:created}
.lrow .acts{grid-area:acts}
.lrow[data-state="revoked"] .who,.lrow[data-state="expired"] .who{opacity:.62}
.lrow[data-confirm="true"]{background:rgba(var(--rgb-danger),.07)}
.lrow[data-busy="true"]{opacity:.45;pointer-events:none}
.lrow[data-new="true"]{animation:rowNew 2.4s var(--ease)}
.lrow .meta small{display:block;font-size:.58rem;opacity:.75}
.c-state small{display:block;margin-top:.3rem;font-family:var(--mono);font-size:.6rem;letter-spacing:.03em;color:var(--muted);
  white-space:nowrap}
@media (max-width:980px){
  .lrow{grid-template-columns:minmax(0,1fr) auto;
    grid-template-areas:"who acts" "state state" "visits visits" "ups ups" "created created"}
  .lrow--head{display:none}
  .lrow .c-visits,.lrow .c-ups{text-align:left}
  .lrow .meta[data-l]::before{content:attr(data-l) " ";color:var(--muted);opacity:.7}
  .lrow .c-state{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem .6rem}
  .c-state small{margin-top:0}
  .lrow .meta small{display:inline;margin-left:.4rem}
}

.badge{display:inline-flex;align-items:center;gap:.4rem;height:22px;padding:0 .55rem;border-radius:999px;
  font-family:var(--mono);font-size:.56rem;letter-spacing:.14em;text-transform:uppercase;white-space:nowrap;
  border:1px solid var(--line-strong);color:var(--muted)}
.badge::before{content:"";width:5px;height:5px;border-radius:50%;background:currentColor}
.badge--active{color:var(--live);border-color:rgba(var(--rgb-live),.45);background:rgba(var(--rgb-live),.07)}
.badge--active::before{box-shadow:0 0 8px 1px rgba(var(--rgb-live),.6)}
.badge--soon{color:#F5C46B;border-color:rgba(245,196,107,.45);background:rgba(245,196,107,.07)}
.badge--revoked{color:var(--danger);border-color:rgba(var(--rgb-danger),.45);background:rgba(var(--rgb-danger),.06)}

/* activity log */
.log{border-top:1px solid var(--line)}
.lg{display:grid;gap:.25rem clamp(.75rem,1.6vw,1.25rem);align-items:baseline;
  grid-template-columns:8.6rem 9.5rem minmax(7rem,.8fr) 8rem minmax(0,2fr);
  grid-template-areas:"at act who ip data";
  padding:.55rem 0;border-bottom:1px solid var(--line);font-size:.86rem}
.lg:hover{background:rgba(var(--rgb-ink),.025)}
.lg .at{grid-area:at;font-family:var(--mono);font-size:.66rem;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.lg .act-name{grid-area:act;display:flex;align-items:center;gap:.5rem;white-space:nowrap}
.lg .act-name::before{content:"";flex:none;width:6px;height:6px;border-radius:50%;background:var(--muted)}
.lg[data-group="signin"] .act-name::before{background:var(--accent)}
.lg[data-group="files"] .act-name::before{background:var(--live)}
.lg[data-group="links"] .act-name::before{background:var(--warn)}
.lg[data-bad="true"] .act-name{color:var(--danger)}
.lg[data-bad="true"] .act-name::before{background:var(--danger)}
.lg .who{grid-area:who;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}
.lg .who b{font-weight:400;color:var(--ink)}
.lg .ip{grid-area:ip;font-family:var(--mono);font-size:.66rem;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lg .data{grid-area:data;min-width:0;font-family:var(--mono);font-size:.68rem;letter-spacing:.01em;color:var(--muted);
  overflow-wrap:anywhere}
.lg .data b{font-weight:500;color:var(--ink)}
@media (max-width:980px){
  .lg{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"act at" "who ip" "data data"}
  .lg .ip{text-align:right}
}
.more{display:flex;justify-content:center;padding:1.25rem 0}
.more[hidden]{display:none}

/* ---- sign-in with single sign-on ---- */
.dlg__sso{display:grid;gap:.75rem;justify-items:stretch}
.dlg__sso[hidden],.dlg__local[hidden]{display:none}
.dlg__ssobtn{justify-content:center;height:44px;font-size:.7rem}
.dlg__alt{justify-self:center;font-size:.8rem;color:var(--muted);border-bottom:1px solid transparent}
.dlg__alt:hover{color:var(--ink);border-bottom-color:var(--accent)}
.dlg__alt[hidden]{display:none}
.dlg__local{display:grid;gap:1.1rem}
.pill[hidden]{display:none}

/* ---- folders hidden from the public list ---- */
.tag-hidden{flex:none;font-family:var(--mono);font-size:.56rem;letter-spacing:.12em;text-transform:uppercase;
  color:var(--muted);border:1px dashed var(--line-strong);border-radius:999px;padding:.1rem .45rem}
.act[aria-pressed="true"]{color:var(--accent);border-color:rgba(var(--rgb-accent),.55)}

/* ---- administration: tabs and forms ---- */
.tabs{display:flex;flex-wrap:wrap;gap:.35rem;margin-bottom:clamp(1.5rem,3vw,2rem);border-bottom:1px solid var(--line);
  padding-bottom:.75rem}
.tab{height:34px;padding:0 1rem;border:1px solid var(--line);border-radius:999px;font-family:var(--mono);font-size:.62rem;
  letter-spacing:.14em;text-transform:uppercase;color:var(--muted);transition:color .2s,border-color .2s,background .2s}
.tab:hover{color:var(--ink);border-color:var(--line-strong)}
.tab[aria-selected="true"]{color:var(--night);background:var(--accent);border-color:var(--accent);font-weight:500}
.panel[hidden]{display:none}
.section.panel{padding-top:clamp(.25rem,1.5vh,1rem)}
.form{display:grid;gap:1.15rem;max-width:44rem}
.form .field{display:grid;gap:.4rem}
.form .hint{font-size:.82rem;color:var(--muted)}
.form .row2{display:grid;gap:1rem;grid-template-columns:1fr 1fr}
@media (max-width:640px){ .form .row2{grid-template-columns:1fr} }
.switch{display:flex;gap:.75rem;align-items:flex-start;cursor:pointer}
.switch input{appearance:none;-webkit-appearance:none;flex:none;width:38px;height:22px;border-radius:999px;margin:.1rem 0 0;
  background:rgba(var(--rgb-ink),.12);border:1px solid var(--line-strong);position:relative;cursor:pointer;transition:background .2s}
.switch input::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:var(--ink);
  transition:transform .2s var(--ease)}
.switch input:checked{background:var(--accent);border-color:var(--accent)}
.switch input:checked::after{transform:translateX(16px);background:var(--night)}
.switch input:disabled{opacity:.45;cursor:not-allowed}
.switch strong{display:block;font-weight:400}
.switch span span{display:block;font-size:.82rem;color:var(--muted)}
.actions{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}
.msg{font-size:.86rem;min-height:1.3em}
.msg[data-kind="error"]{color:var(--danger)}
.msg[data-kind="ok"]{color:var(--live)}
.card{border:1px solid var(--line);border-radius:4px;padding:1.1rem 1.25rem;background:rgba(var(--rgb-ink),.02)}
.card h3{font-family:var(--serif);font-weight:300;font-size:1.25rem;letter-spacing:-.01em;margin-bottom:.35rem}
.card p{color:var(--muted);font-size:.88rem}
.kv{display:grid;grid-template-columns:minmax(8rem,auto) minmax(0,1fr) auto;gap:.45rem .9rem;align-items:center;margin-top:.8rem}
.kv dt{font-family:var(--mono);font-size:.6rem;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.kv dd{margin:0;font-family:var(--mono);font-size:.74rem;overflow-wrap:anywhere}
@media (max-width:640px){ .kv{grid-template-columns:1fr auto} .kv dt{grid-column:1 / -1} }
.token{font-family:var(--mono);font-size:.8rem;padding:.75rem .9rem;border:1px dashed var(--accent);border-radius:4px;
  background:rgba(var(--rgb-accent),.08);overflow-wrap:anywhere}
.grid2{display:grid;gap:1rem;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));margin-top:1.25rem}
.dir{border-top:1px solid var(--line)}
.dir li{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.2rem 1rem;padding:.6rem 0;border-bottom:1px solid var(--line)}
.dir b{font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dir small{grid-column:1 / -1;font-family:var(--mono);font-size:.64rem;color:var(--muted);overflow-wrap:anywhere}
.dir .off{opacity:.55}
.perm{display:grid;gap:.6rem;padding:1rem 0;border-bottom:1px solid var(--line)}
.perm__head b{font-weight:400;font-size:1rem}
.perm__head small{display:block;font-size:.82rem;color:var(--muted)}
.perm .chips .chip[aria-pressed="true"]{background:rgba(var(--rgb-accent),.16);border-color:var(--accent);color:var(--accent)}
.chip--free{border-style:dashed}
.addgroup{display:flex;gap:.4rem;max-width:26rem}
.addgroup .input{height:34px;font-size:.85rem}


/* ===========================================================================
   3 Components in the FreeIdP style — rounded, quiet surfaces, one accent.
   (These come last on purpose: they set the final look of the rules above.)
   ======================================================================== */

/* buttons */
.pill{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;height:36px;padding:0 .9rem;flex:none;
  border:1px solid var(--line-strong);border-radius:8px;background:var(--surface);color:var(--ink);
  font-family:var(--sans);font-size:.88rem;font-weight:500;letter-spacing:0;text-transform:none;white-space:nowrap;
  -webkit-backdrop-filter:none;backdrop-filter:none;transition:border-color .2s,color .2s,background .2s,filter .2s}
.pill:hover{border-color:var(--accent);color:var(--ink)}
.pill svg{width:16px;height:16px;flex:none}
.pill[disabled]{opacity:.45;cursor:not-allowed}
.pill[disabled]:hover{border-color:var(--line-strong)}
.pill--primary{background:var(--acc-fill);border-color:var(--acc-fill);color:var(--on-acc)}
.pill--primary:hover{background:var(--acc-fill);border-color:var(--acc-fill);color:var(--on-acc);filter:brightness(1.1)}
.pill--danger:not([disabled]){border-color:rgba(var(--rgb-danger),.6);color:var(--danger)}
.pill--danger:not([disabled]):hover{background:var(--danger);border-color:var(--danger);color:#fff}
.pill[aria-current="page"]{border-color:var(--accent);color:var(--accent)}
.pill .caret{width:10px;height:10px;margin-left:-.1rem;opacity:.8}
.pill[hidden]{display:none}
.btn-s{height:32px;padding:0 .75rem;border-radius:8px;border:1px solid var(--line-strong);background:var(--surface);
  font-family:var(--sans);font-size:.82rem;font-weight:500;letter-spacing:0;text-transform:none;color:var(--ink)}
.btn-s:hover{border-color:var(--accent)}
.btn-s--primary{background:var(--acc-fill);border-color:var(--acc-fill);color:var(--on-acc)}
.btn-s--primary:hover{background:var(--acc-fill);border-color:var(--acc-fill);filter:brightness(1.1)}
.btn-s--primary[disabled]:hover{filter:none}
.btn-s--danger{background:var(--danger);border-color:var(--danger);color:#fff}
.btn-s--danger:hover{background:var(--danger);border-color:var(--danger);color:#fff;filter:brightness(1.08)}
.act{border-radius:8px;border-color:transparent;background:none}
.act:hover{color:var(--accent);border-color:transparent;background:var(--surface-2)}
.act[disabled]:hover{border-color:transparent}
.act--danger:hover{color:var(--danger);border-color:transparent;background:rgba(var(--rgb-danger),.1)}
.act[aria-pressed="true"]{color:var(--accent);background:rgba(var(--rgb-fill),.14)}
.link{font-family:var(--sans);font-size:.85rem;letter-spacing:0;text-transform:none;font-weight:500}

/* chips, tags, badges */
.chip{height:30px;padding:0 .8rem;font-family:var(--mono);font-size:.74rem;letter-spacing:.01em;text-transform:none;
  background:none}
.chip:hover{color:var(--ink);border-color:var(--accent)}
.chip:has(input:checked),.chip[aria-pressed="true"],.perm .chips .chip[aria-pressed="true"]{
  background:rgba(var(--rgb-fill),.16);border-color:var(--accent);color:var(--accent)}
.badge{font-size:.62rem;letter-spacing:.1em}
.badge--soon{color:var(--warn);border-color:rgba(var(--rgb-warn),.45);background:rgba(var(--rgb-warn),.08)}
.tag-hidden{font-size:.62rem;letter-spacing:.06em;text-transform:none}

/* form controls */
.input{height:40px;border-radius:8px;background:var(--night);border:1px solid var(--line-strong);font-size:.94rem}
.input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(var(--rgb-accent),.18)}
.filter{border-radius:8px;background:var(--surface);padding:.45rem .8rem}
.filter input{font-family:var(--sans);font-size:.86rem;letter-spacing:0}
.check{border-radius:5px;background:var(--surface)}
.check:checked,.check:indeterminate{background:var(--acc-fill);border-color:var(--acc-fill)}
.check:checked::after{border-color:var(--on-acc)}
.check:indeterminate::after{background:var(--on-acc)}
.switch input{background:rgba(var(--rgb-ink),.14)}
.switch input:checked{background:var(--acc-fill);border-color:var(--acc-fill)}
.switch input::after{background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.3)}
.switch input:checked::after{background:var(--on-acc)}

/* sections and cards */
.section{padding-block:clamp(.75rem,2vh,1.25rem) clamp(1.5rem,4vh,2.5rem)}
.section.panel{padding-top:0}
.sec__head{align-items:center;gap:.5rem 1rem;padding-bottom:.85rem;margin-bottom:1.1rem}
.sec__head h2{font-family:var(--sans);font-weight:500;font-size:1.05rem;letter-spacing:0}
.sec__head .label span.n{color:var(--accent)}
.card{border:1px solid var(--line);border-radius:12px;padding:1.2rem 1.3rem;background:var(--surface)}
.card h3{font-family:var(--sans);font-weight:500;font-size:1rem;letter-spacing:0;margin-bottom:.3rem}
.stat{border-radius:12px;background:var(--surface);border:1px solid var(--line)}
.stat__n{font-weight:400}
.gate{border-radius:12px;background:var(--surface)}
.notice{border-radius:10px;border-left-width:1px}
.diag__fix{border-radius:10px;background:var(--surface)}
.token{border-radius:10px}

/* lists sit on a card */
.list,.log,#links,.dir{border:1px solid var(--line);border-radius:12px;background:var(--surface);overflow:hidden}
.list:empty,.log:empty,#links:empty{display:none}
.row{padding:.55rem 1rem}
.row:last-child,.lg:last-child,.lrow:last-child,.dir li:last-child{border-bottom:0}
.row:hover{background:var(--surface-2)}
.thumb{border-radius:8px;background:var(--surface-2)}
.thumb--dir{background:rgba(var(--rgb-fill),.14);border-color:transparent}
.log{padding:0 1rem}
#links{padding:0 1rem}
.dir li{padding:.6rem 1rem}
.lrow:hover,.lg:hover{background:none}

/* floating things */
.pop{border-radius:12px;background:var(--night-2);box-shadow:var(--shadow)}
.menu__item{border-radius:8px}
.menu__item:hover,.menu__item:focus-visible{background:rgba(var(--rgb-fill),.14)}
.toast{border-radius:10px;background:var(--night-2);box-shadow:var(--shadow)}
.modal__box{border-radius:12px;background:var(--night-2)}
.up{border-radius:12px;background:var(--night-2);box-shadow:var(--shadow)}
.up__total span,.up__prog span{background:linear-gradient(90deg,var(--acc-fill),var(--acc2));box-shadow:none}
.up__ext,.thumb .ext{border-radius:8px}
.drop__box{border-radius:14px}

/* the sign-in dialog, like the FreeIdP sign-in card */
.dlg{border-radius:16px;background:var(--night-2);box-shadow:var(--shadow);width:min(420px,calc(100% - 2rem))}
.dlg form{gap:1rem;padding:clamp(1.4rem,4vw,2rem)}
.dlg__logo{width:48px;height:48px;object-fit:contain}
.dlg__title{font-weight:400;font-size:1.9rem}
.dlg__title em{font-style:italic;color:var(--accent)}
.dlg__ssobtn{height:44px;font-size:.95rem}
.dlg__actions .pill{min-width:90px}

/* the user in the header */
.user{display:flex;align-items:center;gap:.35rem}
.user[hidden]{display:none}
.avatar{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;flex:none;
  border:1px solid var(--accent);background:rgba(var(--rgb-fill),.16);color:var(--accent)}
.avatar svg{width:16px;height:16px}
.avatar .ini{font-family:var(--sans);font-size:.72rem;font-weight:600;letter-spacing:0}

/* the old in-page tab bar is replaced by the menu on the left */
.tabs{display:none}

/* branding page */
.swatches{display:flex;flex-wrap:wrap;gap:.6rem}
.swatch{display:flex;align-items:center;gap:.65rem;min-width:150px;height:46px;padding:0 .8rem;border-radius:10px;
  border:1px solid var(--line-strong);background:var(--surface);color:var(--ink);font-size:.9rem}
.swatch:hover{border-color:var(--accent)}
.swatch .dot{width:24px;height:24px;border-radius:50%;flex:none}
.swatch[aria-pressed="true"]{border-color:var(--accent);box-shadow:0 0 0 3px rgba(var(--rgb-accent),.18)}
.swatch[aria-pressed="true"]::after{content:"✓";margin-left:auto;color:var(--accent);font-size:.85rem}
.seg{display:inline-flex;padding:3px;border-radius:10px;background:var(--surface-2);border:1px solid var(--line)}
.seg button{height:32px;padding:0 .9rem;border-radius:7px;color:var(--muted);font-size:.88rem}
.seg button[aria-pressed="true"]{background:var(--surface);color:var(--ink);font-weight:500;box-shadow:0 1px 3px rgba(0,0,0,.2)}
.bgopts{display:flex;flex-wrap:wrap;gap:.8rem}
.bgopt{display:grid;gap:.4rem;color:var(--muted);font-size:.82rem;text-align:left}
.bgopt .pv{display:block;width:120px;height:68px;border-radius:10px;border:2px solid var(--line);background:var(--surface)}
.bgopt[aria-pressed="true"]{color:var(--ink)}
.bgopt[aria-pressed="true"] .pv{border-color:var(--accent)}
.bgopt .pv[data-bg="aurora"]{background:radial-gradient(60% 140% at 90% 0%,rgba(var(--rgb-acc2),.45),transparent 70%),radial-gradient(60% 120% at 5% 100%,rgba(var(--rgb-fill),.5),transparent 70%),var(--surface)}
.bgopt .pv[data-bg="dusk"]{background:linear-gradient(160deg,rgba(var(--rgb-fill),.55),rgba(var(--rgb-acc2),.15) 55%,var(--surface))}
.bgopt .pv[data-bg="grid"]{background:linear-gradient(var(--line-strong) 1px,transparent 1px) 0 0/14px 14px,linear-gradient(90deg,var(--line-strong) 1px,transparent 1px) 0 0/14px 14px,radial-gradient(70% 130% at 85% 0%,rgba(var(--rgb-fill),.4),transparent 70%),var(--surface)}
.logo-box{display:flex;flex-wrap:wrap;align-items:center;gap:1rem}
.logo-box .pv{display:grid;place-items:center;width:72px;height:72px;border-radius:14px;border:1px solid var(--line);background:var(--surface-2)}
.logo-box .pv img{width:56px;height:56px;object-fit:contain}
.brand-cards{display:grid;gap:1rem;max-width:62rem}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;
    transition-duration:.001ms!important}
}

/* preview of a picture or a video: the window fits the medium — no grey frame.
   At most 90 % of the screen; the picture keeps its proportions and is never
   scaled up past its own size. */
.modal__box--fit{--fw:min(90vw,calc(100vw - 2 * var(--pad)));--fh:min(90vh,calc(100svh - 2 * var(--pad)));
  width:auto;min-width:min(340px,var(--fw));max-width:var(--fw);max-height:var(--fh)}
.modal__box--fit .modal__body{display:flex;justify-content:center;align-items:center;overflow:hidden;background:#000}
.modal__box--fit .modal__body img,.modal__box--fit .modal__body video{display:block;margin:0;
  max-width:calc(var(--fw) - 2px);max-height:calc(var(--fh) - var(--headh) - 2px);width:auto;height:auto}
