/* Pub in the Desert: the gold and cream of the Shorts (make_shorts.py), on a dark pub-wood bar. */
:root {
  --bg: #f7f2ea;
  --card: #fffdf9;
  --ink: #2a2118;
  --muted: #7a6a58;
  --line: #e6dccd;
  --bar: #241a12;
  --bar-ink: #f3ebdd;
  --gold: #b88a3e;
  --gold-soft: #f3e6cc;
  --ok: #2f7a4a;
  --ok-soft: #e1f1e6;
  --warn: #a8661a;
  --warn-soft: #fbecd6;
  --bad: #a63a2b;
  --bad-soft: #f8e0dc;
  --info: #31597a;
  --info-soft: #e1ebf3;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
a { color: var(--info); }
h1, h2, h3 { font-family: Georgia, "Iowan Old Style", serif; font-weight: 600; line-height: 1.2; }
h1 { font-size: 1.7rem; margin: 0 0 .25rem; }
h2 { font-size: 1.25rem; margin: 1.6rem 0 .6rem; }
h3 { font-size: 1.05rem; margin: 1rem 0 .4rem; }
code, pre, textarea.code { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* Bar */
.bar { background: var(--bar); color: var(--bar-ink); position: sticky; top: 0; z-index: 10; }
.bar-in { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.brand { color: var(--bar-ink); text-decoration: none; font-family: Georgia, serif; font-size: 18px; letter-spacing: .06em; white-space: nowrap; }
.brand b { color: #d4af6a; font-weight: 600; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--bar-ink); opacity: .8; text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.nav a:hover, .nav a.on { opacity: 1; background: rgba(255,255,255,.08); }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; color: var(--bar-ink); opacity: .8; padding: 6px 10px; border-radius: 6px; user-select: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " ▾"; font-size: .8em; }
.menu summary:hover, .menu summary.on, .menu[open] summary { opacity: 1; background: rgba(255,255,255,.08); }
.menu-list { position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; min-width: 160px; display: flex; flex-direction: column;
  padding: 6px; border-radius: 8px; background: var(--bar, #241a12); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.menu-list a { padding: 8px 10px; }
.who { font-size: 13px; opacity: .8; display: flex; gap: 12px; }
.who a { color: var(--bar-ink); }

main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 64px; }
.flash { padding: 10px 14px; border-radius: var(--radius); margin: 0 0 16px; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.error { background: var(--bad-soft); color: var(--bad); }

/* Cards and grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card + .card { margin-top: 14px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.grid.halves { grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .grid.two, .grid.halves { grid-template-columns: 1fr; } }
.head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Buttons and forms */
button, .button {
  font: inherit; font-size: 14px; border: 1px solid var(--bar); background: var(--bar); color: var(--bar-ink);
  padding: 7px 14px; border-radius: 7px; cursor: pointer; text-decoration: none; display: inline-flex; gap: 6px; align-items: center;
}
button:hover, .button:hover { filter: brightness(1.2); }
button.quiet, .button.quiet { background: transparent; color: var(--ink); border-color: var(--line); }
button.quiet:hover, .button.quiet:hover { background: var(--gold-soft); filter: none; }
button.gold, .button.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
button.danger { background: transparent; color: var(--bad); border-color: var(--bad-soft); }
button.tiny, .button.tiny { padding: 2px 8px; font-size: 12px; }
button.link { background: none; border: 0; color: var(--info); padding: 0; text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=email], input[type=date], input[type=number], input[type=url], select, textarea {
  font: inherit; border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; background: #fff; color: var(--ink); width: 100%;
}
textarea { min-height: 120px; line-height: 1.45; }
textarea.tall { min-height: 60vh; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
label.check { display: inline-flex; gap: 6px; align-items: center; color: var(--ink); margin: 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 14px; }
.fields .wide { grid-column: 1 / -1; }
form.inline { display: inline; }

/* Chips */
.chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--line); color: var(--ink); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.gold { background: var(--gold-soft); color: #7a5a22; }

/* Queue */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.q-num { font-family: Georgia, serif; font-size: 20px; color: var(--gold); width: 52px; }
.q-num.prov::after { content: "*"; font-size: 13px; vertical-align: super; color: var(--muted); }
.q-title a { color: var(--ink); text-decoration: none; font-weight: 600; }
.q-title a:hover { text-decoration: underline; }
.q-date { white-space: nowrap; }
.q-actions { white-space: nowrap; text-align: right; }
.q-actions form { display: inline; }
.table-wrap { overflow-x: auto; }
.steps { display: flex; gap: 4px; flex-wrap: wrap; }

/* Episode */
.ep-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.ep-num { font-family: Georgia, serif; color: var(--gold); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 20px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--gold); }
.tabs a .chip { margin-left: 4px; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); font-size: 13px; }
dl.facts dd { margin: 0; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 6px 0; display: flex; gap: 8px; align-items: baseline; border-bottom: 1px dashed var(--line); }
.checklist li:last-child { border: 0; }
.tick { width: 18px; flex: none; text-align: center; }

/* Video */
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player iframe, .player video, .player > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player.vertical { aspect-ratio: 9 / 16; max-width: 300px; }
.sticky-player { position: sticky; top: 64px; }

/* Transcript */
.tx-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tx-tools input[type=search] { flex: 1; min-width: 200px; font: inherit; border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; }
.turn { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.turn .stamp { align-self: start; font-family: var(--mono); font-size: 12px; color: var(--info); cursor: pointer; background: none; border: 0; padding: 2px 0; text-align: left; }
.turn .spk { font-weight: 600; font-size: 13px; }
.turn .spk.s0 { color: #7a4f12; } .turn .spk.s1 { color: #31597a; } .turn .spk.s2 { color: #5b3f7a; } .turn .spk.s3 { color: #2f7a4a; }
.turn.auto .spk::after { content: " (label guessed)"; font-weight: 400; color: var(--muted); }
.turn.playing { background: var(--gold-soft); }
.turn mark { background: #ffe58f; }
.transcript-scroll { max-height: 75vh; overflow-y: auto; padding-right: 6px; }

/* Content */
.md { line-height: 1.65; overflow-wrap: anywhere; }
.md blockquote { border-left: 3px solid var(--gold); margin: .6em 0; padding: .1em 1em; color: #4b3c2e; background: var(--gold-soft); border-radius: 0 6px 6px 0; }
.md table { font-size: 13px; }
.md td, .md th { padding: 4px 8px; border: 1px solid var(--line); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); display: flex; justify-content: space-between; gap: 8px; }
.side-nav a.on, .side-nav a:hover { background: var(--gold-soft); }
.content-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
@media (max-width: 860px) { .content-layout { grid-template-columns: 1fr; } }

/* Social */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.post { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.post .post-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.post .post-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.post .md { font-size: 14px; }
.post.blog { grid-column: 1 / -1; }
.post.blog .md { max-height: 320px; overflow: hidden; mask-image: linear-gradient(#000 80%, transparent); }
.post.blog.open .md { max-height: none; mask-image: none; }
.copied { color: var(--ok) !important; border-color: var(--ok) !important; }
.title-option { border-left: 3px solid var(--line); padding: 4px 12px; margin: 10px 0; }
.title-option.chosen { border-color: var(--gold); }

/* Shorts */
.clip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px; }
@media (max-width: 860px) { .clip { grid-template-columns: 1fr; } }
.clip + .clip { margin-top: 14px; }
.clip-quote { font-family: Georgia, serif; font-size: 16px; line-height: 1.55; background: var(--gold-soft); padding: 10px 14px; border-radius: 8px; }

/* Jobs */
pre.log { background: #1d1712; color: #eadfcd; padding: 14px; border-radius: var(--radius); overflow-x: auto; white-space: pre-wrap; max-height: 70vh; }
.job-line { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.spin { display: inline-block; width: 10px; height: 10px; border: 2px solid var(--gold); border-right-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Sign-in */
.signin-wrap { max-width: 420px; margin: 8vh auto; }
.signin-wrap h1 { font-size: 1.9rem; }
.signin { display: flex; gap: 8px; margin-top: 12px; }
.error { color: var(--bad); }
.note { color: var(--muted); font-size: 13px; margin-top: 16px; }

/* Diff */
.diff { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; max-height: 60vh; overflow: auto; }
.diff .add { background: #e1f1e6; display: block; }
.diff .del { background: #f8e0dc; display: block; text-decoration: line-through; }

footer.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 20px; }

@media (max-width: 700px) {
  .bar-in { padding: 8px 16px; gap: 6px 12px; }
  .nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; margin: 0 -6px; }
  .who span { display: none; }
  .who { margin-left: auto; }
  main { padding: 18px 16px 48px; }
  .q-num { width: 36px; font-size: 17px; }
}

/* The queue on a phone: each episode a stacked block instead of a wide row. */
@media (max-width: 700px) {
  .queue-table { padding: 4px 14px; }
  .queue-table thead { display: none; }
  .queue-table table, .queue-table tbody, .queue-table tr, .queue-table td { display: block; }
  .queue-table tr { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .queue-table tr:last-child { border-bottom: 0; }
  .queue-table td { border: 0; padding: 0; }
  .queue-table td:not(.q-num):not(.q-date) { grid-column: 1 / -1; }
  .queue-table .q-num { width: auto; grid-row: span 1; }
  .queue-table .q-title { margin-top: 4px; }
  .queue-table .q-actions { text-align: left; margin-top: 6px; }
  .queue-table .steps { margin-top: 6px; }
}

/* ---- Angle picker ---------------------------------------------------------------------- */
.angle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.angle-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--line, #e3d9c8);
  border-radius: 10px; background: var(--card, #fffdf8); cursor: pointer; font-weight: normal; margin: 0; }
.angle-card:hover { border-color: #b88a3e; }
.angle-card:has(input:checked) { border: 2px solid #b88a3e; box-shadow: 0 0 0 3px rgba(184, 138, 62, .15); padding: 13px 15px; }
.angle-card > input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.angle-argument { font-family: Georgia, serif; font-size: 1.08rem; line-height: 1.4; }
.angle-title { color: #6b5a44; }
.angle-moments { margin: 0; padding-left: 18px; }
.angle-moments li { margin: 3px 0; }
.angle-card.own textarea, .angle-card.own input[type=text] { width: 100%; }

/* Two-click confirmation (data-confirm in app.js) */
button.armed { outline: 2px solid var(--gold, #b8860b); outline-offset: 1px; }
.confirm-note { color: var(--muted); margin-left: 8px; }
