/* TIMAN Video Factory - control panel.
   One design system for every page: spacing on a 4 px scale, one card style, one button hierarchy
   (primary = yellow, normal = outlined, link = text), status colours that always mean the same thing. */

:root {
  --bg: #f3f4f7;
  --panel: #ffffff;
  --panel-2: #f8f9fb;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-2: #d4d8df;
  --brand: #f5a800;
  --brand-2: #e29b00;
  --brand-soft: #fff5d6;
  --brand-ink: #3a2a00;
  --accent: #2158e8;
  --accent-soft: #e9f0ff;
  --ok: #157347;
  --ok-bg: #e0f4ea;
  --warn: #8a5a00;
  --warn-bg: #fff1cf;
  --bad: #b3261e;
  --bad-bg: #fde8e6;
  --info-bg: #e9f0ff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 8px rgba(16, 24, 40, .05);
  --shadow-lg: 0 8px 28px rgba(16, 24, 40, .16);
  --gap: 16px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f131a; --panel: #171c25; --panel-2: #1c222d; --ink: #eef1f6; --ink-2: #c9d0dc; --muted: #94a0b3; --line: #2a3240; --line-2: #384355;
    --brand-soft: #3a2d0c; --brand-ink: #1d1400; --accent: #78a0ff; --accent-soft: #1c2a4a;
    --ok: #62d49c; --ok-bg: #12301f; --warn: #f2c14e; --warn-bg: #3a2d10; --bad: #ff8b82; --bad-bg: #3b1b19; --info-bg: #1c2a4a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 8px 28px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
h1 { font-size: 22px; line-height: 1.25; margin: 0; letter-spacing: -.2px; }
h2 { font-size: 16px; line-height: 1.3; margin: 0; display: flex; align-items: center; gap: 10px; }
h3 { font-size: 13px; margin: 0; }
h4 { margin: 14px 0 4px; font-size: 13px; }
a { color: var(--accent); }
code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; font-size: 12.5px; }

/* ---------------------------------------------------------------- top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 24px; height: 60px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: .3px; white-space: nowrap; }
.brand::before { content: "T"; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); font-weight: 900; font-size: 18px; }
.brand span { font-weight: 500; color: var(--muted); }
.menu { display: flex; gap: 4px; padding: 4px; background: var(--bg); border-radius: 12px; }
.menu button { border: none; background: none; font-weight: 600; font-size: 14px; padding: 7px 16px; border-radius: 9px; color: var(--muted); }
.menu button:hover { color: var(--ink); background: var(--panel-2); border-color: transparent; }
.menu button.active { background: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }

/* ---------------------------------------------------------------- pages */
.page { max-width: 1520px; margin: 0 auto; padding: 24px 24px 56px; }
.page-head { margin: 0 0 18px; }
.page-head .sub { margin: 4px 0 0; color: var(--muted); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: var(--gap); align-items: start; }
.brand-layout { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: start; }
.stack > * + * { margin-top: var(--gap); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.jobs { margin-top: var(--gap); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: 13px; font-weight: 800; flex: none; }
.muted { color: var(--muted); font-weight: 400; }
.hint { color: var(--muted); margin: 6px 0; font-size: 13px; }
.error { color: var(--bad); min-height: 1.2em; margin: 8px 0 0; }
.small-text { font-size: 12px; color: var(--muted); }
.help { margin: 8px 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); padding: 0 12px; }
.help > summary { cursor: pointer; padding: 8px 0; font-weight: 600; color: var(--ink-2); }
.help[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.help > :not(summary) { font-size: 13px; color: var(--ink-2); }
.help p { margin: 0 0 8px; }
.help ul { margin: 0 0 8px; padding-left: 18px; }

/* ---------------------------------------------------------------- forms & buttons */
label { display: block; margin: 14px 0 5px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
label.check { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; font-size: 13.5px; color: var(--ink); cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand-2); width: 16px; height: 16px; margin: 0; }
input[type=search], input[type=text], input[type=number], select, textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--panel); color: var(--ink); font: inherit; transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus, button:focus-visible, .sku-card:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; line-height: 1.5; }
select { appearance: auto; }
.tools input[type=search] { width: 270px; }
button { font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); padding: 7px 14px; transition: background .12s, border-color .12s, transform .05s; }
button:hover:not(:disabled) { border-color: var(--accent); background: var(--panel-2); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { width: 100%; padding: 13px; background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 800; font-size: 15.5px; box-shadow: 0 2px 6px rgba(226, 155, 0, .35); }
button.primary:hover:not(:disabled) { background: var(--brand-2); border-color: var(--brand-2); }
button.primary:disabled { box-shadow: none; }
button.link { border: none; background: none; color: var(--accent); padding: 4px 6px; font-weight: 600; }
button.link:hover:not(:disabled) { background: var(--accent-soft); }
button.small { padding: 4px 11px; font-size: 12.5px; border-radius: 8px; }
.buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.buttons button { padding: 11px; font-weight: 700; }
.buttons button.primary { width: auto; margin-top: 0; font-size: 14.5px; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline select { flex: 1; min-width: 0; }
.inline button { flex: none; white-space: nowrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.only-shape { margin: 10px 0 0; }
.spin { display: inline-block; width: 10px; height: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; margin-right: 6px; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- status chips */
.chip { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; line-height: 1.6; }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.chip.busy { background: var(--info-bg); color: var(--accent); border-color: transparent; }
.chips .chip { padding: 3px 11px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag { font-size: 11.5px; padding: 1px 8px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }

/* ---------------------------------------------------------------- 1. product list */
.sku-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 10px; max-height: min(72vh, 820px); overflow-y: auto; padding: 2px 4px 2px 2px; margin-right: -4px; }
.sku-card { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); cursor: pointer; transition: border-color .12s, box-shadow .12s, background .12s; align-items: flex-start; }
.sku-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.sku-card.selected { border-color: var(--brand-2); background: var(--brand-soft); box-shadow: 0 0 0 2px var(--brand); }
.sku-card.idle { background: var(--panel-2); }
.sku-card .thumb { width: 62px; height: 88px; flex: none; }
.sku-main { min-width: 0; flex: 1; }
.sku-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sku { font-weight: 800; font-size: 16px; letter-spacing: .2px; white-space: nowrap; }
.sku-folders { font-size: 12px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sku-meta { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.sku-desc { margin: 5px 0 0; font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sku-card .actions { margin-top: 8px; }
.thumb { width: 44px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--line); display: block; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); grid-column: 1 / -1; }

/* ---------------------------------------------------------------- 2. create form */
.form { position: sticky; top: 76px; padding: 0; display: flex; flex-direction: column; max-height: calc(100vh - 92px); overflow: hidden; }
.form-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.form-body { padding: 4px 20px 12px; overflow-y: auto; flex: 1; }
.form-foot { padding: 12px 20px 14px; border-top: 1px solid var(--line); background: var(--panel); }
.form-foot .error { margin: 6px 0 0; min-height: 0; }
.form-foot .hint { margin: 8px 0 0; font-size: 12.5px; }
.picked { margin-top: 10px; padding: 9px 12px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); color: var(--muted); }
.picked.ok { border-style: solid; border-color: var(--brand); background: var(--brand-soft); color: var(--ink); }
.fsec { padding: 14px 0; border-bottom: 1px solid var(--line); }
.fsec:last-child { border-bottom: none; }
.fsec > h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 2px; }
.fsec > label:first-of-type { margin-top: 8px; }
details.fsec > summary { cursor: pointer; font-weight: 700; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 8px; }
details.fsec > summary::before { content: "▸"; color: var(--muted); transition: transform .12s; }
details.fsec[open] > summary::before { transform: rotate(90deg); }
details.fsec > summary::-webkit-details-marker { display: none; }
audio { width: 100%; height: 36px; display: block; margin-top: 6px; }
.variants { margin: 12px 0 0; padding: 12px 0 14px; border-bottom: 1px solid var(--line); }
.variants h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 0 0 4px; }
.variants .hint { margin: 0 0 8px; }
.variant { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 6px; cursor: pointer; background: var(--panel); transition: border-color .12s, background .12s; }
.variant:hover { border-color: var(--line-2); }
.variant.chosen { border-color: var(--brand-2); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.variant img { width: 36px; height: 50px; object-fit: cover; border-radius: 6px; background: var(--line); flex: none; }
.variant .what { font-size: 13px; line-height: 1.3; font-weight: 600; min-width: 0; }
.variant .what small { display: block; color: var(--muted); font-weight: 400; margin-top: 1px; }
.sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.size { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px 4px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 0; cursor: pointer; text-align: center; background: var(--panel); transition: border-color .12s, background .12s; }
.size:hover { border-color: var(--line-2); }
.size.chosen { border-color: var(--brand-2); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.size input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.size .shape { display: inline-block; flex: none; border: 2px solid currentColor; border-radius: 4px; opacity: .8; }
.size .what { font-size: 12.5px; line-height: 1.2; font-weight: 700; }
.size .what small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; margin-top: 2px; }
.logo-preview { display: block; max-width: 160px; max-height: 70px; margin-top: 6px; padding: 6px; border-radius: 8px; background: repeating-conic-gradient(#8884 0% 25%, transparent 0% 50%) 50% / 14px 14px; border: 1px solid var(--line); }

/* ---------------------------------------------------------------- tables (videos, voices, previews) */
.table-wrap { overflow-x: auto; max-height: 520px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.jobs .table-wrap, .voices .table-wrap { max-height: none; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 9px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel-2); z-index: 1; white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.pick { cursor: pointer; }
tbody tr.pick:hover { background: var(--panel-2); }
tbody tr.selected { background: var(--brand-soft); }
tr.detail td { background: var(--panel-2); padding: 16px 20px; border-bottom: 1px solid var(--line); }
.detail h4 { margin: 14px 0 4px; font-size: 13px; }
.detail h4:first-child { margin-top: 0; }
.detail ul, .detail ol { margin: 0; padding-left: 20px; }
.detail pre { white-space: pre-wrap; margin: 0; font: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.clip { max-width: 380px; }
.script-cell { max-width: 640px; white-space: pre-wrap; max-height: 9.5em; overflow-y: auto; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.filters button { border-radius: 999px; padding: 4px 13px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.filters button.active { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.batch-filter { margin: 0 0 10px; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--info-bg); display: flex; align-items: center; gap: 8px; }
.dimmed { opacity: .45; }
tr.bad-row td { background: var(--bad-bg); }
tr.bad-row .why { color: var(--bad); }
.preview-table td, .preview-table th { font-size: 13px; }

/* the five criteria of the quality check */
.crit { display: inline-flex; gap: 4px; margin-top: 6px; }
.crit-dot { display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; border-radius: 50%; font-size: 11px; font-weight: 700; background: var(--line); color: var(--muted); cursor: help; }
.crit-dot.ok { background: var(--ok-bg); color: var(--ok); }
.crit-dot.warn { background: var(--warn-bg); color: var(--warn); }
.crit-dot.bad { background: var(--bad-bg); color: var(--bad); }
.criteria { display: grid; gap: 12px; margin: 8px 0; }
.criterion .checks { margin: 4px 0 0; padding-left: 18px; }
.criterion .checks li { margin: 3px 0; }

/* ---------------------------------------------------------------- batch, farm, sources, brand */
#batch-table { font: 13px/1.45 ui-monospace, Consolas, monospace; white-space: pre; overflow-x: auto; }
.farm { position: sticky; top: 76px; }
.farm table { font-size: 13px; }
.farm .row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.farm .row:last-child { border-bottom: none; }
.meter { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; min-width: 60px; }
.meter > span { display: block; height: 100%; background: var(--accent); }
.meter.hot > span { background: var(--brand); }
.batch { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; background: var(--panel); }
.batch-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.progress { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; margin: 10px 0 8px; display: flex; }
.progress > span { display: block; height: 100%; }
.progress .p-ok { background: var(--ok); }
.progress .p-warn { background: var(--brand); }
.progress .p-bad { background: var(--bad); }
.progress .p-run { background: var(--accent); }
.batch .chips { justify-content: flex-start; margin: 8px 0; }
.batch-result-box { margin-top: 12px; }
.batch-result-box .table-wrap { max-height: 420px; }
#src-list .batch a { word-break: break-all; }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.brand-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--panel); }
.brand-card .thumb-box { height: 124px; border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: repeating-conic-gradient(#8884 0% 25%, transparent 0% 50%) 50% / 14px 14px; }
.brand-card .thumb-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-card .thumb-box video { max-width: 100%; max-height: 100%; background: #000; }
.brand-card .name { font-weight: 700; word-break: break-word; }
.brand-note { margin: 14px 0 0; }

/* ---------------------------------------------------------------- dialogs, banners */
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); padding: 16px; max-width: 440px; width: 92vw; box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(10, 14, 22, .6); }
.player-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
dialog video { width: 100%; max-height: 78vh; background: #000; border-radius: var(--radius-sm); }
.stale { margin: 16px auto 0; max-width: 1472px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); }
.stale code { background: rgba(0, 0, 0, .08); border: none; }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 1100px) {
  .layout, .brand-layout { grid-template-columns: 1fr; }
  .form, .farm { position: static; max-height: none; overflow: visible; }
  .form-body { overflow: visible; }
  .sku-list { max-height: 60vh; }
}
@media (max-width: 760px) {
  .top { height: auto; flex-wrap: wrap; padding: 10px 14px; gap: 8px; }
  .menu { order: 3; width: 100%; overflow-x: auto; }
  .page { padding: 16px 12px 40px; }
  .grid2, .buttons { grid-template-columns: 1fr; }
  .sizes { grid-template-columns: repeat(2, 1fr); }
  .sku-list { grid-template-columns: 1fr; }
  .tools input[type=search] { width: 100%; }
}

/* the file pickers look like the other buttons */
input[type=file] { font: inherit; font-size: 13px; color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); padding: 4px 11px; margin-right: 8px; }
input[type=file]::file-selector-button:hover { border-color: var(--accent); background: var(--panel-2); }
label.check.file { gap: 0; }

/* ---------------------------------------------------------------- the page "Đối thủ" */
.cmp-card { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); margin-bottom: 12px; overflow: hidden; }
.cmp-card.open { border-color: var(--line-2); box-shadow: var(--shadow); }
.cmp-head { display: flex; gap: 14px; padding: 12px 14px; cursor: pointer; align-items: flex-start; }
.cmp-head:hover { background: var(--panel-2); }
.cmp-main { flex: 1; min-width: 0; }
.cmp-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 560px; }
.cmp-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.cmp-progress { padding: 0 14px 10px 90px; color: var(--accent); }
.cmp-error-line { padding: 0 14px 8px 90px; margin: 0; min-height: 0; }
.steps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.step-dot { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.step-dot.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.step-dot.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.step-dot.busy { background: var(--info-bg); color: var(--accent); border-color: transparent; }
.cmp-detail { border-top: 1px solid var(--line); padding: 14px; background: var(--panel-2); }
.cmp-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.btn-link { display: inline-block; padding: 4px 11px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.btn-link:hover { border-color: var(--accent); background: var(--panel-2); }
.cmp-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.cmp-player { position: sticky; top: 76px; }
.cmp-video { width: 100%; max-height: 440px; border-radius: var(--radius-sm); background: #000; }
.cmp-tabs-box { min-width: 0; }
.cmp-hook { background: var(--brand-soft); border: 1px solid var(--brand); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 8px; }
.cmp-hook h4 { margin: 0 0 4px; }
.script-lines { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 12px; max-height: 420px; overflow-y: auto; }
.script-line, .section-row { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.script-line:last-child, .section-row:last-child { border-bottom: none; }
.sections { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 12px; }
.time-link { border: none; background: var(--info-bg); color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12px; padding: 1px 7px; border-radius: 6px; flex: none; }
.time-link:hover:not(:disabled) { background: var(--accent); color: #fff; border: none; }
.stats { width: auto; margin: 8px 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.stats td { padding: 7px 14px; }
.stat-label { color: var(--muted); font-weight: 600; white-space: nowrap; width: 1%; }
.shot-strip { display: flex; height: 34px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.shot-seg { flex: none; min-width: 6px; border: none; border-right: 2px solid var(--panel); border-radius: 0; color: #fff; font-size: 11px; font-weight: 700; padding: 0; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); overflow: hidden; }
.shot-seg:hover:not(:disabled) { filter: brightness(1.12); border-color: var(--panel); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 4px; font-size: 12px; color: var(--ink-2); }
.legend-item i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.shot-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 12px; }
.shot-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.shot-row:last-child { border-bottom: none; }
.shot-frames img { width: 56px; height: 100px; object-fit: cover; border-radius: 6px; background: var(--line); display: block; }
.shot-text { min-width: 0; flex: 1; }
.sheets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.sheets img { width: 100%; border-radius: 8px; border: 1px solid var(--line); display: block; }
#cmp-upload { margin-top: 10px; }
@media (max-width: 1100px) { .cmp-body { grid-template-columns: 1fr; } .cmp-player { position: static; } .cmp-video { max-height: 320px; } }

/* ---------------------------------------------------------------- the owner's decision on a video that needs a person */
.decide { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.decide .buttons { justify-content: flex-end; flex-wrap: wrap; }
.review-result { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); font-size: 13.5px; line-height: 1.5; }
.review-result ul { margin: 4px 0 8px; padding-left: 18px; }
.review-result .ok-line::marker { color: var(--ok); }
.review-result .no-line::marker { color: var(--bad); }
.decision-buttons { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.fix-history { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; margin: 6px 0; background: var(--panel-2); }
.fix-history pre { white-space: pre-wrap; margin: 4px 0; }

/* ---------------------------------------------------------------- the competitor's product details (parts shown, tests done) */
.demo-list { display: grid; gap: 0; }
.demo-row { padding: 9px 0; border-bottom: 1px solid var(--line); display: grid; gap: 3px; }
.demo-row:last-child { border-bottom: none; }

/* the colours that fill the most of a competitor's picture */
.palette { display: flex; gap: 6px; margin: 8px 0 4px; }
.swatch { width: 44px; height: 28px; border-radius: 6px; border: 1px solid var(--line, rgba(0,0,0,.12)); display: inline-block; }

/* ---------------------------------------------------------------- accounts of the shared server */
.login { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 16px; }
.login[hidden] { display: none; }
.login-box { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 28px 24px; }
.login-box h1 { margin: 0 0 6px; font-size: 22px; }
.login-box form { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.login-box input { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--panel-2); color: var(--ink); font-size: 15px; }
.login-box button.primary { margin-top: 8px; padding: 10px; font-size: 15px; }
body.locked { overflow: hidden; }
body:not([data-auth="1"]) .auth-only { display: none !important; }
body[data-role="member"] .admin-only { display: none !important; }
.user-chip { display: flex; align-items: center; gap: 8px; margin-left: 12px; white-space: nowrap; }
.user-chip .who { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-weight: 600; color: var(--ink); cursor: pointer; }
.meter { width: 160px; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--brand); }
.secret { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.secret input, .secret select { padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--panel-2); color: var(--ink); }
.pw { display: block; font-size: 20px; letter-spacing: .04em; padding: 12px; text-align: center; background: var(--brand-soft); color: var(--brand-ink); border-radius: var(--radius-sm); user-select: all; }
.player-actions { display: flex; justify-content: flex-end; gap: 8px; }
.steps { margin: 6px 0 12px 18px; padding: 0; line-height: 1.7; }
code.copy { cursor: copy; background: var(--panel-2); padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); user-select: all; }
.form-grid { display: grid; grid-template-columns: 220px minmax(0, 360px); gap: 8px 12px; align-items: center; margin-bottom: 10px; }
.form-grid input, .inline input[type="text"] { padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--panel-2); color: var(--ink); }
.inline input[type="text"] { flex: 1; min-width: 0; }
tr.off td { opacity: .55; }
.hint.ok { color: var(--ok); }
.hint.error, .error { color: var(--bad); }
dialog:has(.secret) { max-width: 520px; }
.add-user { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 170px auto; gap: 8px; align-items: center; }
.add-user input, .add-user select { padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--panel-2); color: var(--ink); min-width: 0; }
.add-user button { width: auto; padding: 9px 18px; white-space: nowrap; }
@media (max-width: 800px) { .add-user { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- the batch page: reuse a voice that was made before */
.reuse-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); padding: 14px 16px; margin: 14px 0; }
.reuse-box > h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 2px; }
.reuse-box label { margin-top: 10px; }
.reuse-info { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.reuse-info audio { display: block; width: 100%; max-width: 420px; margin: 6px 0; }
.reuse-info .script { white-space: pre-wrap; max-height: 5.5em; overflow: auto; color: var(--ink); }
#batch-reuse-warn p { margin: 8px 0 0; color: var(--warn, #b45309); font-size: 13px; }
.script-coverage { margin: 6px 0 10px; padding: 8px 12px; border-left: 3px solid var(--accent, #4f7cff); background: var(--panel); border-radius: var(--radius-sm); font-size: 13.5px; }
.script-end { color: var(--muted); font-size: 12px; white-space: nowrap; }
