/* ==========================================================================
   LVS Web Staging — v2 stylesheet (no build step).
   --------------------------------------------------------------------------
   Dark-first, one cyan accent, Fibonacci spacing (8 13 21 34 55), a serif
   italic display face. The staging client adds a shell, a downloader table
   and a settings surface that the live v1.3 manager does not have.
   ========================================================================== */

:root {
  --f1: 8px; --f2: 13px; --f3: 21px; --f4: 34px; --f5: 55px;

  --bg: #080B10;
  --bg-2: #0C1118;
  --panel: #101720;
  --panel-2: #151E28;
  --panel-3: #1A2430;
  --ink: #EEF3F7;
  --ink-2: #A9B6C1;
  --ink-3: #77858F;
  --rule: rgba(255, 255, 255, .10);
  --rule-2: rgba(255, 255, 255, .055);

  --cyan: #17A2B8;
  --cyan-soft: #4CC9DD;
  --cyan-deep: #0C6B7B;
  --cyan-wash: rgba(23, 162, 184, .13);

  --keep: #2FBF8F;
  --reject: #E0837B;
  --amber: #D9A13B;
  --grey: #7E8B96;

  --focus: #4CC9DD;
  --shadow: 0 22px 60px -28px rgba(0, 0, 0, .75), 0 2px 8px -3px rgba(0, 0, 0, .5);
  --star: #E4B33D;

  --r-xl: 21px; --r-lg: 13px; --r-md: 8px; --r-xs: 5px;
  --tile: 240px;

  --font: system-ui, -apple-system, 'Segoe UI', 'Inter', sans-serif;
  --serif: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);

  --topbar-h: 64px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F6F4EE;
    --bg-2: #EEECE5;
    --panel: #FFFFFF;
    --panel-2: #F4F2EC;
    --panel-3: #EAE7DF;
    --ink: #12181E;
    --ink-2: #46505A;
    --ink-3: #657079;
    --rule: rgba(18, 24, 30, .13);
    --rule-2: rgba(18, 24, 30, .06);
    --cyan-wash: rgba(23, 162, 184, .10);
    --shadow: 0 26px 64px -30px rgba(18, 24, 30, .30), 0 2px 8px -3px rgba(18, 24, 30, .07);
    --star: #C2922A;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 78% -10%, rgba(76, 201, 221, .13), transparent 62%),
    radial-gradient(900px 480px at 8% 0%, rgba(23, 162, 184, .10), transparent 58%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 46%);
  background-attachment: fixed;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--cyan-soft); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
::selection { background: var(--cyan-wash); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: var(--f2);
  min-height: var(--topbar-h);
  padding: 10px clamp(13px, 3vw, 34px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--rule-2);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); font-size: 14px; letter-spacing: .01em;
  white-space: nowrap;
  background: none; border: 0; padding: 4px; cursor: pointer;
}
.brand:hover { text-decoration: none; }
.brand .logo { height: 27px; width: auto; flex: none; }
.brand b { font-weight: 600; }
.brand-name { font-family: var(--serif); font-size: 16px; letter-spacing: .01em; }
.brand .stage {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em;
  color: var(--cyan-soft); border: 1px solid var(--cyan-wash);
  background: var(--cyan-wash); padding: 2px 7px; border-radius: 999px;
}
.nav { display: flex; align-items: center; gap: 3px; margin-left: var(--f2); overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.navlink {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-radius: 999px; border: 1px solid transparent;
  color: var(--ink-2); background: none; cursor: pointer; white-space: nowrap;
  font-size: 13px; letter-spacing: .02em;
}
.navlink .ic { width: 16px; height: 16px; }
.navlink:hover { color: var(--ink); background: var(--panel-2); text-decoration: none; }
.navlink.is-active { color: var(--ink); background: var(--panel-2); border-color: var(--rule); }
.navlink.is-active .ic { color: var(--cyan-soft); }
.spacer { flex: 1 1 auto; }
.user-chip {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--ink-2); font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; white-space: nowrap;
  background: none; border: 0; padding: 4px 6px; border-radius: var(--r-md); cursor: pointer;
}
.user-chip:hover { background: var(--rule-2); }
.user-chip .u { display: grid; gap: 1px; text-align: left; }
.user-chip .u span { font-size: 9px; color: var(--ink-3); letter-spacing: .14em; }
.user-chip .av {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--rule); background: var(--panel-2);
  display: grid; place-items: center; color: var(--cyan-soft);
}
.user-chip .av .ic { width: 15px; height: 15px; }
.user-chip .av { overflow: hidden; }
.user-chip .av img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.user-chip--compact { padding: 0; background: none; border: 0; }
.cv-actions .user-chip .av { width: 31px; height: 31px; background: #101820; border-color: #2A343D; }

/* ------------------------------------------------------------------ page */
.page {
  width: min(1560px, 100%);
  margin: 0 auto;
  padding: clamp(21px, 4vw, 45px) clamp(13px, 3vw, 34px) 90px;
  flex: 1;
}
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--f3); margin-bottom: var(--f4); }
.page-head .grow { flex: 1 1 340px; min-width: 0; }
.eyebrow {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--cyan-soft); margin: 0 0 9px;
}
h1, h2, h3 { line-height: 1.16; margin: 0; font-weight: 560; }
h1.title { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(34px, 5vw, 55px); letter-spacing: -.015em; }
h1.title em { color: var(--cyan-soft); font-style: inherit; }
.lede { margin: 10px 0 0; color: var(--ink-2); max-width: 68ch; font-size: 14px; }
.page-actions { display: flex; flex-wrap: wrap; gap: var(--f1); align-items: center; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 8px 14px;
  border-radius: var(--r-md); border: 1px solid var(--rule);
  background: var(--panel-2); color: var(--ink);
  font-size: 13px; letter-spacing: .015em; cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease);
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--panel-3); border-color: color-mix(in srgb, var(--rule) 60%, var(--cyan-soft)); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn .ic { width: 16px; height: 16px; flex: none; }
.btn--solid { background: var(--cyan); border-color: var(--cyan); color: #04222A; font-weight: 600; }
.btn--solid:hover { background: var(--cyan-soft); border-color: var(--cyan-soft); }
.btn--ghost { background: transparent; }
.btn--white { background: #fff; border-color: #fff; color: #17212a; font-weight: 600; }
.btn--white:hover { background: #eee; border-color: #eee; }
.login-actions { display: grid; gap: 12px; margin-top: 16px; }
.login-actions .btn { width: 100%; min-height: 44px; }
.btn--danger { color: var(--reject); border-color: color-mix(in srgb, var(--reject) 45%, transparent); background: transparent; }
.btn--danger:hover { background: color-mix(in srgb, var(--reject) 14%, transparent); border-color: var(--reject); }
.btn--icon { padding: 8px; min-width: 38px; }
.btn--sm { min-height: 30px; padding: 5px 10px; font-size: 12px; }
.btn--sm .ic { width: 14px; height: 14px; }

.linkish {
  background: none; border: 0; padding: 0; color: var(--cyan-soft);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}

/* ------------------------------------------------------------------ chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--rule);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-2); white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--grey); }
.chip.is-active { color: var(--keep); border-color: color-mix(in srgb, var(--keep) 38%, transparent); }
.chip.is-active .dot { background: var(--keep); box-shadow: 0 0 0 4px color-mix(in srgb, var(--keep) 18%, transparent); }
.chip.is-paused { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 38%, transparent); }
.chip.is-paused .dot { background: var(--amber); }
.chip.is-finalized, .chip.is-expired { color: var(--ink-3); }
.chip.is-finalized .dot, .chip.is-expired .dot { background: var(--ink-3); }
.chip.is-returned { color: var(--cyan-soft); border-color: color-mix(in srgb, var(--cyan) 38%, transparent); }
.chip.is-returned .dot { background: var(--cyan); }
.chip--off { color: var(--ink-3); border-style: dashed; }

/* ------------------------------------------------------------------ stats */
.statrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: var(--f1); margin: 0 0 var(--f4); }
.stat {
  border: 1px solid var(--rule-2); border-radius: var(--r-lg); background: var(--panel);
  padding: 13px 15px; min-width: 0;
}
.stat b { display: block; font-family: var(--mono); font-size: 21px; font-weight: 500; letter-spacing: -.02em; }
.stat span { display: block; margin-top: 3px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }

/* ------------------------------------------------------------- collection */
.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: var(--f2); }
.coll-card {
  position: relative; display: flex; flex-direction: column; gap: 11px;
  text-align: left; padding: 18px 18px 14px;
  border: 1px solid var(--rule-2); border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--ink); cursor: pointer; overflow: hidden;
  transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
}
.coll-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, var(--cyan-soft), transparent);
  opacity: .55;
}
.coll-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--rule) 55%, var(--cyan)); box-shadow: var(--shadow); }
.coll-top { display: flex; align-items: flex-start; gap: 10px; }
.coll-title { flex: 1 1 auto; min-width: 0; }
.coll-title h3 { font-size: 17px; font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coll-rename {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
  padding: 0; border: 0; background: none; color: inherit; font: inherit;
  cursor: pointer; text-align: left;
}
.coll-rename span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coll-rename .ic { width: 14px; height: 14px; flex: none; color: var(--ink-3); opacity: .55; transition: opacity .16s; }
.coll-rename:hover .ic, .coll-rename:focus-visible .ic { opacity: 1; }
.inline-name-input { display: block; box-sizing: border-box; width: 100%; min-width: 100px; margin: 0; padding: 0 3px; border: 1px solid var(--cyan); border-radius: 2px; background: var(--panel); color: inherit; font: inherit; letter-spacing: inherit; }
.inline-name-input:disabled { opacity: .65; }
.coll-title small { display: block; margin-top: 3px; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coll-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12px; color: var(--ink-2); }
.coll-meta strong { color: var(--ink); font-weight: 560; }
.meter { height: 4px; border-radius: 99px; background: var(--rule-2); overflow: hidden; display: flex; }
.meter i { display: block; height: 100%; }
.meter .keep { background: var(--keep); }
.meter .cull { background: var(--reject); }
.coll-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.del {
  margin-left: auto; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: var(--r-md); color: var(--ink-3); cursor: pointer;
}
.del .ic { width: 16px; height: 16px; }
.del:hover { color: var(--reject); background: color-mix(in srgb, var(--reject) 13%, transparent); }

/* ----------------------------------------------------------- empty/errors */
.empty, .error-panel {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  text-align: center; padding: 55px 21px;
  border: 1px dashed var(--rule); border-radius: var(--r-xl);
  color: var(--ink-3); background: color-mix(in srgb, var(--panel) 60%, transparent);
}
.empty .ic, .error-panel .ic { width: 34px; height: 34px; opacity: .55; }
.empty strong, .error-panel strong { color: var(--ink); font-size: 16px; font-weight: 560; }
.empty span, .error-panel span { font-size: 13px; max-width: 52ch; }
.error-panel { border-color: color-mix(in srgb, var(--reject) 40%, transparent); }
.error-panel .ic { color: var(--reject); }

/* ------------------------------------------------------------------ busy */
.busy {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 55px 21px; color: var(--ink-3); font-family: var(--mono);
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
}
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--rule); border-top-color: var(--cyan-soft);
  animation: spin .8s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton {
  background: linear-gradient(90deg, var(--panel-2), var(--panel-3), var(--panel-2));
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
  border-radius: var(--r-md);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* --------------------------------------------------------------- workspace */
.ws-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--f2); margin-bottom: var(--f2); }
.ws-head h1 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(27px, 3.6vw, 40px); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-head h1 .title-btn {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 0; border: 0; background: none; color: inherit; font: inherit;
  cursor: pointer; text-align: left;
}
.ws-head h1 .title-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-head h1 .title-btn .ic { width: 16px; height: 16px; flex: none; color: var(--ink-3); opacity: .45; transition: opacity .16s; }
.ws-head h1 .title-btn:hover .ic, .ws-head h1 .title-btn:focus-visible .ic { opacity: 1; }
.ws-sub { display: flex; flex-wrap: wrap; gap: 7px 15px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.ws-sub .mono { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; color: var(--ink-3); }

.tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--rule-2); border-radius: 999px; background: var(--panel); width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent;
  color: var(--ink-2); padding: 8px 15px; border-radius: 999px; cursor: pointer;
  font-size: 12.5px; letter-spacing: .04em; white-space: nowrap;
}
.tab .ic { width: 15px; height: 15px; }
.tab:hover { color: var(--ink); background: var(--panel-2); }
.tab.is-active { background: var(--panel-3); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule); }
.tab.is-active .ic { color: var(--cyan-soft); }
.tab .n { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--f1);
  margin: var(--f2) 0; padding: 10px 12px;
  border: 1px solid var(--rule-2); border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--panel) 80%, transparent);
}
.toolbar .search { position: relative; flex: 1 1 220px; max-width: 360px; min-width: 160px; }
.toolbar .search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-3); }
.toolbar .search input { width: 100%; padding: 9px 11px 9px 34px; }
.toolbar select { padding: 8px 10px; }
.toolbar label.f { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.sizesel { display: inline-flex; align-items: center; gap: 6px; }
.sizesel input[type="range"] { width: 76px; accent-color: var(--cyan); }
.sizesel .SML { font-family: var(--mono); font-size: 9px; color: var(--ink-3); }
.count { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; color: var(--ink-3); }

input[type="text"], input[type="search"], input[type="password"], input[type="email"], input[type="number"], select, textarea {
  background: var(--panel-2); border: 1px solid var(--rule); border-radius: var(--r-md);
  padding: 10px 11px; color: var(--ink); min-height: 38px;
}
input:focus, select:focus, textarea:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px var(--cyan-wash); }
input[type="checkbox"] { accent-color: var(--cyan); width: 16px; height: 16px; }

.banner {
  display: flex; align-items: center; gap: 10px; margin: 0 0 var(--f2);
  padding: 11px 14px; border-radius: var(--r-md);
  border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
  background: color-mix(in srgb, var(--amber) 10%, transparent);
  color: var(--ink); font-size: 13px;
}
.banner .ic { width: 17px; height: 17px; color: var(--amber); flex: none; }
.banner--info { border-color: var(--rule); background: var(--panel); }
.banner--info .ic { color: var(--cyan-soft); }

/* -------------------------------------------------------------------- grid */
.files-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr));
  gap: var(--f2); align-content: start;
}
.tile {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  background: var(--panel); border: 1px solid var(--rule-2);
  cursor: pointer; transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.tile:hover { border-color: color-mix(in srgb, var(--rule) 50%, var(--cyan)); transform: translateY(-1px); }
.tile.is-selected { border-color: var(--cyan); box-shadow: 0 0 0 2px var(--cyan-wash); }
.tile.is-culled .frame { opacity: .62; }
.tile.is-culled::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border-top: 2px solid color-mix(in srgb, var(--reject) 65%, transparent);
}
.tile.is-keep::before {
  content: ""; position: absolute; z-index: 3; inset: 0 0 auto 0; height: 2px;
  background: var(--keep);
}
.tile .frame {
  position: relative; aspect-ratio: 4 / 3; background: var(--bg-2);
  display: grid; place-items: center; overflow: hidden;
}
.tile .frame img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .25s var(--ease); }
.tile .frame .ph {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  color: var(--ink-3); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
}
.tile .frame .ph .ic { width: 24px; height: 24px; opacity: .5; }
.tile .badges { position: absolute; z-index: 4; top: 7px; left: 7px; display: flex; gap: 5px; }
.badge {
  display: inline-grid; place-items: center; min-width: 21px; height: 21px; padding: 0 5px;
  border-radius: var(--r-xs); font-family: var(--mono); font-size: 10px; font-weight: 600;
  background: rgba(6, 10, 14, .72); color: var(--ink); border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(6px);
}
.badge--edit { color: var(--keep); }
.badge--v { color: var(--cyan-soft); }
.tile .check {
  position: absolute; z-index: 5; top: 7px; right: 7px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(6, 10, 14, .66); border: 1px solid rgba(255, 255, 255, .2);
  color: transparent; backdrop-filter: blur(6px);
}
.tile .check .ic { width: 14px; height: 14px; }
.tile:hover .check, .tile.is-selected .check { color: var(--ink-2); }
.tile.is-selected .check { background: var(--cyan); border-color: var(--cyan); color: #04222A; }
.tile .bar {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px;
  padding: 8px 9px; background: linear-gradient(180deg, var(--panel), var(--panel-2));
}
.tile .name {
  font-size: 11.5px; color: var(--ink-2); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); letter-spacing: .01em;
}
.stars { display: inline-flex; gap: 1px; }
.stars button {
  border: 0; background: transparent; padding: 2px; cursor: pointer; color: var(--ink-3);
  display: grid; place-items: center; line-height: 0;
}
.stars button .ic { width: 13px; height: 13px; }
.stars button.on { color: var(--star); }
.stars button:hover { color: var(--star); transform: scale(1.12); }
.stars button.on .ic { fill: currentColor; }
.stars button .ic { fill: none; }

/* selection bar */
.selbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 9px;
  margin: 0 0 var(--f2); padding: 9px 12px;
  border: 1px solid var(--cyan-wash); border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--cyan) 9%, var(--panel));
  position: sticky; top: calc(var(--topbar-h) + 6px); z-index: 30;
  backdrop-filter: blur(12px);
}
.selbar .n { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan-soft); }
.ratingset { display: inline-flex; gap: 3px; }
.ratingset button {
  min-width: 30px; height: 30px; border-radius: var(--r-xs);
  border: 1px solid var(--rule); background: var(--panel-2); cursor: pointer;
  font-family: var(--mono); font-size: 12px; color: var(--ink);
  display: grid; place-items: center;
}
.ratingset button:hover { border-color: var(--star); color: var(--star); }
.ratingset button .ic { width: 14px; height: 14px; }

/* ------------------------------------------------------------------ viewer */
.viewer {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column;
  background: rgba(4, 7, 10, .97);
  color: #F2F6F9;
}
.vtop {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px clamp(10px, 2.4vw, 21px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(8, 12, 17, .8); backdrop-filter: blur(12px);
}
.vtop .fname { font-family: var(--mono); font-size: 12px; letter-spacing: .03em; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vtop .counter { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; color: #8FA0AC; }
.vstage {
  position: relative; flex: 1; display: grid; place-items: center;
  overflow: auto; padding: 21px; min-height: 0;
}
.vstage img {
  max-width: 100%; max-height: 100%; object-fit: contain; display: block;
  opacity: 0; transition: opacity .3s var(--ease); box-shadow: 0 30px 80px -40px #000;
}
.vstage img.is-loaded { opacity: 1; }
.vstage.is-zoomed { place-items: start; }
.vstage.is-zoomed img { max-width: none; max-height: none; cursor: grab; }
.vnav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(12, 18, 24, .72); border: 1px solid rgba(255, 255, 255, .14);
  color: #EAF1F5; backdrop-filter: blur(8px);
}
.vnav .ic { width: 20px; height: 20px; }
.vnav:hover { background: var(--cyan-deep); border-color: var(--cyan-soft); }
.vnav--prev { left: 14px; }
.vnav--next { right: 14px; }
.vnav[disabled] { opacity: .25; cursor: default; }
.vmsg {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  color: #A9B6C1; font-size: 12px; text-align: center;
}
.vmsg .ic { width: 30px; height: 30px; opacity: .5; }
.vfoot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 10px clamp(10px, 2.4vw, 21px);
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: rgba(8, 12, 17, .86); backdrop-filter: blur(12px);
  color: #C8D3DA;
}
.vfoot .stars button { color: #6C7A85; }
.vfoot .stars button.on { color: var(--star); }
.vfoot .stars button .ic { width: 19px; height: 19px; }
.vfoot .verdict-inline { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #8FA0AC; }
.vfoot .rating-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #7D8C97; }
.vinfo {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(330px, 86vw);
  background: rgba(9, 14, 20, .96); border-left: 1px solid rgba(255, 255, 255, .1);
  padding: 21px; overflow: auto; z-index: 3; color: #D6E0E6;
  transform: translateX(100%); transition: transform .26s var(--ease);
}
.vinfo.is-open { transform: none; }
.vinfo h3 { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: #8FA0AC; margin-bottom: 13px; }
.vinfo .kv { display: grid; gap: 2px; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.vinfo .kv span { font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: #7D8C97; }
.vinfo .kv b { font-family: var(--mono); font-size: 12px; font-weight: 500; word-break: break-word; }

/* ------------------------------------------------- culling workspace (cv) */
.viewer.cv {
  overflow: hidden;
  background: #05080B;
  color: #EDF3F7;
}

/* top bar: brand, section tabs, breadcrumb, verbs */
.cv-top {
  flex: none; display: flex; align-items: center; gap: 20px;
  height: 56px; padding: 0 clamp(12px, 1.6vw, 20px);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  background: #070B0F;
}
.cv-brand {
  flex: none; display: grid; place-items: center;
  margin: 0; padding: 5px 7px; border: 0; border-radius: 5px;
  background: none; color: #EAF2F6; cursor: pointer;
}
.cv-brand:hover { background: rgba(255, 255, 255, .05); }
.cv-brand .logo { display: block; width: auto; height: 19px; }

.cv-tabs { display: flex; align-items: stretch; gap: clamp(13px, 1.6vw, 24px); height: 100%; flex: none; }
.cvtab {
  position: relative; display: flex; align-items: center; height: 100%;
  color: #93A0AB; font-size: 13px; text-decoration: none; white-space: nowrap;
  transition: color .15s;
}
.cvtab:hover { color: #D7E1E7; }
.cvtab.is-active { color: #F5F9FB; }
.cvtab.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--star);
}

.cv-train {
  margin-left: auto; display: flex; align-items: center; gap: 9px;
  min-width: 0; font-size: 12px; color: #8D9AA5;
}
.cv-train > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-session-title { min-width: 0; max-width: min(360px, 30vw); color: #EAF2F6; font-size: 19px; line-height: 1.3; }
.cv-session-button { display: block; max-width: 100%; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: text; }
.cv-session-button:disabled { cursor: default; opacity: 1; }
.cv-session-button:hover:not(:disabled) { color: white; }
.cv-session-title .inline-name-input { background: #101820; color: #EAF2F6; }
.cv-crumb-file { max-width: min(300px, 24vw); font-family: var(--mono); font-size: 11.5px; color: #94A2AD; }
.cv-crumb-count { font-family: var(--mono); font-size: 11px; color: #7C8A95; }
.cv-sep { flex: none; color: #3E4C56; }

.cv-actions { flex: none; display: flex; align-items: center; gap: 7px; }

.cv-btn, .cv-iconbtn {
  height: 31px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 11px; border-radius: 5px; border: 1px solid #2A343D;
  background: #111820; color: #DCE6EC; font-family: var(--font); font-size: 12px;
  cursor: pointer; white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}
.cv-btn:hover, .cv-iconbtn:hover { border-color: #46545F; background: #17202A; }
.cv-btn .ic, .cv-iconbtn .ic { width: 15px; height: 15px; flex: none; }
.cv-iconbtn { width: 32px; padding: 0; }
.cv-btn--strong { background: #1A232C; border-color: #394752; }
.cv-editbtn.is-on { border-color: var(--star); color: var(--star); background: rgba(228, 179, 61, .12); }
.cv-btn:disabled, .cv-iconbtn:disabled { opacity: .4; cursor: default; }
.cv-btn:disabled:hover, .cv-iconbtn:disabled:hover { border-color: #2A343D; background: #111820; }

.cv-split { display: inline-flex; }
.cv-split-main { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cv-split-caret { width: 27px; padding: 0; border-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cv-split-caret .ic { width: 13px; height: 13px; }

/* main row: photograph details, the frame, the numbers */
.cv-main {
  flex: 1 1 auto; min-height: 0;
  display: grid;
  grid-template-columns: minmax(190px, 250px) minmax(0, 1fr) minmax(160px, 210px);
  gap: clamp(16px, 2.6vw, 38px);
  padding: 0 clamp(12px, 1.6vw, 20px);
}

.cv-left { min-width: 0; padding-top: clamp(18px, 3.2vh, 34px); display: flex; flex-direction: column; gap: 11px; }
.cv-pill {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 4px; border-radius: 999px;
  border: 1px solid rgba(76, 201, 221, .45); color: #9FE6F0;
  font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
}
.cv-pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.cv-pill.is-received { border-color: rgba(47, 191, 143, .5); color: #8FE3BD; }
.cv-pill.is-readonly { border-color: rgba(224, 131, 123, .5); color: #F0A49C; }

.cv-name {
  margin: 0; font-size: clamp(21px, 1.9vw, 28px); font-weight: 600;
  line-height: 1.16; letter-spacing: -.015em; overflow-wrap: anywhere;
}
.cv-name-btn {
  display: flex; align-items: flex-start; gap: 8px; max-width: 100%;
  margin: 0; padding: 0; border: 0; background: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
.cv-name-btn span { min-width: 0; overflow-wrap: anywhere; }
.cv-name-btn .ic {
  width: 15px; height: 15px; flex: none; margin-top: 5px;
  color: #7E8C97; opacity: 0; transition: opacity .15s;
}
.cv-name-btn:hover .ic, .cv-name-btn:focus-visible .ic { opacity: 1; }
.cv-name-input {
  width: 100%; max-width: 100%; margin: -3px -7px; padding: 2px 6px;
  border: 1px solid var(--star); border-radius: 5px; outline: none;
  background: #0B1117; color: #F5F9FB; font: inherit; letter-spacing: inherit;
  box-shadow: 0 0 0 3px rgba(228, 179, 61, .12);
}
.cv-name-input:disabled { opacity: .6; }
.cv-meta { margin: 0; font-family: var(--mono); font-size: 11.5px; line-height: 1.7; color: #8795A1; }
.cv-session { margin: 0; font-size: 12px; color: #65737F; }
.cv-state {
  margin-top: 5px; font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .1em; text-transform: uppercase; color: #7E8C97;
}

.cv-centre { display: flex; min-width: 0; min-height: 0; padding-top: clamp(10px, 1.8vh, 18px); }
.cv-stage {
  position: relative; flex: 1; min-width: 0; min-height: 0; overflow: hidden;
  display: grid; place-items: center; border-radius: 10px;
}
.cv-img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  opacity: 0; transform-origin: center center; cursor: grab;
  transition: opacity .25s var(--ease), transform .18s var(--ease);
  will-change: transform; touch-action: none;
}
.cv-img.is-panning { transition: opacity .25s var(--ease); }
.cv-img.is-loaded { opacity: 1; }
.cv-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; z-index: 2;
  background: rgba(8, 13, 18, .66); border: 1px solid rgba(255, 255, 255, .14);
  color: #EAF1F5; backdrop-filter: blur(7px);
  transition: background .15s, border-color .15s, opacity .15s;
}
.cv-nav .ic { width: 19px; height: 19px; }
.cv-nav:hover { background: rgba(25, 36, 46, .92); border-color: rgba(255, 255, 255, .3); }
.cv-nav--prev { left: 7px; }
.cv-nav--next { right: 7px; }
.cv-nav[disabled] { opacity: .2; cursor: default; }
.cv-msg {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 2;
  color: #A9B6C1; font-size: 12px; text-align: center; max-width: 80%;
}
.cv-msg .ic { width: 30px; height: 30px; opacity: .5; }

/* score column */
.cv-right {
  min-width: 0; padding-top: clamp(18px, 3.2vh, 34px);
  display: flex; flex-direction: column; gap: clamp(20px, 3.2vh, 30px);
}
.cv-bigscore { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.cv-bigscore b {
  font-size: clamp(34px, 3.3vw, 46px); line-height: 1;
  font-weight: 500; letter-spacing: -.03em; color: #F3F8FB;
}
.cv-score-rule { width: 44px; height: 2px; border-radius: 2px; background: var(--star); }
.cv-score-note {
  font-family: var(--mono); font-size: 9px; letter-spacing: .16em;
  text-transform: uppercase; color: #72808B; text-align: center;
}
.cv-subs { display: flex; flex-direction: column; gap: 13px; padding-top: 17px; border-top: 1px solid rgba(255, 255, 255, .08); }
.cv-sub { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cv-sub .ic { width: 17px; height: 17px; flex: none; color: #A9B6C0; }
.cv-sub span { flex: 1; min-width: 0; font-size: 12.5px; color: #B7C3CC; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-sub b { flex: none; font-family: var(--mono); font-size: 12px; font-weight: 500; color: #E8EFF3; }

/* filmstrip + colour strip */
.cv-film { flex: none; display: flex; flex-direction: column; gap: 7px; padding: 9px clamp(12px, 1.6vw, 20px) 0; }
.cv-rail {
  display: flex; gap: 7px; overflow-x: auto; overflow-y: hidden;
  padding: 2px 0 5px; scrollbar-width: thin; scrollbar-color: #25303A transparent;
  cursor: grab;
}
.cv-rail.is-dragging { cursor: grabbing; user-select: none; }
.cv-rail.is-dragging .cv-thumb { pointer-events: none; }
.cv-rail::-webkit-scrollbar { height: 7px; }
.cv-rail::-webkit-scrollbar-thumb { background: #232D36; border-radius: 99px; }
.cv-rail::-webkit-scrollbar-track { background: transparent; }
.cv-thumb {
  position: relative; flex: 0 0 auto; width: 118px; height: 76px; padding: 0;
  border: 2px solid transparent; border-radius: 5px; overflow: hidden;
  background: #0B1015; cursor: pointer; opacity: .7;
  transition: opacity .16s, border-color .16s, box-shadow .16s;
}
.cv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv-thumb:hover { opacity: 1; }
.cv-thumb.is-picked:not(.is-current) { opacity: 1; border-color: rgba(76, 201, 221, .75); }
.cv-thumb.is-current { opacity: 1; border-color: var(--star); box-shadow: 0 0 0 1px rgba(228, 179, 61, .3); }
.cv-badge {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(3, 6, 9, .74); color: #DDE6EC;
  font-family: var(--mono); font-size: 10px; line-height: 1;
}
.cv-badge:empty { display: none; }
.cv-badge.is-low { background: rgba(217, 87, 75, .92); color: #180A08; }
.cv-badge.is-high { background: rgba(47, 191, 143, .94); color: #04140D; }

.cv-strip { display: flex; gap: 2px; height: 9px; }
.cv-seg {
  flex: 1 1 0; min-width: 2px; height: 100%; padding: 0; border: 0;
  background: #39444E; cursor: pointer; opacity: .82; transition: opacity .15s;
}
.cv-seg:hover { opacity: 1; }
.cv-seg.r1 { background: #D9574B; }
.cv-seg.r2 { background: #EE8B3C; }
.cv-seg.r3 { background: #E5C34A; }
.cv-seg.r4 { background: #61C9A4; }
.cv-seg.r5 { background: #2FBF8F; }
.cv-seg.is-current { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9); opacity: 1; }

/* bottom bar */
.cv-foot {
  flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 16px; padding: 7px clamp(12px, 1.6vw, 20px) 11px;
  border-top: 1px solid rgba(255, 255, 255, .07); background: #070B0F;
}
.cv-count { font-family: var(--mono); font-size: 10.5px; letter-spacing: .07em; color: #7D8B96; white-space: nowrap; }
.cv-rate { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.cv-rate small { font-family: var(--mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: #84929D; }
.cv-rate-btns { display: flex; gap: 8px; }
.cv-rate-btns button {
  width: 45px; height: 36px; border-radius: 5px; border: 1px solid #2A343D;
  background: #10171E; color: #C9D4DC; font-family: var(--mono); font-size: 14px;
  cursor: pointer; transition: border-color .15s, color .15s, background .15s;
}
.cv-rate-btns button:hover { border-color: #4A5863; color: #FFFFFF; }
.cv-rate-btns button.is-on {
  border-color: var(--star); color: var(--star); background: rgba(228, 179, 61, .13);
  box-shadow: inset 0 0 0 1px rgba(228, 179, 61, .35);
}
.cv-rate-btns button:disabled { opacity: .4; cursor: default; }
.cv-tools { justify-self: end; display: flex; align-items: center; gap: 9px; min-width: 0; }
.cv-zoom { width: clamp(74px, 8vw, 126px); accent-color: var(--star); }
.cv-zoombar-btn { width: 28px; height: 28px; }
.cv-gridbtn { height: 32px; }

/* popover menus */
.cv-menu {
  position: fixed; z-index: 120; min-width: 208px; padding: 5px;
  border-radius: 8px; border: 1px solid rgba(255, 255, 255, .1);
  background: #0D141B; box-shadow: 0 18px 44px -16px #000;
  opacity: 0; transform: translateY(-4px); transition: opacity .12s, transform .12s;
}
.cv-menu.is-open { opacity: 1; transform: none; }
.cv-menu-item {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border: 0; border-radius: 5px; background: none;
  color: #DDE7ED; font-family: var(--font); font-size: 12.5px; text-align: left; cursor: pointer;
}
.cv-menu-item .ic { width: 15px; height: 15px; flex: none; color: #8D9AA5; }
.cv-menu-item small { margin-left: auto; font-size: 10px; color: #77848F; }
.cv-menu-item:hover { background: #161F27; }
.cv-menu-item.is-danger { color: #F0A49C; }
.cv-menu-item.is-danger .ic { color: #E0837B; }
.cv-menu-item:disabled { opacity: .4; cursor: default; background: none; }

/* information drawer */
.cv-info {
  position: absolute; top: 56px; right: 0; bottom: 0; width: min(340px, 88vw);
  z-index: 100; padding: 17px 20px 24px; overflow: auto;
  background: #0A1117; border-left: 1px solid rgba(255, 255, 255, .1);
  box-shadow: -24px 0 60px -40px #000;
}
.cv-info[hidden] { display: none; }
.cv-info-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.cv-info-head h2 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #8D9AA5; }
.cv-info-row { display: grid; gap: 2px; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.cv-info-row span { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: #75828D; }
.cv-info-row b { font-size: 12.5px; font-weight: 500; color: #E1E9EE; overflow-wrap: anywhere; }
.cv-info-note { margin: 14px 0 0; font-size: 11.5px; line-height: 1.55; color: #7E8C97; }
.cv-info-actions { display: flex; gap: 8px; margin-top: 14px; }

/* steer composer */
.cv-steer {
  position: absolute; left: 50%; bottom: 80px; transform: translateX(-50%);
  width: min(680px, calc(100vw - 36px)); z-index: 110;
  padding: 11px 12px 12px; border-radius: 10px;
  background: #0C141B; border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 22px 56px -20px #000;
}
.cv-steer[hidden] { display: none; }
.cv-steer-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: #93A1AC; font-size: 11px; }
.cv-steer-head .ic { width: 14px; height: 14px; color: #B7C3CC; }
.cv-steer-head strong { font-family: var(--mono); font-size: 9.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #D5DFE5; }
.cv-steer-head .cv-iconbtn { width: 24px; height: 24px; margin-left: 2px; }
.cv-steer-note { margin-left: auto; font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: #7B8994; }
.cv-steer-note.is-pending { color: #EBC66B; }
.cv-steer-row { display: flex; align-items: flex-end; gap: 8px; }
.cv-steer textarea {
  flex: 1; min-height: 38px; max-height: 120px; resize: vertical;
  padding: 9px 11px; border-radius: 6px; border: 1px solid #2B3640;
  background: #080E14; color: #E8EFF3; font-family: var(--font);
  font-size: 12.5px; line-height: 1.45;
}
.cv-steer textarea:focus { outline: none; border-color: var(--star); }
.cv-steer textarea::placeholder { color: #62707B; }
.cv-send { height: 38px; }
.cv-conversation { max-height: 180px; overflow-y: auto; margin: 8px 0 12px; }
.cv-message { border-left: 2px solid #3b756c; padding: 5px 10px; margin-bottom: 8px; }
.cv-message b { font-size: 11px; color: #b8d9d3; }
.cv-message p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 3px 0; color: #dce3e8; font-size: 13px; }

.cv-pending {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: 99px; border: 1px solid rgba(228, 179, 61, .4);
  background: rgba(228, 179, 61, .14); color: #EBC66B;
  font-family: var(--mono); font-size: 9px; letter-spacing: .12em;
  text-transform: uppercase; white-space: nowrap;
}
.cv-pending[hidden] { display: none; }
.cv-pending i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: cvpulse 1.8s infinite; }
@keyframes cvpulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

@media (max-width: 1120px) {
  .cv-crumb-file { display: none; }
  .cv-crumb-file + .cv-sep { display: none; }
  .cv-crumb-file { max-width: 190px; }
}
@media (max-width: 940px) {
  .cv-main { grid-template-columns: minmax(0, 1fr) minmax(140px, 170px); }
  .cv-left { display: none; }
  .cv-top { flex-wrap: wrap; height: auto; min-height: 56px; padding-top: 8px; padding-bottom: 8px; }
  .cv-train { order: 3; flex: 1 0 100%; margin-left: 0; }
  .cv-session-title { max-width: min(600px, 75vw); }
}
@media (max-width: 720px) {
  .cv-main { grid-template-columns: minmax(0, 1fr); }
  .cv-right { display: none; }
  .cv-top { gap: 10px; }
  .cv-tabs { gap: 13px; }
  .cvtab { font-size: 12px; }
  .cv-actions .cv-btn span { display: none; }
  .cv-actions .cv-btn { padding: 0 9px; }
  .cv-thumb { width: 88px; height: 60px; }
  .cv-foot { grid-template-columns: auto 1fr; row-gap: 8px; }
  .cv-count { grid-column: 1 / -1; order: 3; }
  .cv-tools { justify-self: end; }
  .cv-zoom { width: 70px; }
  .cv-rate-btns button { width: 38px; height: 32px; }
}

/* -------------------------------------------------------------- downloader */
.dl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: var(--f2); }
.dl-head .grow { flex: 1 1 260px; }
.dl-head .hint { font-size: 12px; color: var(--ink-3); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--panel); border: 1px solid var(--rule-2); }
.seg button {
  border: 0; background: transparent; padding: 7px 13px; border-radius: 999px;
  color: var(--ink-2); cursor: pointer; font-size: 12px;
}
.seg button.is-active { background: var(--panel-3); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule); }
.dl-table { border: 1px solid var(--rule-2); border-radius: var(--r-lg); overflow: hidden; background: var(--panel); }
.dl-row {
  display: grid; grid-template-columns: 34px 46px minmax(0, 1fr) 96px 84px 104px 84px;
  align-items: center; gap: 9px; padding: 8px 12px;
  border-top: 1px solid var(--rule-2); font-size: 12.5px;
}
.dl-row:first-child { border-top: 0; }
.dl-row.is-head {
  background: var(--panel-2); font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3);
}
.dl-row.is-selected { background: color-mix(in srgb, var(--cyan) 7%, transparent); }
.dl-thumb { width: 46px; height: 34px; border-radius: var(--r-xs); overflow: hidden; background: var(--bg-2); }
.dl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dl-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 11.5px; }
.dl-name small { display: block; font-family: var(--font); font-size: 10px; color: var(--ink-3); }
.dl-num { font-family: var(--mono); font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.dl-rating { min-width: 0; }
.dl-rating .stars { flex-wrap: nowrap; }
.dl-rating .rating-label { display: none; }
.dl-get { display: flex; gap: 4px; flex-wrap: nowrap; justify-content: flex-end; }
.dl-state { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.dl-state.is-done { color: var(--keep); }
.dl-state.is-busy { color: var(--cyan-soft); }
.dl-state.is-fail { color: var(--reject); }
.dl-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 11px 12px; border-top: 1px solid var(--rule); background: var(--panel-2); }

/* ---------------------------------------------------------------- uploader */
.uploader { display: grid; gap: var(--f2); }
.dz {
  display: grid; place-items: center; gap: 9px; text-align: center;
  padding: 34px 21px; border-radius: var(--r-lg);
  border: 1.5px dashed var(--rule); background: color-mix(in srgb, var(--panel) 70%, transparent);
  color: var(--ink-2); font-size: 13px; transition: border-color .18s var(--ease), background .18s var(--ease);
}
.dz.is-over { border-color: var(--cyan); background: color-mix(in srgb, var(--cyan) 10%, transparent); }
.dz .ic { width: 30px; height: 30px; color: var(--cyan-soft); }
.dz small { color: var(--ink-3); font-size: 11.5px; }
.upl-list { display: grid; gap: 7px; }
.upl {
  border: 1px solid var(--rule-2); border-radius: var(--r-md); background: var(--panel);
  padding: 9px 11px;
}
.upl .r1 { display: flex; align-items: center; gap: 9px; }
.upl .nm { font-family: var(--mono); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upl .sz { font-family: var(--mono); font-size: 10px; color: var(--ink-3); white-space: nowrap; }
.upl .bar2 { height: 4px; border-radius: 99px; background: var(--rule-2); overflow: hidden; margin-top: 8px; }
.upl .bar2 i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--cyan-soft)); width: 0; transition: width .25s linear; }
.upl .st { font-size: 11px; color: var(--reject); margin-top: 5px; min-height: 0; }
.upl.is-done { border-color: color-mix(in srgb, var(--keep) 35%, transparent); }
.upl.is-failed { border-color: color-mix(in srgb, var(--reject) 40%, transparent); }
.upl .ctrl { border: 1px solid var(--rule); background: transparent; color: var(--ink-2); width: 28px; height: 28px; border-radius: var(--r-xs); display: grid; place-items: center; cursor: pointer; }
.upl .ctrl .ic { width: 14px; height: 14px; }
.pill-state {
  font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; border: 1px solid var(--rule); color: var(--ink-3);
}
.pill-state.is-uploading, .pill-state.is-registering, .pill-state.is-hashing, .pill-state.is-completing { color: var(--cyan-soft); border-color: var(--cyan-wash); }
.pill-state.is-done { color: var(--keep); border-color: color-mix(in srgb, var(--keep) 35%, transparent); }
.pill-state.is-failed { color: var(--reject); border-color: color-mix(in srgb, var(--reject) 35%, transparent); }

/* ----------------------------------------------------------------- details */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: var(--f2); }
.panel {
  border: 1px solid var(--rule-2); border-radius: var(--r-lg);
  background: var(--panel); padding: 18px;
}
.panel h3 { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 13px; }
.kvlist { display: grid; gap: 0; }
.kvlist .kv { display: flex; align-items: baseline; gap: 13px; padding: 8px 0; border-bottom: 1px solid var(--rule-2); }
.kvlist .kv:last-child { border-bottom: 0; }
.kvlist .kv span { flex: 0 0 118px; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.kvlist .kv b { font-family: var(--mono); font-size: 11.5px; font-weight: 500; word-break: break-word; }
.hist { display: grid; gap: 7px; }
.hist .row { display: grid; grid-template-columns: 66px 1fr 34px; align-items: center; gap: 9px; font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); }
.hist .track { height: 6px; border-radius: 99px; background: var(--rule-2); overflow: hidden; }
.hist .track i { display: block; height: 100%; background: var(--cyan); }
.hist .row.cull .track i { background: var(--reject); }
.hist .row.keep .track i { background: var(--keep); }
.danger { border-color: color-mix(in srgb, var(--reject) 32%, transparent); }
.danger h3 { color: var(--reject); }

/* ----------------------------------------------------------------- profile */
.style-card { border-color: color-mix(in srgb, var(--cyan) 38%, transparent); background: color-mix(in srgb, var(--cyan) 8%, var(--panel)); }
.style-card h3 { color: var(--cyan-soft); }
.style-copy { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.style-options { display: grid; gap: 8px; }
.style-option {
  display: flex; align-items: flex-start; gap: 10px; text-align: left;
  padding: 11px 13px; border-radius: var(--r-md); cursor: pointer;
  border: 1px solid var(--rule); background: var(--panel-2); color: var(--ink);
  font: inherit;
}
.style-option:hover { border-color: color-mix(in srgb, var(--cyan) 45%, transparent); }
.style-option.is-selected { border-color: var(--cyan); background: color-mix(in srgb, var(--cyan) 12%, transparent); }
.style-option .pick { flex: none; width: 18px; height: 18px; margin-top: 1px; display: grid; place-items: center; color: var(--cyan-soft); }
.style-option .pick .ic { width: 15px; height: 15px; }
.style-option .txt { display: grid; gap: 3px; }
.style-option .txt b { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan-soft); font-weight: 600; }
.style-option .txt span { font-size: 13px; color: var(--ink-2); }
.pcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--f2); }
.profile-head { display: flex; align-items: center; gap: var(--f3); margin-bottom: var(--f4); }
.profile-head .av {
  width: 76px; height: 76px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--rule); background: var(--panel-2);
  display: grid; place-items: center; color: var(--cyan-soft);
}
button.av--editable { padding: 0; cursor: pointer; overflow: hidden;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease); }
button.av--editable:hover { border-color: var(--cyan); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cyan) 14%, transparent); }
button.av--editable:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.profile-head .av .ic { width: 30px; height: 30px; }
.profile-head h1 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 34px; }
.profile-head p { margin: 3px 0 0; color: var(--ink-2); font-size: 13px; }
.money { font-family: var(--mono); font-size: 34px; letter-spacing: -.02em; }
.money small { font-size: 13px; color: var(--ink-3); letter-spacing: .06em; }

/* ---------------------------------------------------------------- settings */
.settings { display: grid; gap: var(--f2); max-width: 880px; }
.set-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 13px;
  padding: 15px 18px; border: 1px solid var(--rule-2); border-radius: var(--r-lg);
  background: var(--panel);
}
.set-row .txt { flex: 1 1 300px; min-width: 0; }
.set-row .txt b { display: block; font-size: 14px; font-weight: 560; }
.set-row .txt span { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.set-row select, .set-row input[type="number"] { min-width: 120px; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i {
  position: absolute; inset: 0; border-radius: 99px; background: var(--panel-3);
  border: 1px solid var(--rule); transition: background .2s var(--ease);
}
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--ink-3); transition: transform .2s var(--ease), background .2s var(--ease);
}
.switch input:checked + i { background: var(--cyan-deep); border-color: var(--cyan); }
.switch input:checked + i::after { transform: translateX(20px); background: var(--cyan-soft); }
.switch input:disabled + i { opacity: .45; }
.switch input:disabled { cursor: not-allowed; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 9px; }
.feature {
  display: flex; align-items: center; justify-content: space-between; gap: 9px;
  padding: 11px 13px; border: 1px solid var(--rule-2); border-radius: var(--r-md);
  background: var(--panel-2); font-size: 12.5px;
}
.feature .on { color: var(--keep); font-family: var(--mono); font-size: 10px; letter-spacing: .1em; }
.feature .off { color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: .1em; }

/* ------------------------------------------------------------------ login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 34px 18px; }
.login-card {
  width: min(430px, 100%); padding: clamp(21px, 4vw, 34px);
  border: 1px solid var(--rule-2); border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
}
.login-card .logo { width: 96px; height: auto; color: var(--ink); }
.login-card h1 { margin: 18px 0 4px; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 31px; }
.login-card .lede { margin: 0 0 21px; }
.login-form { display: grid; gap: var(--f2); }
.field { display: grid; gap: 6px; }
.field label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.login-form .btn { width: 100%; min-height: 44px; }
.login-note { margin: 0; color: var(--ink-3); font-size: 11.5px; line-height: 1.55; }
.login-error { margin: 0; padding: 9px 11px; border-radius: var(--r-md); color: var(--reject); background: color-mix(in srgb, var(--reject) 11%, transparent); font-size: 12.5px; }
.login-alt { background: none; border: 0; color: var(--cyan-soft); cursor: pointer; font-size: 12.5px; padding: 2px; }
.login-alt:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ modal */
.modal-back {
  position: fixed; inset: 0; z-index: 120; display: grid; place-items: center;
  padding: 21px; background: rgba(3, 6, 9, .72); backdrop-filter: blur(6px);
}
.modal {
  width: min(560px, 100%); max-height: 90vh; display: flex; flex-direction: column;
  border: 1px solid var(--rule); border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow); overflow: hidden;
}
.modal--wide { width: min(860px, 100%); }
.modal--red { border-color: color-mix(in srgb, var(--reject) 42%, transparent); }
.mhead { display: flex; align-items: center; gap: 9px; padding: 15px 18px; border-bottom: 1px solid var(--rule-2); }
.mhead h3 { font-size: 15px; font-weight: 560; }
.mhead .x { margin-left: auto; width: 30px; height: 30px; border: 0; border-radius: var(--r-xs); background: transparent; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.mhead .x:hover { background: var(--panel-3); color: var(--ink); }
.mhead .x .ic { width: 15px; height: 15px; }
.mbody { padding: 18px; overflow: auto; }
.mfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 13px 18px; border-top: 1px solid var(--rule-2); }
.mfoot .spacer { flex: 1; }
.type-label label { color: var(--reject) !important; }
.stack { display: grid; gap: 13px; }

/* ------------------------------------------------------------------ toasts */
.toasts {
  position: fixed; z-index: 200; right: 16px; bottom: 16px;
  display: flex; flex-direction: column; gap: 7px; width: min(370px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 9px; pointer-events: auto;
  padding: 11px 13px; border-radius: var(--r-md);
  border: 1px solid var(--rule); background: var(--panel-3); color: var(--ink);
  box-shadow: var(--shadow); font-size: 12.5px; animation: toastin .22s var(--ease);
}
.toast .ic { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--cyan-soft); }
.toast--ok { border-color: color-mix(in srgb, var(--keep) 45%, transparent); }
.toast--ok .ic { color: var(--keep); }
.toast--err { border-color: color-mix(in srgb, var(--reject) 48%, transparent); }
.toast--err .ic { color: var(--reject); }
.toast--warn { border-color: color-mix(in srgb, var(--amber) 48%, transparent); }
.toast--warn .ic { color: var(--amber); }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------------ misc */
.mono { font-family: var(--mono); }
.muted { color: var(--ink-3); }
.divider { height: 1px; background: var(--rule-2); margin: var(--f2) 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.progress-note { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; color: var(--ink-3); }
.pill-note {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 9px;
  border-radius: 999px; border: 1px dashed var(--rule); color: var(--ink-3);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
}

/* ------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; margin-left: 0; padding-bottom: 2px; }
  .user-chip .u { display: none; }
  .dl-row { grid-template-columns: 30px 42px minmax(0, 1fr) 96px 74px 84px; }
  .dl-row .dl-col-state { display: none; }
  .page { padding-bottom: 55px; }
}
@media (max-width: 620px) {
  .page-head { align-items: flex-start; }
  .page-actions { width: 100%; }
  .files-grid { grid-template-columns: repeat(auto-fill, minmax(min(150px, 45vw), 1fr)); gap: 9px; }
  .tile .bar { grid-template-columns: 1fr; }
  .tile .stars { justify-content: flex-start; }
  .dl-row { grid-template-columns: 28px 40px minmax(0, 1fr) 76px; }
  .dl-row .dl-col-rating, .dl-row .dl-col-size, .dl-row .dl-col-state { display: none; }
  .vtop .fname { max-width: 100%; order: 5; flex-basis: 100%; }
  .vnav { width: 38px; height: 38px; }
  .vnav--prev { left: 6px; }
  .vnav--next { right: 6px; }
  .statrow { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
/* Explicit user preference from Settings (a superset of the OS setting). */
html.reduced-motion *, html.reduced-motion *::before, html.reduced-motion *::after {
  animation-duration: .001ms !important; transition-duration: .001ms !important;
}

