:root {
  --bg: #141414;
  --panel: #1d1d1d;
  --panel-2: #272727;
  --panel-3: #323232;
  --text: #ececec;
  --muted: #9d9d9d;
  --faint: #6f6f6f;
  --danger: #e05a5a;
  --radius: 14px;
  --radius-s: 9px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, system-ui, "Segoe UI", Roboto, Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.015em; }
img { display: block; }
button { font: inherit; color: inherit; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px 60px; }

/* ---------- nav (admin only) ---------- */
.nav {
  max-width: 1280px; margin: 0 auto; padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.brand-admin { font-style: normal; color: var(--faint); font-size: 13px; margin-left: 6px; }
.nav-right { display: flex; gap: 8px; }

/* ---------- buttons / chips / inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel-2); color: var(--text);
  border: 0; border-radius: var(--radius-s);
  padding: 9px 16px; cursor: pointer;
  font-size: 14px; font-weight: 550; line-height: 1.2;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-3); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: #e9e9e9; color: #171717; }
.btn-primary:hover { background: #ffffff; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-danger { color: var(--danger); }
.btn-disabled { opacity: .45; cursor: default; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--panel-2); color: var(--muted);
  border-radius: 999px; padding: 2px 9px;
  font-size: 11px; font-weight: 650; letter-spacing: .05em;
}

.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.12em; flex: none; }
.chip-new { background: #e9e9e9; color: #171717; }
.chip-lock { color: var(--text); }

input[type=text], input[type=password], input[type=datetime-local], textarea, select {
  width: 100%;
  background: var(--panel-2); color: var(--text);
  border: 0; border-radius: var(--radius-s);
  padding: 10px 13px; font: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .14);
}
textarea { resize: vertical; min-height: 110px; }
::placeholder { color: var(--faint); }

.form-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 8px; }

/* ---------- panels / sections ---------- */
.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.section { margin-top: 38px; }
.section-title {
  font-size: 13px; font-weight: 650; letter-spacing: .09em;
  text-transform: uppercase; color: var(--faint);
  margin-bottom: 14px;
}
.empty { color: var(--faint); padding: 30px 0; }

/* ---------- home ---------- */
.hero { padding: 54px 0 8px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.08; }

.fresh-list { display: flex; flex-direction: column; gap: 6px; }
.fresh-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); border-radius: var(--radius);
  padding: 10px 16px 10px 10px;
  transition: background .15s;
}
.fresh-row:hover { background: #222222; }
.fresh-thumb {
  width: 56px; height: 40px; border-radius: 7px;
  object-fit: cover; flex: none;
}
.fresh-thumb.ph {
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-2); color: var(--faint); font-weight: 700;
}
.fresh-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fresh-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fresh-meta { color: var(--faint); font-size: 12.5px; }

.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  /* Cards size to their own content: no empty space under a card whose
     neighbour has more tags/lines. */
  align-items: start;
}
.card {
  background: var(--panel); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: background .15s, transform .15s;
}
.card:hover { background: #222222; transform: translateY(-2px); }
/* Fixed 16:9 cover: 16:9 thumbnails show fully (no crop); other ratios crop
   centered. Square-ish images (icons/logos) get .fit-contain instead. */
.card-cover { aspect-ratio: 16 / 9; background: var(--panel-2); overflow: hidden; flex: none; }
/* The image fills the frame by inheriting its ratio instead of a percentage
   height: engines that size the cover from aspect-ratio but mis-resolve
   in-flow percentage heights inside it would let the image spill past the
   frame and get clipped. */
.card-cover img { width: 100%; height: auto; aspect-ratio: inherit; object-fit: cover; }
.card-cover img.fit-contain { object-fit: contain; padding: 14px; }
img.fresh-thumb.fit-contain { object-fit: contain; background: var(--panel-2); padding: 3px; }
.card-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 700; color: var(--faint);
}
.card-body { padding: 13px 16px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
/* Cards stay uniform via the fixed 16:9 cover; titles wrap to 2 lines max and
   the meta row (tags, chips) wraps freely, so long names and many tags fit. */
.card-title {
  font-weight: 650; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}
.card-meta {
  margin-top: auto; padding-top: 6px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  color: var(--faint); font-size: 12.5px;
}

/* ---------- item page ---------- */
.back { color: var(--faint); font-size: 14px; display: inline-block; margin: 28px 0 18px; }
.back:hover { color: var(--muted); }
.item-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.item-head h1 { font-size: clamp(24px, 4vw, 34px); overflow-wrap: anywhere; }
.item-chips { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.item-meta { color: var(--faint); font-size: 13.5px; margin: 12px 0 24px; }

.gallery { margin-bottom: 24px; }
/* The preview box is a fixed 16:9 frame: it never changes size with the
   media inside; images and videos letterbox to fit. */
.gallery-main {
  display: block; border-radius: var(--radius); overflow: hidden;
  background: transparent; aspect-ratio: 16 / 9;
}
/* Same percentage-height pitfall as .card-cover img above: the frame's ratio
   is inherited down the chain so no percentage height is involved. */
#galContent { width: 100%; height: auto; aspect-ratio: inherit; }
#galContent img, #galContent video { width: 100%; height: auto; aspect-ratio: inherit; object-fit: contain; display: block; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; padding-bottom: 4px; }
.gallery-thumb {
  position: relative;
  border: 0; padding: 0; border-radius: 8px; overflow: hidden;
  background: var(--panel); cursor: pointer; flex: none;
  opacity: .55; transition: opacity .15s;
}
.gallery-thumb.active, .gallery-thumb:hover { opacity: 1; }
.gallery-thumb img { width: 86px; height: 58px; object-fit: cover; }

.desc { color: #d6d6d6; margin-bottom: 24px; overflow-wrap: anywhere; }

/* ---------- rendered markdown (descriptions + changelogs) ---------- */
.md p { margin: 0 0 12px; } .md > *:last-child { margin-bottom: 0; }
.md code {
  background: var(--panel-2); border-radius: 5px; padding: 1px 6px;
  font: 13px/1.6 ui-monospace, Consolas, monospace;
}
.md a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { margin: 20px 0 8px; line-height: 1.25; }
.md > h1:first-child, .md > h2:first-child, .md > h3:first-child,
.md > h4:first-child, .md > h5:first-child, .md > h6:first-child { margin-top: 0; }
.md h1 { font-size: 24px; } .md h2 { font-size: 20px; } .md h3 { font-size: 17px; }
.md h4, .md h5, .md h6 { font-size: 15px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 24px; }
.md li { margin: 4px 0; }
.md li > p { margin-bottom: 4px; }
.md blockquote {
  margin: 0 0 12px; padding: 10px 14px;
  background: var(--panel-2); border-radius: var(--radius-s);
  color: var(--muted);
}
.md blockquote blockquote { background: var(--panel-3); margin-top: 8px; }
.md hr { border: 0; height: 2px; background: var(--panel-3); border-radius: 2px; margin: 18px 0; }
.md pre {
  background: var(--panel-2); border-radius: var(--radius-s);
  padding: 12px 14px; overflow-x: auto; margin: 0 0 12px;
}
.md pre code { background: transparent; padding: 0; }
.md img { max-width: 100%; border-radius: var(--radius-s); }
.md video { max-width: 100%; border-radius: var(--radius-s); display: block; margin: 0 0 12px; background: #000; }
.md table { border-collapse: collapse; margin: 0 0 12px; max-width: 100%; }
.md th, .md td { padding: 8px 12px; text-align: left; }
.md thead th { background: var(--panel-2); }
.md tbody tr:nth-child(even) { background: rgba(255, 255, 255, .025); }

.lock-banner { text-align: center; margin-bottom: 24px; }
.lock-banner-title { color: var(--muted); font-weight: 600; }
.countdown { font-size: clamp(26px, 5vw, 40px); font-weight: 700; letter-spacing: .02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.unlock-form { display: flex; gap: 10px; max-width: 380px; margin: 14px auto 0; }

.files { display: flex; flex-direction: column; }
.file-row {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 4px; border-radius: var(--radius-s);
}
.file-row:hover { background: rgba(255, 255, 255, .025); }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.file-info { display: flex; gap: 14px; color: var(--faint); font-size: 13px; flex: none; }
.file-actions { display: flex; gap: 8px; flex: none; }

.version { margin-bottom: 12px; }
.version-latest { background: #202020; }
.version-head { display: flex; align-items: center; gap: 10px; }
.version-name { font-weight: 700; font-size: 17px; }
.version-date { color: var(--faint); font-size: 13px; margin-left: auto; }
.version-log { color: var(--muted); font-size: 14px; margin-top: 10px; overflow-wrap: anywhere; }
.version-log p { margin: 0 0 8px; } .version-log p:last-child { margin: 0; }
.version .files { margin-top: 12px; }

.updater-note { color: var(--faint); font-size: 13px; margin-top: 26px; text-align: center; }

.error-page { text-align: center; padding: 90px 0; }
.error-code { font-size: 74px; font-weight: 800; color: var(--panel-3); }
.error-page p { color: var(--muted); margin: 8px 0 24px; }

/* ---------- login ---------- */
.login-box { max-width: 340px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 14px; }
.login-box h1 { font-size: 22px; }
.login-box form { display: flex; flex-direction: column; gap: 10px; }

/* ---------- admin ---------- */
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 18px 0 22px; flex-wrap: wrap; }
.admin-top h1 { font-size: 24px; }

/* Dashboard stat strip */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--panel); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.stat span { color: var(--faint); font-size: 12px; }
.stat-warn { outline: 1px solid rgba(255, 255, 255, .22); }
.stat-warn b { color: #fff; }

/* Dashboard tools (filter) */
.dash-tools { margin-bottom: 14px; }
.dash-tools input { max-width: 340px; }

/* Storage panel */
.storage-panel { margin-bottom: 20px; }
.storage-row { display: flex; align-items: center; gap: 12px; padding: 5px 0; }
.storage-name { width: 56px; flex: none; color: var(--muted); font-size: 13px; }
.storage-bar { flex: 1; height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.storage-bar > div { height: 100%; background: #e9e9e9; border-radius: 99px; min-width: 0; }
.storage-size { width: 84px; flex: none; text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.storage-count { width: 92px; flex: none; text-align: right; color: var(--faint); font-size: 12px; }
.storage-total { border-top: 1px solid var(--panel-2); margin-top: 5px; padding-top: 9px; }
.storage-total .storage-name, .storage-total .storage-size { font-weight: 650; color: var(--text); }

/* Dashboard card grid (mirrors the public home grid) */
.admin-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); align-items: start; }
.acard {
  background: var(--panel); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; cursor: pointer;
  transition: background .15s, transform .15s;
}
.acard:hover { background: #222222; transform: translateY(-2px); }
.acard-cover { position: relative; aspect-ratio: 16 / 9; background: var(--panel-2); overflow: hidden; flex: none; }
.acard-cover img { width: 100%; height: 100%; object-fit: cover; }
.acard-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; color: var(--faint); }
.acard-flag { position: absolute; top: 8px; left: 8px; }
.acard-body { padding: 11px 14px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.acard-title { font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.acard-sub { color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acard-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: 6px; }

/* Reorder mode: drag & drop cards to curate the homepage grid. */
.reorder-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--panel); border: 1px solid var(--panel-3); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 12px;
  position: sticky; top: 10px; z-index: 5;
  color: var(--muted); font-size: 13px;
}
.admin-grid.reordering .acard { cursor: grab; }
.admin-grid.reordering .acard:hover { transform: none; background: #242424; }
.acard.dragging { opacity: .45; cursor: grabbing; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card { text-align: center; padding: 16px 12px; }
.stat-num { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat-lbl { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin-top: 5px; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 460px; }
.stat-table th { text-align: left; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 2px 10px 12px; cursor: pointer; user-select: none; white-space: nowrap; }
.stat-table th:hover { color: var(--text); }
.stat-table th.num, .stat-table td.num { text-align: right; }
.stat-table td { padding: 9px 10px; }
.stat-row { cursor: pointer; }
.stat-row:hover { background: #222; }
.stat-open { margin-left: 7px; color: var(--faint); text-decoration: none; }
.stat-open:hover { color: var(--text); }
.stat-files td { background: var(--panel-2); padding: 2px 10px 10px; }
.stat-file { display: flex; justify-content: space-between; gap: 12px; padding: 5px 4px; color: var(--faint); }
.stat-file .num { color: var(--text); white-space: nowrap; }
.faint { color: var(--faint); }

/* ---------- charts (analytics + update tracking) ---------- */
.chart-panel { margin-bottom: 18px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.chart-head h3 { margin-bottom: 0; }
.chart-days { margin: 0; }
.chart-days .tab { padding: 5px 13px; font-size: 12.5px; }
.chart-legend { display: flex; gap: 15px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; cursor: pointer; user-select: none; }
.chart-legend .lg:hover { color: var(--text); }
.chart-legend .lg.off { opacity: .35; }
.chart-legend .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.chart-panel canvas, .upd-card canvas { width: 100%; display: block; }
.upd-card { margin-bottom: 18px; }
.upd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.upd-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.upd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-bottom: 16px; }

.editor-head { display: flex; align-items: center; gap: 12px; margin: 14px 0 18px; flex-wrap: wrap; }
.editor-head input.title-input {
  flex: 1; min-width: 220px; width: auto; font-size: 20px; font-weight: 650;
  background: transparent; padding: 8px 10px;
}
.editor-head input.title-input:hover { background: var(--panel); }

.tabs { display: flex; gap: 6px; margin: 0 0 18px; flex-wrap: wrap; }
.tab {
  background: transparent; border: 0; border-radius: 999px;
  padding: 8px 18px; color: var(--muted); cursor: pointer;
  font-weight: 600; font-size: 14px;
  transition: background .15s, color .15s;
}
.tab:hover { background: var(--panel); color: var(--text); }
.tab.active { background: var(--panel-2); color: var(--text); }
.tabpane { display: flex; flex-direction: column; gap: 16px; max-width: 940px; }
.tabpane[hidden] { display: none; }

.panel h3 { font-size: 13px; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.field-row { display: flex; align-items: center; gap: 10px; }
.check { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: #e9e9e9; }
.hint { color: var(--faint); font-size: 12.5px; margin-top: 6px; line-height: 1.5; }

/* Embed toolbar above Description/Changelog textareas (paste or pick
   images/videos to embed in the markdown text). */
.embed-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.embed-bar .btn { display: inline-flex; align-items: center; gap: 6px; }
.embed-status { color: var(--faint); font-size: 12.5px; }

.dropzone {
  background: var(--panel-2); border-radius: var(--radius-s);
  padding: 26px 16px; text-align: center; color: var(--faint);
  cursor: pointer; transition: background .15s;
  font-size: 13.5px;
}
.dropzone:hover, .dropzone.drag { background: var(--panel-3); color: var(--muted); }

.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }
.img-cell { position: relative; border-radius: 8px; overflow: hidden; background: var(--panel-2); aspect-ratio: 4/3; }
.img-cell img { width: 100%; height: 100%; object-fit: cover; }
.img-cell .img-x, .img-cell .img-mv {
  position: absolute; top: 5px;
  width: 24px; height: 24px; border: 0; border-radius: 6px;
  background: rgba(0, 0, 0, .65); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  opacity: 0; transition: opacity .12s;
}
.img-cell:hover .img-x, .img-cell:hover .img-mv { opacity: 1; }
.img-cell .img-x { right: 5px; }
.img-cell .img-mv.left { left: 5px; }
.img-cell .img-mv.right { left: 34px; }
.img-cell .cover-tag {
  position: absolute; bottom: 5px; left: 5px;
  background: rgba(0, 0, 0, .65); color: #fff;
  border-radius: 5px; font-size: 10px; padding: 2px 6px; letter-spacing: .06em;
}

/* +Q button on video cells: add quality copies to an existing video */
.img-cell .img-q {
  position: absolute; bottom: 5px; right: 5px; z-index: 2;
  border: 0; border-radius: 6px;
  background: rgba(0, 0, 0, .65); color: #fff; cursor: pointer;
  font-size: 11px; font-weight: 700; padding: 4px 7px;
  opacity: 0; transition: opacity .12s;
}
.img-cell:hover .img-q { opacity: 1; }
.qpick-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text); padding: 3px 0; }
.qdel {
  border: 0; background: rgba(255, 255, 255, .08); color: #ececec;
  width: 18px; height: 18px; border-radius: 5px; cursor: pointer;
  font-size: 10px; line-height: 1; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.qdel:hover { background: rgba(210, 69, 69, .35); }

/* ---------- post-upload modal (what to do with a video) ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(10, 10, 11, .62);
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--panel-2); border-radius: 12px;
  padding: 18px 20px; width: min(430px, 92vw);
  display: flex; flex-direction: column; gap: 9px;
}
.modal h3 { margin: 0; font-size: 16px; word-break: break-word; }

/* ---------- processing-now panel (admin home) ---------- */
.jobs-panel { margin-bottom: 14px; }
.jobs-panel h3 { margin: 0 0 8px; font-size: 14px; }
.job-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 6px; border-radius: 8px; text-decoration: none; color: var(--text);
  font-size: 13.5px;
}
.job-row:hover { background: rgba(255, 255, 255, .04); }
.job-title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-status { color: var(--muted); font-size: 12.5px; flex: none; font-variant-numeric: tabular-nums; }

/* ---------- interactive charts: hover tooltip + live chip ---------- */
.chart-tip {
  position: absolute; z-index: 6; pointer-events: none;
  background: #1c1d20; border-radius: 8px; padding: 8px 11px;
  font-size: 12px; color: var(--text); white-space: nowrap;
  transform: translate(-50%, -118%);
  display: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
}
.chart-tip.show { display: block; }
.chart-tip .ct-date { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.chart-tip .ct-row { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
.chart-tip .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.legend-inline { margin-left: 10px; font-size: 11px; color: var(--faint); font-weight: 500; display: inline-flex; align-items: center; gap: 5px; }
.legend-inline .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* skeleton shimmer while a data page loads */
.skel {
  background: linear-gradient(90deg, var(--panel) 25%, #232427 50%, var(--panel) 75%);
  background-size: 200% 100%;
  animation: skelmove 1.2s ease-in-out infinite;
  color: transparent !important;
  pointer-events: none;
}
@keyframes skelmove { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.afile-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-radius: var(--radius-s); flex-wrap: wrap; }
.afile-row:hover { background: rgba(255, 255, 255, .025); }
.afile-name { flex: 1; min-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; cursor: pointer; }
.afile-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.afile-sub { color: var(--faint); font-size: 12.5px; flex: none; }
.afile-row select { width: auto; padding: 5px 9px; font-size: 12.5px; }
.afile-row.nodl .afile-name { color: var(--muted); }
.afile-row.nodl .js-fnodl { color: var(--muted); }
.afile-note {
  flex-basis: 100%; color: var(--faint); font-size: 12.5px;
  font-style: italic; padding: 2px 2px 0; overflow-wrap: anywhere;
}

.progress { background: var(--panel-2); border-radius: 999px; height: 8px; overflow: hidden; flex: 1; min-width: 120px; }
.progress > div { background: #e9e9e9; height: 100%; width: 0%; transition: width .2s; }

.version-block { background: var(--panel-2); border-radius: var(--radius-s); padding: 12px 14px; margin-bottom: 10px; }
.version-block .version-head { margin-bottom: 4px; }
.version-block textarea { background: var(--panel-3); }

.mono {
  background: var(--panel-2); border-radius: var(--radius-s);
  padding: 10px 12px; font: 12.5px/1.6 ui-monospace, Consolas, monospace;
  word-break: break-all; user-select: all;
}
pre.mono { white-space: pre-wrap; word-break: normal; user-select: text; margin: 0; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #e9e9e9; color: #171717; font-weight: 600; font-size: 14px;
  border-radius: 999px; padding: 10px 20px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.danger-zone { display: flex; justify-content: flex-end; }

/* ---------- item page: main column + sticky sidebar ---------- */
.item-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; margin-top: 6px; }
.item-main { min-width: 0; }
.item-main .gallery { margin-bottom: 22px; }
.item-side { position: sticky; top: 22px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 920px) {
  .item-layout { grid-template-columns: 1fr; }
  .item-side { position: static; order: -1; }
}
.side-title { font-size: 13px; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.side-card .file-row { flex-wrap: wrap; padding: 10px 2px; }
.side-card .file-name { flex-basis: 100%; white-space: normal; overflow-wrap: anywhere; }
.side-card .lock-banner { padding: 4px 0 12px; }
.btn-block { width: 100%; justify-content: center; margin-top: 12px; }
.unlock-form-side { flex-direction: column; max-width: none; }
.fb-form { display: flex; flex-direction: column; gap: 8px; }
.fb-form textarea { min-height: 80px; }
.fb-toggle summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  color: var(--faint);
}
.fb-toggle summary::-webkit-details-marker { display: none; }
.fb-toggle summary:hover { color: var(--muted); }
.fb-toggle .chev { transition: transform .15s; }
.fb-toggle[open] .chev { transform: rotate(180deg); }
.fb-toggle[open] summary { margin-bottom: 12px; }

/* ---------- video previews ---------- */
.gallery-main video { background: #000; }
.gallery-main { position: relative; }
#galContent img { cursor: zoom-in; }
.gal-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  border: 0; background: rgba(0, 0, 0, .55); color: #fff;
  width: 40px; height: 58px; border-radius: 10px;
  font-size: 26px; line-height: 1; cursor: pointer;
  opacity: .75; transition: opacity .15s; z-index: 3;
}
.gal-arrow:hover { opacity: 1; }
.gal-prev { left: 10px; }
.gal-next { right: 10px; }
.gal-expand {
  position: absolute; top: 10px; right: 10px;
  border: 0; background: rgba(0, 0, 0, .55); color: #fff;
  width: 34px; height: 34px; border-radius: 8px;
  font-size: 15px; cursor: pointer; opacity: .75; z-index: 3;
}
.gal-expand:hover { opacity: 1; }
.gal-expand { transition: opacity .15s; }

/* Arrows and the expand button only appear while hovering the media area
   (kept always-visible on touch devices, which have no hover). */
@media (hover: hover) {
  .gallery-main .gal-arrow, .gallery-main .gal-expand { opacity: 0; }
  .gallery-main:hover .gal-arrow, .gallery-main:hover .gal-expand { opacity: .8; }
  .gallery-main .gal-arrow:hover, .gallery-main .gal-expand:hover { opacity: 1; }
  .lightbox .gal-arrow { opacity: 0; }
  .lightbox:hover .gal-arrow { opacity: .8; }
  .lightbox .gal-arrow:hover { opacity: 1; }
}

.thumb-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.thumb-row .img-cell { width: 132px; flex: none; }
.dropzone-sm { padding: 14px 12px; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(8, 8, 8, .94);
  z-index: 100; display: none; align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lb-content { max-width: 96vw; max-height: 94vh; display: flex; align-items: center; justify-content: center; }
.lb-content img, .lb-content video { max-width: 96vw; max-height: 94vh; object-fit: contain; border-radius: 8px; }
.lb-content img { cursor: zoom-in; transition: transform .12s ease-out; }
.lb-content img.lb-zoomed { cursor: grab; transition: none; }
.lb-content img.lb-dragging { cursor: grabbing; }
.lightbox .gal-arrow, .lightbox .lb-x { z-index: 102; }
.lb-x {
  position: absolute; top: 16px; right: 18px;
  border: 0; background: rgba(255, 255, 255, .12); color: #fff;
  width: 40px; height: 40px; border-radius: 10px;
  font-size: 17px; cursor: pointer; z-index: 101;
}
.lb-x:hover { background: rgba(255, 255, 255, .22); }
.lightbox .gal-prev { left: 18px; }
.lightbox .gal-next { right: 18px; }

/* ---------- bare lock screen ---------- */
.locked-page {
  max-width: 420px; margin: 16vh auto 0; text-align: center;
  display: flex; flex-direction: column; gap: 16px; align-items: stretch;
}
.locked-icon { color: var(--faint); }
.locked-icon .ico { width: 46px; height: 46px; }
.locked-page .back { text-align: center; }

/* ---------- public item tabs ---------- */
.ptabs { margin-top: 4px; }
.ppane[hidden] { display: none; }
.vid-tile { display: flex; align-items: center; justify-content: center; width: 86px; height: 58px; background: #000; color: var(--muted); }
.vid-tile .ico { width: 18px; height: 18px; }
.vid-cell { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 100%; background: #000; color: var(--muted); font-size: 13px; }

/* ---------- 3D gallery entries (material sphere + model viewer) ----------
   The viewer canvases fill their mount target; the little "3D" tag marks the
   pseudo-cells in the thumb strip. Viewer chrome (buttons, progress) is
   inline-styled by the components so it works on any page. */
.gal3d { width: 100%; height: 100%; position: relative; }
.lb-content .gal3d { width: min(1040px, 94vw); height: min(78vh, 720px); flex: none; }
.tag3d {
  position: absolute; top: 4px; right: 4px; background: rgba(0, 0, 0, .72);
  color: #ececec; border-radius: 5px; font-size: 9px; font-weight: 800;
  letter-spacing: .4px; padding: 1px 5px; pointer-events: none;
}
.gal3d-tile { flex-direction: column; gap: 3px; }
.gal3d-tile svg { width: 20px; height: 20px; }

.ts-wrap { display: flex; justify-content: center; }
.owner-note { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; padding: 12px 16px; }
.owner-note a { color: #fff; text-decoration: underline; text-underline-offset: 3px; margin-left: 6px; }

/* ---------- admin: editor layout, feedback, site settings ---------- */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.editor-main { min-width: 0; }
.editor-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 920px) {
  .editor-layout { grid-template-columns: 1fr; }
  .editor-side { position: static; }
}
.tab-badge { background: #e9e9e9; color: #171717; border-radius: 999px; font-size: 11px; padding: 1px 7px; margin-left: 4px; }
.fb-entry { background: var(--panel-2); border-radius: var(--radius-s); padding: 12px 14px; margin-bottom: 10px; }
.fb-head { display: flex; align-items: center; gap: 10px; }
.fb-name { font-weight: 650; }
.fb-date { color: var(--faint); font-size: 12.5px; margin-left: auto; }
.fb-entry .btn { flex: none; }
.fb-msg { color: var(--muted); font-size: 14px; margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.settings-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.settings-num { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.settings-num input { width: 76px; padding: 7px 10px; }
#settingsPanel { margin-bottom: 16px; }

/* ---------- admin: creators ---------- */
#invitePanel { margin-bottom: 16px; }
#invitePanel .field-row input { max-width: 320px; }
#invResult { min-height: 18px; margin-top: 10px; }
#invResult .btn { margin-left: 4px; }
.cr-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-items: start; }
.cr-head { display: flex; align-items: center; gap: 12px; }
.cr-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: none; background: var(--panel-2); }
.cr-ph { display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 18px; font-weight: 700; }
.cr-id { flex: 1; min-width: 0; }
.cr-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-sub { color: var(--faint); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-ok { color: #6fbf73; }
.chip-bad { color: var(--danger); }
.chip-warn { color: #e0b56a; }
.cr-chips { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; flex: none; max-width: 45%; }
.cr-quota { margin: 13px 0 9px; }
.cr-quota-labels { display: flex; justify-content: space-between; gap: 10px; color: var(--faint); font-size: 12px; margin-bottom: 5px; }
.cr-bar { height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.cr-bar > div { height: 100%; background: #e9e9e9; border-radius: 99px; min-width: 0; }
.cr-bar.danger > div { background: var(--danger); }
.cr-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--faint); font-size: 12.5px; }
.cr-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 13px; }

/* ---------- admin: dashboard info card, moderation list, announcements ---------- */
.moved-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 16px; padding: 13px 18px;
}
.mod-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.mod-tools input { max-width: 340px; }
.mod-tools select { width: auto; max-width: 220px; }
.ann-row { margin-bottom: 10px; }
.ann-body { overflow-wrap: anywhere; }
.ann-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.ann-actions { display: flex; gap: 7px; flex: none; }

/* ---------- site footer ---------- */
.site-foot {
  max-width: 1280px; margin: 0 auto; padding: 22px 24px 34px;
  border-top: 1px solid var(--panel-2);
  color: var(--faint); font-size: 12.5px; text-align: center;
}
.site-foot a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--faint); }
.site-foot a:hover { color: var(--text); border-bottom-color: var(--text); }


/* ============================================================
   Creator pages, directory + visitor accounts (ported from the
   approved mainpage-preview design, same conventions as above).
   ============================================================ */

/* ---------- top bar ---------- */
.topbar {
  max-width: 1280px; margin: 0 auto; padding: 16px 24px 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
/* Account chip: the container only renders when an account cookie is present
   (anonymous visitors get a static Sign in link instead) and is hydrated
   client-side by app.js; the fixed min size keeps the bar from jumping when
   the fetch lands. */
.acct-chip {
  display: inline-flex; align-items: center; justify-content: flex-end;
  min-width: 84px; min-height: 35px;
}
.acct-link {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel-2); border-radius: 999px; padding: 4px 13px 4px 5px;
  font-size: 13px; font-weight: 600; transition: background .15s;
}
.acct-link:hover { background: var(--panel-3); }
.acct-ava {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--panel-3); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; object-fit: cover;
}
.acct-signin { color: var(--muted); font-size: 14px; font-weight: 550; }
.acct-signin:hover { color: var(--text); }

/* ---------- profile header (creator pages) ---------- */
.profile { padding: 42px 0 4px; display: flex; flex-direction: column; gap: 14px; }
.profile-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.avatar {
  border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: rgba(255, 255, 255, .92);
}
img.avatar { object-fit: cover; }
.avatar-lg { width: 76px; height: 76px; font-size: 30px; }
.avatar-md { width: 54px; height: 54px; font-size: 21px; }
.profile-id { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.profile-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-name h1 { font-size: clamp(26px, 4vw, 34px); }
.profile-bio { color: var(--muted); margin: 0; }

/* Social chips: real links where the platform has a URL, plain spans
   (same look, no hover state) for display-only handles. */
.soc-row { display: flex; gap: 8px; flex-wrap: wrap; }
.soc {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel-2); color: var(--muted);
  border-radius: 999px; padding: 6px 12px;
  font-size: 13px; font-weight: 550;
  transition: background .15s, color .15s;
}
a.soc:hover { background: var(--panel-3); color: var(--text); }
.soc svg { width: 14px; height: 14px; flex: none; }

/* ---------- items head + live filter ---------- */
.items-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 14px;
}
.items-head .section-title { margin-bottom: 0; }
.filter-box { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.filter-box input { width: 200px; padding: 8px 12px; }
@media (max-width: 560px) {
  .filter-box { flex: 1 1 100%; }
  .filter-box input { flex: 1; width: auto; }
}
/* display:flex on .card beats the [hidden] UA rule, so re-state it. */
.card[hidden] { display: none; }

/* ---------- item card extras ---------- */
.card-when { color: var(--faint); }
.chip-with { background: var(--panel-3); color: var(--text); }

/* ---------- creators directory ---------- */
.dir-head { padding: 40px 0 24px; }
.dir-head h1 { font-size: clamp(28px, 4vw, 38px); }
.dir-sub { color: var(--muted); margin: 8px 0 0; }
.creator-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  align-items: start;
}
.ccard {
  background: var(--panel); border-radius: var(--radius);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 11px;
  transition: background .15s, transform .15s;
}
.ccard:hover { background: #222222; transform: translateY(-2px); }
.ccard-top { display: flex; align-items: center; gap: 14px; }
.ccard-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ccard-name { font-weight: 650; font-size: 17px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ccard-bio { color: var(--faint); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard-socs { display: flex; gap: 6px; flex-wrap: wrap; }
.soc-ico {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--panel-2); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.soc-ico svg { width: 14px; height: 14px; }
.ccard-stats { color: var(--muted); font-size: 13px; }
.ccard-upd { color: var(--faint); font-size: 12.5px; }

/* ---------- auth pages (signup/login) ---------- */
.login-box a.tlink { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.ts-holder { min-height: 32px; margin: 2px 0 4px; }
.ts-holder iframe { transform: scale(.85); transform-origin: left top; }

/* ---------- focus + screen transitions ---------- */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid #4A7BB5; outline-offset: 2px;
}
.screen-enter { animation: screen-in .18s ease-out; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .screen-enter { animation: none; }
}


/* ============================================================
   Item engagement: byline, star ratings, comments + auth polish.
   Same conventions as above (panel/card language, .15s transitions).
   ============================================================ */

/* ---------- item byline (owner + collaborators) ---------- */
.byline { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.byline-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel-2); color: var(--muted);
  border-radius: 999px; padding: 4px 12px 4px 5px;
  font-size: 12.5px; font-weight: 550;
  transition: background .15s, color .15s;
}
.byline-chip:hover { background: var(--panel-3); color: var(--text); }
.byline-chip b { color: var(--text); font-weight: 650; }
.byline-ava {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  background: var(--panel-3); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; object-fit: cover;
}

/* ---------- star ratings ---------- */
.stars-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stars-wrap { position: relative; display: inline-block; line-height: 0; }
.stars-row { display: flex; gap: 2px; }
.stars-fill {
  position: absolute; top: 0; left: 0; overflow: hidden;
  pointer-events: none; transition: width .15s ease-out;
}
.star {
  width: 22px; height: 22px; padding: 0; border: 0; background: none;
  color: #424242; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.star svg { width: 22px; height: 22px; display: block; }
.stars-fill .star { color: #ececec; }
button.star { cursor: pointer; transition: transform .1s ease; }
button.star:hover { transform: scale(1.22); }
.stars-meta { display: flex; align-items: baseline; gap: 6px; }
.stars-avg { font-size: 17px; font-weight: 700; }
.stars-count, .stars-none { color: var(--faint); font-size: 12.5px; }
.stars-hint { margin-top: 10px; }
a.tlink { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- comments ---------- */
.cmt-form textarea { min-height: 74px; }
.cmt-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.cmt-count { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.cmt-gate, .fb-gate { color: var(--muted); font-size: 13.5px; }
.cmt-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.cmt {
  display: flex; gap: 11px;
  background: var(--panel); border-radius: var(--radius);
  padding: 13px 16px;
  transition: opacity .18s ease, transform .18s ease;
}
.cmt-ava { width: 30px; height: 30px; font-size: 13px; background: var(--panel-3); color: var(--muted); }
.cmt-main { flex: 1; min-width: 0; }
.cmt-head { display: flex; align-items: center; gap: 9px; }
.cmt-user { font-weight: 650; font-size: 13.5px; }
.cmt-when { color: var(--faint); font-size: 12px; }
.cmt-x {
  margin-left: auto; border: 0; background: none; color: var(--faint);
  width: 22px; height: 22px; border-radius: 6px; cursor: pointer; flex: none;
  font-size: 15px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.cmt-x:hover { background: var(--panel-2); color: var(--danger); }
.cmt-confirm {
  margin-left: auto; color: var(--faint); font-size: 12px; flex: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.cmt-confirm button {
  border: 0; background: var(--panel-2); color: var(--text);
  border-radius: 6px; padding: 3px 9px; font-size: 12px; cursor: pointer;
  transition: background .15s;
}
.cmt-confirm button:hover { background: var(--panel-3); }
.cmt-confirm .js-cmt-yes { color: var(--danger); }
.cmt-body { color: #d6d6d6; font-size: 14px; margin-top: 3px; overflow-wrap: anywhere; }
.cmt-creator { background: var(--panel-3); color: var(--text); }
/* Actions row: like heart (outline -> filled when liked, the pop bounce only
   plays when liking) and the Reply opener (top-level rows only). Visitors
   get a disabled heart that still shows the count. */
.cmt-actions { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.cmt-like {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; padding: 2px 4px; margin: -2px -4px;
  color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums;
  border-radius: 6px; cursor: pointer; transition: color .15s;
}
.cmt-like:hover:not(:disabled) { color: var(--text); }
.cmt-like:disabled { cursor: default; }
.cmt-like.liked { color: #e05a5a; }
.cmt-heart { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.cmt-like.liked .cmt-heart { fill: currentColor; stroke: none; }
.cmt-like.pop .cmt-heart { animation: cmt-like-pop .15s ease-out; }
@keyframes cmt-like-pop { 0% { transform: scale(1); } 50% { transform: scale(1.35); } 100% { transform: scale(1); } }
.cmt-reply-btn {
  border: 0; background: none; padding: 2px 4px; margin: -2px -4px;
  color: var(--faint); font-size: 12.5px; font-weight: 550;
  border-radius: 6px; cursor: pointer; transition: color .15s;
}
.cmt-reply-btn:hover { color: var(--text); }
/* Replies: one level, indented with a slim left rail. */
.cmt-rail {
  margin-top: 10px; padding-left: 28px;
  border-left: 2px solid var(--panel-2);
  display: flex; flex-direction: column; gap: 10px;
}
.cmt-rail:empty { display: none; }
.cmt-reply { background: transparent; padding: 8px 10px; }
.cmt-rep-form { background: var(--panel-2); border-radius: var(--radius-s); padding: 10px 12px; }
.cmt-rep-form textarea { min-height: 60px; background: var(--panel-3); }
.cmt-rep-btns { display: inline-flex; align-items: center; gap: 8px; }
.cmt-pending { opacity: .55; }
.cmt-in { animation: cmt-in .22s ease-out; }
@keyframes cmt-in { from { opacity: 0; transform: translateY(-7px); } to { opacity: 1; transform: none; } }
.cmt-out { opacity: 0; transform: translateX(12px); }
.cmt-empty { padding: 18px 0 8px; }

/* ---------- account page (/account profile card) ---------- */
.acct-panel > .form-error:empty { display: none; }
.acct-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.acct-ava-btn {
  position: relative; border: 0; padding: 0; background: none; cursor: pointer;
  border-radius: 50%; overflow: hidden; flex: none; line-height: 0;
}
.acct-ava-btn .avatar-lg { width: 76px; height: 76px; font-size: 30px; }
.acct-ava-wrap { display: contents; }
.acct-ava-edit {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 12px; font-weight: 650;
  opacity: 0; transition: opacity .15s;
}
.acct-ava-btn:hover .acct-ava-edit, .acct-ava-btn:focus-visible .acct-ava-edit { opacity: 1; }
.acct-ava-btn:disabled { cursor: default; }
.acct-id { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 8px; }
.acct-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acct-val { font-weight: 650; font-size: 17px; overflow-wrap: anywhere; }
.acct-mail { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.acct-since { color: var(--faint); font-size: 13px; }
.acct-out { margin: 0; }
.acct-form { border-top: 1px solid var(--panel-2); margin-top: 14px; padding-top: 14px; }
.acct-form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.acct-form-row input { width: auto; flex: 1; min-width: 180px; }
.acct-form .hint { margin-top: 8px; }

/* ---------- auth pages: centered panel card, visible widget spacing ---------- */
.login-box {
  background: var(--panel); border-radius: var(--radius);
  padding: 26px 26px 22px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .28);
}
.login-box h1 { margin-bottom: 2px; }
.ts-holder { margin: 8px 0 10px; }

/* ---------- small screens (~380px phones) ----------
   The item/editor layouts already collapse under 920px above; this is the
   phone pass. Desktop rules are untouched. */
@media (max-width: 640px) {
  .wrap { padding: 0 16px 48px; }
  .topbar { padding: 14px 16px 0; gap: 10px; }
  .topbar .btn { padding: 7px 12px; font-size: 13px; }
  .acct-chip { min-width: 56px; min-height: 32px; }
  .acct-link .acct-name {
    max-width: 96px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
  }
  /* Directory: creator cards stack in a single column. */
  .creator-grid { grid-template-columns: 1fr; }
  .dir-head { padding: 28px 0 18px; }
  .hero { padding: 36px 0 6px; }
  .profile { padding: 30px 0 4px; }
  .login-box { padding: 22px 18px 18px; }
  .cmt { padding: 12px 13px; }
  .cmt-actions { flex-wrap: wrap; gap: 10px; }
  .cmt-rail { padding-left: 16px; }
  .cmt-rep-btns { flex-wrap: wrap; }
  .acct-form-row input { min-width: 0; flex: 1 1 140px; }
  /* Wide markdown tables scroll sideways instead of breaking the layout. */
  .md table { display: block; overflow-x: auto; }
  /* Gallery thumbs shrink proportionally to fit the row instead of
     overflowing off-screen; wider screens keep fixed 86x58 thumbs that
     scroll sideways. */
  .gallery-thumb { flex: 0 1 86px; min-width: 0; }
  .gallery-thumb img, .gallery-thumb .vid-tile { width: 100%; height: auto; aspect-ratio: 86 / 58; }
}

@media (prefers-reduced-motion: reduce) {
  .cmt-in, .cmt-like.pop .cmt-heart { animation: none; }
  .cmt, .stars-fill, button.star { transition: none; }
}

/* ---------- true fullscreen 3D (Fullscreen API) ---------- */
.lightbox:fullscreen { background: rgba(8, 8, 8, .985); }
.lightbox:fullscreen .lb-content { max-width: 100vw; max-height: 100vh; }
.lightbox:fullscreen .lb-content .gal3d { width: 100vw; height: 100vh; }
.lightbox:fullscreen .lb-content img, .lightbox:fullscreen .lb-content video { max-width: 100vw; max-height: 100vh; border-radius: 0; }

/* ---------- admin analytics: rich sections (mirror of the creator panel) ---------- */
/* Accent tokens used by the bars below (declared here to keep :root above untouched). */
:root { --accent: #e9e9e9; --accent-soft: rgba(255, 255, 255, .12); }

/* The analytics header row packs buttons + day tabs + live chip: let it wrap. */
.field-row { flex-wrap: wrap; }

.mini-stars { position: relative; display: inline-flex; white-space: nowrap; vertical-align: -2px; }
.mini-stars .ico { width: 13px; height: 13px; }
.mini-stars-base { display: inline-flex; color: var(--panel-3); }
.mini-stars-fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; display: inline-flex; color: #ececec; }

/* Stat cards in the analytics view: left-aligned, sparkline under the number,
   clickable as chart-series toggles (no border/outline on any state). */
.an-cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.an-cards .stat-card { text-align: left; padding: 14px 16px 10px; }
.an-cards .stat-card canvas { width: 100%; display: block; margin-top: 6px; }
.stat-card.clickable { cursor: pointer; user-select: none; }
.stat-card.clickable:hover { background: var(--panel-2); }

/* Section grid: auto-fit, capped at 3 columns on very wide screens. */
.an-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); gap: 18px; align-items: stretch; margin-bottom: 18px; }
@media (min-width: 1900px) { .an-grid:has(> :nth-child(3)) { grid-template-columns: repeat(3, 1fr); } }
.an-grid .panel { margin-bottom: 0; display: flex; flex-direction: column; }

/* Bars shared by Top resources / Rating breakdown / 3D viewer top models. */
.upd-behind { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.upd-behind b { font-size: 22px; font-weight: 800; }
.upd-behind span { color: var(--muted); font-size: 12.5px; }
.upd-bar { display: grid; grid-template-columns: 62px 1fr auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.upd-bar-label { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upd-bar-label.mono { background: none; border-radius: 0; padding: 0; font-family: ui-monospace, Consolas, monospace; word-break: normal; user-select: none; }
.upd-bar-track { display: block; height: 7px; background: var(--panel-3); border-radius: 5px; overflow: hidden; }
.upd-bar-track span { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.upd-bar-num { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.upd-bar.other .upd-bar-label { color: var(--faint); font-style: italic; }
/* Devices: donut + mobile/desktop split. */
.an-dev { display: flex; flex-direction: column; gap: 14px; }
.donut-wrap { position: relative; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.donut-wrap canvas { width: 168px; display: block; flex: none; }
.donut-legend { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.donut-legend .lg { cursor: default; }
.split-bar { height: 10px; background: var(--panel-3); border-radius: 6px; overflow: hidden; }
.split-bar span { display: block; height: 100%; background: var(--accent); }
.split-lbl { display: flex; justify-content: space-between; color: var(--faint); font-size: 11.5px; margin-top: 5px; }
/* Resource picker for the Per-day chart + 3D viewer rows + hover tooltip. */
.stat-item-sel { width: auto; max-width: 240px; padding: 6px 10px; font-size: 12.5px; }
.anv-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 12.5px; color: var(--muted); }
.anv-row b { color: var(--text); font-size: 13px; white-space: nowrap; }
.top-link { position: relative; text-decoration: none; color: inherit; }
.top-link:hover .top-tip { display: flex; }
.top-tip {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 12px; z-index: 6;
  flex-direction: column; gap: 2px; white-space: nowrap;
  background: #101010; border: 1px solid #2e2e2e; border-radius: var(--radius-s);
  padding: 8px 11px; font-size: 12px; color: var(--muted);
  pointer-events: none;
}
.top-tip b { color: var(--text); font-size: 12.5px; }

/* Avatars are never drag sources: dragging your own pfp off the page and
   dropping it back used to re-upload it / navigate to the image. */
.acct-ava, .avatar, .cmt-ava, .side-ava, .ava-drop img, .ava-img, .c-ava, .acct-ava img {
  -webkit-user-drag: none; user-select: none;
}
