/* VidRender component system — premium pass. Tokens live in theme.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14.5px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}
/* aurora depth — two soft brand glows + grain */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 520px at 8% -6%, var(--aurora-a), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, var(--aurora-b), transparent 55%),
    radial-gradient(700px 700px at 50% 120%, var(--aurora-c), transparent 60%);
}
body::after {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: calc(var(--grain-opacity) * .045);
  background-image: repeating-conic-gradient(rgba(128,128,128,.6) 0% .0001%, transparent .0002% .0004%);
  background-size: 4px 4px;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img, video { max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
::selection { background: rgba(63, 184, 156, .25); }

/* slim scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: .93em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.page-title.lg { font-size: 26px; }

/* ── layout ── */
.shell { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 22px 90px; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1400px; margin: 0 auto; padding: 13px 22px;
  display: flex; align-items: center; gap: 12px;
}
.wordmark {
  font-family: var(--font-display); font-weight: 700; font-size: 18.5px; letter-spacing: -0.03em;
  text-decoration: none; display: flex; align-items: center; gap: 10px;
}
.wordmark .dot {
  width: 26px; height: 26px; border-radius: 8px; display: block;
  box-shadow: 0 3px 10px -3px rgba(20,19,14,.5);
}
.wordmark .sub {
  font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: .14em;
  text-transform: uppercase; margin-left: 2px; padding-top: 3px;
}
.topbar .spacer { flex: 1; }
.userchip { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.avatar {
  width: 30px; height: 30px; border-radius: var(--r-pill); display: grid; place-items: center;
  background: var(--grad-soft); border: 1px solid var(--line); font-weight: 700; font-size: 11px;
  font-family: var(--font-display); color: var(--ink); letter-spacing: 0;
  box-shadow: var(--shadow-xs);
}

/* ── icons ── */
.lucide { width: 17px; height: 17px; stroke-width: 2; vertical-align: -3.5px; flex: none; }
.btn .lucide { width: 15px; height: 15px; }
.ico-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 10px; border: none; background: transparent; color: var(--muted);
  cursor: pointer; transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
  position: relative;
}
.ico-btn:hover { background: var(--bg-sunken); color: var(--ink); }
.ico-btn:active { transform: scale(.94); }
.ico-btn .badge { position: absolute; top: 0; right: 0; }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: var(--r-pill); border: 1px solid var(--line-strong);
  background: var(--bg-raised); color: var(--ink);
  padding: 8px 17px; font-weight: 550; font-size: 13.5px; cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease),
    background var(--t-fast), border-color var(--t-fast), opacity var(--t-fast);
  text-decoration: none; white-space: nowrap; letter-spacing: -0.006em;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); border-color: var(--faint); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }

/* primary = ink (premium restraint; gradient stays for signature CTAs) */
.btn-primary {
  border-color: transparent; color: var(--btn-ink-fg); background: var(--btn-ink-bg);
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255,255,255,.12);
}
.btn-primary:hover { background: var(--btn-ink-bg-hover); border-color: transparent; box-shadow: var(--shadow-hover); }

/* signature gradient CTA — one per view, per the brand rule */
.btn-grad, .auth-card .btn-primary {
  border: none; color: #fff; background: var(--grad); background-size: 150% 100%;
  box-shadow: 0 2px 6px -1px rgba(63,184,156,.4), 0 8px 22px -6px rgba(63,184,156,.5),
    inset 0 1px 0 rgba(255,255,255,.3);
  text-shadow: 0 1px 2px rgba(0,0,0,.12);
}
.btn-grad:hover, .auth-card .btn-primary:hover {
  background-position: 85% 0; border: none;
  box-shadow: 0 3px 8px -1px rgba(63,184,156,.45), 0 12px 30px -6px rgba(63,184,156,.6),
    inset 0 1px 0 rgba(255,255,255,.3);
}
.btn-danger { border-color: transparent; background: var(--danger); color: #fff; }
.btn-danger:hover { border-color: transparent; filter: brightness(1.06); }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--bg-sunken); box-shadow: none; border-color: transparent; }
.btn-sm { padding: 6px 13px; font-size: 12.5px; }
.btn-block { width: 100%; }
.backlink {
  background: none; border: none; color: var(--muted); cursor: pointer; font: inherit;
  font-size: 13px; font-weight: 500; padding: 4px 8px; margin-left: -8px; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 5px;
  transition: color var(--t-fast), background var(--t-fast);
}
.backlink:hover { color: var(--ink); background: var(--bg-sunken); }

/* ── forms ── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 11px;
  background: var(--bg-raised); color: var(--ink);
  padding: 9px 13px; font: inherit; font-size: 14px;
  box-shadow: inset 0 1px 2px var(--ring);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3.5px rgba(63,184,156,.16); }
textarea.input { resize: vertical; min-height: 64px; line-height: 1.55; }

/* ── cards ── */
.card {
  position: relative;
  background: var(--bg-raised);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card), var(--card-highlight);
  padding: 22px;
}
.card-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 9px; margin-bottom: 4px; letter-spacing: -0.01em; }
.card-title .lucide { color: var(--muted); }
.card-sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; line-height: 1.55; }

/* ── chips & badges ── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--r-pill); padding: 4.5px 11px;
  font-size: 12px; font-weight: 600; letter-spacing: 0;
  border: 1px solid var(--line); background: var(--bg-raised); color: var(--ink-2);
  box-shadow: var(--shadow-xs);
}
.chip .lucide { width: 13px; height: 13px; color: var(--muted); }
.chip-eta { background: var(--info-bg); border-color: transparent; color: var(--ink); }
.chip-eta.overdue { background: var(--danger-bg); color: var(--danger); }
.chip-eta.overdue .lucide { color: var(--danger); }
.chip-tier { background: var(--grad-soft); border-color: transparent; }
.chip-note { background: var(--warn-bg); border-color: transparent; color: var(--ink); font-weight: 500; }
.badge {
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: var(--r-pill);
  display: inline-grid; place-items: center;
  background: var(--brand-1); color: #fff; font-size: 10.5px; font-weight: 700;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 4px rgba(255,154,46,.4);
}
/* stage pill: quiet neutral pill with a gradient tick — not a rainbow slab */
.stage-pill {
  border: 1px solid var(--line); color: var(--ink-2); background: var(--bg-raised);
  font-weight: 600; padding-left: 9px;
}
.stage-pill::before {
  content: ''; width: 8px; height: 8px; border-radius: 3px; background: var(--grad); flex: none;
  box-shadow: 0 1px 3px rgba(63,184,156,.4);
}
.version-tag {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 11px; font-weight: 700; padding: 2.5px 9px; border-radius: var(--r-pill);
  background: var(--btn-ink-bg); color: var(--btn-ink-fg); letter-spacing: .02em;
}

/* ── key/value rows, threads, bars ── */
.kv {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-size: 13px; padding: 7px 0; border-bottom: 1px solid var(--line);
}
.kv:last-child { border-bottom: none; }
.thread { border-radius: var(--r-sm); transition: background var(--t-fast); }
.thread:hover { background: var(--bg-sunken); }
.bar { height: 7px; border-radius: 4px; background: var(--bg-sunken); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--grad); border-radius: 4px; }

/* ── app nav ── */
.appnav {
  display: flex; gap: 3px; padding: 4px; background: var(--bg-sunken);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  width: fit-content; max-width: 100%; overflow-x: auto;
  box-shadow: inset 0 1px 3px var(--ring);
}
.appnav::-webkit-scrollbar { display: none; }
.tabs { display: flex; gap: 3px; padding: 4px; background: var(--bg-sunken); border-radius: var(--r-pill); border: 1px solid var(--line); width: fit-content; max-width: 100%; overflow-x: auto; }
.tab {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  padding: 7px 15px; border-radius: var(--r-pill); font-weight: 600; font-size: 13px;
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
  transition: all var(--t-fast) var(--ease); letter-spacing: -0.006em;
}
.tab .lucide { width: 15px; height: 15px; }
.tab:hover { color: var(--ink); }
.tab.active { background: var(--bg-raised); color: var(--ink); box-shadow: var(--shadow-card); }

/* ── stepper ── */
.stepper { display: grid; gap: 0; margin: 10px 0 4px; }
.stepper .track { position: relative; height: 3px; border-radius: 3px; background: var(--line); }
.stepper .track .fill {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 3px;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(63,184,156,.35);
  transition: width var(--t-slow) var(--ease);
}
.stepper .stops { display: grid; transform: translateY(-11px); }
.stepper .stop { display: flex; flex-direction: column; align-items: center; gap: 9px; text-align: center; }
.stepper .stop .knot {
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--bg-raised); border: 2px solid var(--line-strong);
  display: grid; place-items: center; font-size: 9.5px; color: transparent;
  transition: all var(--t-med) var(--ease);
  box-shadow: var(--shadow-xs);
}
.stepper .stop.done .knot { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.stepper .stop.current .knot {
  background: var(--bg-raised); border-color: var(--brand-3);
  box-shadow: 0 0 0 5px rgba(21,194,212,.14), 0 2px 8px rgba(21,194,212,.25);
}
.stepper .stop.current .knot::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--grad); }
.stepper .stop .lbl { font-size: 11px; font-weight: 600; color: var(--faint); max-width: 88px; line-height: 1.3; letter-spacing: -0.005em; }
.stepper .stop.current .lbl { color: var(--ink); }
.stepper .stop.done .lbl { color: var(--muted); }

/* ── uppy theme bridge ── */
/* containment: the dashboard has an intrinsic min-width; without this it
   overflows modals and cards horizontally. Force it to fit its parent. */
.uppy-Root, .uppy-Dashboard, .uppy-Dashboard-inner, .uppy-Dashboard-innerWrap { max-width: 100% !important; }
.uppy-Dashboard-inner {
  width: 100% !important; min-width: 0 !important; min-height: 0 !important;
  border-radius: var(--r-lg) !important;
  border: 1.5px dashed var(--line-strong) !important;
  background: var(--bg-sunken) !important;
  transition: border-color var(--t-fast);
}
.uppy-Dashboard-files, .uppy-Dashboard-AddFiles { min-width: 0 !important; }
.uppy-Dashboard-Item-name { word-break: break-all !important; }
.uppy-Dashboard-inner:hover { border-color: var(--brand-2) !important; }
.uppy-Dashboard-AddFiles { border: none !important; }
.uppy-Dashboard-AddFiles-title { font-family: var(--font-display) !important; color: var(--ink) !important; font-size: 16px !important; }
.uppy-StatusBar-progress { background: var(--grad) !important; }
.uppy-c-btn-primary { background: var(--btn-ink-bg) !important; color: var(--btn-ink-fg) !important; border-radius: var(--r-pill) !important; }
.uppy-Dashboard-browse { color: var(--brand-2) !important; }
[data-theme="dark"] .uppy-Dashboard-inner, [data-theme="dark"] .uppy-Dashboard-AddFiles { background: var(--bg-sunken) !important; }
/* any uploader mount point stays inside its column */
[id$="uploader"], [id$="-up"], #wz-uploader, #au-up { max-width: 100%; overflow: hidden; }

/* ── media ── */
.media-frame {
  position: relative; border-radius: var(--r-md); overflow: hidden;
  background: #000; aspect-ratio: 16 / 9;
  box-shadow: var(--shadow-card), 0 0 0 1px var(--ring);
}
.media-frame video, .media-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.ratio-916 { aspect-ratio: 9/16; max-width: 235px; }

/* ── file rows ── */
.file-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 6px;
  border-bottom: 1px solid var(--line); font-size: 13.5px;
  border-radius: var(--r-sm);
  transition: background var(--t-fast);
}
.file-row:hover { background: var(--bg-sunken); }
.file-row:last-child { border-bottom: none; }
.file-row.selected { background: var(--grad-soft); }
.file-row .sel { accent-color: var(--brand-2); width: 15px; height: 15px; }
.file-ico {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; background: var(--bg-sunken);
  border: 1px solid var(--line); color: var(--muted);
}
.file-ico .lucide { width: 16px; height: 16px; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

/* ── chat ── */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 320px; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 4px 2px 12px; display: flex; flex-direction: column; gap: 10px; }
.day-divider { text-align: center; font-size: 11px; font-weight: 500; color: var(--faint); margin: 10px 0 2px; display: flex; align-items: center; gap: 12px; }
.day-divider::before, .day-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.msg { max-width: 84%; display: flex; flex-direction: column; gap: 3px; animation: msg-in var(--t-med) var(--ease); }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg .bubble {
  padding: 9px 14px; border-radius: 16px; font-size: 13.5px; line-height: 1.5;
  background: var(--bg-sunken); border: 1px solid var(--line);
  overflow-wrap: break-word; box-shadow: var(--shadow-xs);
}
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.me .bubble { background: var(--grad-soft); border-color: transparent; border-bottom-right-radius: 5px; }
.msg:not(.me) .bubble { border-bottom-left-radius: 5px; }
.msg .meta { font-size: 11px; color: var(--faint); padding: 0 4px; }
.chat-compose { display: flex; gap: 9px; padding-top: 12px; border-top: 1px solid var(--line); }
.chat-compose textarea { flex: 1; min-height: 42px; max-height: 130px; }
.chat-compose .btn { align-self: flex-end; height: 42px; width: 46px; padding: 0; }

/* ── skeleton shimmer ── */
.skel {
  position: relative; overflow: hidden; background: var(--bg-sunken);
  border-radius: var(--r-sm); color: transparent !important; min-height: 14px;
}
.skel::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  transform: translateX(-100%); animation: shimmer 1.4s infinite;
}
[data-theme="dark"] .skel::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.05), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ── empty states ── */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .glyph {
  width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 17px;
  display: grid; place-items: center;
  background: var(--grad-soft); border: 1px solid var(--line);
  box-shadow: var(--shadow-xs), var(--card-highlight);
  color: var(--ink-2);
}
.empty .glyph .lucide { width: 22px; height: 22px; }
.empty h4 { color: var(--ink); margin-bottom: 4px; font-size: 15px; }

/* ── toasts ── */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(430px, calc(100vw - 32px)); align-items: center; }
.toast {
  padding: 11px 20px; border-radius: var(--r-pill); font-size: 13px; font-weight: 550;
  background: var(--btn-ink-bg); color: var(--btn-ink-fg); box-shadow: var(--shadow-pop);
  animation: toast-in var(--t-med) var(--ease); max-width: 100%;
}
.toast.err { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }

/* ── modal ── */
.modal-veil {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px;
  background: rgba(12, 10, 5, .48); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: veil-in var(--t-fast) ease-out;
}
@keyframes veil-in { from { opacity: 0; } }
.modal {
  width: min(540px, 100%); max-height: 88dvh; overflow-y: auto;
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: var(--shadow-pop), var(--card-highlight); padding: 26px;
  animation: modal-in var(--t-med) var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal h3 { margin-bottom: 16px; font-size: 17px; letter-spacing: -0.015em; }
.modal .modal-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px;
  position: sticky; bottom: -26px; background: var(--bg-raised);
  padding: 14px 0 2px; margin-bottom: -8px;
}
.modal .modal-actions::before {
  content: ''; position: absolute; left: -26px; right: -26px; top: 0; height: 1px; background: var(--line);
}
body.modal-open { overflow: hidden; }

/* ── grids & stats ── */
.grid { display: grid; gap: 16px; }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.two-col { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .two-col { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); align-items: start; } }
.stat { padding: 16px 18px; }
.stat .k { font-size: 11px; font-weight: 650; color: var(--muted); letter-spacing: .07em; text-transform: uppercase; }
.stat .v { font-family: var(--font-display); font-size: 25px; font-weight: 700; margin-top: 3px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .v .unit { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; }

/* ── reveals ── */
.reveal { opacity: 0; transform: translateY(12px); animation: reveal var(--t-slow) var(--ease) forwards; }
.reveal.d1 { animation-delay: 60ms; } .reveal.d2 { animation-delay: 140ms; } .reveal.d3 { animation-delay: 220ms; }
@keyframes reveal { to { opacity: 1; transform: none; } }

/* ── auth ── */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.auth-card { width: min(400px, 100%); padding: 38px 32px; border-radius: 24px; }
.auth-hero { text-align: center; margin-bottom: 28px; }
.auth-hero .dot {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 16px; display: block;
  box-shadow: 0 12px 32px -10px rgba(20,19,14,.5);
}
.auth-hero h1 { font-size: 24px; letter-spacing: -0.025em; font-weight: 700; }
.auth-hero p { color: var(--muted); font-size: 13.5px; margin-top: 6px; }

/* ── kanban ── */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 16px; align-items: flex-start; }
.kanban-col {
  min-width: 266px; width: 266px; flex: none;
  background: var(--bg-sunken); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 10px;
}
.kanban-col h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-family: var(--font-body); font-weight: 700;
}
.kanban-col h4 .badge { background: var(--bg-raised); color: var(--muted); box-shadow: var(--shadow-xs); border: 1px solid var(--line); }
.kanban-col .col-body { display: flex; flex-direction: column; gap: 9px; min-height: 40px; }
.video-card { padding: 14px; cursor: pointer; transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), border-color var(--t-fast); }
.video-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--line-strong); }

/* deliverable mini-chips */
.dcheck { display: flex; gap: 5px; flex-wrap: wrap; }
.dchip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--bg-raised); color: var(--muted);
}
.dchip .lucide { width: 11px; height: 11px; }
.dchip.s-approved { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.dchip.s-draft_ready { background: var(--info-bg); color: var(--ink); border-color: transparent; }
.dchip.s-changes_requested { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.dchip.s-in_progress { border-style: dashed; color: var(--ink-2); }

/* ── deliverable panels ── */
.deliv-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 6px;
  border-bottom: 1px solid var(--line); cursor: pointer; border-radius: var(--r-sm);
}
.deliv-row:hover { background: var(--bg-sunken); }
.status-pill {
  font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: var(--r-pill);
  white-space: nowrap; letter-spacing: .01em;
}
.status-pill.s-waiting { background: var(--bg-sunken); color: var(--faint); border: 1px solid var(--line); }
.status-pill.s-in_progress { background: var(--info-bg); color: var(--ink); }
.status-pill.s-draft_ready { background: var(--btn-ink-bg); color: var(--btn-ink-fg); box-shadow: var(--shadow-xs); }
.status-pill.s-changes_requested { background: var(--warn-bg); color: var(--warn); }
.status-pill.s-approved { background: var(--ok-bg); color: var(--ok); }

/* timestamped comments */
.tc-comment { display: flex; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 13px; align-items: baseline; }
.tc-comment:last-child { border-bottom: none; }
.tc-time {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 11.5px; font-weight: 700;
  color: var(--brand-3); cursor: pointer; background: var(--info-bg); padding: 2px 8px; border-radius: var(--r-pill); flex: none;
  transition: transform var(--t-fast);
}
.tc-time:hover { transform: scale(1.06); }
.tc-comment.resolved { opacity: .45; }

/* thumbnails & feed mock */
.variant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.variant {
  position: relative; border-radius: var(--r-md); overflow: hidden; border: 2px solid var(--line);
  cursor: pointer; transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  background: var(--bg-sunken);
}
.variant:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.variant img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.variant.picked { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(63,184,156,.22); }
.variant .pick-badge { position: absolute; top: 8px; right: 8px; background: var(--brand-2); color: #fff; border-radius: var(--r-pill); padding: 3px 10px; font-size: 10.5px; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.variant .anno-dot {
  position: absolute; width: 21px; height: 21px; border-radius: 50%; background: var(--brand-1);
  color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
  transform: translate(-50%, -50%); border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); cursor: pointer;
}
.feedmock { border-radius: var(--r-md); padding: 16px; box-shadow: var(--shadow-card); }
.feedmock.light { background: #ffffff; border: 1px solid #e5e5e5; }
.feedmock.dark { background: #0f0f0f; border: 1px solid #272727; }
.feedmock .fm-thumb { width: 100%; aspect-ratio: 16/9; border-radius: 12px; object-fit: cover; display: block; background: #222; }
.feedmock .fm-row { display: flex; gap: 12px; margin-top: 12px; }
.feedmock .fm-avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.feedmock .fm-title { font-family: Roboto, Arial, sans-serif; font-size: 15px; font-weight: 500; line-height: 1.35; margin: 0 0 4px; }
.feedmock.light .fm-title { color: #0f0f0f; }
.feedmock.dark .fm-title { color: #f1f1f1; }
.feedmock .fm-meta { font-family: Roboto, Arial, sans-serif; font-size: 12.5px; color: #606060; }
.feedmock.dark .fm-meta { color: #aaaaaa; }

/* SEO pack */
.seo-title-opt {
  display: flex; align-items: center; gap: 10px; padding: 10px 13px; border: 1px solid var(--line);
  border-radius: var(--r-md); cursor: pointer; margin-bottom: 8px;
  transition: border-color var(--t-fast), background var(--t-fast); font-size: 13.5px;
}
.seo-title-opt:hover { border-color: var(--line-strong); background: var(--bg-sunken); }
.seo-title-opt.picked { border-color: var(--brand-2); background: var(--ok-bg); }
.copy-block {
  position: relative; background: var(--bg-sunken); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px 14px; font-size: 13px; white-space: pre-wrap;
  word-break: break-word; line-height: 1.6;
}
.copy-block .copy-btn { position: absolute; top: 8px; right: 8px; }

/* ── file manager ── */
.fm-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.crumbs { display: flex; align-items: center; gap: 3px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.crumbs a { cursor: pointer; text-decoration: none; padding: 4px 8px; border-radius: 8px; font-weight: 500; transition: background var(--t-fast), color var(--t-fast); }
.crumbs a:hover { background: var(--bg-sunken); color: var(--ink); }
.crumbs .lucide { width: 13px; height: 13px; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
.folder-tile {
  display: flex; align-items: center; gap: 10px; padding: 13px; border: 1px solid var(--line);
  border-radius: var(--r-md); cursor: pointer; background: var(--bg-raised);
  box-shadow: var(--shadow-xs);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), border-color var(--t-fast);
}
.folder-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--line-strong); }
.folder-tile > .lucide { color: var(--brand-1); width: 20px; height: 20px; }
.folder-tile .meta { min-width: 0; }
.folder-tile .nm { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── wizard ── */
.wiz-steps { display: flex; gap: 6px; margin-bottom: 20px; }
.wiz-steps i { height: 3.5px; flex: 1; border-radius: 4px; background: var(--line); transition: background var(--t-med); }
.wiz-steps i.on { background: var(--grad); }
.toggle-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px;
  border: 1.5px solid var(--line); border-radius: var(--r-md); cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
  font-size: 13.5px;
}
.toggle-card:hover { border-color: var(--line-strong); }
.toggle-card.on { border-color: var(--brand-2); background: var(--ok-bg); }
.toggle-card input { accent-color: var(--brand-2); width: 15px; height: 15px; }
.pill-select { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-select .p {
  padding: 6px 14px; border-radius: var(--r-pill); border: 1.5px solid var(--line);
  cursor: pointer; font-size: 12.5px; font-weight: 600; background: var(--bg-raised);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.pill-select .p:hover { border-color: var(--line-strong); }
.pill-select .p.on { border-color: var(--brand-2); background: var(--ok-bg); }

/* ── publish kit ── */
.kit-row { display: flex; gap: 13px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.kit-row:last-of-type { border-bottom: none; }
.kit-ico {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad-soft); border: 1px solid var(--line); flex: none; color: var(--ink-2);
  box-shadow: var(--shadow-xs);
}

/* ── welcome ── */
.welcome-hero {
  background:
    radial-gradient(600px 300px at 0% 0%, rgba(255,154,46,.10), transparent 60%),
    radial-gradient(600px 300px at 100% 100%, rgba(21,194,212,.10), transparent 60%),
    var(--bg-raised);
  border: 1px solid var(--line);
}
.starter { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; align-items: flex-start; }
.starter .step { display: flex; gap: 10px; align-items: center; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.starter .step:hover { color: var(--ink); background: var(--bg-sunken); }
.starter .step .lucide { color: var(--faint); }
.starter .n {
  width: 22px; height: 22px; border-radius: 50%; background: var(--grad); color: #fff;
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center; flex: none;
  box-shadow: 0 2px 6px rgba(63,184,156,.35);
}

/* ── calendar ── */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { font-size: 10.5px; font-weight: 700; color: var(--faint); text-align: center; text-transform: uppercase; letter-spacing: .06em; padding: 4px 0; }
.cal .day { min-height: 78px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 7px; font-size: 11.5px; background: var(--bg-raised); }
.cal .day.other { opacity: 0; pointer-events: none; }
.cal .day.today { border-color: var(--brand-3); box-shadow: 0 0 0 2.5px rgba(21,194,212,.14); }
.cal .day .dnum { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }
.cal .ev { display: block; margin-top: 3px; padding: 2.5px 7px; border-radius: 6px; font-weight: 600; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; transition: transform var(--t-fast); }
.cal .ev:hover { transform: translateX(2px); }
.cal .ev.eta { background: var(--info-bg); }
.cal .ev.pub { background: var(--btn-ink-bg); color: var(--btn-ink-fg); }
.cal .ev.overdue { background: var(--danger-bg); color: var(--danger); }

/* ── cmd-k ── */
.cmdk { width: min(580px, 92vw); padding: 0; overflow: hidden; }
.cmdk input { border: none; border-bottom: 1px solid var(--line); border-radius: 0; padding: 17px 20px; font-size: 15px; background: transparent; box-shadow: none; }
.cmdk input:focus { box-shadow: none; border-color: var(--line); }
.cmdk .res { max-height: 50vh; overflow-y: auto; padding: 7px; }
.cmdk .hit { display: flex; align-items: center; gap: 12px; padding: 10px 13px; border-radius: 10px; cursor: pointer; font-size: 13.5px; }
.cmdk .hit .lucide { color: var(--muted); }
.cmdk .hit.active, .cmdk .hit:hover { background: var(--bg-sunken); }
.cmdk .hit .sub { color: var(--faint); font-size: 12px; }

/* ── notifications ── */
.notif-pop {
  position: absolute; right: 0; top: 46px; width: min(370px, 90vw); max-height: 60vh; overflow-y: auto;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop); z-index: 120; padding: 8px;
  animation: modal-in var(--t-fast) var(--ease);
}
.notif-item { display: flex; gap: 10px; padding: 11px 13px; border-radius: 11px; font-size: 13px; cursor: pointer; transition: background var(--t-fast); }
.notif-item:hover { background: var(--bg-sunken); }
.notif-item.unread { background: var(--grad-soft); }

/* ── invoices ── */
.inv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.inv-table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--faint); font-weight: 700; padding: 9px 10px; border-bottom: 1px solid var(--line-strong);
}
.inv-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.inv-table tr:last-child td { border-bottom: none; }
.inv-table tr:hover td { background: var(--bg-sunken); }
.inv-status { font-size: 10.5px; font-weight: 700; padding: 3.5px 10px; border-radius: var(--r-pill); white-space: nowrap; letter-spacing: .02em; text-transform: uppercase; }
.inv-status.paid { background: var(--ok-bg); color: var(--ok); }
.inv-status.overdue, .inv-status.unpaid { background: var(--danger-bg); color: var(--danger); }
.inv-status.partially_paid, .inv-status.advance_received { background: var(--warn-bg); color: var(--warn); }
.inv-status.sent, .inv-status.draft { background: var(--bg-sunken); color: var(--muted); border: 1px solid var(--line); }
.inv-status.cancelled, .inv-status.refunded { background: var(--bg-sunken); color: var(--faint); text-decoration: line-through; }
.line-editor { display: grid; grid-template-columns: 1fr 64px 100px 32px; gap: 8px; margin-bottom: 8px; align-items: center; }

/* ── drag-to-upload highlight ── */
.drop-hot { outline: 2px dashed var(--brand-2); outline-offset: 3px; border-radius: var(--r-lg); background: var(--grad-soft); transition: background var(--t-fast); }
#assets-card.drop-hot::after {
  content: 'Drop to upload'; position: absolute; inset: 0; display: grid; place-items: center;
  font-weight: 700; color: var(--brand-2); background: color-mix(in srgb, var(--bg-raised) 80%, transparent);
  border-radius: var(--r-lg); pointer-events: none; z-index: 2;
}
#assets-card { position: relative; }

/* ── video asset groups ── */
.asset-group { margin-top: 12px; }
.asset-group-head {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600;
  color: var(--ink-2); margin-bottom: 7px;
}
.asset-group-head .lucide { color: var(--brand-1); }
.asset-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.asset-thumb {
  width: 112px; height: 66px; object-fit: cover; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg-sunken); cursor: zoom-in;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast);
}
.asset-thumb:hover { transform: translateY(-2px) scale(1.02); box-shadow: var(--shadow-hover); }

/* ── misc ── */
.collapse-upl summary { cursor: pointer; list-style: none; width: fit-content; }
.collapse-upl summary::-webkit-details-marker { display: none; }
.side-list { display: flex; flex-direction: column; gap: 2px; }

/* ── responsive ── */
@media (max-width: 767px) {
  .shell { padding: 0 14px 70px; }
  .card { padding: 16px; border-radius: var(--r-md); }
  .stepper .stop .lbl { display: none; }
  .stepper .stop.current .lbl { display: block; }
  .topbar-inner { padding: 11px 14px; gap: 7px; }
  .page-title { font-size: 20px; }
  .page-title.lg { font-size: 22px; }
}
@media (max-width: 480px) {
  .userchip #user-name, .wordmark .sub { display: none; }
  .btn-sm { padding: 6px 10px; }
}

/* ── uppy containment hardening ──
   While a file is uploading, Uppy renders an item card with a preview
   thumbnail. Give the dashboard its own stacking context and clip every
   wrapper so a preview can never spill out of its modal/card or paint
   over the surrounding UI. The files list keeps its own vertical scroll. */
.uppy-Dashboard, .uppy-Dashboard-inner { position: relative !important; isolation: isolate; }
.uppy-Dashboard-inner, .uppy-Dashboard-innerWrap,
.uppy-Dashboard-Item, .uppy-Dashboard-Item-preview,
.uppy-Dashboard-Item-previewInnerWrap { overflow: hidden !important; }
.uppy-Dashboard-files { overflow-x: hidden !important; }
.uppy-Dashboard-Item-previewInnerWrap img,
.uppy-Dashboard-Item-previewImg { max-width: 100% !important; max-height: 100% !important; }
/* the informer/toast bubbles Uppy pops sit inside the dashboard, not the page */
.uppy-Informer { position: absolute !important; z-index: 1 !important; }

/* ── download manager (non-blocking, minimizable corner widget) ── */
.dlm {
  position: fixed; right: 20px; bottom: 20px; z-index: 210;
  width: min(340px, calc(100vw - 32px));
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-pop);
  overflow: hidden; animation: modal-in var(--t-med) var(--ease);
}
.dlm-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 12px; cursor: pointer; user-select: none;
  border-bottom: 1px solid var(--line); background: var(--bg-sunken);
}
.dlm-mini .dlm-head { border-bottom: none; }
.dlm-title { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink); }
.dlm-title .lucide { color: var(--brand-2); }
.dlm-count { color: var(--faint); font-weight: 500; font-size: 11.5px; }
.dlm-head-actions { display: flex; gap: 2px; }
.dlm-icobtn {
  display: grid; place-items: center; width: 26px; height: 26px; padding: 0;
  border: none; background: transparent; color: var(--muted); border-radius: 7px;
  cursor: pointer; transition: background var(--t-fast), color var(--t-fast);
}
.dlm-icobtn:hover { background: var(--bg-sunken); color: var(--ink); }
.dlm-icobtn.sm { width: 22px; height: 22px; }
.dlm-mini [data-dlm-min] .lucide { transform: rotate(180deg); }
.dlm-list { max-height: 46vh; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.dlm-mini .dlm-list { display: none; }
.dlm-item { padding: 8px 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.dlm-item-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.dlm-item-top .lucide { flex: none; }
.dlm-item.ok .dlm-item-top .lucide { color: var(--brand-1); }
.dlm-item.bad .dlm-item-top .lucide { color: #d9534f; }
.dlm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 500; }
.dlm-bar { height: 6px; border-radius: 4px; background: var(--bg-sunken); overflow: hidden; }
.dlm-bar > i { display: block; height: 100%; width: 0; background: var(--grad); transition: width var(--t-fast) linear; }
.dlm-item.ok .dlm-bar > i { background: var(--brand-1); }
.dlm-item.bad .dlm-bar > i { background: #d9534f; opacity: .5; }
.dlm-item.indet .dlm-bar > i { background-image: linear-gradient(110deg, transparent 20%, var(--brand-2) 50%, transparent 80%); background-size: 200% 100%; animation: dlm-indet 1.1s linear infinite; }
@keyframes dlm-indet { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.dlm-meta { margin-top: 5px; font-size: 11px; color: var(--muted); }
.dlm-meta b { color: var(--ink); }
/* uploads shelf shares the download-manager look but docks bottom-left so the
   two corner windows never collide */
.dlm.upl { right: auto; left: 20px; }
.dlm.upl .dlm-item.ok .dlm-bar > i { background: var(--brand-2); }
.dlm-link { background: none; border: none; padding: 0; color: var(--brand-2); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
@media (max-width: 480px) {
  .dlm { right: 10px; left: 10px; bottom: 10px; width: auto; }
  .dlm.upl { left: 10px; right: 10px; bottom: calc(10px + 46vh + 12px); } /* stack above downloads if both open */
}

/* accessibility: reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
