:root {
  --topbar-h: 56px;
  --bg: #f6f3ec;
  --surface: #ffffff;
  --surface-2: #f0ece2;
  --text: #1f2a2e;
  --muted: #66716f;
  --line: #e2ddd0;
  --brand: #1f6f6b;
  --brand-ink: #ffffff;
  --accent: #f6c453;
  --danger: #b3261e;
  --ok: #2e7d4f;
  --warn: #9a6200;
  --whatsapp: #128c4a;
  --heat-rgb: 31, 111, 107;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 8px rgba(0, 0, 0, 0.04);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141a1b;
    --surface: #1c2425;
    --surface-2: #243032;
    --text: #e8ecea;
    --muted: #9aa6a3;
    --line: #2f3c3e;
    --brand: #4fb3a9;
    --brand-ink: #0d1516;
    --danger: #ff8a80;
    --ok: #7fd49d;
    --warn: #f0b860;
    --whatsapp: #4cd38a;
    --heat-rgb: 79, 179, 169;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--brand); }
h1, h2 { line-height: 1.2; margin: 0 0 0.5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }

/* --- layout ---------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.6rem 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; }
.topbar nav { display: flex; gap: 0.25rem; }
.topbar nav a { padding: 0.4rem 0.7rem; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; }
.topbar nav a.active { background: var(--surface-2); color: var(--text); }
@media (max-width: 420px) { .brand { font-size: 0; gap: 0; } }

.page { max-width: 760px; margin: 0 auto; padding: 1rem 16px 3rem; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.crumb { margin: 0 0 0.5rem; }
.crumb a { text-decoration: none; color: var(--muted); }
.hello { margin-bottom: 1rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.card-head a { text-decoration: none; font-size: 0.9rem; }
.callout { border-left: 4px solid var(--accent); }
.callout.ok { border-left-color: var(--ok); }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.empty { text-align: center; padding: 2rem 0; }
.error { color: var(--danger); }
.meta { color: var(--muted); font-size: 0.9rem; margin: 0; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0.75rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

ul.plain, ol.windows { list-style: none; margin: 0; padding: 0; }

/* --- controls -------------------------------------------------------------- */
.btn, input, select, textarea { font: inherit; color: inherit; }
.btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-2); color: var(--text);
  text-decoration: none; font-weight: 600; cursor: pointer;
  min-height: 40px;
}
.btn.small { padding: 0.3rem 0.75rem; font-size: 0.875rem; min-height: 34px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.danger { color: var(--danger); }
.btn.whatsapp { color: var(--whatsapp); border-color: currentColor; background: transparent; }
.link-btn { background: none; border: 0; padding: 0.25rem; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 0.85rem; }
.link-btn.danger { color: var(--danger); }
summary { list-style: none; cursor: pointer; width: fit-content; }
summary::-webkit-details-marker { display: none; }
details[open] > summary { margin-bottom: 0.75rem; }
details { margin-top: 0.75rem; }

input:not([type=checkbox]), select, textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg);
}
textarea { resize: vertical; }
label { display: block; font-weight: 600; font-size: 0.9rem; }
label > input, label > select, label > textarea { margin-top: 0.25rem; font-weight: 400; }
label.check { display: flex; gap: 0.5rem; align-items: center; font-weight: 400; }
.stack { display: grid; gap: 0.75rem; }
.stack > .btn { justify-self: start; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end; }
.row > label { flex: 1 1 140px; }
form.inline { display: inline; }
.actions details { margin-top: 0; }
.actions details[open] { flex-basis: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }
.footer-actions { display: flex; gap: 1rem; justify-content: center; margin-top: 1rem; }

.toolbar { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.toolbar input { flex: 1; }
.toolbar select { width: auto; }

.tabs { display: flex; gap: 0.35rem; overflow-x: auto; padding-bottom: 0.5rem; margin-bottom: 0.25rem; scrollbar-width: none; }
.tabs a { white-space: nowrap; padding: 0.3rem 0.75rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: 0.875rem; background: var(--surface); }
.tabs a span { opacity: 0.7; margin-left: 0.15rem; }
.tabs a.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.pill { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.pill.ok, .status-publicado, .status-gravado { color: var(--ok); }
.pill.warn, .status-agendado { color: var(--warn); }
.status-pauta { color: var(--brand); }
.status-descartado { text-decoration: line-through; }

/* --- themes ---------------------------------------------------------------- */
.theme-list.card { padding: 0.25rem 0.75rem; }
.theme-row { display: flex; gap: 0.75rem; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.theme-row:last-child { border-bottom: 0; }
.theme-main { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.theme-title { display: block; font-weight: 600; overflow-wrap: anywhere; }
.theme-main .meta { font-size: 0.8rem; }
.vote-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 44px; height: 48px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
  cursor: pointer; font: inherit; line-height: 1.1;
}
.vote-btn .arrow { font-size: 0.7rem; }
.vote-btn .count { font-weight: 700; color: var(--text); }
.vote-btn.on { background: var(--accent); border-color: var(--accent); color: #1f2a2e; }
.vote-btn.on .count { color: #1f2a2e; }
.vote-btn.big { width: 56px; height: 60px; font-size: 1.1rem; }
.theme-head { display: flex; gap: 1rem; align-items: flex-start; }
.links { padding-left: 1.2rem; overflow-wrap: anywhere; }
.comments li { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.comments li .prose { margin: 0.25rem 0 0; }
.comment-head { display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; }
.comments + form { margin-top: 0.75rem; }

/* --- agenda ---------------------------------------------------------------- */
.recordings > li, .polls > li { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.recordings > li:last-child, .polls > li:last-child { border-bottom: 0; }
.recordings .when { font-weight: 700; margin-right: 0.5rem; }
.recording .actions { margin-top: 0.4rem; }
.past { opacity: 0.75; }
.polls li { display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; align-items: baseline; }

.who { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.chip { font-size: 0.8rem; padding: 0.1rem 0.55rem; border-radius: 999px; border: 1px solid var(--line); }
.chip.done { color: var(--ok); border-color: currentColor; }
.chip.todo { color: var(--muted); border-style: dashed; }

.mode-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); margin-bottom: 0.5rem; }
.mode-switch button { border: 0; background: none; padding: 0.4rem 0.9rem; border-radius: 999px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.mode-switch button[aria-selected=true] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.hint { margin: 0 0 0.75rem; font-size: 0.9rem; }

.grid-wrap { overflow-x: auto; margin: 0 -0.25rem; }
.slot-grid { width: 100%; border-collapse: separate; border-spacing: 2px 0; margin: 0 auto; user-select: none; -webkit-user-select: none; }
.slot-grid thead th { font-size: 0.7rem; font-weight: 600; color: var(--muted); padding-bottom: 0.35rem; text-transform: capitalize; }
.slot-grid thead th span { color: var(--text); font-size: 0.85rem; }
.slot-grid tbody th { font-size: 0.75rem; font-weight: 500; color: var(--muted); text-align: right; padding-right: 0.35rem; vertical-align: top; line-height: 1; transform: translateY(-0.35em); white-space: nowrap; }
.slot-grid td {
  min-width: 32px; height: 26px;
  background: var(--surface-2);
  border-top: 1px dashed var(--line);
  cursor: pointer;
  position: relative;
}
.slot-grid tr.hour td { border-top: 1px solid var(--line); }
.slot-grid[data-mode=me] td { touch-action: none; }
.slot-grid[data-mode=me] td.mine { background: var(--brand); }
.slot-grid[data-mode=me] td.mine + td.mine { box-shadow: none; }
.slot-grid[data-mode=group] td { background: rgba(var(--heat-rgb), calc(0.08 + var(--heat) * 0.92)); }
.slot-grid[data-mode=group] td[data-n="0"] { background: var(--surface-2); }
.slot-grid[data-mode=group] td.mine::after { content: ""; position: absolute; inset: 40% auto auto 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.slot-grid td.focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.who-at { min-height: 1.5em; font-size: 0.9rem; margin: 0.5rem 0 0; }
.save-row { justify-content: space-between; align-items: center; margin-top: 0.5rem; }

.windows li { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.windows li:last-child { border-bottom: 0; }

/* --- members / login --------------------------------------------------------- */
.members > li { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.members > li:last-child { border-bottom: 0; }
.member-head { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.login { max-width: 420px; margin: 4rem auto; text-align: center; }
.login .left { text-align: left; margin-top: 1rem; }
.btn.block { width: 100%; justify-content: center; }
.callout.error { border-left-color: var(--danger); color: var(--danger); }
.credentials { font-size: 1.05rem; line-height: 1.8; }
.credentials code { background: var(--surface-2); padding: 0.1rem 0.4rem; border-radius: 6px; user-select: all; }

/* --- episodes board ---------------------------------------------------------- */
.page.wide { max-width: 1400px; }
.page.wide .narrow { max-width: 760px; margin: 1.5rem auto 0; }
.actions.tight { margin-top: 0; }
.toolbar { flex-wrap: wrap; align-items: center; }
.toolbar .mode-switch { margin-bottom: 0; }
.mode-switch a { padding: 0.4rem 0.9rem; border-radius: 999px; font-weight: 600; color: var(--muted); text-decoration: none; }
.mode-switch a[aria-selected=true] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(215px, 1fr);
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
}
@media (max-width: 700px) {
  .board { grid-auto-columns: 82%; margin: 0 -16px; padding: 0 16px 0.75rem; scroll-padding: 0 16px; }
}
.column {
  scroll-snap-align: start;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 0.6rem;
  min-height: 160px;
  display: flex; flex-direction: column;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}
.column.drop-target { border-color: var(--brand); }
.column-head { display: flex; align-items: center; justify-content: space-between; padding: 0.2rem 0.3rem 0.6rem; }
.column-head h2 { font-size: 0.95rem; margin: 0; }
.column-head .count { font-size: 0.8rem; font-weight: 700; color: var(--muted); background: var(--surface); border-radius: 999px; padding: 0 0.5rem; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; align-content: start; flex: 1; }
.empty-col { text-align: center; margin: 1rem 0; }

.ep-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  box-shadow: var(--shadow);
  display: grid; gap: 0.4rem;
  cursor: grab;
}
.ep-card { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.ep-card.dragging { opacity: 0.35; }
.ep-card.ghost { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; box-shadow: 0 10px 30px rgba(0,0,0,0.25); cursor: grabbing; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }
.ep-card.saving { opacity: 0.7; }
.ep-title { font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; line-height: 1.3; }
.ep-title:hover { text-decoration: underline; }
.ep-num { color: var(--muted); font-weight: 700; margin-right: 0.35rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.chip.seg { font-size: 0.72rem; padding: 0.05rem 0.5rem; background: var(--surface-2); border-color: transparent; color: var(--text); }
.people { display: flex; align-items: center; gap: 0.15rem; min-width: 0; }
.avatar {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: inline-grid; place-items: center;
  font-size: 0.7rem; font-weight: 700;
  background: var(--brand); color: var(--brand-ink);
  border: 2px solid var(--surface); margin-left: -6px;
}
.avatar:first-child { margin-left: 0; }
img.avatar { object-fit: cover; background: var(--surface-2); padding: 0; }
.avatar.md { width: 36px; height: 36px; font-size: 0.9rem; margin-left: 0; }
.avatar.xl { width: 96px; height: 96px; font-size: 2rem; margin-left: 0; border-width: 3px; }
.photo-pick { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.photo-pick label.btn { cursor: pointer; }
.photo-nudge { display: flex; align-items: center; gap: 0.75rem; }
.photo-nudge p { margin: 0; }
.member-head .avatar { margin-right: 0.25rem; }
.tour-skip .avatar { vertical-align: middle; margin-left: 0; }
.facts .people { display: inline-flex; flex-wrap: wrap; }
.people .names { margin-left: 0.35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-foot { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.vote-chip { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 0.05rem 0.55rem; font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.vote-chip.on { background: var(--accent); border-color: var(--accent); color: #1f2a2e; }
.listen { font-size: 0.8rem; font-weight: 700; text-decoration: none; }
.board-foot { margin: 0.25rem 0 0; }

/* --- episode page ------------------------------------------------------------ */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0.75rem 0; }
.facts dt { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.facts dd { margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.8rem 0.8rem; margin: 0; }
legend { font-weight: 600; font-size: 0.9rem; padding: 0 0.3rem; }
legend a { font-weight: 400; margin-left: 0.5rem; }
.checks { display: flex; flex-wrap: wrap; gap: 0.4rem; }
label.check.pick { border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.75rem; cursor: pointer; background: var(--bg); }
label.check.pick:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--surface)); }
.row > label.grow, .grow { flex: 3 1 220px; }
.row > label.num { flex: 0 0 80px; }

/* --- segments ---------------------------------------------------------------- */
.segments > li { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.segments > li:last-child { border-bottom: 0; }
.seg-row { display: flex; align-items: center; gap: 0.75rem; }
.seg-order { display: flex; flex-direction: column; }
.icon-btn { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 0.7rem; padding: 0.1rem 0.3rem; line-height: 1; }
.icon-btn:disabled { opacity: 0.3; cursor: default; }

/* --- games & logo ------------------------------------------------------------ */
img.logo { object-fit: cover; border-radius: 22%; }
.logo-preview { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.logo-preview p { margin: 0 0 0.25rem; }
.game-list > li { padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.game-list > li:last-child { border-bottom: 0; }
.game-item { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.game-row { display: flex; gap: 0.75rem; align-items: center; color: inherit; text-decoration: none; min-width: 0; }
a.game-row:hover strong { text-decoration: underline; }
.game-row img, .thumb-ph { flex: none; width: 48px; height: 48px; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.results .game-row img, .results .thumb-ph { width: 40px; height: 40px; }
.game-search { margin: 0.75rem 0 0.25rem; }
.game-head { display: flex; gap: 1rem; align-items: flex-start; }
.game-head .cover { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; flex: none; }
.small-h { font-size: 0.85rem; color: var(--muted); margin: 0.9rem 0 0.35rem; }
.game-thumbs { display: flex; align-items: center; gap: 0.2rem; min-width: 0; }
.game-thumbs img { width: 28px; height: 28px; object-fit: cover; border-radius: 5px; flex: none; }
.game-thumbs .names { margin-left: 0.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pager { margin-top: 0.75rem; }
.add-to { margin-top: 0.75rem; }
.in-episodes { margin: 0.3rem 0 0 calc(48px + 0.75rem); line-height: 1.6; }
.toolbar select { max-width: 100%; min-width: 0; }

/* --- tutorial ---------------------------------------------------------------- */
.tour { max-width: 520px; margin: 1rem auto; text-align: center; }
.tour-steps { list-style: none; margin: 0; padding: 0; }
.tour:not(.stepping) .tour-step + .tour-step { border-top: 1px solid var(--line); margin-top: 1.25rem; padding-top: 1.25rem; }
.tour.stepping .tour-step { min-height: 300px; }
.tour-step p { margin: 0.5rem 0; }
.tour-art { min-height: 84px; display: flex; align-items: center; justify-content: center; gap: 0.3rem; margin: 0.5rem 0 1rem; font-size: 3rem; }
.mini-board { display: flex; gap: 4px; font-size: 0.62rem; font-weight: 700; }
.mini-board span { background: var(--surface-2); border-radius: 6px; padding: 0.4rem 0.35rem 1.8rem; color: var(--muted); }
.mini-grid { display: grid; grid-template-columns: repeat(4, 22px); gap: 3px; }
.mini-grid span { height: 16px; background: var(--surface-2); border-radius: 3px; }
.mini-grid span.on { background: var(--brand); }
.vote-chip.big { font-size: 1.2rem; padding: 0.2rem 0.9rem; }
.tour-art .avatar { width: 30px; height: 30px; font-size: 0.85rem; }
.tour-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
.tour:not(.stepping) .tour-nav { justify-content: center; }
.tour-dots { display: flex; gap: 6px; }
.tour-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.tour-dots span.on { background: var(--brand); }
.tour-skip { margin-top: 0.5rem; }

/* Jogos: the search stays under the header while the results scroll */
.games-search {
  position: sticky; top: var(--topbar-h); z-index: 4;
  background: var(--bg);
  margin: 0 -16px; padding: 0.5rem 16px 0.6rem;
  border-bottom: 1px solid var(--line);
}
.games-search .toolbar { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 0.4rem; }
.games-search .toolbar select { grid-column: 1 / -1; grid-row: 2; }
@media (min-width: 700px) {
  .games-search .toolbar { grid-template-columns: 1fr 260px auto; }
  .games-search .toolbar select { grid-column: auto; grid-row: auto; }
}
.games-search .btn { min-height: 0; }
.games-search + .search-hint { margin: 0.5rem 0 0; }
.search-hint + * { margin-top: 0.75rem; }

/* --- episode page ------------------------------------------------------------ */
.page.mid { max-width: 1000px; }
.ep-head { margin-bottom: 0.75rem; }
.ep-head h1 { font-size: 1.6rem; margin: 0.35rem 0 0.25rem; overflow-wrap: anywhere; }
.ep-head .actions { margin-top: 0.6rem; }
.status-select {
  width: auto; padding: 0.15rem 1.6rem 0.15rem 0.6rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700; background-color: var(--surface-2); border-color: transparent;
}
.vote-chip.big-chip { font-size: 0.875rem; padding: 0.3rem 0.8rem; min-height: 34px; }
.ep-tabs { display: flex; gap: 0.25rem; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 1rem; scrollbar-width: none; }
.ep-tabs a {
  white-space: nowrap; padding: 0.55rem 0.8rem; color: var(--muted); text-decoration: none; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.ep-tabs a.active { color: var(--text); border-bottom-color: var(--brand); }
.ep-tabs a span { font-size: 0.75rem; background: var(--surface-2); border-radius: 999px; padding: 0 0.4rem; margin-left: 0.15rem; }
.ep-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.ep-grid > .card { margin-bottom: 0; }
@media (min-width: 820px) { .ep-grid { grid-template-columns: 3fr 2fr; align-items: start; } }
.details .facts { grid-template-columns: 7.5rem 1fr; margin: 0; }
.details .facts dd { align-items: baseline; }
.details .facts dd a.muted { color: var(--muted); }

.script-card { padding: 0.75rem 1rem 1rem; }
.script-bar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.script-bar .btn { margin-left: auto; }
.presence { color: var(--warn); font-weight: 600; }
textarea.script {
  font: 1rem/1.65 ui-serif, Georgia, "Times New Roman", serif;
  padding: 1rem 1.1rem; min-height: 55vh; resize: none; background: var(--surface);
}
.revisions > li { padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.rev-head { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
.rev-text { white-space: pre-wrap; font: 0.85rem/1.5 ui-serif, Georgia, serif; background: var(--surface-2); padding: 0.75rem; border-radius: 8px; max-height: 300px; overflow: auto; }

.timeline > li { display: grid; grid-template-columns: auto 1fr auto; gap: 0.6rem; align-items: center; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.timeline > li:last-child { border-bottom: 0; }
.timeline .avatar { margin-left: 0; width: 28px; height: 28px; font-size: 0.8rem; }
.timeline time { white-space: nowrap; }
.form-foot { margin-top: 0.25rem; }
ol.timeline { list-style: none; margin: 0; padding: 0; }
@media (max-width: 500px) {
  .ep-tabs a { padding: 0.5rem 0.5rem; font-size: 0.9rem; }
}
.facts .people .names { white-space: normal; }
