/* Hidden Docs — public site: warm-minimal directory (artcraft-inspired)
   light: warm paper #f2f1ee, ink #101014, accent #2d81ff · admin: dark pro panel */

/* ---------- tokens ---------- */
:root {
  --bg: #f2f1ee;
  --bg-raised: #faf9f7;
  --bg-sunken: #e9e8e4;
  --ink: #101014;
  --ink-strong: #000;
  --muted: rgba(16,16,20,.62);
  --faint: rgba(16,16,20,.42);
  --line: rgba(16,16,20,.16);
  --line-strong: rgba(16,16,20,.36);
  --accent: #2d81ff;
  --accent-ink: #1659c4;
  --accent-soft: rgba(45,129,255,.10);
  --invert-bg: #101014;
  --invert-fg: #f2f1ee;
  --danger: #b3261e;
  --ok: #017a54;
  --radius: 10px;
  --font: "Archivo", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

/* ---------- base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-ink); }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: #fff; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(242,241,238,.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 22px; height: 58px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.02em; font-size: 1.05rem; }
.brand .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.topnav { display: flex; gap: 4px; margin-left: 8px; }
.topnav a { padding: 6px 12px; border-radius: 999px; font-size: .875rem; color: var(--muted); }
.topnav a:hover { color: var(--ink); background: var(--bg-sunken); }
.topbar .spacer { flex: 1; }
.topbar .count-pill {
  font-size: .75rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px;
  font-variant-numeric: tabular-nums;
}

/* ---------- hero / search ---------- */
.hero { padding: 52px 0 8px; text-align: center; }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.08; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--muted); margin-top: 10px; font-size: 1.02rem; }
.searchform { max-width: 560px; margin: 26px auto 0; position: relative; }
.searchform input {
  width: 100%; height: 52px; padding: 0 54px 0 18px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--bg-raised); color: var(--ink);
  font: inherit; font-size: 1rem; outline: none;
  box-shadow: 0 1px 2px rgba(16,16,20,.04), 0 8px 24px -18px rgba(16,16,20,.25);
  transition: border-color .15s, box-shadow .15s;
}
.searchform input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.searchform button {
  position: absolute; right: 8px; top: 8px; height: 36px; width: 44px;
  border: 0; border-radius: 9px; background: var(--invert-bg); color: var(--invert-fg);
  cursor: pointer; display: grid; place-items: center;
}
.searchform button:hover { background: #232329; }

/* ---------- category chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 26px 0 8px; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg-raised); font-size: .84rem; color: var(--muted);
  transition: all .13s;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.active { background: var(--invert-bg); color: var(--invert-fg); border-color: var(--invert-bg); }

/* ---------- file grid ---------- */
.section { padding: 30px 0 70px; }
.sec-head { display: flex; align-items: baseline; gap: 12px; margin: 26px 0 16px; flex-wrap: wrap; }
.sec-head .idx { font-family: var(--mono); font-size: .78rem; color: var(--faint); }
.sec-head h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
.sec-head .rule { flex: 1; border-top: 1px solid var(--line); align-self: center; min-width: 24px; }
.explore { font-size: .82rem; font-weight: 600; color: var(--accent-ink); white-space: nowrap; }
.explore:hover { text-decoration: underline; }

/* ---------- directory-style file list (minimal table look) ---------- */
.flist {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-raised); overflow: hidden;
  box-shadow: 0 1px 2px rgba(16,16,20,.04);
}
.lcount { font-family: var(--mono); font-size: .74rem; color: var(--faint); margin: 0 0 8px; }
.lrow {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px 13px 0;
  border-bottom: 1px solid var(--line);
  background: transparent; transition: background .12s;
  counter-increment: rownum;
  position: relative;
}
.flist { counter-reset: rownum; }
.lrow:last-child { border-bottom: 0; }
.lrow::before {
  content: counter(rownum, decimal-leading-zero);
  font-family: var(--mono); font-size: .7rem; color: var(--faint);
  flex: none; width: 44px; text-align: center;
  border-right: 1px solid var(--line); margin-right: 2px; align-self: stretch;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-sunken); transition: color .12s, background .12s;
}
.lrow:hover { background: var(--accent-soft); }
.lrow:hover::before { color: var(--accent-ink); background: rgba(45,129,255,.12); }
/* main cell is an <a> — same look as before, whole title block is the link */
.lrow a.lmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
  color: inherit; text-decoration: none; }
.lrow a.lmain:hover .lname { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.lrow .lname { font-weight: 600; font-size: .92rem; letter-spacing: -.01em; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .lname.mono { font-family: var(--mono); font-weight: 500; font-size: .85rem; color: var(--muted); }
.lrow .fname { font-family: var(--mono); font-size: .72rem; color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .fdirs { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: 260px; }
.lrow .fdir { font-size: .74rem; color: var(--accent-ink); background: var(--accent-soft);
  padding: 3px 10px; border-radius: 999px; white-space: nowrap; text-decoration: none; }
.lrow .fdir:hover { text-decoration: underline; }
.lrow .fdir.dim { color: var(--muted); background: var(--bg-sunken); }
.lrow .lsize { font-family: var(--mono); font-size: .74rem; color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap; width: 68px; text-align: right; }
/* preview eye — sits just before the row arrow */
.lrow .leye { flex: none; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-raised); color: var(--muted);
  cursor: pointer; padding: 0; transition: color .12s, border-color .12s, background .12s; }
.lrow .leye:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.lrow .leye[hidden] { display: none; }
.lrow a.lgo { color: var(--faint); font-size: .9rem; flex: none; width: 20px; text-align: center;
  text-decoration: none; transition: color .12s, transform .12s; }
.lrow:hover a.lgo { color: var(--accent-ink); transform: translateX(2px); }

/* ---------- lazy preview lightbox (loads only on click) ---------- */
.lb { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  background: rgba(12,14,18,.72); backdrop-filter: blur(3px); padding: 28px; }
.lb img { max-width: min(92vw, 900px); max-height: 82vh; border-radius: 10px;
  box-shadow: 0 18px 60px rgba(0,0,0,.45); background: var(--bg-raised); }
.lb .lb-x { position: fixed; top: 14px; right: 16px; width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35); background: rgba(20,22,26,.5); color: #fff; font-size: 1.1rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lb .lb-spin { position: absolute; color: #fff; font-family: var(--mono); font-size: .8rem; }

/* ---------- directory folder stack (home) ---------- */
.fstack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.fstack {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-raised); transition: border-color .12s, transform .12s;
}
.fstack:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.fstack svg { color: var(--accent); flex: none; }
.fstack-name { flex: 1; min-width: 0; font-weight: 600; font-size: .88rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fstack-n { font-family: var(--mono); font-size: .72rem; color: var(--faint); }

@media (max-width: 640px) {
  .lrow { gap: 10px; padding: 11px 12px 11px 0; }
  .lrow::before { width: 34px; }
  .lrow .fdirs { display: none; }
  .lrow .lname { font-size: .88rem; }
  .lrow .lsize { width: auto; }
  .lrow .leye { width: 30px; height: 30px; }
  .fstack-grid { grid-template-columns: 1fr; }
}

/* ---------- file page ---------- */
.filepage { max-width: 760px; margin: 0 auto; padding: 40px 20px 80px; }
.crumb { font-size: .8rem; color: var(--faint); margin-bottom: 18px; display: flex; gap: 6px; }
.crumb a:hover { color: var(--ink); }
.filepage .preview { border-radius: 12px; border: 1px solid var(--line); margin-bottom: 22px; width: 100%; }
.filepage h1 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.fmeta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.fmeta .kv { font-size: .78rem; color: var(--muted); border: 1px solid var(--line); background: var(--bg-raised); padding: 4px 10px; border-radius: 999px; }
.fmeta .kv b { color: var(--ink); font-weight: 600; }
.filepage .desc { margin: 20px 0; color: rgba(16,16,20,.8); white-space: pre-wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--invert-bg); color: var(--invert-fg);
  padding: 13px 26px; border-radius: 11px; font-weight: 600; font-size: .95rem;
  transition: transform .12s, opacity .12s;
}
.btn:hover { transform: translateY(-1px); color: var(--invert-fg); opacity: .92; }
.btn .bytes { font-family: var(--mono); font-size: .78rem; opacity: .7; }

/* ---------- misc ---------- */
.empty { color: var(--faint); text-align: center; padding: 60px 0; }
.pager { display: flex; gap: 10px; justify-content: center; margin-top: 34px; }
.pager a { font-size: .85rem; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--bg-raised); }
.pager a:hover { color: var(--ink); border-color: var(--line-strong); }
code { font-family: var(--mono); font-size: .85em; background: var(--bg-sunken); padding: 1px 6px; border-radius: 5px; }
.footer { border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--faint); font-size: .82rem; }
.footer-in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ==========================================================================
   ADMIN — light professional panel
   ========================================================================== */
body.admin {
  --bg: #f4f3f0; --bg-raised: #ffffff; --bg-sunken: #ebeae5;
  --ink: #17181c; --ink-strong: #000; --muted: #5c6068; --faint: #8b8f98;
  --line: #e4e2dc; --line-strong: #c8c5bd;
  --invert-bg: #101014; --invert-fg: #f4f3f0;
  --accent: #2d81ff; --accent-ink: #1659c4; --accent-soft: rgba(45,129,255,.10);
  background: var(--bg); color: var(--ink);
  min-height: 100vh;
}
.admin-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.aside {
  background: var(--bg-raised); border-right: 1px solid var(--line);
  padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.aside .brand { padding: 4px 10px 16px; color: var(--ink); }
.aside .brand small { display: block; font-size: .66rem; color: var(--faint); letter-spacing: .14em; text-transform: uppercase; margin-top: 2px; }
.anav { display: flex; flex-direction: column; gap: 2px; }
.anav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; font-size: .875rem; color: var(--muted);
}
.anav a:hover { background: var(--bg-sunken); color: var(--ink); }
.anav a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.anav .sep { margin: 12px 10px 6px; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.aside .foot { margin-top: 22px; padding: 0 10px; font-size: .74rem; color: var(--faint); }
.main { padding: 30px 34px 70px; max-width: 1160px; width: 100%; margin: 0 auto; justify-self: center; }
.main h1 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 4px; }
.main .sub { color: var(--faint); font-size: .85rem; margin-bottom: 22px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.stat b { display: block; font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: .76rem; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }

/* tables */
.tblwrap { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; margin-bottom: 22px; }
.tblwrap table { min-width: 640px; }
/* compact inline row-edit form (categories page): inputs shrink, wrap to a 2nd line instead of squeezing columns */
.tbl td form.formrow { flex-wrap: wrap; row-gap: 4px; }
.tbl td form.formrow input, .tbl td form.formrow select { width: auto; min-width: 90px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tbl th { text-align: left; padding: 11px 14px; color: var(--faint); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--line); background: var(--bg-sunken); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: rgba(16,16,20,.02); }
.tbl .mono { font-family: var(--mono); font-size: .8rem; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.badge.inbox { background: rgba(217,119,6,.12); color: #b45309; }
.badge.published { background: rgba(1,122,84,.10); color: #017a54; }
.badge.hidden { background: rgba(107,114,128,.12); color: #4b5563; }
.badge.pending { background: rgba(45,129,255,.10); color: #1659c4; }
.badge.awaiting { background: rgba(124,58,237,.10); color: #6d28d9; }
.badge.scanning { background: rgba(217,119,6,.12); color: #b45309; }
.badge.imported { background: rgba(1,122,84,.10); color: #017a54; }
.badge.cancelled { background: rgba(179,38,30,.10); color: #b3261e; }

/* forms */
.cardpanel { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 12px; padding: 22px; margin-bottom: 22px; }
.cardpanel h2 { font-size: 1rem; font-weight: 700; margin-bottom: 14px; }
label { display: block; margin: 12px 0; font-size: .8rem; color: var(--muted); font-weight: 600; }
label small { display: block; color: var(--faint); font-weight: 400; margin-top: 2px; }
input, select, textarea {
  width: 100%; margin-top: 6px;
  background: var(--bg-sunken); border: 1px solid var(--line-strong); color: var(--ink);
  border-radius: 9px; padding: 10px 12px; font: inherit; font-size: .9rem; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
button, .btn2 {
  background: var(--invert-bg); color: var(--invert-fg); border: 0; border-radius: 9px;
  padding: 10px 18px; font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; transition: opacity .12s;
}
button:hover, .btn2:hover { opacity: .88; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line-strong); }
button.ghost:hover { color: var(--ink); }
button.danger { background: #b3261e; color: #fff; }
button.sm { padding: 6px 12px; font-size: .8rem; }
.formrow { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.formrow label { margin: 0; }

/* notices */
.ok { background: rgba(1,122,84,.08); border: 1px solid rgba(1,122,84,.35); color: #015c41; border-radius: 10px; padding: 11px 15px; margin: 12px 0; font-size: .88rem; }
.err { background: rgba(179,38,30,.07); border: 1px solid rgba(179,38,30,.35); color: #8f1f19; border-radius: 10px; padding: 11px 15px; margin: 12px 0; font-size: .88rem; }
.hint { color: var(--faint); font-size: .8rem; margin-top: 8px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.login-card { width: 380px; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 16px; padding: 34px; }
.login-card .brand { margin-bottom: 24px; }

/* misc admin */
.kvlist { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: .86rem; }
.kvlist dt { color: var(--faint); }
.kvlist dd { color: var(--ink); }
.filehead { display: flex; justify-content: space-between; align-items: start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.filehead .orig { color: var(--faint); font-size: .82rem; font-family: var(--mono); word-break: break-all; }
.scanbox { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 20px; }
.scanbox label { margin: 0; }
.scanbox input { width: 130px; }
.checkcell input { width: auto; margin: 0; }

/* image upload + preview */
.imgprev { max-width: 320px; border-radius: 10px; border: 1px solid var(--line); display: block; margin-top: 10px; }
.uprow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.uprow input[type=file] { width: auto; max-width: 340px; padding: 8px; background: var(--bg-raised); }


/* sort options (public) */
.sortrow { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.sopt { font-size: .78rem; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--bg-raised); }
.sopt:hover { color: var(--ink); border-color: var(--line-strong); }
.sopt.on { background: var(--ink-strong); color: var(--bg-raised); border-color: var(--ink-strong); }

/* bulk actions bar (admin) */
.bulkbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bulkbar .inline { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-size: .82rem; color: var(--muted); font-weight: 600; cursor: pointer; }
.bulkbar .inline input { width: auto; margin: 0; }
.bulkbar select { margin-top: 0; }

/* ── mobile hamburger (below 900px the topnavs become a drop sheet) ── */
.navtoggle { display: none; width: 40px; height: 40px; margin-right: -8px; border: 1px solid var(--line-strong);
  border-radius: 9px; background: var(--bg-raised); cursor: pointer; padding: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.navtoggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink, #111); transition: transform .15s, opacity .15s; }
.navtoggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.navtoggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.navtoggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.mobnav { display: none; border-bottom: 1px solid var(--line); background: var(--bg-raised); }
.mobnav a { display: block; padding: 12px 22px; border-top: 1px solid var(--line); font-size: .95rem; color: var(--ink); }
.mobnav a:first-child { border-top: 0; }
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .aside { position: static; height: auto; min-width: 0; overflow-x: hidden; }
  .anav { flex-direction: row; flex-wrap: wrap; }
  .anav a { white-space: nowrap; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
  .topnav { display: none; }
  .navtoggle { display: flex; }
  .mobnav { display: block; }
  .mobnav[hidden] { display: none; }
  .row2 { grid-template-columns: 1fr; }
  .main { padding: 20px 16px 50px; min-width: 0; overflow-x: hidden; }
  .tblwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl { min-width: 640px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .filehead { flex-direction: column; }
  .formrow, .bulkbar, .scanbox { flex-wrap: wrap; }
  .bulkbar select, .scanbox input { max-width: 100%; }
}

/* ---------- P6: auth, buy, checkout, payment, account ---------- */
.authwrap { min-height: 60vh; display: flex; align-items: flex-start; justify-content: center; padding: 48px 20px 80px; }
.authcard {
  width: 100%; max-width: 460px; background: var(--bg-raised);
  border: 1px solid var(--line); border-radius: 14px; padding: 30px 28px;
  box-shadow: 0 1px 2px rgba(16,16,20,.04), 0 12px 32px -24px rgba(16,16,20,.3);
}
.authcard h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.authcard label { display: block; margin: 14px 0 0; font-size: .82rem; color: var(--muted); }
.authcard input, .authcard select {
  width: 100%; margin-top: 6px; padding: 11px 13px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--bg); color: var(--ink); font: inherit; outline: none;
  transition: border-color .13s, box-shadow .13s;
}
.authcard input:focus, .authcard select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.authcard .btn { margin-top: 20px; width: 100%; justify-content: center; }
.authcard .btn.ghost { margin-top: 10px; background: transparent; border-color: var(--line-strong); color: var(--muted); }
.formhint { font-size: .78rem; color: var(--faint); margin-top: 12px; line-height: 1.5; }
.authalt { font-size: .8rem; color: var(--faint); margin-top: 16px; }
.err { background: rgba(179,38,30,.08); border: 1px solid rgba(179,38,30,.3); color: var(--danger);
  padding: 10px 14px; border-radius: 10px; font-size: .85rem; margin: 12px 0 0; }

.buypage { padding-bottom: 80px; }
.quota-pill {
  display: inline-block; margin: 4px 0 20px; padding: 8px 16px; border-radius: 999px;
  font-size: .84rem; font-weight: 600; color: var(--muted);
  background: var(--bg-raised); border: 1px solid var(--line);
}
.quota-pill.ok { color: var(--ok); background: rgba(1,122,84,.08); border-color: rgba(1,122,84,.25); }
.pkggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.pkgcard {
  border: 1px solid var(--line); border-radius: 14px; background: var(--bg-raised);
  padding: 22px 18px; display: flex; flex-direction: column; gap: 6px; text-align: center;
  transition: border-color .13s, transform .13s, box-shadow .13s;
}
.pkgcard:hover { border-color: var(--line-strong); transform: translateY(-2px);
  box-shadow: 0 10px 28px -18px rgba(16,16,20,.28); }
.pkg-units { font-weight: 700; font-size: .95rem; letter-spacing: -.01em; }
.pkg-price { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; color: var(--ink-strong); }
.pkg-note { font-size: .74rem; color: var(--faint); }
.pkgbtn { margin-top: 12px; justify-content: center; }
.buynote { margin-top: 26px; font-size: .78rem; color: var(--faint); text-align: center; }

.checkout-card { max-width: 680px; }
.sumbox { border: 1px solid var(--line); border-radius: 12px; margin-top: 18px; overflow: hidden; }
.sumrow { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.sumrow:last-child { border-bottom: 0; }
.sumrow b { color: var(--ink); font-variant-numeric: tabular-nums; }
.sumrow.total { background: var(--bg-sunken); font-weight: 700; color: var(--ink); }
.sumrow.total b { font-size: 1.05rem; }

.pay-card { max-width: 680px; }
.pay-sub { font-size: .85rem; color: var(--muted); line-height: 1.55; }
.pay-addr { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.pay-addr .lbl { font-size: .76rem; color: var(--faint); }
.pay-addr code {
  display: block; padding: 13px 15px; border: 1px dashed var(--line-strong); border-radius: 10px;
  background: var(--bg-sunken); font-size: .8rem; word-break: break-all; color: var(--ink);
}
.cp { padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--invert-bg); color: var(--invert-fg); font-size: .78rem; font-weight: 600; cursor: pointer; }
.cp:hover { background: #232329; }
.cp.sm { padding: 5px 12px; font-size: .74rem; }
.cp.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.pay-status {
  margin-top: 20px; padding: 14px 16px; border-radius: 10px; display: flex; align-items: center; gap: 10px;
  background: var(--accent-soft); color: var(--accent-ink); font-size: .88rem; font-weight: 600;
}
.pay-status.paid { background: rgba(1,122,84,.1); color: var(--ok); }
.spin {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid rgba(45,129,255,.25); border-top-color: var(--accent);
  animation: hdspin .8s linear infinite;
}
.pay-status.paid .spin { display: none; }
@keyframes hdspin { to { transform: rotate(360deg); } }

.accpage { padding: 40px 20px 80px; }
.accemail { color: var(--muted); font-size: .85rem; }
.plist { width: 100%; border-collapse: collapse; background: var(--bg-raised);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.plist th { text-align: left; font-size: .74rem; color: var(--faint); font-weight: 600;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg-sunken); }
.plist td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: .85rem; }
.plist tr:last-child td { border-bottom: 0; }
.plist td.empty { color: var(--faint); text-align: center; padding: 22px; }

/* generate-download-link button + progress */
.genbox { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.genlink-btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; font-size: .95rem; }
.genlink-btn .dl-ico {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: rgba(255,255,255,.18); font-weight: 800; font-size: .95rem;
}
.genhint { font-size: .78rem; color: var(--faint); }
.genprogress { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.genprogress .genbar {
  height: 6px; border-radius: 999px; background: var(--bg-sunken); overflow: hidden; position: relative;
}
.genprogress .genbar > i {
  display: block; height: 100%; width: 0%; border-radius: 999px;
  background: var(--accent); transition: width .5s; position: relative; z-index: 1;
}
/* indeterminate shimmer only while no concrete % is known yet */
.genprogress .genbar.pending::after {
  content: ""; position: absolute; inset: 0; width: 40%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: hdslide 1.2s ease-in-out infinite;
}
@keyframes hdslide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
.genprogress .gentxt { font-size: .8rem; color: var(--muted); }
.genbox.done .genlink-btn { background: var(--ok); }

/* dirlinks on file page */
.dirlinks { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.dirlinks a { color: var(--accent-ink); }
.dirlinks a:hover { text-decoration: underline; }
.dirlinks .sep { color: var(--faint); }

/* ── media library grid (admin) ─────────────────────────────── */
.mediagrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.mediacard { background: var(--panel, #171b26); border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.mediacard img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--bg-sunken, #232836); }
.mediameta { font-size: .72rem; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.mediacap { font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dim { color: var(--faint); }
/* gallery strip on the file edit page */
.galstrip { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.galstrip .gitem { width: 110px; text-align: center; }
.galstrip .gitem img { width: 110px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.galstrip .gitem .star { color: var(--faint); font-size: .7rem; }

/* cache-bust 2026-11-15d: hidden!important filter fix + token sublabels + conditional min badge */
/* ── account panel (redesigned 2026-11-15) ── */
.accpage { max-width: 860px; }
.acc-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px;
  padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-raised);
  margin-bottom: 26px; flex-wrap: wrap; }
.acc-hero h1 { font-size: 1.25rem; margin: 0 0 4px; }
.acc-id .accemail { margin: 0; color: var(--muted); font-size: .82rem; }
.acc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.acchint { font-size: .72rem; color: var(--faint); }
.plist .warn { color: #b45309; font-weight: 700; }
.ta-r { text-align: right; }
.acc-pass { max-width: 420px; display: flex; flex-direction: column; gap: 10px; }
.acc-pass .btn2 { align-self: flex-start; }
/* public gallery strip on the file page */
.pubgal { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.pubgal a img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }

/* ── checkout coin picker (4-col grid + network filter chips) ── */
.coinpick { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; }
.coinpick > .lbl { font-size: .78rem; color: var(--muted); font-weight: 600; }
.netfilter { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; }
.netchip { border: 1px solid var(--line-strong); background: var(--bg-raised); color: var(--muted);
  font: 600 .72rem/1.4 system-ui, sans-serif; padding: 5px 10px; border-radius: 999px; cursor: pointer; }
.netchip:hover { color: var(--ink); border-color: #9aa0a6; }
.netchip.active { background: var(--ink, #111); color: #fff; border-color: var(--ink, #111); }
.netchip small { opacity: .65; margin-left: 3px; font-weight: 500; }
.coingrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.coinrow { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 10px 6px 8px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  background: var(--bg-raised); transition: border-color .12s, background .12s;
  color: var(--ink); font-weight: 400; text-align: center; }   /* override the global invert button look */
.coinrow[hidden] { display: none !important; }   /* .coinrow{display:flex} would otherwise override the hidden attribute — that killed the network filter */
.coinrow:hover { border-color: #9aa0a6; }
.coinrow.sel { border-color: var(--ink, #111); background: var(--bg-sunken, rgba(0,0,0,.05));
  box-shadow: 0 0 0 2px var(--ink, #111) inset; }
.coinrow.sel .coinname b { text-decoration: underline; text-underline-offset: 2px; }
.coinic { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.coinic img { width: 22px; height: 22px; border-radius: 50%; display: block; }
.coinic.big { width: 40px; height: 40px; }
.coinic.big img { width: 32px; height: 32px; }
.coinph { font-size: .58rem; font-weight: 700; color: var(--faint); }
.coinname { display: flex; flex-direction: column; gap: 1px; min-width: 0; line-height: 1.25; }
.coinname b { font-size: .82rem; font-weight: 700; }
.coinname small { font-size: .66rem; color: var(--muted); max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; display: block; }
.coinmin { flex: none; font-size: .64rem; color: var(--faint); font-family: var(--mono); }
@media (max-width: 640px) {
  .coingrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coinname small { white-space: normal; }
}

/* ── payment screen: coin header, numbered steps, balanced grid ── */
.paycoin { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.paycoin-id { display: flex; flex-direction: column; gap: 2px; }
.paynet { font-size: .78rem; color: var(--muted); font-weight: 600; }
.paysteps { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
.paystep { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raised); }
.stepnum { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--ink, #111); color: #fff; font-size: .74rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.stepbody { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.steplbl { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 600; }
.stepval { font-size: 1.02rem; word-break: break-all; }
.stepval b { font-size: 1.15rem; }
.stepsub { font-size: .74rem; color: var(--muted); }
.paystep .cp { flex: none; }
.paygrid { display: flex; gap: 18px; align-items: stretch; margin: 0 0 14px; flex-wrap: wrap; }
.payqr { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.payqr img { border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; }
.payfacts { flex: 1; min-width: 230px; margin: 0; padding: 4px 0; list-style: none; display: flex; flex-direction: column; justify-content: center; gap: 9px; }
.payfacts li { display: flex; justify-content: space-between; gap: 12px; font-size: .82rem; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.payfacts li:last-child { border-bottom: 0; padding-bottom: 0; }
.payfacts span { color: var(--faint); }
.payfacts b { text-align: right; }

/* ── admin: autocomplete directory picker ── */
.dirpick { display: flex; flex-direction: column; gap: 8px; }
.dirpick-in { position: relative; }
.dirpick-in input { width: 100%; }
.dirpick-drop { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40; background: var(--bg-raised, #fff);
  border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.14); max-height: 260px; overflow: auto; padding: 4px; }
.diropt { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; width: 100%; text-align: left;
  padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-size: .84rem; }
.diropt:hover, .diropt:focus { background: var(--bg-sunken, rgba(0,0,0,.05)); outline: none; }
.diropt small { color: var(--faint); font-size: .7rem; }
.dirpick-list { display: flex; flex-wrap: wrap; gap: 6px; }
.dirpick-list:empty::after { content: 'none selected yet'; color: var(--faint); font-size: .76rem; }
.dirchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--bg-sunken, rgba(0,0,0,.04)); font-size: .8rem; }
.dirx { border: 0; background: var(--ink, #111); color: #fff; width: 18px; height: 18px; border-radius: 50%;
  cursor: pointer; font: 500 13px/1 system-ui, sans-serif; display: inline-flex; align-items: center;
  justify-content: center; padding: 0; flex: 0 0 auto; transform: translateY(-1px); }
.dirx:hover { background: #b91c1c; }

/* ── admin: zip editor ── */
#ziptbl .zipren { width: 100%; box-sizing: border-box; padding: 5px 8px; font-size: .8rem; font-family: var(--mono); }
#ziptbl tr:has(.zipdel:checked) { background: rgba(220,38,38,.07); text-decoration: line-through; }
#ziptbl tr:has(.zipren:not([value=""])) td:nth-child(2) { color: var(--faint); }

/* ── checkout coin picker: click-to-select highlighted boxes ── */
.coinpick .coinrow { cursor: pointer; user-select: none; }
