:root {
  --paper: #f6ebdd;
  --ink: #1a1a1a;
  --muted: #6b625a;
  --rule: #e14b3b;
  --card: #fffaf3;
  --line: #d9cbb8;
  --ok: #2f7d4a;
  --no: #b3342b;
  --shadow: 0 1px 2px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17140f; --ink: #f1e9dc; --muted: #a79c8e; --card: #221d16; --line: #3a3128;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font: 17px/1.5 -apple-system, "Helvetica Neue", Arial, sans-serif; }
main { max-width: 1120px; margin: 0 auto; padding: 32px 16px 64px; }
h1 { font-size: 40px; letter-spacing: -.02em; margin: 0 0 6px; }
h1 span { display: block; height: 4px; background: var(--rule); width: 72px; margin-top: 10px; }
h2 { font-size: 20px; margin: 40px 0 12px; }
p.lede { color: var(--muted); margin: 0 0 24px; }
.strip img, video { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: var(--shadow); background: #000; }
.strip img { background: var(--card); }
nav { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 24px 0 0; }
a.btn, button { font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; cursor: pointer; }
a.btn.primary, button.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
button.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
button.no { background: var(--no); color: #fff; border-color: var(--no); }
button[disabled] { opacity: .5; cursor: default; }
.tabs { display: flex; gap: 6px; margin: 16px 0 24px; flex-wrap: wrap; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin: 0 0 18px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 4px; font-size: 19px; }
.card .sub { color: var(--muted); margin: 0 0 12px; }
.card .desc { white-space: pre-wrap; margin: 0 0 12px; }
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 0 0 14px; }
.imgs figure { margin: 0; }
.imgs img { width: 100%; height: auto; border-radius: 6px; background: #fff; border: 1px solid var(--line); }
.imgs figcaption { font-size: 13px; color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions input { font: inherit; flex: 1 1 200px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.pill { display: inline-block; font-size: 13px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.pill.approved { color: var(--ok); border-color: var(--ok); }
.pill.denied { color: var(--no); border-color: var(--no); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.gallery figure { margin: 0; }
.gallery figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; word-break: break-all; }
.empty { color: var(--muted); padding: 24px; text-align: center; border: 1px dashed var(--line); border-radius: 10px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar .who { color: var(--muted); font-size: 15px; }
footer { color: var(--muted); font-size: 14px; margin-top: 48px; }
body { -webkit-font-smoothing: antialiased; }
.err { color: var(--no); }
/* studio additions */
h1 em { font-style: normal; color: var(--muted); font-weight: 500; }
a.plain { color: inherit; text-decoration: none; }
.count { display: inline-block; font-size: 13px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--rule); color: #fff; vertical-align: middle; }
details.show { margin: 0 0 20px; }
details.show summary { cursor: pointer; list-style: none; }
details.show summary::-webkit-details-marker { display: none; }
details.show summary h2 { display: inline-block; margin: 8px 0; padding-bottom: 4px; border-bottom: 3px solid var(--rule); }
details.show summary::before { content: "▸ "; color: var(--muted); }
details.show[open] summary::before { content: "▾ "; }
h3.type { margin: 18px 0 10px; font-size: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.gallery.tight { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gallery.tight img { background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.card h4 { margin: 16px 0 6px; font-size: 15px; }
table.procs { width: 100%; border-collapse: collapse; font-size: 14px; }
table.procs td { padding: 4px 8px 4px 0; border-top: 1px solid var(--line); vertical-align: top; }
table.procs td:first-child { white-space: nowrap; color: var(--muted); width: 1%; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; word-break: break-all; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: var(--muted); }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(47,125,74,.2); }
.dot.off { background: var(--no); }
/* homepage */
.hero { padding: 24px 0 8px; }
.hero h1 { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: clamp(40px, 7vw, 68px); letter-spacing: -.01em; line-height: 1; }
.hero p.lede { font-size: 20px; max-width: 34em; }
.frame { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.frame figcaption { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; padding: 10px 4px 0; }
figure { margin: 0; }
.kicker { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--rule); font-weight: 700; margin: 40px 0 8px; }
.trio { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 16px; }
.trio div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.trio b { display: block; margin-bottom: 4px; }
.trio p { margin: 0; color: var(--muted); font-size: 15px; }
footer.site { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
button.chip { padding: 7px 14px; border-radius: 999px; font-weight: 500; }
button.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
button.chip .count { background: transparent; color: inherit; opacity: .7; padding: 0; }
h2.gallery-title { margin: 8px 0 14px; padding-bottom: 6px; border-bottom: 3px solid var(--rule); display: inline-block; }
h2.gallery-title em { font-style: normal; color: var(--muted); font-weight: 500; }
.banner { background: #fff3cd; color: #5c4400; border: 1px solid #e6c25a; border-radius: 8px; padding: 10px 14px; margin: 0 0 16px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .banner { background: #3a2e05; color: #f5dd8a; border-color: #7a6220; } }
/* the strip: whole on a wide screen, one panel per row on a phone */
.strip-stack { display: none; }
.strip-stack img { display: block; width: 100%; height: auto; border-radius: 6px; }
.strip-stack img + img { margin-top: 10px; }
@media (max-width: 700px) {
  .strip-wide { display: none; }
  .strip-stack { display: block; }
  main { padding: 20px 16px 48px; }
  .hero { padding: 8px 0 4px; }
  .hero p.lede { font-size: 17px; }
  .frame { padding: 10px; }
  .kicker { margin-top: 28px; }
  .gallery { grid-template-columns: 1fr; }
  .gallery.tight { grid-template-columns: repeat(2, 1fr); }
  .imgs { grid-template-columns: repeat(2, 1fr); }
}
.episode .ep-title { font-weight: 600; margin: 0 0 8px; display: flex; gap: 8px; align-items: center; text-transform: capitalize; }
details.versions { margin-top: 8px; font-size: 14px; color: var(--muted); }
details.versions summary { cursor: pointer; }
details.versions .version { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
/* gallery tiles: a fixed box per thumbnail, so lazy loading works */
.gallery.wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.gallery.strips { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.tile { position: relative; aspect-ratio: 16 / 10; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.gallery.tight .tile { aspect-ratio: 3 / 4; background: #fff; }
.gallery.strips .tile { aspect-ratio: 12 / 5; background: #fff; }
.tile img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tile:focus-visible { outline: 3px solid var(--rule); outline-offset: 2px; }
.tile .nothumb { color: var(--muted); font-size: 14px; padding: 12px; text-align: center; word-break: break-all; }
.tile .play { position: absolute; width: 56px; height: 56px; border-radius: 50%; background: rgba(0,0,0,.6); }
.tile .play::after { content: ""; position: absolute; left: 22px; top: 17px; border-left: 18px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; }
.tile:hover .play { background: var(--rule); }
.tile.playing { aspect-ratio: auto; cursor: default; background: #000; }
.tile.playing video { width: 100%; max-height: 80vh; display: block; }
button.more { display: block; margin: 20px auto 0; }
.lightbox { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.88); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; gap: 12px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 90px); object-fit: contain; background: #fff; border-radius: 6px; }
.lightbox .lb-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; color: #eee; font-size: 14px; }
.lightbox .lb-bar a { color: #fff; }
/* account */
form.stack { display: flex; flex-direction: column; gap: 10px; max-width: 420px; margin: 8px 0; }
form.stack input { font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
img.qr { width: 200px; height: 200px; image-rendering: pixelated; background: #fff; border-radius: 6px; margin: 8px 0; }
.rows { margin: 8px 0 14px; }
.rows .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
.tabs button { flex: 0 0 auto; }
/* studio v3: create, shows, characters */
.frame img, .frame video { display: block; width: 100%; height: auto; border-radius: 6px; }
.who-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
button.small, a.btn.small { padding: 6px 12px; font-size: 14px; }
.site-top { margin: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 4px; }
.site-top .brand { font-weight: 700; letter-spacing: .02em; }
textarea.idea { width: 100%; font: inherit; font-size: 18px; line-height: 1.45; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); resize: vertical; margin: 6px 0 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.row2 label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
select { font: inherit; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.req-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.pill.queued { color: var(--muted); } .pill.running { color: #b7791f; border-color: #b7791f; }
.pill.done { color: var(--ok); border-color: var(--ok); } .pill.failed { color: var(--no); border-color: var(--no); }
ol.log { font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--muted); margin: 8px 0; padding-left: 20px; }
section.season { margin-bottom: 24px; }
.episode figcaption { margin-top: 8px; font-size: 15px; color: var(--ink); word-break: normal; }
.reader { display: flex; flex-direction: column; gap: 28px; max-width: 960px; }
.strip-read img { display: block; width: 100%; height: auto; min-height: 120px; background: #fff; border: 1px solid var(--line); border-radius: 8px; cursor: zoom-in; }
.strip-read figcaption { margin: 0 0 8px; font-size: 16px; }
.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin: 8px 0 32px; }
.cast-card { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 10px; text-align: left; font-weight: 400; }
.cast-card b { font-size: 16px; }
.cast-img { aspect-ratio: 3 / 4; background: #fff; border-radius: 6px; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; }
.cast-img img { width: 100%; height: 100%; object-fit: contain; }
.cast-grid.poses .tile { aspect-ratio: 3 / 4; background: #fff; }
.cast-grid figcaption { font-size: 14px; color: var(--muted); margin-top: 4px; text-transform: capitalize; }
@media (max-width: 700px) {
  .row2 { grid-template-columns: 1fr; }
  .cast-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .topbar h1 { font-size: 30px; }
  .tabs button { padding: 8px 14px; }
}
[hidden] { display: none !important; }
p.field { margin: 10px 0 6px; font-size: 14px; color: var(--muted); }
.styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin-bottom: 10px; }
.style-card { display: flex; flex-direction: column; gap: 6px; padding: 6px 6px 8px; font-weight: 500; font-size: 14px; text-align: center; line-height: 1.25; }
.style-card img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 6px; object-fit: cover; background: #e8dcc6; }
.style-card.on { border: 2px solid var(--rule); background: var(--paper); box-shadow: 0 0 0 3px rgba(225,75,59,.18); }
input.other-style { width: 100%; font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); margin-bottom: 12px; }
@media (max-width: 700px) { .styles { grid-template-columns: repeat(3, 1fr); gap: 8px; } .style-card { font-size: 12px; } }
.add-row { margin: 0 0 18px; }
label.field input[type=file] { display: block; margin-top: 6px; font: inherit; }
/* needs you: requests stopped on questions, approvals */
h2.needs .count { font-size: 14px; }
.pill.question { color: var(--rule); border-color: var(--rule); font-weight: 600; }
.card.asks { border: 2px solid var(--rule); }
.card.request h4 { margin: 14px 0 8px; font-size: 16px; }
form.answers .why { color: var(--muted); font-style: italic; margin: 0 0 12px; }
label.qa { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
label.qa span { font-weight: 600; }
textarea.answer, input.text { width: 100%; font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
textarea.answer { resize: vertical; }
.qa-done { display: flex; flex-direction: column; margin: 8px 0 0; color: var(--ink); }
.qa-done span { color: var(--muted); }
/* the new-show wizard: one step per screen */
.wizard { padding-bottom: 0; }
.wiz-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.wiz-top .kicker { margin: 0; }
.wizard > h3 { font-size: 24px; margin: 4px 0 4px; }
.wizard textarea.idea.small { font-size: 16px; margin: 0; }
.wizard textarea.idea { margin: 0; }
ol.dots { display: flex; gap: 2px; list-style: none; padding: 0; margin: 10px 0 14px -6px; }
ol.dots button { width: 28px; height: 28px; padding: 0; border: 0; background: none; display: flex; align-items: center; justify-content: center; }
ol.dots button::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); box-sizing: content-box; }
ol.dots button.done::before { background: var(--muted); border-color: var(--muted); }
ol.dots button.on::before { background: var(--rule); border-color: var(--rule); width: 12px; height: 12px; }
ol.dots button[disabled] { opacity: 1; }
label.wiz-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; }
label.wiz-field > span { font-size: 14px; color: var(--muted); }
label.wiz-field input[type=file] { font: inherit; font-size: 15px; }
.wiz-nav { position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: 10px; margin: 18px -18px 0; padding: 12px 18px 14px; background: var(--card); border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
.wiz-nav button { min-width: 110px; }
.cast-list { display: flex; flex-direction: column; gap: 0; margin: 0 0 12px; }
.cast-row, .review-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.cast-row:last-child { border-bottom: 1px solid var(--line); }
.cast-row > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.cast-row .sub { margin: 0; font-size: 15px; }
.row-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.review-row p.desc { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.review-row > div { min-width: 0; }
.review-row button { flex: 0 0 auto; }
p.next-up { margin-top: 16px; }
form.char-form { border: 1px dashed var(--line); border-radius: 10px; padding: 14px; margin: 0 0 12px; background: var(--paper); }
form.char-form h4 { margin: 0 0 12px; }
form.char-form textarea.idea, form.char-form input.text { background: var(--card); }
details.bring-back { margin: 4px 0 12px; }
details.bring-back .chips { margin-top: 10px; }
@media (max-width: 700px) {
  .wizard > h3 { font-size: 21px; }
  .wiz-nav button { flex: 1 1 0; min-width: 0; }
  .cast-row { flex-direction: column; gap: 8px; }
}
@media (max-width: 700px) {
  /* four tabs fit a phone without scrolling */
  .tabs button { flex: 1 1 auto; padding: 8px 10px; font-size: 15px; }
}
.wiz-nav button { white-space: nowrap; padding: 10px 12px; }
details.bring-back p.field { margin: 12px 0 0; }
details.bring-back .chips { margin: 6px 0 0; }
.wizard { max-width: 780px; }
/* last updated, on every show card */
time.when { color: var(--muted); font-size: 14px; cursor: pointer; white-space: nowrap; }
time.when:focus-visible { outline: 2px solid var(--rule); outline-offset: 2px; border-radius: 4px; }
.cap-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.cap-row > div { min-width: 0; }
.cap-row button.edit { flex: 0 0 auto; }
.version .cap-row { margin-top: 6px; font-size: 14px; color: var(--muted); word-break: break-all; }
.strip-read time.when { margin-left: 6px; }
/* editing a video */
.edit-video { max-width: 720px; margin: 8px 0 18px; }
.edit-video .sub { color: var(--muted); font-size: 14px; margin: 6px 0 0; word-break: break-all; }
.edit-form { max-width: 820px; }
.edit-form h3.script-title { margin-top: 18px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.edit-form h3.script-title .sub { margin: 0; font-size: 14px; font-weight: 500; color: var(--rule); }
.script section.scene { margin: 0 0 16px; }
.script h4 { margin: 14px 0 6px; font-size: 15px; }
.script h4 .sub { font-weight: 400; font-size: 13px; color: var(--muted); }
.line-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 8px; align-items: start; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; }
.line-row .who { font-weight: 600; font-size: 14px; padding-top: 9px; }
.line-row textarea.line { width: 100%; font: inherit; font-size: 16px; line-height: 1.4; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); resize: vertical; }
.line-row.changed { background: rgba(225,75,59,.10); }
.line-row.changed textarea.line { border-color: var(--rule); }
.line-row button { margin-top: 4px; }
.sticky-send { position: sticky; bottom: 0; background: var(--card); padding: 12px 18px 14px; margin: 16px -18px -18px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
/* characters: the kit */
.cast-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cast-cell .cast-card { flex: 1 1 auto; }
button.kit-link { align-self: flex-start; border: 0; background: none; padding: 2px 4px; font-weight: 500; font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.detail-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.detail-head h2.gallery-title { margin-bottom: 8px; }
form.kit { margin-top: 8px; max-width: 760px; }
@media (max-width: 700px) {
  .line-row { grid-template-columns: 1fr auto; }
  .line-row .who { grid-column: 1 / -1; padding: 0; }
  .line-row button { margin-top: 2px; }
}
h2.edit-title { margin-top: 16px; }
.progress { margin: 6px 0 10px; }
.progress .bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress .bar span { display: block; height: 100%; background: var(--ok); border-radius: 999px; transition: width .4s; }
.progress .bar.busy span { width: 30%; background: #b7791f; animation: busy 1.6s ease-in-out infinite; }
@keyframes busy { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { .progress .bar.busy span { animation: none; width: 100%; opacity: .5; } }
.progress-meta { margin: 6px 0 0; }
.sub.progress-eta { margin: 2px 0 0; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
/* download and share, under every video */
.media-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.media-actions button[aria-expanded="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.save-panel { margin-top: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }
.save-panel .sub { color: var(--muted); }
.save-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin: 0 0 10px; }
.save-opt.row { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.save-opt .sub { margin: 0; font-size: 13px; word-break: break-all; }
.save-panel p.note, .save-panel p[role="status"] { font-size: 13px; margin: 0 0 8px; }
.save-panel p[role="status"]:empty { display: none; }
/* 16px: iPhone Safari zooms into any smaller field on focus */
.save-panel input.link { flex: 1 1 220px; width: auto; min-width: 0; font-size: 16px; padding: 6px 10px; }
button.title-link { all: unset; font-weight: 700; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
button.title-link:hover { text-decoration-color: var(--rule); }
button.title-link:focus-visible { outline: 3px solid var(--rule); outline-offset: 2px; border-radius: 4px; }
.watch-video { max-width: 960px; margin: 8px 0 18px; }
.watch-video video { max-height: 78vh; }
.watch-video > p.sub { color: var(--muted); font-size: 14px; margin: 8px 0 0; word-break: break-all; }
.version .media-actions { margin-top: 6px; }
/* channels: every show is one, YouTube-style */
.chan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 0 0 24px; }
button.chan-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left; font-weight: 400; border-radius: 10px; }
.chan-banner { aspect-ratio: 16 / 7; width: 100%; background: linear-gradient(135deg, var(--line), var(--paper)); overflow: hidden; }
.chan-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chan-card-body { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px 14px; min-width: 0; }
.chan-card-body > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chan-card-body b { font-size: 17px; }
.chan-card-body .sub { color: var(--muted); font-size: 14px; }
.chan-card-body .pill { align-self: flex-start; }
.avatar { width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto; object-fit: cover; background: var(--line); }
.avatar.letters { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; color: var(--paper); background: var(--ink); }
.avatar.big { width: 72px; height: 72px; font-size: 26px; }
.pill.priv { font-size: 12px; padding: 1px 8px; vertical-align: middle; }
.pill.priv.private { color: var(--muted); }
.pill.priv.invite { color: #b7791f; border-color: #b7791f; }
.pill.priv.subscribers { color: var(--ok); border-color: var(--ok); }
.chan-hero { aspect-ratio: 16 / 4; border-radius: 12px; overflow: hidden; margin: 12px 0 0; background: var(--line); }
.chan-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chan-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 16px 0 8px; }
.chan-head-text { flex: 1 1 200px; min-width: 0; }
.chan-head h2 { margin: 0; font-size: 28px; }
.chan-head .sub { color: var(--muted); margin: 2px 0 0; }
button.subscribed { background: var(--line); }
.chan-desc { max-width: 760px; margin: 0 0 16px; }
.chan-desc .desc-text, .watch-desc .desc-text { white-space: pre-wrap; margin: 0 0 8px; }
.chan-desc .sub { color: var(--muted); }
details.chan-settings { max-width: 820px; }
details.chan-settings > summary { cursor: pointer; font-weight: 600; }
form.stack.wide { max-width: none; }
form.stack.wide textarea.idea { margin: 0; }
.priv-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
button.priv-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; font-weight: 400; }
button.priv-choice .sub { font-size: 13px; color: var(--muted); margin: 0; }
button.priv-choice.on { border: 2px solid var(--rule); background: var(--paper); }
label.check { display: flex; gap: 8px; align-items: baseline; font-size: 15px; }
label.check .sub { color: var(--muted); font-size: 13px; }
form.invite-row { display: flex; gap: 8px; flex-wrap: wrap; }
form.invite-row input { flex: 1 1 220px; width: auto; font-size: 16px; }
/* publish state and views on each card */
button.pub-toggle { flex: 0 0 auto; border-style: dashed; color: var(--muted); }
button.pub-toggle.on { border-style: solid; border-color: var(--ok); color: var(--ok); }
figure.draft .tile { opacity: .72; }
.card-meta { color: var(--muted); font-size: 14px; }
.views { color: var(--muted); font-size: 14px; white-space: nowrap; }
.strip-read figcaption button.pub-toggle { margin-left: 6px; vertical-align: middle; }
/* a video's own page */
h2.watch-title { margin: 14px 0 6px; font-size: 22px; }
.watch-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 0 0 10px; }
.watch-row .sub { color: var(--muted); }
.watch-desc { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0 0 10px; }
.watch-desc .desc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.watch-desc .desc-meta { margin: 0 0 6px; font-weight: 600; font-size: 14px; }
.watch-desc .desc-meta .views, .watch-desc .desc-meta time.when { color: var(--ink); }
.watch-desc.folded .desc-text { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.watch-desc button.more-less { border: 0; background: none; padding: 0; font-size: 14px; }
@media (max-width: 700px) {
  .chan-grid { grid-template-columns: 1fr; }
  .chan-hero { aspect-ratio: 16 / 6; }
  .chan-head h2 { font-size: 23px; }
  .avatar.big { width: 56px; height: 56px; font-size: 20px; }
}

/* The passkey step: the whole screen until the account has one. */
.gate { max-width: 560px; margin: 8vh auto 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 28px 24px; box-shadow: var(--shadow); }
.gate h2 { margin: 0 0 18px; font-size: 26px; line-height: 1.2; letter-spacing: -.01em; }
.gate p { margin: 0 0 16px; }
.gate .sub { color: var(--muted); font-size: 15px; }
.gate .steps { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
.gate .steps li { display: flex; gap: 12px; align-items: center; }
.gate .steps li.done { color: var(--muted); }
.gate .tick { flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700; border: 2px solid var(--line); }
.gate .steps li.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.gate .steps li.now { font-weight: 600; }
.gate .steps li.now .tick { border-color: var(--ink); }
button.big { display: block; width: 100%; padding: 16px 18px; font-size: 18px; margin: 8px 0 14px; }
button.link { all: unset; cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
button.link:focus-visible { outline: 3px solid var(--rule); outline-offset: 2px; border-radius: 4px; }
@media (max-width: 480px) { .gate { margin-top: 12px; padding: 22px 18px; } .gate h2 { font-size: 22px; } }
/* characters: one card per person, their designs (variants) as a strip */
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin: 8px 0 32px; }
.person-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.person-card .cast-card { flex: 1 1 auto; }
.variant-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: thin; }
.variant-chip, .variant-more { flex: 0 0 auto; padding: 3px; border-radius: 8px; font-weight: 500; }
.variant-chip.on, .variant-tab.on { border: 2px solid var(--rule); box-shadow: 0 0 0 3px rgba(225,75,59,.15); }
.variant-thumb { width: 44px; aspect-ratio: 3 / 4; background: #fff; border-radius: 5px; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; }
.variant-thumb img { width: 100%; height: 100%; object-fit: contain; }
.variant-thumb .nothumb, .cast-img .nothumb { color: var(--muted); font-size: 11px; padding: 4px; text-align: center; align-self: center; }
.variant-more { font-size: 13px; padding: 0 10px; min-height: 44px; color: var(--muted); }
.variant-more.add { font-size: 20px; line-height: 1; }
.variant-tabs { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; margin: 6px 0 4px; }
.variant-tab { flex: 0 0 auto; width: 128px; display: flex; flex-direction: column; gap: 4px; padding: 6px; text-align: left; font-weight: 500; font-size: 14px; line-height: 1.25; }
.variant-tab .variant-thumb { width: 100%; }
.variant-tab small { color: var(--muted); font-weight: 400; font-size: 12px; }
details.demos { margin: 0 0 8px; }
details.demos summary { cursor: pointer; color: var(--muted); font-size: 15px; padding: 4px 0; }
.variant-panel { margin: 8px 0 20px; }
.variant-head { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: start; }
.variant-head h3 { margin: 0 0 6px; }
.variant-head .sub { margin: 0 0 6px; }
.variant-head code { font-size: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; word-break: break-all; }
.kit-status { margin: 10px 0 12px; }
.kit-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin-bottom: 6px; max-width: 420px; }
.kit-bar span { display: block; height: 100%; background: var(--ok); }
.kit-row { display: grid; grid-template-columns: 130px 1fr; gap: 8px; align-items: start; margin: 6px 0; }
.kit-title { font-size: 14px; color: var(--muted); padding-top: 2px; }
.kit-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.kit-chip { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px dashed var(--line); color: var(--muted); }
.kit-chip.have { border-style: solid; border-color: var(--ok); color: var(--ok); }
@media (max-width: 700px) {
  .person-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .variant-head { grid-template-columns: 1fr; }
  .variant-head .cast-img { max-width: 220px; }
  .kit-row { grid-template-columns: 1fr; gap: 2px; }
  .variant-tab { width: 104px; }
}
