/* Salty & Savage Production Truck: synthwave, taken from the show's channel art.
   Magenta = the "Savage" brush, cyan = the ampersand, chrome lavender = "Salty". */
:root {
  --night: #140833;
  --surface: #1f0c4d;
  --raised: #2b1466;
  --line: #3d2385;
  --line-soft: #2e1868;
  --text: #f1eaff;
  --muted: #a99bd9;
  --magenta: #ff2e97;
  --magenta-deep: #c4136f;
  --cyan: #33e1ed;
  --amber: #ffc34d;
  --red: #ff5c7a;
  --green: #5ef2b0;
  --glow-magenta: 0 0 18px rgb(255 46 151 / 45%);
  --glow-cyan: 0 0 0 2px rgb(51 225 237 / 85%), 0 0 14px rgb(51 225 237 / 40%);
  --display: 'Kanit', 'Arial Black', sans-serif;
  --ui: 'Barlow Semi Condensed', 'Arial Narrow', system-ui, sans-serif;
  --radius-sm: 4px;
  --radius: 8px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 400 16px/1.5 var(--ui);
  background:
    radial-gradient(ellipse 90% 420px at 50% -120px, rgb(255 46 151 / 22%), transparent 70%),
    radial-gradient(ellipse 60% 300px at 85% -60px, rgb(122 60 255 / 25%), transparent 70%),
    var(--night);
  background-attachment: fixed;
}
a { color: var(--cyan); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2 { font-family: var(--display); font-style: italic; font-weight: 700; letter-spacing: 0.01em; }
h1 { font-size: 2rem; line-height: 1.1; margin: 0.2em 0 0.5em; }
h2 { font-size: 1.2rem; line-height: 1.2; margin: 1.6em 0 0.6em; }
code { font-size: 0.9em; background: var(--raised); padding: 0.05em 0.35em; border-radius: var(--radius-sm); }
.muted, .sub { color: var(--muted); }
.sub { font-size: 0.9rem; }
.nowrap { white-space: nowrap; }
.count { color: var(--muted); font-family: var(--ui); font-style: normal; font-weight: 500; font-size: 0.8em; }
::selection { background: var(--magenta); color: #fff; }

/* The one loud thing: page titles get the "SALTY" chrome-and-neon treatment. */
.hero-title {
  font-family: var(--display);
  font-style: italic;
  font-weight: 900;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0.3rem 0 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #efe4ff 45%, #b99cff 62%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 1px rgb(255 46 151 / 90%)) drop-shadow(0 0 14px rgb(255 46 151 / 55%));
}

/* top bar with the neon horizon */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.55rem 1.25rem;
  background: rgb(20 8 51 / 88%);
  backdrop-filter: blur(8px);
}
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--magenta) 20%, #9b4dff 55%, var(--cyan) 85%, transparent);
  box-shadow: 0 0 12px rgb(255 46 151 / 60%);
}
.brand {
  display: flex; align-items: center; gap: 0.6rem; color: var(--text); text-decoration: none; white-space: nowrap;
  font-family: var(--display); font-style: italic; font-weight: 900; font-size: 1.15rem;
}
.brand img { border-radius: 50%; box-shadow: 0 0 0 2px var(--magenta), var(--glow-magenta); }
.topbar nav { display: flex; gap: 0.2rem; flex: 1; }
.topbar nav a, .who a {
  color: var(--muted); text-decoration: none; padding: 0.3rem 0.7rem; border-radius: var(--radius-sm); font-weight: 600;
}
.topbar nav a:hover, .who a:hover { color: var(--text); background: var(--surface); }
.topbar a.active { color: var(--text); background: var(--raised); box-shadow: inset 0 -2px 0 var(--magenta); }
.who { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; }
.who form { margin: 0; }
.role { color: var(--muted); font-size: 0.85rem; }

main { max-width: 1180px; margin: 0 auto; padding: 1.4rem 1.25rem 4rem; }
main.wide { max-width: 1680px; }

/* forms */
input, select, textarea, button {
  font: inherit; color: inherit; background: var(--raised); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 0.4rem 0.6rem;
}
input::placeholder, textarea::placeholder { color: #8677bd; }
textarea { width: 100%; resize: vertical; }
select option { background: var(--surface); color: var(--text); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: none; box-shadow: var(--glow-cyan);
}
button, .button {
  background: linear-gradient(180deg, var(--magenta), var(--magenta-deep));
  color: #fff; border: 1px solid var(--magenta); font-weight: 700; letter-spacing: 0.02em;
  cursor: pointer; text-decoration: none; display: inline-block; padding: 0.42rem 0.9rem; border-radius: var(--radius-sm);
}
button:hover, .button:hover { box-shadow: var(--glow-magenta); }
button.secondary, .button.secondary { background: transparent; color: var(--text); border-color: var(--line); }
button.secondary:hover, .button.secondary:hover { border-color: var(--cyan); box-shadow: none; color: var(--cyan); }
button.small { padding: 0.2rem 0.55rem; font-size: 0.88rem; }
button.link { background: none; border: none; color: var(--cyan); padding: 0 0.2rem; font-weight: 500; text-decoration: underline; letter-spacing: 0; }
button.link:hover { box-shadow: none; }
button.link.danger, button.icon.danger { color: var(--red); }
button.icon { background: transparent; color: var(--text); border-color: var(--line); padding: 0.1rem 0.5rem; font-weight: 500; }
button.icon:hover { border-color: var(--cyan); box-shadow: none; }
button:disabled { opacity: 0.35; cursor: default; box-shadow: none; }
label { display: block; font-weight: 600; font-size: 0.95rem; }
label > input, label > select, label > textarea { display: block; width: 100%; margin-top: 0.25rem; font-weight: 400; }
.stack { display: grid; gap: 0.85rem; }
.stack.narrow { max-width: 420px; }
.inline-form { display: inline-flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; margin: 0 0 1rem; }
.inline-form input[type=text] { min-width: 14rem; }
td .inline-form { margin: 0; }
.actions { display: flex; gap: 0.7rem; align-items: center; margin-top: 0.5rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem; }
legend { color: var(--muted); padding: 0 0.3rem; }
.facet-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.6rem; }
.edit-form { display: grid; gap: 0.9rem; max-width: 900px; }

/* flash / toast / one-time secret */
.flash { padding: 0.55rem 0.85rem; border-radius: var(--radius-sm); border: 1px solid; }
.flash.ok { color: var(--green); background: rgb(94 242 176 / 8%); }
.flash.error { color: var(--red); background: rgb(255 92 122 / 9%); }
.toast {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 50; padding: 0.7rem 1rem; border-radius: var(--radius);
  background: var(--magenta-deep); color: #fff; box-shadow: var(--glow-magenta); animation: toast 6s forwards;
}
@keyframes toast { 0%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
.secret { padding: 0.8rem 1rem; border: 2px dashed var(--amber); border-radius: var(--radius); margin: 0 0 1rem; }
.secret code { font-size: 1.15rem; user-select: all; color: var(--amber); }

/* badges */
.badge, .chip {
  display: inline-block; font-size: 0.82rem; font-weight: 600; padding: 0.05rem 0.55rem; border-radius: 999px;
  white-space: nowrap; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
}
.chip { color: var(--text); font-weight: 500; }
.badge.ver-verified { color: var(--cyan); border-color: rgb(51 225 237 / 55%); }
.badge.ver-strong { color: #b99cff; border-color: rgb(185 156 255 / 55%); }
.badge.ver-needs-verification { color: var(--amber); border-color: rgb(255 195 77 / 55%); }
.badge.fam-obscure { color: var(--cyan); }
.badge.fam-somewhat-known { color: var(--amber); }
.badge.fam-famous { color: var(--red); }
.badge.ep-published { color: var(--green); }
.badge.ep-recorded { color: var(--cyan); }
.badge.ep-planning { color: var(--muted); }
.badge.clear-cleared { color: var(--green); }
.badge.clear-do-not-use { color: var(--red); }
.badge.status-slotted { color: var(--magenta); border-color: var(--magenta); }
.badge.status-used { color: var(--green); }

/* board */
.filters {
  display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; margin-bottom: 0.7rem;
  padding: 0.65rem; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius);
}
.filters input[type=search] { flex: 1 1 18rem; }
.filters .reset { font-size: 0.95rem; }
#board-results > .count { margin: 0.2rem 0 0.45rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line-soft); }
th {
  font-size: 0.85rem; font-weight: 600; color: var(--muted); position: sticky; top: 0; background: var(--surface);
  border-bottom-color: var(--line);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgb(43 20 102 / 60%); }
td.num, th.num { text-align: center; font-variant-numeric: tabular-nums; }
td.num { font-family: var(--display); font-style: italic; font-weight: 700; }
td.r5 { color: var(--cyan); text-shadow: 0 0 10px rgb(51 225 237 / 45%); }
td.r4 { color: #8fe9f0; } td.r3 { color: #b99cff; } td.r2 { color: #ff8fbf; } td.r1 { color: var(--red); }
.board td.title { min-width: 16rem; max-width: 30rem; }
.board td.title a { color: var(--text); font-weight: 700; font-size: 1.02rem; text-decoration-color: var(--magenta); }
.board td.title a:hover { color: var(--cyan); }
.board td.mech { max-width: 16rem; font-size: 0.93rem; }
.board td.thumb { width: 64px; padding-right: 0; }
.board td.thumb img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); display: block; background: var(--raised); border: 1px solid var(--line); }
.board tr.row-rejected td { opacity: 0.5; }
.board tr.row-used td.title a { text-decoration: line-through; text-decoration-thickness: 1px; }
.empty { text-align: center; color: var(--muted); padding: 2rem; }
.status-select { font-size: 0.9rem; padding: 0.2rem 0.35rem; font-weight: 600; }
.status-shortlisted { border-color: var(--cyan); color: var(--cyan); }
.status-slotted { border-color: var(--magenta); color: #fff; background: rgb(255 46 151 / 22%); }
.status-used { border-color: var(--green); color: var(--green); }
.status-rejected { color: var(--muted); }
.status-hold { border-color: var(--amber); color: var(--amber); }
table.list { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); }

/* item page */
.crumbs { display: flex; gap: 1.1rem; font-size: 0.95rem; margin-bottom: 0.4rem; }
.item-head { padding: 0.2rem 0 1rem; border-bottom: 1px solid var(--line); }
.item-head .hero-title { margin-bottom: 0.4rem; }
.kicker { color: var(--muted); font-size: 0.9rem; }
.headline { font-size: 1.2rem; margin: 0 0 0.8rem; color: #ffd0e6; font-style: italic; }
.facets { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.8rem; }
.item-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.item-actions label { display: flex; gap: 0.45rem; align-items: center; }
.ratings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; margin: 1rem 0 0.2rem; }
.ratings div { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 0.45rem 0.7rem; }
.ratings dt { font-size: 0.85rem; color: var(--muted); }
.ratings dd { margin: 0; font-family: var(--display); font-style: italic; font-weight: 900; font-size: 1.7rem; line-height: 1.1; }
.ratings dd.r5 { color: var(--cyan); text-shadow: 0 0 12px rgb(51 225 237 / 50%); }
.ratings dd.r4 { color: #8fe9f0; } .ratings dd.r3 { color: #b99cff; } .ratings dd.r2 { color: #ff8fbf; } .ratings dd.r1 { color: var(--red); }
.item-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.4rem; margin-top: 1.2rem; align-items: start; }
.fields { margin: 0; display: grid; gap: 1rem; max-width: 76ch; }
.fields dt { font-family: var(--display); font-style: italic; font-weight: 700; font-size: 0.95rem; color: var(--muted); }
.fields dd { margin: 0.15rem 0 0; overflow-wrap: anywhere; }
/* the three fields that carry the segment get the magenta rail */
.field-what_happened, .field-why_funny, .field-second_reveal { padding-left: 0.9rem; border-left: 3px solid var(--magenta); }
.field-why_funny dt, .field-second_reveal dt { color: var(--magenta); }
.edited { font-family: var(--ui); font-style: normal; font-size: 0.75rem; color: var(--amber); }
.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 0.85rem 1rem; margin-bottom: 1rem; }
.panel h2 { margin-top: 0; }
.panel .sub { overflow-wrap: anywhere; }
.panel form { display: grid; gap: 0.45rem; }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.plain.big { font-size: 1.1rem; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.gallery.small { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gallery.small img { width: 100%; height: 120px; object-fit: contain; background: var(--raised); border-radius: var(--radius-sm); }
.image-card { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--night); }
.image-card img { width: 100%; height: 130px; object-fit: contain; display: block; }
.image-card figcaption { padding: 0.4rem 0.5rem; font-size: 0.8rem; display: grid; gap: 0.25rem; background: var(--raised); }
.image-card select { font-size: 0.8rem; padding: 0.1rem 0.25rem; }
.image-card .credit { color: var(--muted); overflow-wrap: anywhere; }
.image-card.clear-do_not_use img { opacity: 0.3; }
.image-card.clear-cleared { border-color: var(--green); }
.activity summary { cursor: pointer; font-family: var(--display); font-style: italic; font-weight: 700; }
.activity li { font-size: 0.88rem; }

/* comments */
.comment { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 0.65rem 0.95rem; margin-bottom: 0.6rem; max-width: 76ch; }
.comment.system { border-left: 3px solid var(--amber); }
.comment header { display: flex; gap: 0.5rem; align-items: baseline; font-size: 0.9rem; flex-wrap: wrap; }
.comment header time { color: var(--muted); }
.comment.editing { display: grid; gap: 0.45rem; }
.new-comment { display: grid; gap: 0.45rem; max-width: 76ch; }
.prose { overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0.2rem; }
.prose > :last-child { margin-bottom: 0.2rem; }
.prose table { font-size: 0.95rem; }
.report { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 1rem 1.7rem; max-width: 980px; }
.report h1 { font-weight: 900; }
.report table { display: block; overflow-x: auto; }

/* episodes: the rundown really is a sequence, so it gets numbers */
.rundown { padding: 0; list-style: none; counter-reset: slot; display: grid; gap: 0.6rem; margin: 0 0 1rem; }
.rundown > li {
  counter-increment: slot; position: relative;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 0.65rem 0.85rem 0.75rem 3rem;
}
.rundown > li::before {
  content: counter(slot); position: absolute; left: 0.85rem; top: 0.35rem;
  font-family: var(--display); font-style: italic; font-weight: 900; font-size: 1.6rem; color: var(--magenta);
  text-shadow: var(--glow-magenta);
}
.rundown > li.empty { padding-left: 0.85rem; }
.rundown > li.empty::before { content: none; }
.slot-head { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }
.slot-head a strong { color: var(--text); }
.slot-actions { margin-left: auto; display: inline-flex; gap: 0.25rem; }
.rundown input[name=note] { width: 100%; margin-top: 0.45rem; font-size: 0.95rem; }
.rundown .note { margin-top: 0.3rem; font-style: italic; }

/* login: the only place the synthwave floor grid appears */
body.login-page {
  background:
    linear-gradient(180deg, transparent 57.7%, rgb(255 46 151 / 70%) 58%, rgb(255 46 151 / 14%) 58.4%, transparent 80%),
    radial-gradient(ellipse 70% 50% at 50% 60%, rgb(255 46 151 / 25%), transparent 70%),
    var(--night);
}
body.login-page::before {
  content: ''; position: fixed; left: -50%; right: -50%; bottom: 0; height: 42vh; z-index: -1;
  background:
    repeating-linear-gradient(90deg, rgb(255 46 151 / 55%) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, rgb(255 46 151 / 55%) 0 1px, transparent 1px 44px);
  transform: perspective(360px) rotateX(62deg);
  transform-origin: bottom center;
  mask-image: linear-gradient(0deg, #000 10%, transparent 90%);
}
.login { max-width: 360px; margin: 9vh auto 0; text-align: center; }
.login img { border-radius: 50%; box-shadow: 0 0 0 3px var(--magenta), 0 0 40px rgb(255 46 151 / 55%); }
.login .hero-title { font-size: 2.6rem; margin-top: 1.2rem; }
.login form { text-align: left; background: rgb(31 12 77 / 85%); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }

/* printable rundown */
.printable .slot { break-inside: avoid; border-top: 1px solid var(--line); padding-top: 0.6rem; }
@media print {
  :root { --text: #000; --muted: #444; --line: #bbb; --line-soft: #ddd; --surface: #fff; --raised: #f3f3f3; color-scheme: light; }
  .topbar, .noprint { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .hero-title { background: none; color: #000; filter: none; -webkit-background-clip: initial; background-clip: initial; }
  main { max-width: none; padding: 0; }
  a { color: #000; }
}

@media (max-width: 900px) {
  .item-grid { grid-template-columns: 1fr; }
  .ratings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { flex-wrap: wrap; gap: 0.5rem 1rem; padding: 0.5rem 1rem; }
  .brand { font-size: 1rem; }
  .who .role { display: none; }
  main { padding: 1rem 1rem 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
}

/* Episode header = the show's VHS tape label: cassette shell, cream paper, dotted rules,
   hand lettering, red stripe with the air date, grey-green block with the episode number. */
.tape {
  max-width: 760px; margin: 0.4rem 0 1.6rem; padding: 18px 22px 22px;
  background:
    repeating-linear-gradient(0deg, rgb(255 255 255 / 3%) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, #25282b, #151719);
  border-radius: 14px;
  box-shadow: 0 0 0 1px #3a3e42, 0 18px 40px rgb(0 0 0 / 45%), 0 0 60px rgb(255 46 151 / 12%);
}
.tape-label {
  --paper: #efece2; --ink: #2f3133; --red: #e5264d; --slate: #8fa39b;
  position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 20%, rgb(255 255 255 / 55%), transparent 60%),
    var(--paper);
  color: var(--ink);
  border-radius: 6px;
  padding: 12px 18px 0;
  transform: rotate(-0.6deg);
}
.tape-top { display: flex; align-items: center; gap: 0.7rem; font: 700 0.8rem/1 var(--ui); }
.tape-master { background: var(--red); color: #fff; padding: 3px 8px 2px; letter-spacing: 0.04em; }
.tape-box { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); }
.tape-box::before {
  content: ''; width: 11px; height: 11px; border: 1.5px solid var(--ink); display: inline-block;
}
.tape-box.on::before {
  background:
    linear-gradient(45deg, transparent 43%, var(--red) 43% 57%, transparent 57%),
    linear-gradient(-45deg, transparent 43%, var(--red) 43% 57%, transparent 57%);
}
.tape-vhs {
  margin-left: auto; border: 1.5px solid #6d7275; color: #6d7275; padding: 1px 5px;
  font: italic 900 0.8rem/1 var(--display); letter-spacing: 0.03em;
}
.tape-show, .tape-title {
  font-family: 'Permanent Marker', var(--display); font-weight: 400; font-style: normal; margin: 0;
  background-image: radial-gradient(circle, #9a9a92 1px, transparent 1.3px);
  background-size: 9px 3px; background-repeat: repeat-x; background-position: 0 100%;
  padding-bottom: 4px;
}
.tape-amp { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 0.85em; }
.tape-show { font-size: clamp(1.8rem, 4.6vw, 2.9rem); line-height: 1.1; margin-top: 0.3rem; color: var(--ink); }
.tape-title { font-size: clamp(1.05rem, 2.6vw, 1.45rem); line-height: 1.3; color: var(--red); margin: 0.2rem 0 0.8rem; }
.tape-foot { display: grid; grid-template-columns: 1fr 1fr; margin: 0 -18px; }
.tape-stripe {
  background: var(--red); color: #fff; padding: 0.55rem 18px; font: 600 0.95rem/1.2 var(--ui);
}
.tape-brand {
  background: var(--slate); color: #f4f6f2; padding: 0.3rem 18px; text-align: right;
  font: italic 900 1.6rem/1 var(--display); letter-spacing: 0.02em;
}
@media print {
  .tape { box-shadow: none; background: none; padding: 0; }
  .tape-label { transform: none; border: 1px solid #999; }
}

/* segments: tab strip, header with bumper */
.segment-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0 0 0.8rem; }
.segment-tabs a {
  color: var(--muted); text-decoration: none; font-weight: 600; padding: 0.3rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--line-soft); display: inline-flex; gap: 0.45rem; align-items: baseline;
}
.segment-tabs a:hover { color: var(--text); border-color: var(--line); }
.segment-tabs a.active { color: #fff; border-color: var(--magenta); background: rgb(255 46 151 / 16%); }
.tab-count { font-size: 0.8em; color: var(--muted); font-variant-numeric: tabular-nums; }
.segment-tabs a.active .tab-count { color: #ffc2de; }
.segment-head { display: flex; gap: 1.5rem; align-items: flex-start; justify-content: space-between; margin-bottom: 1rem; }
.segment-head .hero-title { margin-bottom: 0.3rem; }
.bumper { margin: 0; width: 300px; flex: none; }
.bumper video { width: 100%; aspect-ratio: 16 / 9; display: block; background: #000; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.bumper figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; }
.templates { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.templates .bumper { width: 240px; }
.section-title { font-size: 1.4rem; margin-top: 1.8rem; }
.add-item summary { cursor: pointer; font-family: var(--display); font-style: italic; font-weight: 700; color: var(--magenta); }
.add-item[open] summary { margin-bottom: 0.7rem; }
.add-item form { max-width: 640px; }
.empty-state { padding: 1.4rem; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
.warn { color: var(--amber); }
.big-num { font-family: var(--display); font-style: italic; font-weight: 900; font-size: 1.6rem; color: var(--cyan); }

/* home */
.home-next { margin: 0.4rem 0 1rem; }
.home-next-grid { display: grid; grid-template-columns: minmax(0, 760px) minmax(220px, 1fr); gap: 1.6rem; align-items: center; }
.tape-link { display: block; text-decoration: none; color: inherit; border-radius: 14px; }
.tape-link .tape { margin: 0; transition: transform 0.2s ease; }
.tape-link:hover .tape { transform: translateY(-2px) rotate(-0.4deg); }
.next-facts h2 { margin-top: 0; font-size: 1.5rem; }
.facts { margin: 0 0 1rem; display: grid; gap: 0.5rem; }
.facts dt { color: var(--muted); font-size: 0.9rem; }
.facts dd { margin: 0; font-weight: 600; }
.segment-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.segment-card a { display: block; position: relative; text-decoration: none; color: var(--text); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.segment-card img, .segment-card .no-poster { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--raised); }
.segment-card a:hover { border-color: var(--magenta); box-shadow: var(--glow-magenta); }
.segment-name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1.6rem 0.8rem 0.55rem;
  background: linear-gradient(180deg, transparent, rgb(20 8 51 / 92%) 60%);
  font-family: var(--display); font-style: italic; font-weight: 900; font-size: 1.25rem; line-height: 1.1;
}
.segment-stats { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; margin: 0.45rem 0.1rem 0; font-size: 0.92rem; color: var(--muted); }
.segment-stats strong { color: var(--text); }
.segment-stats .slotted strong { color: var(--magenta); }
.home-lower { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-top: 1.6rem; }
.home-lower h2 a { color: var(--text); text-decoration: none; }
.home-lower h2 a:hover { color: var(--cyan); }

/* intros board */
.seg-control { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg-control label { font-weight: 600; padding: 0.35rem 0.75rem; cursor: pointer; color: var(--muted); display: inline-flex; gap: 0.35rem; align-items: baseline; }
.seg-control label + label { border-left: 1px solid var(--line); }
.seg-control label.on, .seg-control label:has(input:checked) { background: rgb(255 46 151 / 18%); color: #fff; }
.seg-control input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-control label:has(input:focus-visible) { box-shadow: var(--glow-cyan); }
.tape-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.tape-card > a { display: block; position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.tape-card img, .tape-card .no-poster { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--raised); }
.tape-card > a:hover { border-color: var(--cyan); }
.tape-card.status-slotted > a { border-color: var(--magenta); box-shadow: var(--glow-magenta); }
.tape-card.status-used img { filter: saturate(0.45) brightness(0.8); }
.tape-num {
  position: absolute; top: 0.4rem; left: 0.4rem; padding: 0.05rem 0.45rem; border-radius: var(--radius-sm);
  background: rgb(20 8 51 / 85%); font: italic 900 1rem/1.3 var(--display); color: var(--cyan);
}
.tape-meta { display: grid; gap: 0.3rem; padding: 0.45rem 0.1rem 0; }
.tape-card-title { color: var(--text); font-weight: 700; text-decoration: none; line-height: 1.25; }
.tape-card-title:hover { color: var(--cyan); }
.slot-ep { font-size: 0.9rem; margin-left: 0.3rem; }
.outro-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--line-soft); }

/* episode intro/outro slots */
.slots { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; max-width: 1180px; margin: -0.4rem 0 0.6rem; }
.slot { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 0.8rem 1rem; }
.slot h2 { margin-top: 0; }
.slot-still { display: flex; gap: 0.8rem; align-items: center; color: var(--text); text-decoration: none; font-weight: 600; margin-bottom: 0.6rem; }
.slot-still img { width: 200px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--magenta); }
.slot-picker select { width: 100%; }

/* item kinds */
.intro-video { width: 100%; max-width: 76ch; aspect-ratio: 16 / 9; display: block; background: #000; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 1.2rem; }
.note-body { max-width: 76ch; font-size: 1.05rem; }
.links { padding-left: 1.2rem; max-width: 76ch; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .segment-head { flex-direction: column; }
  .bumper, .templates .bumper { width: 100%; max-width: 420px; }
  .home-next-grid, .slots { grid-template-columns: 1fr; }
  .slot-still img { width: 140px; }
}

/* transcripts */
.transcript-search { margin-bottom: 1rem; }
.transcript-search input[type=search] { flex: 1 1 22rem; }
.hits { margin-bottom: 1.6rem; }
.hit-list { gap: 0.5rem; max-width: 90ch; }
.hit-list li { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 0.55rem 0.85rem; }
.hit-head { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: baseline; font-weight: 600; }
.hit-text { margin: 0.25rem 0 0; color: #d9d0f5; }
mark { background: rgb(255 46 151 / 30%); color: #fff; border-radius: 2px; padding: 0 0.1em; }
.yt-line { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; margin: -0.6rem 0 1.2rem; }
.transcript { margin-top: 1.4rem; max-width: 1180px; }
.transcript summary { cursor: pointer; font-family: var(--display); font-style: italic; font-weight: 700; font-size: 1.15rem; }
.transcript-body { max-height: 70vh; overflow-y: auto; padding-right: 0.6rem; max-width: 90ch; }
.transcript-body p { margin: 0 0 0.7rem; }
.transcript-body p:target { background: rgb(255 46 151 / 14%); border-radius: var(--radius-sm); }
.ts { font-family: var(--display); font-style: italic; font-weight: 700; font-size: 0.88rem; margin-right: 0.35rem; text-decoration: none; }

/* YouTube embeds */
.episode-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 1.4rem; align-items: start; margin-bottom: 1rem; }
.episode-hero .tape { margin: 0.4rem 0 0; }
.yt-embed { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #000; box-shadow: 0 0 40px rgb(255 46 151 / 14%); }
.yt-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.episode-video .yt-line { margin: 0.5rem 0 0; }
td.yt-thumb { width: 96px; padding-right: 0; }
td.yt-thumb img { width: 96px; height: 54px; object-fit: cover; display: block; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--raised); }
@media (max-width: 1100px) { .episode-hero { grid-template-columns: 1fr; } }
