/* Deliberately the same palette as the rendered videos, so the tool and its
   output look like one product. */
:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #1c2230;
  --border: #30363d;
  --fg: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --ok: #3fb950;
  --warn: #d29922;
  --err: #f85149;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.55 "Segoe UI", system-ui, -apple-system, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; }

/* ---- layout ---- */
/* A fixed height with no wrapping clipped whatever did not fit, and the item that fell off
   the end was always the last one -- Sign out. The bar grows instead. */
header.top {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 8px 28px; min-height: 58px;
  background: var(--panel); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
header.top .brand { font-weight: 700; letter-spacing: -0.02em; font-size: 17px; color: var(--fg);
                    white-space: nowrap; }
header.top nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-left: auto; }
@media (max-width: 1100px) {
  header.top { gap: 14px; padding-left: 16px; padding-right: 16px; }
  header.top nav { gap: 8px 14px; font-size: 14px; }
}
header.top nav a { color: var(--muted); }
header.top nav a:hover, header.top nav a.on { color: var(--fg); text-decoration: none; }

main { max-width: 1080px; margin: 0 auto; padding: 32px 28px 80px; }
main.narrow { max-width: 460px; }

h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.02em; }
h2 { font-size: 18px; margin: 34px 0 14px; letter-spacing: -0.01em; }
.sub { color: var(--muted); margin: 0 0 26px; }

/* ---- cards ---- */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.project-card { display: block; color: inherit; }
.project-card:hover { border-color: var(--accent); text-decoration: none; }
.project-card h3 { margin: 0 0 6px; font-size: 17px; }
.project-card p { color: var(--muted); margin: 0 0 16px; font-size: 14px; }

.stats { display: flex; gap: 26px; }
.stat .n { font-size: 22px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }

/* ---- forms ---- */
/* The browser's own [hidden] rule lives in the user-agent stylesheet, and any
   author rule that sets `display` on the same element beats it outright --
   specificity never enters into it, author styles simply win. So the rule
   below, `label { display: block }`, quietly defeated `hidden` on every label
   in the app: the create-series form set the flag correctly and every field
   stayed on screen anyway, so choosing "Film reviews" still asked which news
   beat and how it should be sung.

   One targeted patch for this already existed further down (.coverage[hidden]).
   This is the general form, and it has to carry !important to outrank whatever
   display an element is given elsewhere. */
[hidden] { display: none !important; }

label { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
input, textarea, select {
  width: 100%; padding: 9px 11px;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--border); border-radius: 7px;
  font: inherit;
}
/* A radio is not a text box. The rule above gave every one of them width:100% and 9px of
   padding, which stretched each into a full-width bar that swallowed the label beside it --
   every form with a choice on it had to undo this locally before it read as a form. */
input[type=radio], input[type=checkbox] {
  width: auto; padding: 0; accent-color: var(--accent);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 14px; }
.row > * { flex: 1; }

button, .btn {
  display: inline-block; padding: 9px 16px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--fg);
  font: inherit; cursor: pointer;
}
button:hover, .btn:hover { border-color: var(--accent); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #04101f; font-weight: 600; }
button.primary:hover { filter: brightness(1.1); }
button:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; }

/* ---- tables / lists ---- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
tr:last-child td { border-bottom: none; }
td.num { color: var(--muted); width: 44px; }

/* ---- pills ---- */
.pill {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  border: 1px solid var(--border); color: var(--muted);
}
.pill.review   { color: var(--accent); border-color: var(--accent); }
.pill.approved { color: var(--ok); border-color: var(--ok); }
.pill.uploaded { color: var(--ok); border-color: var(--ok); background: rgba(63,185,80,.12); }
.pill.failed   { color: var(--err); border-color: var(--err); }
.pill.building, .pill.rendering, .pill.running, .pill.queued { color: var(--warn); border-color: var(--warn); }
.pill.needs_setup { color: var(--warn); border-color: var(--warn); }

/* ---- notices ---- */
.notice { border: 1px solid var(--border); border-left: 3px solid var(--muted);
          background: var(--panel); padding: 13px 16px; border-radius: 7px; margin: 16px 0; }
.notice.warn { border-left-color: var(--warn); }
.notice.err  { border-left-color: var(--err); }
.notice.ok   { border-left-color: var(--ok); }
.notice p:first-child { margin-top: 0; } .notice p:last-child { margin-bottom: 0; }

pre.log {
  background: #0a0e14; border: 1px solid var(--border); border-radius: 7px;
  padding: 14px; overflow-x: auto; font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12.5px; color: var(--muted); max-height: 340px;
}

video { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); background: #000; }

.kv { display: grid; grid-template-columns: 190px 1fr; gap: 8px 18px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }

.empty { text-align: center; padding: 54px 20px; color: var(--muted); }

/* ---- progress ---- */
.progress {
  height: 8px; border-radius: 99px; background: var(--panel-2);
  overflow: hidden; margin: 14px 0 10px;
}
.progress > .bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), #7ee3a8);
  border-radius: 99px;
  transition: width .5s ease;
}
/* Long steps report no percentage of their own, so the bar animates to show
   the job is alive rather than pretending to know how far along it is. */
.progress.indeterminate > .bar {
  width: 35% !important;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: sweep 1.4s ease-in-out infinite;
}
@keyframes sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}
.progress.done > .bar { background: var(--ok); }
.progress.failed > .bar { background: var(--err); width: 100% !important; animation: none; }

.progress-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.progress-row .msg { font-size: 14px; }
.progress-row .pct { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }

.steps { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.steps .step {
  font-size: 12px; color: var(--muted);
  padding: 3px 10px; border: 1px solid var(--border); border-radius: 99px;
}
.steps .step.on   { color: var(--fg); border-color: var(--accent); }
.steps .step.past { color: var(--ok); border-color: var(--ok); }

.mini-progress { height: 5px; border-radius: 99px; background: var(--panel-2); overflow: hidden; width: 130px; }
.mini-progress > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .5s ease; }


/* ---- build / schedule panel ---- */
details.build > summary { list-style: none; display: inline-block; }
details.build > summary::-webkit-details-marker { display: none; }
details.build > summary { cursor: pointer; }
details.build[open] > summary { background: var(--panel-2); border-color: var(--accent); color: var(--fg); }

.build-form {
  margin-top: 12px; padding: 14px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
}
.build-form label.choice {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 0 0 12px; padding: 10px; border-radius: 7px;
  border: 1px solid var(--border); cursor: pointer; color: var(--fg);
}
.build-form label.choice:hover { border-color: var(--accent); }
.build-form label.choice input { width: auto; margin-top: 3px; flex: none; }
.build-form label.choice .sub { font-size: 12.5px; }
.build-form .actions { margin-top: 12px; }

.btn.locked {
  color: var(--muted); background: transparent; border-style: dashed;
  cursor: not-allowed; opacity: .8;
}
.btn.locked:hover { border-color: var(--border); }
.lock-why { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); }

details.activity > summary { list-style: none; }
details.activity > summary::-webkit-details-marker { display: none; }
details.activity > summary::before { content: "B8  "; color: var(--muted); }
details.activity[open] > summary::before { content: "BE  "; }
details.activity > summary:hover { color: var(--fg); }

/* ---- series kind chooser ---- */
.kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 6px; }
.kinds .kind {
  display: flex; gap: 12px; align-items: flex-start; margin: 0;
  padding: 14px; border: 1px solid var(--border); border-radius: 9px;
  cursor: pointer; color: var(--fg); font-size: 15px;
}
.kinds .kind:hover { border-color: var(--accent); }
.kinds .kind input { width: auto; margin-top: 4px; flex: none; }
.kinds .kind:has(input:checked) { border-color: var(--accent); background: var(--panel-2); }
.kinds .kind .sub { display: block; margin: 4px 0 0; font-size: 12.5px; }
@media (max-width: 900px) { .kinds { grid-template-columns: 1fr; } }

/* ---- heavy-load confirmation ---- */
dialog.load-dialog {
  max-width: 560px; width: calc(100% - 40px);
  background: var(--panel); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 28px; box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
dialog.load-dialog::backdrop { background: rgba(2, 5, 10, .72); }
dialog.load-dialog h3 { margin: 0 0 8px; font-size: 19px; letter-spacing: -0.01em; }
dialog.load-dialog .sub { margin: 0 0 16px; font-size: 15px; color: var(--accent); }
dialog.load-dialog ul { margin: 0; padding-left: 20px; color: var(--muted);
                        font-size: 14px; line-height: 1.85; }

/* ---- machine meters ---- */
.machine-card { padding: 16px 20px 18px; margin-bottom: 4px; }
.machine-head { display: flex; align-items: baseline; gap: 14px;
                flex-wrap: wrap; margin-bottom: 14px; }
.machine-head .sub { font-size: 12.5px; }

.meters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.meter-top { display: flex; justify-content: space-between; align-items: baseline;
             font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
             color: var(--muted); margin-bottom: 7px; }
.meter-top span:last-child { color: var(--fg); font-weight: 600;
                             font-variant-numeric: tabular-nums;
                             text-transform: none; letter-spacing: 0; font-size: 13px; }
.meter-bar { height: 6px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.meter-bar > span { display: block; height: 100%; border-radius: 99px;
                    background: var(--accent); transition: width .6s ease, background .6s ease; }
.meter-bar > span.hot { background: var(--warn); }
.meter-sub { margin-top: 6px; font-size: 11.5px; color: var(--muted); }

@media (max-width: 820px) { .meters { grid-template-columns: repeat(2, 1fr); } }

/* ---- presenter corner preview ---- */
.corner-map {
  position: relative; margin-top: 14px;
  width: 100%; max-width: 320px; aspect-ratio: 16 / 9;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
}
.corner-map .screen-label {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: var(--muted); font-size: 12px;
}
.corner-map .spot {
  position: absolute; width: 46px; height: 46px; border-radius: 50%;
  border: 2px dashed var(--border); opacity: .4; transition: all .25s ease;
}
.corner-map .spot[data-at="top-left"]     { top: 10px;    left: 10px; }
.corner-map .spot[data-at="top-right"]    { top: 10px;    right: 10px; }
.corner-map .spot[data-at="bottom-left"]  { bottom: 10px; left: 10px; }
.corner-map .spot[data-at="bottom-right"] { bottom: 10px; right: 10px; }
.corner-map[data-corner="top-left"]     .spot[data-at="top-left"],
.corner-map[data-corner="top-right"]    .spot[data-at="top-right"],
.corner-map[data-corner="bottom-left"]  .spot[data-at="bottom-left"],
.corner-map[data-corner="bottom-right"] .spot[data-at="bottom-right"] {
  opacity: 1; border-style: solid; border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(88,166,255,.14);
}

/* ---- coverage advice ---- */
.coverage { margin: 4px 0 0; }
.coverage[hidden] { display: none; }
.coverage .fix { margin-top: 10px; }

/* ---- recreate ---- */
details.recreate > summary { cursor: pointer; list-style: none; color: var(--muted); }
details.recreate > summary::-webkit-details-marker { display: none; }
details.recreate > summary:hover { color: var(--fg); }
details.recreate[open] > summary { color: var(--fg); }


/* ==========================================================================
   Customer surface
   The operator's pages are a control panel and look like one. These are the
   pages a paying customer opens, so they get depth, motion and space -- but
   the same palette, because it is still the same product.
   ========================================================================== */

/* ---- entrance ---- */
/* Elements carry --i (their position); the delay is derived from it, so a
   list animates in as a wave without a line of JavaScript per item. */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.rise {
  opacity: 0;
  animation: rise .5s cubic-bezier(.22,.7,.3,1) forwards;
  animation-delay: calc(var(--i, 0) * 60ms);
}

/* ---- hero ---- */
.hero {
  position: relative; overflow: hidden;
  border: 1px solid var(--border); border-radius: 16px;
  padding: 30px 32px; margin-bottom: 26px;
  background:
    radial-gradient(900px 320px at 12% -30%, rgba(88,166,255,.20), transparent 70%),
    radial-gradient(700px 300px at 92% 130%, rgba(126,227,168,.14), transparent 70%),
    var(--panel);
}
.hero::after {
  /* A slow sheen, so the page feels alive without anything blinking. */
  content: ""; position: absolute; inset: -40% -60%;
  background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,.045) 50%, transparent 58%);
  animation: sheen 9s linear infinite; pointer-events: none;
}
@keyframes sheen { from { transform: translateX(-30%); } to { transform: translateX(30%); } }
.hero h1 { font-size: 30px; margin: 0 0 6px; position: relative; }
.hero .sub { margin: 0; max-width: 62ch; position: relative; }
.hero .hero-actions { display: flex; gap: 12px; margin-top: 20px; position: relative; flex-wrap: wrap; }

/* ---- stat strip ---- */
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
         gap: 14px; margin-bottom: 26px; }
.strip .tile {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 13px; padding: 16px 18px;
  transition: transform .25s ease, border-color .25s ease;
}
.strip .tile:hover { transform: translateY(-3px); border-color: var(--accent); }
.strip .tile .n { font-size: 27px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.strip .tile .l { color: var(--muted); font-size: 11.5px; text-transform: uppercase;
                  letter-spacing: .07em; margin-top: 3px; }

/* ---- series cards ---- */
.series-grid { display: grid; gap: 18px;
               grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.series-tile {
  position: relative; display: block; color: inherit; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 22px 18px;
  transition: transform .28s cubic-bezier(.22,.7,.3,1), border-color .28s ease, box-shadow .28s ease;
}
.series-tile::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), #7ee3a8);
  transform: scaleX(0); transform-origin: left; transition: transform .35s ease;
}
.series-tile:hover {
  transform: translateY(-4px); border-color: var(--accent); text-decoration: none;
  box-shadow: 0 16px 38px rgba(0,0,0,.42);
}
.series-tile:hover::before { transform: scaleX(1); }
.series-tile h3 { margin: 0 0 6px; font-size: 17.5px; letter-spacing: -.01em; }
.series-tile p { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; min-height: 38px; }
.series-tile .foot { display: flex; align-items: center; gap: 16px; }
.series-tile .go { margin-left: auto; color: var(--accent); font-size: 13px;
                   transform: translateX(-4px); opacity: 0; transition: all .28s ease; }
.series-tile:hover .go { transform: none; opacity: 1; }

/* A ring reads as "how far through" at a glance; a number does not. */
.ring { --pct: 0; position: relative; width: 46px; height: 46px; flex: none; }
.ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--panel-2) 0);
}
.ring::after {
  content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--panel);
}
.ring span { position: absolute; inset: 0; display: flex; align-items: center;
             justify-content: center; font-size: 11.5px; font-weight: 700; z-index: 1; }

/* ---- video gallery ---- */
.video-grid { display: grid; gap: 18px;
              grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.video-tile {
  display: block; color: inherit; border-radius: 13px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border);
  transition: transform .28s cubic-bezier(.22,.7,.3,1), border-color .28s ease, box-shadow .28s ease;
}
.video-tile:hover {
  transform: translateY(-4px); border-color: var(--accent); text-decoration: none;
  box-shadow: 0 16px 38px rgba(0,0,0,.42);
}
.video-thumb {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: linear-gradient(135deg, #1b2432, #0f141c);
  display: flex; align-items: center; justify-content: center;
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block;
                   transition: transform .5s cubic-bezier(.22,.7,.3,1); }
.video-tile:hover .video-thumb img { transform: scale(1.06); }
.video-thumb .ep { color: var(--muted); font-size: 30px; font-weight: 700; opacity: .5; }
.video-thumb .play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(3,7,14,.35); opacity: 0; transition: opacity .28s ease;
}
.video-tile:hover .video-thumb .play { opacity: 1; }
.video-thumb .play span {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); color: #04101f;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; padding-left: 4px;
  transform: scale(.86); transition: transform .28s cubic-bezier(.3,1.5,.5,1);
}
.video-tile:hover .video-thumb .play span { transform: none; }
.video-thumb .len {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(3,7,14,.82); color: var(--fg);
  font-size: 11.5px; padding: 2px 7px; border-radius: 5px;
  font-variant-numeric: tabular-nums;
}
.video-meta { padding: 13px 15px 15px; }
.video-meta .t { font-size: 14.5px; line-height: 1.35; margin-bottom: 5px; }
.video-meta .s { color: var(--muted); font-size: 12px; }

/* ---- live work ---- */
.working { position: relative; overflow: hidden; border-color: var(--accent); }
.working::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 40%, rgba(88,166,255,.09) 50%, transparent 60%);
  animation: sheen 2.6s linear infinite; pointer-events: none;
}
.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-right: 8px;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1;  box-shadow: 0 0 0 0 rgba(88,166,255,.5); }
  70%      { opacity: .6; box-shadow: 0 0 0 8px rgba(88,166,255,0); }
}

/* ---- section headings on the customer pages ---- */
.section-head { display: flex; align-items: baseline; gap: 14px; margin: 38px 0 16px; }
.section-head h2 { margin: 0; }
.section-head .more { margin-left: auto; font-size: 13.5px; }

.empty-tile {
  border: 1px dashed var(--border); border-radius: 14px;
  padding: 46px 24px; text-align: center; color: var(--muted);
}
.empty-tile p { margin: 0 0 16px; }

/* Motion is decoration here; anyone who has asked for less gets none of it. */
@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1; animation: none; }
  .hero::after, .working::before, .dot { animation: none; }
  .series-tile, .video-tile, .strip .tile, .video-thumb img { transition: none; }
  .series-tile:hover, .video-tile:hover, .strip .tile:hover { transform: none; }
}

/* The kind chooser now holds five options, and two of them carry a caution
   that has to be read before choosing, not after. */
.kinds { grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); }
.kinds .kind .caution {
  display: block; margin: 8px 0 0; padding-left: 10px;
  border-left: 2px solid var(--warn);
  color: var(--warn); font-size: 12px; line-height: 1.55;
}

/* ---- source material ---- */
.source-box textarea { min-height: 160px; font-family: "Cascadia Mono", Consolas, monospace;
                       font-size: 12.5px; line-height: 1.6; }

/* ---- kind chooser, dropdown form ---- */
.kind-detail {
  margin: 12px 0 4px; padding: 16px 18px;
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 9px; background: var(--panel-2);
  animation: rise .35s cubic-bezier(.22,.7,.3,1);
}
.kind-detail[hidden] { display: none; }
.kind-detail .lead { margin: 0 0 10px; font-size: 15px; color: var(--fg); }
.kind-detail p { margin: 0 0 10px; color: var(--muted); font-size: 13.5px; line-height: 1.65; }
.kind-detail h4 { margin: 0 0 6px; font-size: 11.5px; text-transform: uppercase;
                  letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.kind-detail ul { margin: 0; padding-left: 18px; color: var(--muted);
                  font-size: 13.5px; line-height: 1.7; }
.kind-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 14px 0 4px; }
@media (max-width: 700px) { .kind-cols { grid-template-columns: 1fr; } }
.kind-detail .caution {
  margin: 12px 0 0; padding-left: 12px; border-left: 2px solid var(--warn);
  color: var(--warn); font-size: 13px;
}
@media (prefers-reduced-motion: reduce) { .kind-detail { animation: none; } }

/* ---- character reference sheets ---- */
.sheet { display: grid; gap: 14px; margin-top: 16px;
         grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.sheet figure { margin: 0; }
.sheet img, .sheet .missing {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2);
  display: block;
}
.sheet .missing { display: flex; align-items: center; justify-content: center;
                  color: var(--muted); font-size: 12px; border-style: dashed; }
.sheet figcaption { margin-top: 7px; font-size: 11.5px; color: var(--muted);
                    text-transform: uppercase; letter-spacing: .05em; }

/* ---- delete ---- */
.series-cell { position: relative; }
.tile-delete { position: absolute; top: 10px; right: 10px; z-index: 2; margin: 0; }
.tile-delete button {
  width: 30px; height: 30px; padding: 0; line-height: 1;
  border-radius: 50%; font-size: 18px;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--border);
  opacity: 0; transition: opacity .2s ease, color .2s ease, border-color .2s ease;
}
.series-cell:hover .tile-delete button,
.tile-delete button:focus-visible { opacity: 1; }
.tile-delete button:hover { color: var(--err); border-color: var(--err); }

button.danger { color: var(--err); border-color: var(--err); background: transparent; }
button.danger:hover { background: rgba(248, 81, 73, .12); border-color: var(--err); }

/* Touch screens have no hover, so the control must simply be there. */
@media (hover: none) { .tile-delete button { opacity: 1; } }

/* ---- switching between styles in a family ---- */
.kind-switch { display: grid; gap: 12px; margin-top: 4px;
               grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.kind-switch form { margin: 0; }
.kind-switch button {
  width: 100%; text-align: left; padding: 14px 16px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--fg);
  display: block; cursor: pointer;
}
.kind-switch button:hover:not(:disabled) { border-color: var(--accent); }
.kind-switch button strong { display: block; font-size: 15px; margin-bottom: 5px; }
.kind-switch button span { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.kind-switch button.on { border-color: var(--accent); background: var(--panel); opacity: 1; }
.kind-switch button:disabled { cursor: default; }
.kind-switch .badge {
  display: inline-block; margin-top: 9px; padding: 2px 9px; border-radius: 20px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--accent); border: 1px solid var(--accent);
}

/* ---- redrawing a character ---- */
.section-head form.redraw-one { margin: 0; }
.sheet figcaption { display: flex; align-items: center; gap: 8px; }
.sheet figcaption form { margin: 0 0 0 auto; }
.sheet figcaption button {
  padding: 2px 9px; font-size: 11px; border-radius: 20px;
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  text-transform: none; letter-spacing: 0;
}
.sheet figcaption button:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }

/* ---- detailed progress ---- */
.ld-facts {
  display: grid; gap: 10px 22px; margin-top: 16px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.ld-facts > div { display: flex; flex-direction: column; gap: 2px; }
.ld-facts .l { color: var(--muted); font-size: 11px; text-transform: uppercase;
               letter-spacing: .06em; }
.ld-facts .v { font-size: 14px; font-variant-numeric: tabular-nums; }
details.ld-log { margin-top: 16px; }
details.ld-log > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.ld-log > summary:hover { color: var(--fg); }
details.ld-log pre.log { margin-top: 10px; max-height: 260px; font-size: 12px; }

/* ---- salvaged shots ---- */
.shot-row {
  display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 14px;
  scroll-snap-type: x proximity;
}
.shot-row .shot {
  flex: 0 0 200px; margin: 0; scroll-snap-align: start;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--panel-2); transition: border-color .2s ease, transform .2s ease;
}
.shot-row .shot:hover { border-color: var(--accent); transform: translateY(-2px); }
.shot-row .shot video, .shot-row .shot img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #000;
}
.shot-row .shot figcaption {
  padding: 7px 9px; font-size: 12px; display: flex; gap: 6px;
  align-items: baseline; justify-content: space-between;
}
.shot-row .shot figcaption span {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.shot-row .shot.animated figcaption span { color: var(--accent); }
/* A visible track, because a row that scrolls without saying so gets missed. */
.shot-row::-webkit-scrollbar { height: 8px; }
.shot-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.shot-row::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---- episode role ---- */
.role-tag {
  display: inline-block; margin-left: 8px; padding: 1px 8px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  border-radius: 99px; border: 1px solid var(--border); color: var(--muted);
  vertical-align: middle;
}

/* ---- rebuild dialog ---- */
.rebuild-box {
  border: 1px solid var(--border); border-radius: 14px; padding: 26px;
  background: var(--panel); color: var(--fg);
  max-width: 620px; width: calc(100% - 40px);
}
.rebuild-box::backdrop { background: rgba(0, 0, 0, .55); }
.rebuild-box textarea { width: 100%; }
.btn-again {
  font-size: 12.5px; padding: 4px 10px; margin-left: 6px;
  border: 1px solid var(--border); border-radius: 7px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.btn-again:hover { border-color: var(--accent); color: var(--fg); }

/* The categories a channel publishes. A grid rather than a column: fourteen
   kinds stacked vertically pushes the button that saves them off the screen,
   and a control you have to scroll to find is one nobody uses. */
.channel-cats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 4px 14px;
}
.channel-cats label {
  display: flex; align-items: center; gap: 7px; margin: 0;
  font-size: 13px; color: var(--fg); cursor: pointer;
}
.channel-cats input { margin: 0; }

/* ---- publish popup ---- */
dialog.publish-dialog {
  max-width: 620px; width: calc(100% - 40px);
  max-height: calc(100vh - 60px); overflow-y: auto;
  background: var(--panel); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 28px; box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
dialog.publish-dialog::backdrop { background: rgba(2, 5, 10, .72); }
dialog.publish-dialog h3 { margin: 0 0 18px; font-size: 19px; letter-spacing: -0.01em; }

/* ---- segmented toggle (voice gender) ---- */
.segmented { display: inline-flex; margin: 0 0 12px; padding: 3px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 999px; }
.segmented label { display: inline-block; margin: 0; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; width: 0; height: 0; }
.segmented span { display: block; padding: 7px 20px; border-radius: 999px;
  font-size: 14px; color: var(--muted); user-select: none;
  transition: background .12s, color .12s; }
.segmented input:checked + span { background: var(--accent); color: #08111f;
  font-weight: 600; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent);
  outline-offset: 2px; }

/* ---- per-channel card look ---- */
.look-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.look-row select { width: auto; min-width: 120px; margin: 0; }
.look-row button { margin: 0; }

/* ---- 3D model picker ---- */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px; margin: 6px 0 4px; }
.pick { position: relative; margin: 0; cursor: pointer; }
.pick input { position: absolute; opacity: 0; }
.pick img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px;
  border: 2px solid var(--border); background: var(--panel); display: block;
  transition: border-color .12s; }
.pick input:checked + img { border-color: var(--accent); }
.pick span { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.pick span small { display: block; font-size: 11.5px; opacity: .75; }
.views { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px; }
.views img { width: 100%; border-radius: 10px; background: #2b2b2b; display: block; }

/* ---- 360 turntable ---- */
.spin { position: relative; display: inline-block; cursor: grab;
  user-select: none; border-radius: 12px; overflow: hidden;
  background: #2b2b2b; }
.spin.grabbing { cursor: grabbing; }
.spin img { display: block; max-width: 100%; pointer-events: none; }
.spin-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  font-size: 12px; letter-spacing: .04em; color: #dfe4ee;
  background: rgba(8,10,16,.7); padding: 4px 10px; border-radius: 999px; }

/* ---- three-up upload row ---- */
.row3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; align-items: start; }

/* ---- software picker ---- */
.pick-software { display: grid; gap: 8px; }
.sw-group { background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; }
.sw-group summary { cursor: pointer; font-size: 14.5px; }
.sw-group summary em { color: var(--muted); font-style: normal; font-size: 12.5px; }
.sw-count { color: var(--accent); font-size: 12.5px; margin-left: 8px; }
.sw-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px; margin-top: 10px; }
.sw { display: flex; align-items: center; gap: 8px; margin: 0;
  font-size: 13.5px; cursor: pointer; }
.sw input { width: auto; margin: 0; }
.sw-chosen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px;
  min-height: 26px; align-items: center; }
.chip { background: var(--accent); color: #08111f; font-size: 12.5px;
  font-weight: 600; padding: 4px 10px; border-radius: 999px; }

/* ---- stack confirmation ---- */
.stack-row { display: flex; gap: 14px; align-items: baseline; padding: 7px 0;
  border-bottom: 1px solid var(--border); }
.stack-row:last-child { border-bottom: 0; }
.stack-row .l { min-width: 120px; color: var(--muted); font-size: 13.5px; }
.stack-row .v { display: flex; flex-wrap: wrap; gap: 6px; }

/* Sign in with Google */
.google-btn{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;padding:11px 16px;
  border:1px solid var(--line,#d9dbe6);border-radius:10px;background:#fff;color:#1f2330;font-weight:600;
  text-decoration:none;box-sizing:border-box}
.google-btn:hover{background:#f7f8fb}
.or{display:flex;align-items:center;gap:12px;margin:16px 0;color:#8a8fa8;font-size:13px}
.or::before,.or::after{content:"";flex:1;height:1px;background:var(--line,#e3e5ee)}

/* -- parity widgets (static/parity.js): what the phone app shows, on the web -- */
[data-widget] { margin: 0 0 16px; }
[data-widget] h3 { font-size: 14px; margin: 14px 0 6px; }
.p-head { display: flex; align-items: baseline; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.p-head h2 { margin: 0; }
.p-note { margin: 8px 0 0; }
.p-note.ok { color: #4ad295; } .p-note.bad, .sub.bad { color: #ff7b72; }
.p-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.p-pic, .p-clip { cursor: pointer; flex: 0 0 auto; width: 150px; position: relative; }
.p-strip .p-pic, .p-strip .p-clip { width: 130px; }
.p-pic img, .p-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: #0d1626; display: block; }
.p-thumb { position: relative; } .p-thumb img { aspect-ratio: 16/9; } .p-thumb.small { width: 96px; flex: 0 0 96px; }
.p-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 22px; text-shadow: 0 1px 6px #000; }
.p-label { font-size: 12px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-pic.chosen img { outline: 3px solid var(--accent); }
.p-pic.add { display: grid; place-items: center; aspect-ratio: 1; border: 1px dashed #3a4a63; border-radius: 8px; color: #8a93a6; }
.p-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; padding: 0; border-radius: 50%; line-height: 1; background: rgba(0,0,0,.65); color: #fff; }
.p-list { display: flex; flex-direction: column; gap: 8px; }
.p-row { display: flex; gap: 12px; align-items: flex-start; padding: 8px; border: 1px solid #1f2a3d; border-radius: 10px; }
.p-row.stale { opacity: .7; }
.p-body { flex: 1; min-width: 0; } .p-text { font-size: 13.5px; margin: 2px 0; } .p-dialogue { font-size: 13px; margin: 4px 0; }
.p-actions { display: flex; flex-direction: column; gap: 6px; } .p-actions button { padding: 6px 10px; font-size: 12.5px; white-space: nowrap; }
.p-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
button.danger { border-color: #ff7b72; color: #ff7b72; }
.p-form label, .p-world label, .p-yoga label { display: block; margin: 10px 0 4px; font-size: 13px; color: #8a93a6; }
.p-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.p-form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #8a93a6; }
.p-form-grid label.wide { grid-column: 1 / -1; }
.p-inline { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 6px; color: inherit !important; }
.p-line { display: grid; grid-template-columns: 90px 1fr; gap: 8px; align-items: center; margin: 4px 0; }
.p-newchar { display: grid; grid-template-columns: 1fr 2fr 120px; gap: 8px; margin: 6px 0; align-items: center; }
.p-preview { max-width: 240px; border-radius: 8px; display: block; margin: 6px 0; }
.p-modal { position: fixed; inset: 0; background: rgba(3,8,18,.78); display: grid; place-items: center; z-index: 1000; padding: 16px; }
.p-modal-box { position: relative; background: #101a2b; border: 1px solid #22304a; border-radius: 14px; padding: 18px; max-width: 720px; width: 100%; max-height: 92vh; overflow: auto; }
.p-modal.dark .p-modal-box { background: #000; border-color: #222; max-width: 96vw; padding: 10px; }
.p-close { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; padding: 0; border-radius: 50%; font-size: 18px; line-height: 1; z-index: 2; }
.p-viewer-title { color: #fff; font-weight: 600; padding: 6px 40px 8px 6px; }
.p-viewer-body { display: grid; place-items: center; overflow: hidden; }
.p-big { max-width: 92vw; max-height: 82vh; transition: transform .15s; cursor: zoom-in; }
.p-video { max-width: 92vw; max-height: 82vh; background: #000; } .p-video.small { max-height: 220px; width: 100%; }
.p-record { display: flex; gap: 10px; align-items: flex-start; } .p-cam { width: 160px; border-radius: 8px; background: #000; }
.p-prompter { font-size: 20px; line-height: 1.5; padding: 12px; background: #0b1220; border-radius: 10px; margin: 10px 0; max-height: 200px; overflow: auto; }
.p-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 10px 0; }
.p-stat { background: #0d1626; border-radius: 10px; padding: 10px; } .p-stat .v { font-size: 20px; font-weight: 700; }
.p-insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.p-insight ul { margin: 4px 0 0 18px; padding: 0; font-size: 13px; }
.p-live { border-color: var(--accent); }
.p-live-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-weight: 600; }
.p-live-msg { flex: 1; } .p-live.failed { border-color: #ff7b72; } .p-live.failed .p-live-msg { color: #ff7b72; }
.p-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: p-pulse 1.2s infinite; }
@keyframes p-pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }
.p-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.p-compare figure { margin: 0; } .p-compare img { width: 100%; border-radius: 8px; display: block; }
.p-history { margin: 8px 0; border: 1px solid #1f2a3d; border-radius: 10px; padding: 8px 12px; }
.p-history summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.p-hist { border-top: 1px solid #1f2a3d; padding: 8px 0; font-size: 13px; } .p-hist:first-of-type { border-top: 0; }
.p-diff .before { color: #ff9f95; } .p-diff .after { color: #4ad295; }
.p-lastnote { margin-top: 4px; }

.p-pic.newest img { outline: 3px solid var(--accent); animation: p-pop .5s ease-out; }
@keyframes p-pop { from { transform: scale(.85); opacity: .3 } to { transform: none; opacity: 1 } }
.p-busy .p-head .sub { color: var(--accent); }

.p-strip .p-pic.small { width: 84px; opacity: .85; }

.p-prompt { color: #dfe6f1; background: #0b1220; border: 1px solid #1f2a3d; border-radius: 10px; padding: 10px 14px; margin-top: 8px; max-width: 92vw; font-size: 13px; }
.p-prompt-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 6px; }
.p-copy { padding: 4px 10px; font-size: 12px; }
.p-slots { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; margin: 6px 0 8px; }
.p-slot { display: contents; } .p-slot .k { color: #8a93a6; } .p-slot .v { color: #fff; }
.p-prompt details { margin: 4px 0; } .p-prompt summary { cursor: pointer; color: #8a93a6; }
.p-prompt pre { white-space: pre-wrap; word-break: break-word; font-size: 12px; margin: 4px 0 0; color: #cfd6e2; }

.p-attempts { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.p-attempt { border-left: 3px solid #ff7b72; padding: 4px 10px; font-size: 12.5px; } .p-attempt.ok { border-color: #4ad295; }

.p-ref { border: 1px solid #1f2a3d; border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.p-ref.add { border-style: dashed; }
.p-ref-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.sub.ok { color: #4ad295; }
.p-who { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0; }
button.small { padding: 4px 10px; font-size: 12px; margin-top: 4px; }
.p-refs .p-strip .p-pic { width: 200px; }
.p-refs .p-strip .p-pic img { aspect-ratio: auto; max-height: 200px; object-fit: contain; background: #0b1220; cursor: zoom-in; }

/* the judge's attempts: a thumbnail per try, and the shot compiler's ranking */
.p-attempt { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-start; }
.p-attempt-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; cursor: zoom-in; border: 2px solid transparent; }
.p-attempt.ok .p-attempt-thumb { border-color: #4caf50; }
.p-attempt.bad .p-attempt-thumb { border-color: #e57373; }
.p-attempt > b, .p-attempt > div { flex-basis: calc(100% - 90px); }
.p-attempt .sub.bad { color: #ef9a9a; }
.p-compiled { font-size: 12px; line-height: 1.4; }
.p-pri-removed { opacity: .75; text-decoration: line-through; text-decoration-color: rgba(255,255,255,.35); }

/* the small per-option action under an instructor candidate */
.p-pic .p-mini { display: block; margin: 4px auto 0; font-size: 11px; padding: 2px 8px; border-radius: 6px; opacity: .85; }
.p-pic .p-mini:hover { opacity: 1; }

/* translate: the language versions of a finished episode, and the picker */
.p-translate { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-left: 6px; }
.p-translate .btn.small { padding: 2px 8px; font-size: 12px; }
.p-translate-pick { font-size: 12px; padding: 3px 6px; border-radius: 6px; max-width: 170px; }

/* dubbing: the link form and the list of dubs */
.p-dubbing .p-dub-form label { display: block; margin: 8px 0; }
.p-dubbing .p-dub-url { width: 100%; max-width: 640px; }
.p-dub { margin-top: 10px; }
.p-dub-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.p-dub-video { width: 100%; max-width: 640px; border-radius: 8px; background: #000; margin: 8px 0; }

/* the Director card on the dashboard */
.director-card .director-roles { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; }
.director-card .role-chip { display:inline-flex; gap:6px; padding:3px 9px; border-radius:999px; border:1px solid rgba(255,255,255,.15); font-size:12px; }
.director-card .role-chip.ok { border-color:#4ad295; } .director-card .role-chip.bad { border-color:#ff7b72; }
.director-card .director-runs td { padding:3px 10px 3px 0; font-size:13px; }
.pill.done { background:#1f5a3f; } .pill.running, .pill.planning { background:#5a4a1f; } .pill.failed, .pill.stopped { background:#5a2a2a; }
