/* 7TV Casting Office. Palette taken from the 2e profile card types.
   Light mode is the default; html[data-theme="dark"] switches every token. */
:root {
  --star: #b8282f;
  --star-band: #9e2b2b;
  --costar: #1475bc;
  --tape: #e5a612;       /* Extra gold, used like gaffer tape */
  --vehicle: #90278f;
  --ink: #231f20;
  --paper: #d6d7d9;
  --radius: 10px;
  --head: 'League Gothic', 'Oswald', 'Arial Narrow', sans-serif;
  --num: 'Anton', 'League Gothic', sans-serif;
  /* UI text uses the system sans for readability; the card itself keeps its own fonts */
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --bg: #e4e5e7;
  --topbar: #ffffff;
  --surface: #ffffff;
  --field: #f2f3f4;
  --text: #231f20;
  --text-2: #464b51;
  --strong: #15171a;
  --muted: #687077;
  --line: #cfd2d6;
  --line-hover: #8e959c;
  --seg-on-bg: #231f20;
  --seg-on-text: #ffffff;
  --danger: #b8282f;
  --gold-text: #8f6400;
  --code-bg: rgba(0,0,0,0.06);
  --shadow: 0 1px 2px rgba(0,0,0,0.06);
  --stage-bg: #ffffff;
  --stage-border: #d5d8db;
  --stage-cap: #3d4247;
  --stage-hint: #5d646b;
  --card-shadow: 0 8px 22px rgba(0,0,0,0.22);
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #1a1c1f;
  --topbar: #24272b;
  --surface: #24272b;
  --field: #1d2023;
  --text: #e7e8e9;
  --text-2: #c3c6c9;
  --strong: #ffffff;
  --muted: #8b9096;
  --line: #3b4045;
  --line-hover: #6b7177;
  --seg-on-bg: #d6d7d9;
  --seg-on-text: #231f20;
  --danger: #ff8b8b;
  --gold-text: #e5a612;
  --code-bg: rgba(255,255,255,0.08);
  --shadow: none;
  --stage-bg: radial-gradient(ellipse 60% 55% at 50% 38%, rgba(255,246,220,0.16), transparent 70%), linear-gradient(#16181b, #0e0f11);
  --stage-border: #000;
  --stage-cap: #c3c6c9;
  --stage-hint: #8b9096;
  --card-shadow: 0 18px 40px rgba(0,0,0,0.6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); font: 16px/1.5 var(--body); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--head); font-weight: 400; letter-spacing: 0.01em; margin: 0; line-height: 1; color: var(--strong); }
h2 { font-size: 28px; }
code { background: var(--code-bg); padding: 0 4px; border-radius: 3px; font-size: 0.95em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--tape); outline-offset: 2px; }

/* top bar */
.topbar {
  display: flex; align-items: center; gap: 20px; padding: 10px 20px;
  background: var(--topbar); border-bottom: 4px solid var(--star-band);
  position: sticky; top: 0; z-index: 20; box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand h1 { font-size: 40px; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.brand-mark { width: 46px; height: 46px; flex: none; }
.brand-mark .bm-disc { fill: #1b1d20; stroke: var(--star-band); stroke-width: 5; }
.brand-mark .bm-ant { fill: none; stroke: var(--star-band); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark .bm-tv { fill: var(--star-band); }
.brand-mark .bm-scr { fill: #1b1d20; }
.tabs { display: flex; gap: 4px; }
.tab { background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--text-2); font: 600 16px var(--body); border-bottom: 3px solid transparent; white-space: nowrap; }
/* nine tabs: below this width the tabs take their own row under the brand */
@media (max-width: 1480px) and (min-width: 641px) {
  .topbar { flex-wrap: wrap; row-gap: 4px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tab { padding: 8px 12px; }
}
.tab.is-active { color: var(--strong); border-bottom-color: var(--tape); }
.count { font: 400 14px var(--body); color: var(--muted); }
.theme-btn { min-width: 112px; justify-content: center; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border-radius: 6px; padding: 7px 14px; border: 2px solid transparent; font-weight: 600; font-size: 15px; line-height: 1.25; white-space: nowrap; }
.btn-primary { background: var(--star); color: #fff; border-color: var(--star); }
.btn-primary:hover { background: #cc3138; border-color: #cc3138; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--line-hover); }
.btn:disabled, .btn:disabled:hover { opacity: 0.45; cursor: default; border-color: var(--line); }
.btn-small { padding: 4px 10px; font-size: 14px; }
.btn-danger { color: var(--danger); }
.file-btn input { display: none; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.inline { display: inline-flex; align-items: center; gap: 6px; }
.check input { width: 18px; height: 18px; accent-color: var(--star); }
.hint { color: var(--muted); font-size: 14px; margin: 6px 0; }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 5px 12px; cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 15px; }
.seg button + button { border-left: 2px solid var(--line); }
.seg button.is-on { background: var(--seg-on-bg); color: var(--seg-on-text); }

/* views */
.view { display: none; padding: 20px; }
.view.is-active { display: block; }

/* casting view */
.designer { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stage-col { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 14px; }
.stage {
  border-radius: var(--radius); padding: 22px 18px 14px;
  background: var(--stage-bg);
  border: 1px solid var(--stage-border);
}
.stage-cards { display: flex; gap: 18px; justify-content: center; }
.card-wrap { margin: 0; flex: 1 1 0; max-width: 380px; }
.card-wrap canvas { width: 100%; height: auto; display: block; border-radius: 0; background: #333; box-shadow: var(--card-shadow); }
#cvFront { cursor: grab; touch-action: none; }
#cvFront.dragging { cursor: grabbing; }
.card-wrap.drop canvas { outline: 4px dashed var(--tape); outline-offset: 4px; }
figcaption { text-align: center; font: 600 15px var(--body); color: var(--stage-cap); margin-top: 10px; }
figcaption .hint { display: block; font: 400 13px var(--body); margin: 0; color: var(--stage-hint); }
.stage-tools { display: flex; justify-content: center; margin-top: 10px; }
.stage .seg { background: var(--surface); }
.stage[data-show="front"] #wrapBack, .stage[data-show="back"] #wrapFront { display: none; }
.stage[data-show="front"] .card-wrap, .stage[data-show="back"] .card-wrap { max-width: 520px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.editor { display: flex; flex-direction: column; gap: 14px; }
.panel h2 { margin-bottom: 10px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.panel-head h2 { margin: 0; }
.panel-head .row { flex-wrap: wrap; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.span2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; color: var(--text-2); font-size: 14px; }
input[type=text], input[type=number], input[type=search], select, textarea {
  background: var(--field); border: 2px solid var(--line); border-radius: 6px; padding: 6px 9px; color: var(--text); min-width: 0; font-weight: 400; font-size: 16px;
}
select { max-width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--tape); outline: none; }
textarea { width: 100%; resize: vertical; min-height: 64px; line-height: 1.35; }
.with-toggle { display: flex; gap: 8px; align-items: center; }
.with-toggle input[type=text] { flex: 1; }
.base-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.base-line { margin: 0; color: var(--muted); font-size: 14px; flex: 1 1 260px; }
.base-line b { color: var(--strong); }

.genre-sets { display: grid; gap: 8px; margin-top: 10px; }
.genre-set { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 8px; padding: 6px; border: 2px solid var(--line); border-radius: 8px; }
.genre-set.is-active { border-color: var(--g); }
.gs-pick { display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 700; font-size: 15px; color: var(--strong); }
.gs-pick input { accent-color: var(--g); width: 16px; height: 16px; margin: 0; }
.genres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.genre { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 8px; cursor: pointer; background: #3a3d41; border: 0; border-radius: 6px; color: #c9ccd0; font-size: 13px; font-weight: 600; line-height: 1.15; text-align: left; }
.genre span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.genre img { width: 22px; height: 22px; flex: none; opacity: 0.35; }
.genre.is-on { background: var(--g, var(--star)); color: #fff; }
.genre.is-on img { opacity: 1; }
.genre.ghost { opacity: 0.4; }
.genre.ghost:hover { opacity: 0.6; }
.p-row .r-book { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; background: var(--field); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--text-2); vertical-align: 2px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat span { font: 600 15px var(--body); color: var(--strong); padding-left: 8px; border-left: 6px solid var(--c, #777); }
.stat .stepper { display: flex; }
.stepper button { width: 34px; border: 2px solid var(--line); background: var(--field); cursor: pointer; font-weight: 700; }
.stepper button:first-child { border-radius: 6px 0 0 6px; border-right: 0; }
.stepper button:last-child { border-radius: 0 6px 6px 0; border-left: 0; }
.stepper input { width: 100%; text-align: center; border-radius: 0; }
.stat .delta { font-size: 13px; color: var(--gold-text); min-height: 18px; }

.attack-list { display: flex; flex-direction: column; gap: 8px; }
.attack { display: grid; grid-template-columns: 104px 1fr 70px 70px; grid-template-areas: "type name range strike" "eff eff eff eff" "foot foot foot foot"; gap: 6px; background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.attack .a-type { grid-area: type; } .attack .a-name { grid-area: name; } .attack .a-range { grid-area: range; }
.attack .a-strike { grid-area: strike; } .attack .a-eff { grid-area: eff; }
.attack .a-foot { grid-area: foot; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.attack input, .attack select { width: 100%; background: var(--surface); }
.attack .a-strike input { text-align: center; font-weight: 700; }
.attack .formula { font-size: 13px; color: var(--muted); }
#selAttackTable { width: 260px; }
.icon-btn { background: none; border: 2px solid var(--line); border-radius: 6px; cursor: pointer; padding: 2px 8px; color: var(--text-2); font-weight: 600; font-size: 14px; }
.icon-btn:hover { border-color: var(--line-hover); color: var(--strong); }

.section { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 10px 0; background: var(--field); }
.section input, .section select, .section textarea { background: var(--surface); }
.section-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.section-head input { font: 600 17px var(--body); flex: 1; }
.entry { border-top: 1px solid var(--line); padding: 8px 0; display: grid; grid-template-columns: 1fr auto auto auto auto; gap: 6px; align-items: center; }
.entry .e-name { min-width: 0; }
.entry textarea { grid-column: 1 / -1; }
.entry .e-tools { grid-column: 1 / -1; display: flex; gap: 6px; justify-content: flex-end; }

#ratingsOut table { width: 100%; border-collapse: collapse; }
#ratingsOut td { padding: 4px 0; border-bottom: 1px solid var(--line); }
#ratingsOut td:last-child { text-align: right; font-weight: 700; width: 60px; }
#ratingsOut .total td { font: 700 18px var(--body); border-bottom: 0; color: var(--strong); padding-top: 8px; }
.warn { background: rgba(229,166,18,0.14); border-left: 4px solid var(--tape); padding: 6px 10px; margin: 6px 0; border-radius: 4px; }
.note { color: var(--muted); font-size: 14px; margin: 6px 0; }
.save-state { color: var(--muted); font-size: 14px; }

/* my cards */
.toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cast-total { font: 700 16px var(--body); color: var(--gold-text); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.tile { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.tile.is-selected { border-color: var(--tape); }
.tile img { width: 100%; border-radius: 0; cursor: pointer; display: block; }
.tile .t-name { font: 600 16px var(--body); color: var(--strong); line-height: 1.3; }
.tile .t-meta { color: var(--muted); font-size: 13px; }
.tile .row { justify-content: space-between; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }

/* print */
.print-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; align-items: start; }
.print-opts { display: flex; flex-direction: column; gap: 10px; }
.print-list { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow: auto; }
.print-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--field); padding: 6px 8px; border-radius: 6px; }
.print-item input { width: 60px; }
.print-preview { display: flex; flex-wrap: wrap; gap: 16px; }
.sheet { background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,0.3); position: relative; border: 1px solid var(--line); }
.sheet img { position: absolute; }

/* dialogs */
.dlg { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); padding: 0; max-width: min(1240px, 96vw); width: 96vw; max-height: 92vh; }
.dlg::backdrop { background: rgba(0,0,0,0.6); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 3; }
.dlg-head h2 { font-size: 30px; }
.new-step, .dlg > .filters, .lib-list { padding: 14px 18px; }
.lead { font-size: 17px; margin: 0 0 14px; }
.filters { gap: 10px; }
.filters input[type=search] { flex: 1; min-width: 220px; }
.blank-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lib-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.lib-item { background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.lib-item b { font-size: 16px; color: var(--strong); }
.lib-item p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.lib-item .src { font-size: 13px; color: var(--muted); }
.sym { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; align-items: center; justify-content: center; margin-left: 2px; vertical-align: 2px; }
html[data-theme="dark"] .sym { background: #e7e8e9; color: var(--ink); }

/* archetype picker */
.picker-top { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.kind-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.kind-tab { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 5px 14px 5px 10px; border-radius: 8px; border: 2px solid var(--line); background: var(--field); color: var(--text); font: 600 15px var(--body); }
.kind-tab::before { content: ''; width: 8px; height: 18px; border-radius: 3px; background: var(--k); }
.kind-tab .n { font: 400 14px var(--body); color: var(--muted); }
.kind-tab.is-on { border-color: var(--k); background: var(--k); color: #fff; }
.kind-tab.is-on .n { color: rgba(255,255,255,0.8); }
.picker { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 0; min-height: 60vh; }
.p-list { border-right: 1px solid var(--line); max-height: 66vh; overflow: auto; padding: 8px 10px 16px 0; }
.p-group { font: 600 13px var(--body); color: var(--muted); margin: 16px 0 4px 10px; }
.p-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; text-align: left; cursor: pointer; padding: 8px 10px; border-radius: 8px; border: 2px solid transparent; background: none; color: var(--text); }
.p-row:hover { background: var(--field); }
.p-row.is-on { border-color: var(--k); background: var(--field); }
.p-row .r-name { font: 600 16px/1.35 var(--body); color: var(--strong); }
.p-row .r-rat { font: 700 17px var(--body); color: var(--k); align-self: center; grid-row: span 2; min-width: 28px; text-align: right; }
.p-row { grid-template-columns: 1fr auto auto; }
.p-row .r-ex { grid-column: 1; }
.p-row .r-select { grid-column: 3; grid-row: 1 / span 2; align-self: center; display: none; }
.p-row.is-on .r-select { display: inline-flex; }
.pick-help { margin: 0; font-size: 14px; color: var(--text-2); }
.picker-foot { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 18px; margin: 0 -18px -14px; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 16px rgba(0,0,0,0.08); }
.picker-foot:empty { display: none; }
.pf-text b { color: var(--strong); }
.pf-text .hint { margin-left: 6px; }
.pf-select { font-size: 16px; padding: 9px 20px; }
.p-row .r-ex { font-size: 14px; line-height: 1.4; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-detail { padding: 6px 4px 16px 22px; max-height: 66vh; overflow: auto; }
.d-head { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 18px; align-items: start; }
.d-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.d-title h3 { font-size: 36px; }
.d-pill { font: 600 14px var(--body); color: #fff; background: var(--k); padding: 3px 12px; border-radius: 20px; }
.d-rat { font: 700 20px var(--body); color: var(--k); }
.d-rat small { font: 400 14px var(--body); color: var(--muted); }
.d-label { font: 700 15px var(--body); color: var(--strong); margin: 18px 0 6px; }
.d-label .hint { font: 400 14px var(--body); margin-left: 6px; }
.d-text { margin: 0; font-size: 16px; line-height: 1.5; }
.d-desc { margin: 0; color: var(--text); font-size: 16px; line-height: 1.6; max-width: 68ch; }
.d-genres { display: flex; gap: 6px; flex-wrap: wrap; }
.d-genre { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 2px; border-radius: 20px; background: var(--field); color: var(--muted); font-size: 14px; font-weight: 600; border: 1px solid var(--line); }
.d-genre img { width: 24px; height: 24px; border-radius: 50%; background: #9aa0a6; padding: 2px; opacity: 0.6; }
.d-genre.on { background: var(--k); color: #fff; border-color: var(--k); }
.d-genre.on img { background: transparent; opacity: 1; }
.d-side { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; }
.d-thumb { width: 190px; border-radius: 0; box-shadow: 0 8px 22px rgba(0,0,0,0.35); display: block; background: #333; }
.d-stats { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; }
.d-stat { display: flex; flex-direction: column; align-items: center; min-width: 58px; border-radius: 8px; overflow: hidden; background: #121619; }
.d-stat b { font: 24px/1.2 var(--num); color: #fff; background: var(--c); width: 100%; text-align: center; padding: 6px 4px 2px; }
.d-stat span { font: 600 12px var(--body); color: #d9dadb; padding: 3px 6px 4px; letter-spacing: 0.02em; }
.d-health { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px 10px; border-radius: 8px; background: var(--k); }
.d-health i { display: inline-block; width: 15px; height: 15px; border-radius: 50%; background: #fff; margin: 0 2px; }
.d-health span { font: 600 12px var(--body); color: #fff; }
.d-attacks { width: 100%; border-collapse: collapse; font-size: 15px; }
.d-attacks th { text-align: left; font: 600 13px var(--body); color: #fff; background: #121619; padding: 4px 8px; letter-spacing: 0.02em; }
.d-attacks th:first-child { border-radius: 6px 0 0 0; } .d-attacks th:last-child { border-radius: 0 6px 0 0; }
.d-attacks td { padding: 4px 8px; border-bottom: 1px solid var(--line); }
.d-attacks td.s { font: 17px var(--num); text-align: center; background: #353536; color: #fff; }
.d-attacks .t { font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 10px; color: #fff; margin-right: 6px; vertical-align: 1px; }
.t-fight { background: #9b2024; } .t-shoot { background: #ce7c17; } .t-presence { background: #5b4b8a; }
.d-fx { display: flex; flex-wrap: wrap; gap: 6px; }
.d-fx > span { background: var(--field); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font-size: 14px; }
.d-fx > span.sq { border-color: var(--k); }
.d-actions { display: flex; gap: 10px; margin-top: 18px; align-items: center; flex-wrap: wrap; }
.d-src { color: var(--muted); font-size: 13px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(120px); background: #231f20; color: #fff; padding: 10px 18px; border-radius: 8px; font-weight: 700; transition: transform 0.25s; z-index: 50; border-left: 6px solid var(--tape); }
.toast { visibility: hidden; }
.toast.show { transform: translateX(-50%) translateY(0); visibility: visible; }


/* cast settings disclosure and the phone bar */
.cast-settings > summary { list-style: none; cursor: pointer; font: 400 28px/1 var(--head); color: var(--strong); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.cast-settings > summary::-webkit-details-marker { display: none; }
.cast-settings > summary::after { content: ''; width: 9px; height: 9px; border-right: 3px solid var(--muted); border-bottom: 3px solid var(--muted); transform: rotate(45deg); margin-top: -6px; transition: transform 0.15s; }
.cast-settings:not([open]) > summary { margin-bottom: 0; }
.cast-settings:not([open]) > summary::after { transform: rotate(-45deg); margin-top: 0; }
.cast-bar { display: none; }

.badge-default { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.badge-default .hint { max-width: 70ch; }
.badge-preview { width: 40px; height: 40px; border-radius: 50%; background: #1b1d20 center / cover no-repeat; border: 3px solid var(--star-band); flex: none; }
.badge-preview.empty { background-image: radial-gradient(circle, var(--star-band) 0 30%, transparent 31%); padding: 0; }

/* about */
.about { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.about p { margin: 0 0 10px; max-width: 70ch; }
.about ul { margin: 0 0 10px; padding-left: 20px; max-width: 70ch; }
.about li { margin-bottom: 6px; }
.about-intro { border-top: 4px solid var(--star-band); }
.about-link { text-decoration: none; }
.about-buy .about-link { margin-top: 2px; }

/* cast builder */
.cast-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.cast-side, .cast-add { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow: auto; }
.cast-main { display: flex; flex-direction: column; gap: 14px; }
.cast-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.cast-item { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; text-align: left; cursor: pointer; padding: 8px 10px; border-radius: 8px; border: 2px solid var(--line); background: var(--field); color: var(--text); }
.cast-item.is-on { border-color: var(--star); }
.ci-name { font-weight: 600; color: var(--strong); }
.ci-meta { font-size: 13px; color: var(--muted); grid-column: 1; }
.ci-total { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: 700; font-size: 17px; }
.ci-total small { font-weight: 400; color: var(--muted); font-size: 13px; }
.grid-cast { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1.5fr); gap: 10px 14px; }
.grid-cast select, .grid-cast input[type=text] { width: 100%; }
.grid-cast .with-toggle input { flex: none; width: 76px; }
.grid-cast .with-toggle select { flex: 1; min-width: 0; }
.span-all { grid-column: 1 / -1; }
.cast-summary { display: flex; flex-direction: column; gap: 12px; }
.meter-row { display: flex; align-items: center; gap: 16px; }
.meter-num { white-space: nowrap; color: var(--muted); }
.meter-num b { font: 40px/1 var(--num); color: var(--strong); vertical-align: -4px; }
.meter-num b.over { color: var(--danger); }
.meter { flex: 1; height: 12px; border-radius: 6px; background: var(--field); border: 1px solid var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: #2b963d; transition: width 0.2s; }
.meter span.over { background: var(--danger); }
.cast-counts { display: flex; gap: 8px; flex-wrap: wrap; }
.cc { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; background: var(--field); border-left: 6px solid var(--k); font-size: 14px; }
.cc.plain { border-left-color: var(--line-hover); }
.cc b { font-size: 16px; color: var(--strong); }
.cast-genres { display: flex; gap: 6px; flex-wrap: wrap; }
.cg { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 2px; border-radius: 20px; background: var(--field); border: 1px solid var(--line); color: var(--muted); font-size: 14px; font-weight: 600; }
.cg img { width: 24px; height: 24px; border-radius: 50%; background: #9aa0a6; padding: 2px; opacity: 0.6; }
.cg img + img { margin-left: -4px; }
.cg.on { background: var(--star-band); border-color: var(--star-band); color: #fff; }
.cg.on img { background: transparent; opacity: 1; }
.cg.chosen { outline: 3px solid var(--tape); outline-offset: 1px; }
.cg b { font-weight: 700; }
.ok-line { margin: 0; color: #2b7a3a; font-weight: 600; }
html[data-theme="dark"] .ok-line { color: #6fcf7f; }
.members { display: flex; flex-direction: column; gap: 6px; }
.m-group { font: 600 13px var(--body); color: var(--muted); margin: 10px 0 0 4px; }
.member { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; background: var(--field); border-left: 6px solid var(--k, var(--line)); flex-wrap: wrap; }
.member.bad { box-shadow: inset 0 0 0 2px rgba(229,166,18,0.7); }
.m-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 240px; }
.m-name { font-weight: 600; color: var(--strong); font-size: 16px; }
.m-meta { font-size: 13px; color: var(--muted); }
.m-genres { display: flex; gap: 3px; margin-top: 2px; }
.m-genres img { width: 20px; height: 20px; border-radius: 50%; background: var(--k, #555); padding: 2px; }
.m-genres img.off { opacity: 0.22; }
.m-reason { font-size: 13px; color: var(--gold-text); font-weight: 600; }
.m-ctrl { display: flex; align-items: center; gap: 10px; }
.m-ctrl .stepper { display: flex; width: 120px; }
.m-ctrl .stepper button { height: 34px; }
.m-ctrl .stepper input { background: var(--surface); }
.m-cost { font: 700 18px var(--body); min-width: 36px; text-align: right; color: var(--strong); }
.link { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-hover); text-underline-offset: 3px; }
.link:hover { text-decoration-color: currentColor; }
.tag { font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: 10px; background: var(--line); color: var(--text-2); vertical-align: 2px; }
.empty-line { color: var(--muted); margin: 6px 0; }
.cast-add { display: flex; flex-direction: column; gap: 10px; }
.cast-add > *, .cast-side > * { flex-shrink: 0; }
.cast-add h2 { margin-bottom: 0; }
.seg-full { display: flex; } .seg-full button { flex: 1; }
.kind-tab.small { font-size: 14px; padding: 4px 10px 4px 8px; }
.add-list { display: flex; flex-direction: column; gap: 4px; }
.add-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 6px; border-left: 4px solid var(--k); background: var(--field); }
.add-row.misfit { opacity: 0.7; }
.a-main { display: flex; flex-direction: column; min-width: 0; }
.a-name { font-weight: 600; color: var(--strong); }
.a-meta { font-size: 13px; color: var(--muted); }
.a-why { color: var(--gold-text); font-weight: 600; }
.set-note { background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.print-source { background: rgba(229,166,18,0.14); border-left: 4px solid var(--tape); padding: 8px 10px; border-radius: 4px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
@media (max-width: 1250px) {
  .cast-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .cast-add { grid-column: 1 / -1; position: static; max-height: none; }
}
@media (max-width: 760px) {
  .cast-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cast-side { position: static; max-height: none; padding: 12px 14px; }
  .cast-side h2 { font-size: 24px; }
  .cast-list { flex-direction: row; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
  .cast-item { flex: 0 0 min(230px, 75vw); scroll-snap-align: start; }
  .cast-main { gap: 12px; }
  .cast-main .panel, .cast-add { padding: 12px 14px; }
  .cast-settings > summary { font-size: 24px; }
  #view-cast { padding-bottom: 96px; }
  #view-cast[data-pane="cast"] .cast-add { display: none; }
  #view-cast[data-pane="add"] .cast-side, #view-cast[data-pane="add"] .cast-main { display: none; }
  .cast-add { position: static; max-height: none; }
  .cast-genres { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .cg { font-size: 12px; padding: 2px 6px 2px 2px; gap: 4px; }
  .cg img { width: 20px; height: 20px; }
  .meter-num b { font-size: 34px; }
  .member { padding: 8px; gap: 8px; }
  .m-ctrl { width: 100%; justify-content: space-between; }
  .m-ctrl .stepper { width: 132px; }
  .m-ctrl .stepper button { width: 40px; height: 40px; }
  .add-row .btn { padding: 8px 14px; }
  .cast-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; align-items: center; gap: 12px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(0,0,0,0.12); }
  #view-cast:not(.is-active) .cast-bar { display: none; }
  .cb-total { flex: 1; min-width: 0; color: var(--muted); font-size: 14px; }
  .cb-total b { font: 26px/1 var(--num); color: var(--strong); vertical-align: -2px; }
  .cb-total b.over { color: var(--danger); }
  .cb-total .meter { height: 8px; margin-top: 6px; }
  .cast-bar .btn { padding: 10px 16px; font-size: 15px; }
  body:has(#view-cast.is-active) .toast { bottom: 88px; }
  .grid-cast { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .meter-row { flex-wrap: wrap; } .meter { flex-basis: 100%; }
}

@media (max-width: 1100px) {
  .designer { grid-template-columns: minmax(0, 1fr); }
  .stage-col { position: static; }
  .print-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .picker { grid-template-columns: minmax(0, 1fr); }
  .p-list { border-right: 0; max-height: none; padding-right: 0; order: 2; }
  .p-detail { max-height: none; padding: 10px 0 14px; border-bottom: 1px solid var(--line); order: 1; }
  .d-head { grid-template-columns: minmax(0, 1fr) 120px; }
  .d-thumb { width: 120px; }
  .d-title h3 { font-size: 30px; }
}
@media (max-width: 640px) {
  .view { padding: 12px; }
  .pf-text .hint { display: none; }
  .picker-foot { padding: 10px 14px; }
  .grid-cast { grid-template-columns: minmax(0, 1fr); }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .brand h1 { font-size: 32px; }
  .stage-cards { flex-direction: column; align-items: center; }
  .card-wrap { width: 100%; flex: none; }
  .stage { padding: 14px 10px 10px; }
  .filters .seg { flex-wrap: wrap; }
  .tabs { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tab { padding: 8px 5px; font-size: 13px; flex: none; }
  .tabs { gap: 2px; justify-content: space-between; }
  .dlg { width: 100vw; max-width: 100vw; }
  .genres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .genre-set { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .attack { grid-template-columns: 1fr 1fr; grid-template-areas: "type type" "name name" "range strike" "eff eff" "foot foot"; }
  #selAttackTable { width: 100%; }
  .panel-head .row { width: 100%; }
  .d-attacks { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* 80s genre icons are solid discs with no margin; draw them a little smaller to match the Core rings */
img[src*="/genres/80s/"] { transform: scale(0.9); }

/* units in the Call Sheet */
.unit { border: 2px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.u-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.u-title { display: flex; flex-direction: column; gap: 2px; flex: 1 1 240px; min-width: 0; }
.u-name { font: 600 17px var(--body); color: var(--strong); }
.u-meta { font-size: 13px; color: var(--muted); }
.u-slot { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 6px; }
.u-row.u-none { opacity: 0.62; }
.u-row .u-opt { font: inherit; font-weight: 600; padding: 2px 6px; max-width: 100%; }
.u-fixed { display: inline-flex; width: 120px; justify-content: center; font-weight: 700; color: var(--strong); }
.stepper button:disabled { opacity: 0.35; cursor: default; }
.a-units { font-size: 13px; color: var(--text-2); line-height: 1.35; }

/* find by role in the profile picker */
.role-find { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 10px; }
.role-label { font-weight: 700; color: var(--strong); font-size: 15px; }
.role-find input { width: 100%; }
.role-hits { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; max-height: 132px; overflow-y: auto; }
.role-hits:empty { display: none; }
.role-hit { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); border-left: 4px solid var(--k); background: var(--field); color: var(--text); font-size: 14px; cursor: pointer; }
.role-hit:hover { border-color: var(--line-hover); border-left-color: var(--k); }
.role-hit b { font-weight: 700; color: var(--strong); font-size: 13px; }
.role-hit b::before { content: "\2192\00a0"; font-weight: 400; color: var(--muted); }
@media (max-width: 760px) { .role-find { grid-template-columns: 1fr; } }
.role-hit b.solo::before { content: none; }

/* quick reference (Reference tab); the same content as assets/7TV-Quick-Reference.pdf */
.qref { --q-red: #9e2a24; --q-blue: #285d86; --q-th: #285d86; --q-head: 'Oswald', 'Arial Narrow', sans-serif; max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; font-size: 15px; line-height: 1.35; color: var(--text); }
html[data-theme="dark"] .qref { --q-red: #ec8076; --q-blue: #8dbbe0; }
.qref-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 4px solid var(--star-band); }
.qref-intro > div { flex: 1 1 420px; }
.qref-intro p { margin: 0 0 6px; max-width: 75ch; }
.qref-dl { font-size: 16px; padding: 10px 18px; }
.qref-title { font: 400 30px/1.1 var(--head); letter-spacing: 0.02em; text-transform: uppercase; color: var(--strong); margin: 10px 0 0; }
.qref-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.qref-col { min-width: 0; }
.qref h2:not(.qref-title) { font: 600 20px/1.15 var(--q-head); letter-spacing: 0.02em; text-transform: uppercase; color: var(--q-red); margin: 0 0 6px; padding-bottom: 3px; border-bottom: 2px solid var(--q-red); }
.qref-intro h2 { color: var(--strong) !important; border: 0 !important; font: 400 30px/1.1 var(--head) !important; }
.qref h3 { font: 600 16px/1.2 var(--q-head); letter-spacing: 0.02em; text-transform: uppercase; color: var(--q-blue); margin: 8px 0 3px; }
.qref p { margin: 0 0 4px; }
.qref ul { margin: 0 0 4px; padding-left: 18px; }
.qref li { margin: 0 0 2px; }
.q-pp { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: #9e2a24; color: #fff; font-size: 11px; line-height: 16px; text-align: center; vertical-align: -2px; margin: 0 1px 0 0; font-family: Arial, sans-serif; }
.q-step { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 9px; margin: 0 0 9px; }
.q-num { width: 26px; height: 26px; border-radius: 50%; background: var(--strong); color: var(--surface); font: 600 14px/26px var(--q-head); text-align: center; }
.q-st { font-weight: 700; color: var(--strong); margin: 2px 0 2px; }
.q-opt { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.q-tbl { width: 100%; border-collapse: collapse; font-size: 14px; margin: 4px 0 4px; }
.q-tbl th { font: 600 12.5px var(--q-head); letter-spacing: 0.03em; text-transform: uppercase; text-align: left; color: #fff; background: var(--q-th); padding: 3px 6px; }
.q-tbl td { padding: 3px 6px; border-bottom: 1px solid var(--line); }
.q-tbl td.q-n { text-align: right; font-weight: 600; white-space: nowrap; }
.q-tbl tr:nth-child(even) td { background: var(--field); }
.q-box { background: var(--field); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; margin: 4px 0 8px; }
.q-phase { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 9px; margin: 8px 0 0; }
.q-pn { width: 28px; height: 28px; border-radius: 6px; background: var(--q-th); color: #fff; font: 600 15px/28px var(--q-head); text-align: center; }
.q-ph { font: 600 16px var(--q-head); letter-spacing: 0.02em; text-transform: uppercase; color: var(--q-blue); margin: 3px 0 2px; }
.q-ref { color: var(--muted); font-size: 13px; }
.q-act { border-top: 3px solid var(--q-th); padding-top: 4px; }
.q-at { font: 600 16px var(--q-head); letter-spacing: 0.03em; text-transform: uppercase; color: var(--q-blue); margin: 0 0 2px; }
.q-calc { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 3px 0 6px; text-align: center; font-size: 13px; line-height: 1.2; }
.q-calc div { background: var(--field); border: 1px solid var(--line); border-radius: 5px; padding: 5px 3px; }
.q-calc b { display: block; font: 600 13px var(--q-head); color: var(--q-blue); letter-spacing: 0.03em; }
.q-sn { font: 600 15px/1.15 var(--q-head); letter-spacing: 0.03em; text-transform: uppercase; color: var(--strong); margin: 0 0 1px; }
@media print { .qref-intro .qref-dl { display: none; } }
.q-nw { white-space: nowrap; }
.qref-dl, .qref-dl:hover { text-decoration: none; }
.d-errata { display: block; margin: 0 0 6px; padding: 6px 10px; border-radius: 6px; background: var(--field); border: 1px solid var(--tape); color: var(--text); font-size: 14px; font-weight: 600; }
.about-errata h3 { font: 400 24px/1.1 var(--head); letter-spacing: 0.02em; color: var(--strong); margin: 14px 0 6px; }
.sheet .crop-mark { position: absolute; pointer-events: none; }
.sheet .crop-mark.v { width: 0; border-left: 1px solid #000; }
.sheet .crop-mark.h { height: 0; border-top: 1px solid #000; }
.sheet .crop-mark.fold { border-color: #888; border-style: dashed; }
#pBacksRow[hidden] { display: none; }
[hidden] { display: none !important; }

/* Genres page */
.genres-page { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.gp-intro { border-top: 4px solid var(--star-band); }
.gp-intro p { margin: 0; max-width: 85ch; }
.gp-sets { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.gp-set-title { font: 400 26px/1.1 var(--head); letter-spacing: 0.02em; color: var(--strong); margin: 0 0 10px; }
.gp-grid { display: flex; flex-direction: column; gap: 8px; }
.gp-genre { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: start; text-align: left; padding: 10px; border-radius: 10px; border: 2px solid var(--line); background: var(--field); color: var(--text); cursor: pointer; font: inherit; }
.gp-genre:hover { border-color: var(--line-hover); }
.gp-genre.is-on { border-color: var(--star-band); box-shadow: 0 0 0 2px rgba(158,43,43,0.25); background: var(--surface); }
.gp-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--star-band); display: flex; align-items: center; justify-content: center; }
.gp-icon img { width: 46px; height: 46px; }
.gp-gtext { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gp-gname { font: 400 24px/1.05 var(--head); letter-spacing: 0.02em; color: var(--strong); text-transform: uppercase; }
.gp-n { font: 600 13px var(--body); color: var(--muted); text-transform: none; letter-spacing: 0; margin-left: 6px; vertical-align: 3px; }
.gp-sub { font-size: 13px; font-weight: 700; color: var(--text-2); }
.gp-desc { font-size: 14.5px; line-height: 1.4; }
.gp-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.gp-head h2 { margin: 0; }
.gp-count { color: var(--muted); font-weight: 600; }
.gp-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0 6px; }
.gp-filters input { flex: 1 1 260px; min-width: 0; }
.gp-filters select { flex: 0 1 220px; }
.gp-decade { font: 400 24px/1.1 var(--head); letter-spacing: 0.02em; color: var(--strong); margin: 16px 0 6px; padding-bottom: 3px; border-bottom: 2px solid var(--line); }
.gp-decade span { font: 600 13px var(--body); color: var(--muted); margin-left: 6px; }
.gp-film { border: 1px solid var(--line); border-radius: 8px; background: var(--field); margin: 0 0 6px; }
.gp-film[open] { background: var(--surface); border-color: var(--line-hover); }
.gp-film summary { cursor: pointer; padding: 8px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; list-style: none; }
.gp-film summary::-webkit-details-marker { display: none; }
.gp-film summary::before { content: "\25B8"; position: absolute; left: 8px; top: 9px; color: var(--muted); }
.gp-film[open] summary::before { content: "\25BE"; }
.gp-film summary { position: relative; padding-left: 22px; }
.gp-title { font-weight: 700; color: var(--strong); font-size: 16px; }
.gp-year { font-weight: 500; color: var(--muted); }
.gp-gicons { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.gp-gicons img { width: 24px; height: 24px; border-radius: 50%; background: var(--star-band); padding: 2px; }
.gp-gicons img.is80 { background: #6d2c6b; }
.gp-pitch { grid-column: 1 / -1; font-size: 14px; color: var(--text-2); }
.gp-cast { padding: 0 12px 10px 22px; overflow-x: auto; }
.gp-cast table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.gp-cast th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 4px 8px 4px 0; border-bottom: 1px solid var(--line); }
.gp-cast td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.gp-char b { color: var(--strong); }
.gp-actor { display: block; font-size: 12.5px; color: var(--muted); }
.gp-role { display: inline-block; white-space: nowrap; font-size: 12.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: #fff; background: var(--k); }
.gp-prof .link { text-align: left; }
.gp-cast .hint { margin: 6px 0 0; }
.gp-note { margin-top: 10px; }
@media (max-width: 760px) {
  .gp-sets { grid-template-columns: 1fr; }
  .gp-genre { grid-template-columns: 44px minmax(0, 1fr); }
  .gp-icon { width: 44px; height: 44px; } .gp-icon img { width: 36px; height: 36px; }
  .gp-film summary { grid-template-columns: 1fr; }
  .gp-gicons { justify-content: flex-start; }
  #gpDecade { display: flex; flex-wrap: wrap; width: 100%; }
  #gpDecade button { flex: 1 1 16%; min-width: 0; padding-left: 2px; padding-right: 2px; }
  .gp-filters select { flex: 1 1 100%; }
  /* cast rows as small cards: character and role on one line, profile below */
  .gp-cast { padding: 0 10px 10px 10px; overflow: visible; }
  .gp-cast thead { display: none; }
  .gp-cast table, .gp-cast tbody { display: block; }
  .gp-cast tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
  .gp-cast td { display: block; padding: 0; border: 0; }
  .gp-cast td.gp-prof { grid-column: 1 / -1; }
  .gp-cast td.gp-prof::before { content: "Start a card from "; color: var(--muted); font-size: 13px; }
}
/* name-only profiles in the public build */
.tag-stub { background: var(--field); color: var(--muted); border: 1px dashed var(--line-hover); }
.m-plain { font-weight: 700; color: var(--strong); }
.gp-stub { color: var(--text-2); }
/* Index page */
.ix-panel { border-top: 4px solid var(--star-band); }
.ix-intro { margin: 6px 0 0; max-width: 85ch; }
.ix-list { margin-top: 6px; }
.ix-letter { font: 400 24px/1.1 var(--head); letter-spacing: 0.02em; color: var(--strong); margin: 16px 0 4px; padding-bottom: 3px; border-bottom: 2px solid var(--line); }
.ix-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: baseline; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.ix-row.ix-sub { padding-left: 22px; }
.ix-term { font-size: 15px; min-width: 0; }
.ix-name { font-weight: 700; color: var(--strong); }
.ix-parent { color: var(--muted); font-weight: 600; }
.ix-also { color: var(--muted); font-size: 13.5px; }
.ix-refs { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: flex-end; }
.ix-ref { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.ix-book { font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; padding: 1px 7px; border-radius: 4px; color: #fff; }
.ix-core { background: var(--star-band); }
.ix-b80 { background: #6d2c6b; }
.ix-pages { font-weight: 700; font-variant-numeric: tabular-nums; }
.ix-list mark { background: #f3d36b; color: #1b1d20; border-radius: 2px; padding: 0 1px; }
@media (max-width: 760px) {
  .ix-row { grid-template-columns: 1fr; }
  .ix-refs { justify-content: flex-start; }
  #ixBook { display: flex; width: 100%; } #ixBook button { flex: 1 1 0; }
}
/* Episodes page */
.ep-row { padding: 9px 4px 10px; border-bottom: 1px solid var(--line); }
.ep-head { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.ep-title { font-weight: 700; color: var(--strong); font-size: 16px; margin-right: auto; }
.ep-gicons { display: flex; gap: 3px; }
.ep-gicons img { width: 24px; height: 24px; border-radius: 50%; background: var(--star-band); padding: 2px; }
.ep-gicons img.is80 { background: #6d2c6b; }
.ep-any { font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.ep-sum { margin: 4px 0 2px; font-size: 15px; max-width: 90ch; }
.ep-meta { font-size: 13px; color: var(--muted); }
.ep-group { font-size: 22px; }
#epSearch { flex: 1 1 240px; min-width: 0; }
#epGenre { flex: 0 1 200px; }
@media (max-width: 760px) {
  #epKind, #epBook { display: flex; width: 100%; } #epKind button, #epBook button { flex: 1 1 0; }
  #epGenre { flex: 1 1 100%; }
  .ep-title { flex: 1 1 100%; }
}
.about-links { flex-wrap: wrap; }
.about-links .about-link { white-space: normal; }
.q-s { display: flow-root; margin: 0 0 8px; }
.q-sti { float: left; width: 40px; height: 40px; margin: 1px 8px 2px 0; }
.badge-preview.prop-back-preview { width: 46px; height: 64px; border-radius: 4px; background-size: cover; background-position: center; }
.badge-preview.prop-back-preview.empty { padding: 0; background: linear-gradient(160deg, #5f8fbf, #24456b 55%, #0d1a2a); }
