:root {
  --bg: #f5f6f8; --card: #ffffff; --text: #1a2230; --muted: #667085; --line: #e3e6ec;
  --brand: #0b5cff; --brand-text: #ffffff; --danger: #c62828; --ok: #1b7f3b; --warn: #a15c00;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116; --card: #171b22; --text: #e8ecf3; --muted: #97a1b3; --line: #2a303b;
    --brand: #4c8dff; --brand-text: #0b1020; --danger: #ff6b6b; --ok: #4cd07d; --warn: #e6a23c;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 960px; margin: 0 auto; padding: 24px 16px 64px; }
main.narrow { max-width: 440px; padding-top: 12vh; }
h1 { font-size: 22px; margin: 0 0 4px; } h2 { font-size: 17px; margin: 32px 0 12px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit;
}
/* Browsers paint autofilled fields with their own (usually light) highlight, which ignores
   our background/color and looks broken in dark mode. This repaints it to match the theme. */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
  box-shadow: 0 0 0 1000px var(--bg) inset;
  transition: background-color 9999s ease-in-out 0s;
}
textarea { min-height: 96px; resize: vertical; }
input.code { font-size: 26px; letter-spacing: 8px; text-align: center; }
button, .btn {
  display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--brand);
  background: var(--brand); color: var(--brand-text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
button.ghost, .btn.ghost { background: transparent; color: var(--brand); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
button.sm { padding: 4px 10px; font-size: 13px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; } .row > * { flex: 1 1 140px; }
.error { color: var(--danger); margin: 12px 0 0; } .flash { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand); padding: 10px 14px; border-radius: 8px; margin: 16px 0; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); }
.pill.ready { color: var(--ok); } .pill.failed, .pill.revoked { color: var(--danger); }
.pill.pending, .pill.rendering, .pill.expired, .pill.purged { color: var(--warn); }
.actions form { display: inline; }
.player-shell { background: #000; border-radius: 12px; overflow: hidden; }
.player-shell video { width: 100%; display: block; max-height: 78vh; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.brand { font-weight: 700; letter-spacing: .02em; }
progress { width: 100%; margin-top: 10px; }
