:root { --bg: #f7f6f3; --card: #ffffff; --text: #1b1b1f; --muted: #6b6b73; --line: #e4e2dc;
  --accent: #0f766e; --accent-text: #fff; --danger: #b42318; --ok: #15803d; --warn: #b45309; --focus: #2563eb; }
:root[data-theme="dark"] { --bg: #141416; --card: #1e1e22; --text: #f2f2f3; --muted: #a1a1aa; --line: #34343a;
  --accent: #2dd4bf; --accent-text: #0b1716; --danger: #f87171; --ok: #4ade80; --warn: #fbbf24; --focus: #60a5fa; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 2; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.bar-right { display: flex; gap: 8px; align-items: center; }
main { max-width: 760px; margin: 0 auto; padding: 20px 16px 80px; }
h1 { font-size: 22px; margin: 4px 0 16px; } h2 { font-size: 16px; margin: 24px 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .hidden { display: none !important; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=password], input[type=url], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
textarea { min-height: 70px; resize: vertical; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button { font: inherit; cursor: pointer; border-radius: 8px; padding: 10px 16px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 700; }
button.ghost { background: transparent; padding: 6px 10px; }
button.danger { color: var(--danger); }
button:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 0; }
.err { color: var(--danger); margin-top: 8px; } .ok { color: var(--ok); }
.list a.item { display: flex; justify-content: space-between; gap: 12px; text-decoration: none; color: var(--text); }
.badge { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; }
.badge.done { color: var(--ok); } .badge.failed, .badge.rejected { color: var(--danger); } .badge.queued, .badge.processing, .badge.claimed { color: var(--warn); }
.clips { display: grid; gap: 10px; }
.clip { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
.clip .name { font-weight: 600; overflow-wrap: anywhere; }
.bar-track { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar-fill { height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.add-tile { display: flex; align-items: center; justify-content: center; gap: 8px; border: 2px dashed var(--line); border-radius: 10px; padding: 18px; cursor: pointer; color: var(--muted); font-weight: 600; background: transparent; width: 100%; }
.add-tile:hover { border-color: var(--accent); color: var(--accent); }
.plus { font-size: 26px; line-height: 1; }
.linkish { background: none; border: 0; padding: 4px 0; color: var(--accent); }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
@media (max-width: 560px) { .opts { grid-template-columns: 1fr; } }
.opt { display: flex; gap: 8px; align-items: center; padding: 6px 0; font-weight: 500; margin: 0; }
.opt input { width: 18px; height: 18px; accent-color: var(--accent); }
.sub { margin: 0 0 6px 26px; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 8px auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.center { text-align: center; }
.consent { font-size: 13px; color: var(--muted); margin-top: 16px; }
video { width: 100%; max-height: 70vh; border-radius: 10px; background: #000; }
a.primary { display: inline-block; background: var(--accent); color: var(--accent-text); padding: 10px 16px; border-radius: 8px; text-decoration: none; font-weight: 700; }
