/*
Theme Name: DyarLinks Cloud
Theme URI: https://dyarlinks.net
Author: Dyar.pk
Author URI: https://dyar.pk
Description: Theme for DyarLinks file mirror links. Needs the DyarLinks Ultimate plugin. Public file and pack pages plus the uploader panel.
Version: 1.6.1
Requires PHP: 7.4
Text Domain: dyarlinks-cloud
*/

:root {
  --ink: #12303a;
  --ink-2: #1b4450;
  --ink-3: #275966;
  --mist: #eef3f2;
  --surface: #ffffff;
  --line: #d6e1df;
  --text: #17262b;
  --muted: #5c7177;
  --gold: #f2a93b;
  --gold-deep: #b9740d;
  --ok: #2f9e6f;
  --bad: #d1495b;
  --wait: #8a9ba0;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --head: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.55 var(--body);
  color: var(--text);
  background: var(--mist);
}
a { color: var(--ink-3); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 14px/1 var(--body); padding: 11px 16px; border-radius: var(--r-sm);
  border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--ink); color: #fff;
}
.btn:hover { background: var(--ink-2); }
.btn-gold { background: var(--gold); color: #2b1a00; }
.btn-gold:hover { background: #f6b958; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--mist); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: #efc3ca; }
.btn-danger:hover { background: #fdf1f3; }
.btn-sm { padding: 7px 10px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: wait; }

.input, .select, .textarea {
  width: 100%; font: 14px/1.4 var(--body); color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px;
}
.textarea { min-height: 150px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(39, 89, 102, .15); }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.help { color: var(--muted); font-size: 13px; margin: 6px 0 0; }

/* ---------- extension tag ---------- */
.ext {
  display: inline-grid; place-items: center; min-width: 44px; height: 26px; padding: 0 8px;
  border-radius: var(--r-sm); background: var(--gold); color: #2b1a00;
  font: 700 12px/1 var(--head); text-transform: lowercase;
}

/* =========================================================
   Public pages (home, file, pack)
   ========================================================= */
.pub-head { background: var(--ink); color: #fff; }
.pub-head .wrap { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 700 20px/1 var(--head); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--gold); display: grid; place-items: center; color: var(--ink); }
.pub-head nav a { color: #cfe0e2; text-decoration: none; font-size: 14px; margin-left: 18px; }
.wrap { max-width: 860px; margin: 0 auto; }
.pub-main { padding: 28px 16px 48px; }
.pub-foot { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px 40px; }
.pub-foot ul { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
.pub-foot a { color: var(--muted); }
.dl-ad { margin: 16px auto; text-align: center; overflow: hidden; }

/* file card */
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.ticket-top { padding: 28px 28px 22px; border-bottom: 2px dashed var(--line); position: relative; }
.ticket-top::before, .ticket-top::after {
  content: ""; position: absolute; bottom: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--mist); border: 1px solid var(--line);
}
.ticket-top::before { left: -11px; }
.ticket-top::after { right: -11px; }
.file-name {
  font: 700 clamp(22px, 4.2vw, 34px)/1.12 var(--head); letter-spacing: -.02em;
  word-break: break-word; margin: 14px 0 12px;
}
.file-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 14px; }
.file-meta b { color: var(--text); font-weight: 600; }
.ticket-body { padding: 22px 28px 28px; }
.ticket-body h2 { font-size: 17px; margin-bottom: 14px; }

.mirrors { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.mirror {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-radius: var(--r); text-decoration: none; color: #fff;
  background: var(--c, var(--ink)); font-weight: 700; font-size: 15px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18);
}
.mirror:hover { filter: brightness(1.08); }
.mirror small { font-weight: 500; opacity: .85; font-size: 12px; }
.empty-note { background: var(--mist); border-radius: var(--r); padding: 16px; color: var(--muted); }

/* pack */
.pack-head { margin-bottom: 18px; }
.pack-head h1 { font-size: clamp(24px, 4vw, 34px); word-break: break-word; }
.pack-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.pack-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); }
.pack-row:first-child { border-top: 0; }
.pack-row .nm { word-break: break-word; font-weight: 600; }
.pack-row .sz { color: var(--muted); font-size: 13px; white-space: nowrap; }
@media (max-width: 560px) {
  .pack-row { grid-template-columns: auto 1fr; }
  .pack-row .sz { grid-column: 2; }
  .pack-row .btn { grid-column: 1 / -1; }
  .ticket-top, .ticket-body { padding-left: 18px; padding-right: 18px; }
}

/* home */
.home-hero { padding: 56px 0 24px; }
.home-hero h1 { font-size: clamp(34px, 6vw, 58px); max-width: 14ch; letter-spacing: -.03em; }
.home-hero p { font-size: 17px; color: var(--muted); max-width: 52ch; }
.home-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; border-top: 1px solid var(--line); margin-top: 36px; }
.home-steps div { padding: 20px 20px 20px 0; }
.home-steps h3 { font-size: 17px; }
.home-steps p { color: var(--muted); margin: 0; font-size: 14px; }
.content { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; }

/* =========================================================
   Panel
   ========================================================= */
.panel { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #cfe0e2; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding: 4px 8px 20px; }
.side nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 2px;
  border-radius: var(--r-sm); color: #cfe0e2; text-decoration: none; font-weight: 500; font-size: 14px;
}
.side nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.side nav a:hover { background: var(--ink-2); color: #fff; }
.side nav a.on { background: var(--gold); color: #2b1a00; font-weight: 700; }
.side nav a.on svg { opacity: 1; }
.side .sep { height: 1px; background: rgba(255, 255, 255, .1); margin: 12px 8px; }
.side .count { margin-left: auto; background: var(--bad); color: #fff; border-radius: 99px; font-size: 11px; padding: 2px 7px; font-weight: 700; }

.main { padding: 26px 30px 60px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h1 { font-size: 28px; margin: 0; }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.who img { border-radius: 50%; }

.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 18px; }
.box > h2 { font-size: 17px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 220px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ink-3); border-radius: var(--r); padding: 14px 16px; }
.stat b { display: block; font: 700 26px/1.1 var(--head); }
.stat span { color: var(--muted); font-size: 13px; }
.stat.warn { border-left-color: var(--bad); }
.stat.gold { border-left-color: var(--gold); }
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 150px; }
.bars .b { background: var(--ink-3); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars .b:last-child { background: var(--gold); }
.bars-x { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; font-size: 11px; color: var(--muted); text-align: center; margin-top: 6px; }
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }

/* tables */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.sel td { background: #fff8ea; }
.f-name { font-weight: 600; word-break: break-word; max-width: 420px; }
.f-sub { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 12px; margin-top: 3px; }
.acts { display: flex; gap: 6px; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--mist); }
.icon-btn.bad { color: var(--bad); }
.icon-btn svg { width: 16px; height: 16px; }

/* mirror chips */
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 5px;
  font-size: 12px; font-weight: 700; text-decoration: none; color: #fff; background: var(--c, var(--ink-3));
}
.chip.pending, .chip.processing { background: transparent; color: var(--wait); border: 1px dashed #b9c6c9; }
.chip.processing::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: pulse 1.2s infinite; }
.chip.failed, .chip.broken { background: transparent; color: var(--bad); border: 1px solid #efc3ca; text-decoration: line-through; }
@keyframes pulse { 50% { opacity: .25; } }

/* toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar form { display: flex; gap: 8px; flex: 1 1 320px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg a { padding: 9px 12px; font-size: 13px; text-decoration: none; color: var(--text); }
.seg a.on { background: var(--ink); color: #fff; }
.bulk { display: none; gap: 8px; align-items: center; }
.bulk.show { display: flex; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.pager a, .pager span { padding: 7px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); text-decoration: none; color: var(--text); background: var(--surface); font-size: 13px; }
.pager .on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* generated results */
.gen-row { display: grid; grid-template-columns: 1fr minmax(220px, 1.1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.gen-row:first-of-type { border-top: 0; }
.gen-row .input { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.pack-link { display: flex; gap: 8px; align-items: center; background: #fff8ea; border: 1px solid #f3d9a8; border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 14px; }
.pack-link .input { background: transparent; border: 0; padding: 0; }
.errs { background: #fdf1f3; border: 1px solid #efc3ca; color: #8d2232; border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.errs ul { margin: 6px 0 0; padding-left: 18px; }
@media (max-width: 760px) { .gen-row { grid-template-columns: 1fr; } }

/* folders */
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.folder { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.folder h3 { font-size: 16px; margin: 0; word-break: break-word; }
.folder .meta { color: var(--muted); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; }
.folder .acts { margin-top: auto; flex-wrap: wrap; }

/* broken */
.issue { font-size: 12px; color: var(--bad); margin-top: 4px; }
.src { font-size: 12px; color: var(--muted); word-break: break-all; }

/* modal & toast */
.modal { position: fixed; inset: 0; background: rgba(18, 48, 58, .55); display: none; place-items: center; padding: 16px; z-index: 50; }
.modal.open { display: grid; }
.modal-card { background: var(--surface); border-radius: var(--r-lg); width: 100%; max-width: 520px; padding: 22px; max-height: 92vh; overflow-y: auto; }
.modal-card h2 { font-size: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: var(--r-sm); font-size: 14px; opacity: 0; transition: .2s; z-index: 60; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .btn { margin-top: 10px; }

/* login */
.login-card { max-width: 380px; margin: 10vh auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; }
.login-card .brand { color: var(--ink); margin-bottom: 18px; }
.login-card .brand-mark { color: var(--ink); }
.login-card label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.login-card input[type=text], .login-card input[type=password] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); font: inherit; }
.login-card p { margin: 0 0 14px; }
.login-card input[type=submit] { width: 100%; background: var(--ink); color: #fff; border: 0; padding: 12px; border-radius: var(--r-sm); font: 600 14px var(--body); cursor: pointer; }

/* mobile panel */
@media (max-width: 860px) {
  .panel { grid-template-columns: 1fr; }
  .side { position: sticky; height: auto; padding: 10px; z-index: 20; }
  .side .brand { padding: 4px 6px 10px; }
  .side nav { display: flex; overflow-x: auto; gap: 4px; }
  .side nav a { flex: none; margin: 0; padding: 8px 10px; }
  .side .sep { display: none; }
  .main { padding: 18px 14px 50px; }
}

/* =========================================================
   Home page
   ========================================================= */
.home .pub-main:first-of-type { padding: 0; }
.home .pub-main { padding: 44px 0 48px; }
.home .pub-main .wrap { padding: 0 20px; }
.hero { background: var(--ink); color: #fff; overflow: hidden; }
.hero-in { max-width: 1080px; margin: 0 auto; padding: 56px 20px 72px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(36px, 5.6vw, 64px); letter-spacing: -.035em; line-height: 1.02; margin-bottom: 20px; max-width: 12ch; }
.hero p { color: #c4d6d9; font-size: 17px; max-width: 46ch; margin: 0 0 14px; }
.hero-count { font-size: 15px !important; color: #9fb9bd !important; }
.hero-count b { color: var(--gold); font-weight: 700; }

.mirror-art { display: grid; grid-template-columns: auto 70px auto; align-items: center; justify-content: center; min-height: 260px; }
.art-file { background: #fff; color: var(--text); border-radius: var(--r); padding: 18px 20px; width: 190px; display: grid; gap: 8px; box-shadow: 0 0 0 6px rgba(255, 255, 255, .06); }
.art-file .ext { justify-self: start; }
.art-file strong { font: 700 17px/1.15 var(--head); }
.art-file small { color: var(--muted); }
.art-lines { width: 70px; height: 280px; }
.art-lines path { fill: none; stroke: rgba(242, 169, 59, .7); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.art-servers { list-style: none; margin: 0; padding: 0; height: 280px; display: flex; flex-direction: column; justify-content: space-between; }
.art-servers li {
  background: var(--c); color: #fff; font: 700 14px/1 var(--body); padding: 11px 16px; border-radius: 6px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2); min-width: 140px;
  animation: chipIn .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(.25s + var(--i) * .12s);
}
@keyframes chipIn { from { opacity: 0; transform: translateX(-14px); } }

.about { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; padding: 0 0 8px; }
.about h2 { font-size: 20px; }
.about p { color: var(--muted); margin: 0; }
.sites { margin-top: 40px; }
.sites h2 { font-size: 20px; }
.sites ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.sites a { display: inline-block; padding: 10px 16px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); text-decoration: none; color: var(--text); font-weight: 600; }
.sites a:hover { border-color: var(--ink-3); }
.join-cta { margin-top: 44px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-top: 3px solid var(--gold); padding-top: 24px; }
.join-cta h2 { font-size: 22px; margin-bottom: 4px; }
.join-cta p { margin: 0; color: var(--muted); }
.home .wrap { max-width: 1080px; }

@media (prefers-reduced-motion: reduce) { .art-servers li { animation: none; } }
@media (max-width: 820px) {
  .art-lines { height: 240px; }
  .art-servers { height: 240px; }
  .hero-in { grid-template-columns: 1fr; padding: 40px 18px 48px; }
  .mirror-art { justify-content: start; transform: scale(.92); transform-origin: left center; }
  .about { grid-template-columns: 1fr; gap: 18px; }
}

/* ---------- additions: file views, server picker, join, stats ---------- */
.file-meta .views { display: inline-flex; align-items: center; gap: 5px; }
.file-meta .views svg { width: 16px; height: 16px; }

.servers-pick { border: 0; padding: 0; margin: 0 0 16px; }
.servers-pick legend { font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.pick-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; border-left: 5px solid var(--c); }
.pick.on { background: #fff8ea; border-color: #f3d9a8; border-left-color: var(--c); }
.pick input { accent-color: var(--ink); width: 16px; height: 16px; }
.pick input:disabled + span { opacity: .45; }

.login-lost { font-size: 13px; text-align: center; }
.join { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.join summary { list-style: none; width: 100%; }
.join summary::-webkit-details-marker { display: none; }
.join[open] summary { display: none; }
.join-body h2 { font-size: 20px; }
.join-body ul { padding-left: 18px; margin: 0 0 12px; }
.join-body li { font-weight: 600; margin-bottom: 4px; }
.join-body p { color: var(--muted); font-size: 14px; }
.join-body .btn { width: 100%; }

.stats-title { font-size: 19px; margin: 4px 0 14px; }

/* ---------- watch online ---------- */
.watch-btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 16px; margin-bottom: 18px; border-radius: var(--r); background: var(--ink); color: #fff; text-decoration: none; font-weight: 700; font-size: 16px; }
.watch-btn svg { width: 18px; height: 18px; fill: var(--gold); stroke: var(--gold); }
.watch-btn:hover { background: var(--ink-2); }
.play-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.play-title { font-size: clamp(18px, 3vw, 24px); word-break: break-word; margin: 0; flex: 1 1 300px; }
.play-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.play-tab { font: 600 13px var(--body); padding: 8px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); border-left: 4px solid var(--c); background: var(--surface); cursor: pointer; color: var(--text); }
.play-tab.on { background: var(--ink); color: #fff; border-color: var(--ink); border-left-color: var(--c); }
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--r); overflow: hidden; }
.player video, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.ext-players { margin-top: 14px; }
.ext-players p { margin: 0 0 8px; font-weight: 600; font-size: 14px; }
.ext-row { display: flex; flex-wrap: wrap; gap: 8px; }


/* ---------- dark mode ---------- */
.pub-nav { display: flex; align-items: center; gap: 14px; }
.pub-head nav.pub-nav a { margin-left: 0; }
.theme-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid rgba(255,255,255,.2); background: transparent; color: #cfe0e2; cursor: pointer; }
.theme-btn svg { width: 17px; height: 17px; }
.theme-btn:hover { background: rgba(255,255,255,.08); }
.theme-btn-dark { border-color: var(--line); color: var(--text); }
.player-msg { position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; text-align: center; padding: 24px; color: #e3ecee; }
.player-msg span { color: #a9bcc0; max-width: 52ch; font-size: 14px; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #1d3942;
  --ink-2: #26474f;
  --ink-3: #6cc0cb;
  --mist: #0c1518;
  --surface: #142227;
  --line: #263a40;
  --text: #e3ecee;
  --muted: #93a8ad;
}
:root[data-theme="dark"] a { color: #8fd0d8; }
:root[data-theme="dark"] .btn { color: #fff; }
:root[data-theme="dark"] .btn-gold { color: #2b1a00; }
:root[data-theme="dark"] .btn-ghost { color: var(--text); }
:root[data-theme="dark"] .btn-danger { color: #f08a99; border-color: #5b2a33; }
:root[data-theme="dark"] .btn-danger:hover { background: #2a1519; }
:root[data-theme="dark"] .mirror, :root[data-theme="dark"] .chip:not(.pending):not(.processing):not(.failed):not(.broken), :root[data-theme="dark"] .side nav a, :root[data-theme="dark"] .brand { color: #fff; }
:root[data-theme="dark"] .side nav a { color: #cfe0e2; }
:root[data-theme="dark"] .side nav a.on { color: #2b1a00; }
:root[data-theme="dark"] .tbl tr.sel td, :root[data-theme="dark"] .pick.on, :root[data-theme="dark"] .pack-link { background: #2a2414; border-color: #5a4a1e; }
:root[data-theme="dark"] .errs { background: #2a1519; border-color: #5b2a33; color: #f2b8c1; }
:root[data-theme="dark"] .issue { color: #f08a99; }
:root[data-theme="dark"] .chip.failed, :root[data-theme="dark"] .chip.broken { color: #f08a99; border-color: #5b2a33; }
:root[data-theme="dark"] .chip.pending, :root[data-theme="dark"] .chip.processing { border-color: #3a5157; }
:root[data-theme="dark"] .ticket-top::before, :root[data-theme="dark"] .ticket-top::after { background: var(--mist); }
:root[data-theme="dark"] .sites a { color: var(--text); }
:root[data-theme="dark"] .login-card .brand, :root[data-theme="dark"] .login-card .brand-mark { color: var(--text); }
:root[data-theme="dark"] .login-card input[type=text], :root[data-theme="dark"] .login-card input[type=password] { background: var(--mist); color: var(--text); border-color: var(--line); }
:root[data-theme="dark"] .modal { background: rgba(0, 0, 0, .65); }
:root[data-theme="dark"] .content, :root[data-theme="dark"] .pack-list, :root[data-theme="dark"] .ticket { border-color: var(--line); }
:root[data-theme="dark"] .art-file { background: #e9f1f2; color: #17262b; }
:root[data-theme="dark"] .art-file small { color: #5c7177; }

button.chip { font-family: var(--body); cursor: pointer; }
button.chip:hover { border-style: solid; color: var(--text); }

/* ---------- 1.6: file page status, media info, buttons, click stats ---------- */
.ticket-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.info-btn { display: inline-flex; align-items: center; gap: 6px; font: 600 13px var(--body); padding: 5px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.info-btn svg { width: 15px; height: 15px; }
.info-btn small { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-left: 1px solid var(--line); padding-left: 6px; }
.info-btn:hover { border-color: var(--ink-3); }
.status b { padding: 1px 8px; border-radius: 99px; font-size: 13px; }
.status-ok b { background: #def3e9; color: #1d7a52; }
.status-wait b { background: #fff1d6; color: #8a5a00; }
.status-bad b { background: #fbe3e7; color: #a32b3d; }
:root[data-theme="dark"] .status-ok b { background: #143a2b; color: #7fd8ac; }
:root[data-theme="dark"] .status-wait b { background: #3a2e12; color: #f2c46d; }
:root[data-theme="dark"] .status-bad b { background: #3a1820; color: #f08a99; }
.uploader a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
button.mirror, button.watch-btn { border: 0; cursor: pointer; font-family: var(--body); width: 100%; }
button.mirror { text-align: left; }
.media-card { max-width: 460px; }
.mi-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.mi-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; }
.mi-head h2 svg { width: 18px; height: 18px; }
.media-card h3 { font: 700 11px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.mi { margin: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.mi div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-top: 1px solid var(--line); font-size: 14px; }
.mi div:first-child { border-top: 0; }
.mi dt { color: var(--muted); }
.mi dd { margin: 0; font-weight: 600; text-align: right; }
.mi-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.mi-list li { padding: 9px 12px; border-top: 1px solid var(--line); display: grid; gap: 2px; font-size: 14px; }
.mi-list li:first-child { border-top: 0; }
.mi-list small, .mi-list span { color: var(--muted); font-size: 12px; }
.dl-protect .mirror, .dl-protect .watch-btn, .dl-protect .file-name { -webkit-user-select: none; user-select: none; }
.bulk-drop { display: inline-flex; gap: 6px; align-items: center; }
.bulk-drop .select { padding: 6px 8px; font-size: 13px; width: auto; }
.clickbars { display: grid; gap: 10px; }
.cb-row { display: grid; grid-template-columns: 140px 1fr 110px 110px; gap: 12px; align-items: center; font-size: 13px; }
.cb-row .chip { justify-self: start; }
.cb-track { height: 10px; background: var(--mist); border-radius: 99px; overflow: hidden; }
.cb-fill { display: block; height: 100%; background: var(--c, var(--ink-3)); border-radius: 99px; min-width: 2px; }
.cb-n { text-align: right; }
.cb-all { color: var(--muted); text-align: right; }
.cb-sub { font-size: 15px; margin: 20px 0 8px; }
@media (max-width: 700px) { .cb-row { grid-template-columns: 110px 1fr 80px; } .cb-all { display: none; } }
