/* Resizer: layout and tokens. Dark by default, light when the system asks for it or the page is set to light. */
:root {
  --rs-bg: #161616; --rs-panel: #1f1f1f; --rs-line: #333; --rs-fg: #ececec; --rs-dim: #a3a3a3; --rs-faint: #9a9a9a;
  --rs-accent: #e7efff; --rs-accent-ink: #0f1624; --rs-bad: #ff6b82; --rs-ok: #b3c4ea; --rs-radius: 8px;
  --rs-mono: ui-monospace, Menlo, Consolas, monospace;
  --s-bg: var(--rs-panel); --s-bg2: #262626; --s-input: #161616; --s-line: var(--rs-line); --s-fg: var(--rs-fg);
  --s-dim: var(--rs-dim); --s-accent: var(--rs-accent); --s-accent-ink: var(--rs-accent-ink);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --rs-bg: #f4f2ec; --rs-panel: #ffffff; --rs-line: #d8d4c8; --rs-fg: #161616; --rs-dim: #555; --rs-faint: #666;
    --rs-accent: #2268ff; --rs-accent-ink: #ffffff; --rs-bad: #b3263f; --rs-ok: #2f6b1a;
    --s-bg2: #f0eee7; --s-input: #fff; --s-bg: #fff;
  }
}
:root[data-theme="light"] {
  --rs-bg: #f4f2ec; --rs-panel: #ffffff; --rs-line: #d8d4c8; --rs-fg: #161616; --rs-dim: #555; --rs-faint: #666;
  --rs-accent: #2268ff; --rs-accent-ink: #ffffff; --rs-bad: #b3263f; --rs-ok: #2f6b1a;
  --s-bg2: #f0eee7; --s-input: #fff; --s-bg: #fff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--rs-bg); color: var(--rs-fg); font: 14px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
h1, h2, p, ol { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header: home link (the app icon, brand/brand.js), name, tagline, the queue tools, then the shell's buttons on one row.
   The shared header buttons (shared/ui/hbtn.css) wear the look of the tools. */
.rs-top { display: flex; flex: none; align-items: center; gap: 8px 12px; padding: 10px 16px; border-bottom: 1px solid var(--rs-line); background: var(--rs-panel); position: relative; z-index: 5; min-width: 0;
  --tlbx-hbtn-h: 32px; --tlbx-hbtn-radius: var(--s-radius, 6px); --tlbx-hbtn-bg: var(--s-bg2); --tlbx-hbtn-line: var(--s-line); --tlbx-hbtn-fs: 14px; }
.rs-brand { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; overflow: clip; overflow-clip-margin: 6px; }
.rs-brand .brand { display: grid; place-items: center; width: 32px; height: 32px; flex: none; color: var(--rs-accent); text-decoration: none; }
.rs-brand h1 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.rs-tag { color: var(--rs-dim); font-size: 13px; white-space: nowrap; }
.rs-tools { display: flex; gap: 6px; flex: none; }
.rs-top .sui-btn { height: 32px; }
.rs-stat { flex: none; padding: 8px 16px; color: var(--rs-dim); font-size: 13px; min-height: 34px; }
.rs-warning { flex: none; margin: 0 16px 8px; padding: 10px 12px; border: 1px solid var(--rs-bad); border-radius: var(--rs-radius); color: var(--rs-bad); }

/* layout: TlbxFrame's view (the queue, scrolls) and its panel on the right (shared/frame/frame.css) */
.rs-main { flex: 1 1 auto; min-height: 0; border-top: 1px solid var(--rs-line); }
.rs-left { min-width: 0; padding: 16px 16px 24px; }

/* empty state: one card around the drop zone (shared/drop draws its message, hint, Choose files and progress) */
.rs-empty { display: grid; place-items: center; min-height: 52vh; }
.rs-drop-card { max-width: 520px; text-align: center; padding: 28px; border: 1px dashed var(--rs-line); border-radius: var(--rs-radius); background: var(--rs-panel); display: grid; gap: 12px; justify-items: center; }
.rs-dropzone { width: 100%; }
.rs-dropzone .sd-zone { gap: 12px; }
.rs-dropzone .sd-msg { font-size: 20px; font-weight: 700; color: var(--rs-fg); }
.rs-dropzone .sd-zone > p:not(.sd-msg) { font-size: 14px; color: var(--rs-dim); }
.rs-fine { color: var(--rs-faint); font-size: 12px; }

/* queue */
.rs-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.rs-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--rs-line); border-radius: var(--rs-radius); background: var(--rs-panel); }
.rs-row[data-status="error"] { border-color: var(--rs-bad); }
.rs-row[data-status="done"] { border-color: color-mix(in srgb, var(--rs-ok) 60%, var(--rs-line)); }
.rs-thumb { width: 64px; height: 64px; border-radius: 6px; background: var(--s-bg2); display: grid; place-items: center; overflow: hidden; }
.rs-thumb-img { width: 100%; height: 100%; object-fit: cover; }
.rs-thumb-kind { font: 700 10px/1 var(--rs-mono); letter-spacing: 0.06em; color: var(--rs-dim); }
.rs-body { min-width: 0; display: grid; gap: 3px; }
.rs-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-ba { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; color: var(--rs-dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.rs-arrow { color: var(--rs-faint); }
.rs-to { color: var(--rs-fg); }
.rs-status { font-size: 12px; color: var(--rs-dim); overflow-wrap: anywhere; }
.rs-row[data-status="error"] .rs-status { color: var(--rs-bad); }
.rs-row[data-status="done"] .rs-status { color: var(--rs-ok); }
.rs-bar { height: 4px; border-radius: 2px; background: var(--s-bg2); overflow: hidden; }
.rs-bar i { display: block; height: 100%; background: var(--rs-accent); transition: width 0.15s linear; }
.rs-acts { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.rs-x { min-width: 36px; }

/* settings in the panel (each group is a section of shared/frame/panel.js) */
.rs-group { display: grid; gap: 12px; }
.rs-field { display: grid; gap: 4px; font-size: 13px; color: var(--rs-dim); }
.rs-field select, .rs-field input[type="number"], .rs-field input[type="color"] { width: 100%; }
.rs-field select, .rs-field input[type="number"] { min-height: 34px; padding: 4px 8px; border: 1px solid var(--rs-line); border-radius: 6px; background: var(--s-input); color: var(--rs-fg); font: inherit; }
.rs-field input[type="color"] { height: 34px; padding: 2px; border: 1px solid var(--rs-line); border-radius: 6px; background: var(--s-input); }
.rs-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rs-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--rs-fg); }
.rs-inline { display: inline-flex; align-items: center; gap: 10px; }
.rs-range { display: flex; align-items: center; gap: 10px; }
.rs-range input { flex: 1; min-width: 0; accent-color: var(--rs-accent); }
.rs-range output { min-width: 3.5em; text-align: right; font-variant-numeric: tabular-nums; color: var(--rs-fg); }
.rs-row3 { display: flex; flex-wrap: wrap; gap: 6px; }
.rs-note { padding: 8px 10px; border-radius: 6px; background: var(--s-bg2); color: var(--rs-dim); font-size: 12px; }
.rs-colour { gap: 4px; }

/* small screens: the controls stack under the list */
@media (max-width: 1500px) { .rs-tag { display: none; } }
/* below the width the tools need, they get a row of their own under the name */
@media (max-width: 1100px) {
  .rs-top { flex-wrap: wrap; }
  .rs-tools { order: 9; flex: 1 1 100%; flex-wrap: wrap; }
}
@media (max-width: 900px) { .rs-left { padding: 12px; } .rs-empty { min-height: 0; } }
@media (max-width: 520px) {
  .rs-tools .sui-btn { flex: 1 1 auto; }
  .rs-row { grid-template-columns: 48px minmax(0, 1fr); }
  .rs-thumb { width: 48px; height: 48px; }
  .rs-acts { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .rs-pair { grid-template-columns: 1fr; }
  .rs-drop-card { padding: 20px; }
}
