/* The Studio's channel concepts (concept.js) and chat (chat.js), on top of
   /styles.css and its colour tokens. Phone first: one column, big tap targets. */

/* ---- a production's concept on its channel page ---- */
.concept { max-width: 760px; }
.concept-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.concept-head h3 { margin: 0; }
.concept h4 { margin: 18px 0 8px; font-size: 16px; }
.concept-logline { font-size: 19px; line-height: 1.45; margin: 10px 0 12px; }
.concept-note { margin: 10px 0; padding: 8px 12px; border-radius: 8px; border: 1px dashed var(--line); color: var(--muted); }
.concept-note.proposal { border-style: solid; border-color: #b7791f; color: inherit; }
.concept-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 12px 0; font-size: 15px; }
.concept-facts dt { font-weight: 600; }
.concept-facts dd { margin: 0; }
@media (max-width: 560px) {
  .concept-facts { grid-template-columns: 1fr; }
  .concept-facts dd { margin: 0 0 6px; }
}
.concept-pic { display: block; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; cursor: zoom-in; }
.concept-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.concept-pic.lineup { width: 100%; margin: 12px 0 4px; }
.concept-pic.lineup img { height: auto; object-fit: contain; }
.concept-cast { margin: 0; padding-left: 18px; }
.concept-cast li { margin: 0 0 6px; }
.concept-cast span { color: var(--muted); }
.concept-refs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.concept-refs .concept-pic { aspect-ratio: 1; }
.concept-shorts { list-style: none; margin: 0; padding: 0; }
.concept-shorts .short { border-top: 1px solid var(--line); padding: 10px 0; }
.concept-shorts .short-top { display: flex; gap: 10px; align-items: baseline; }
.concept-shorts .short-n { color: var(--muted); min-width: 1.5em; text-align: right; font-variant-numeric: tabular-nums; }
.concept-shorts .short-cap { flex: 1; }
.concept-shorts .short-bit { margin: 4px 0 6px 2.1em; color: var(--muted); font-size: 15px; }
.concept-shorts .btn { margin-left: 2.1em; }
.concept-shorts .short.done .short-cap { color: var(--ok); }
.pill.st-done { color: var(--ok); border-color: var(--ok); }
.pill.st-in-progress { color: #b7791f; border-color: #b7791f; }
.concept-rules { margin: 14px 0 0; }
.concept-rules summary { cursor: pointer; font-weight: 600; }
.concept-rules li { margin: 6px 0; font-size: 15px; }
.concept-src { margin: 14px 0 0; font-size: 14px; }
.chan-card .concept-badge { display: block; }
/* a channel of several series (Petty District: the crew and Paul) */
.concept-series { border-top: 2px solid var(--line); margin: 18px 0 0; padding: 14px 0 0; }
.concept-series .concept-head h3 { font-size: 20px; }
.concept-series .concept-logline { font-size: 17px; }
.concept-about { margin: 2px 0 6px; color: var(--muted); }
.concept-series-list { margin: 8px 0 0; }

/* Andrew's Shows list: Archive under each card, the archived ones in a drawer */
.chan-item { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.chan-item > button.chan-card { flex: 1; }
.chan-item-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 40px; }
.chan-item-actions .sub { flex: 1; color: var(--muted); font-size: 14px; }
.chan-item-actions button.small { min-height: 40px; padding: 6px 14px; }
.chan-item.archived button.chan-card { opacity: .72; }
.chan-archived { margin: 8px 0 24px; }
.chan-archived > summary { cursor: pointer; font-weight: 600; padding: 10px 0; min-height: 40px; }
.chan-archived > .chan-grid { margin-top: 10px; }
.chan-head > button.small { min-height: 40px; }
/* the second row of a channel choice: which series (or either) */
.news-series, .bits-series { margin-top: 4px; }
.news-series[hidden], .bits-series[hidden] { display: none; }

/* ---- the Studio chat ---- */
.chat { max-width: 760px; margin: 0 auto; }
.chat-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.chat-title { flex: 1; min-width: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-title .pill { margin-left: 6px; font-weight: 400; }
.chat-bar .count { margin-left: 6px; }
.chat-threads { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
.chat-thread-row { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.chat-thread-row.on { border-color: var(--ink); }
.chat-thread-open { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: 2px; text-align: left; font-weight: 400; padding: 10px 12px; border: 0; background: transparent; }
.chat-thread-row .sub { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-thread-row > .small { flex: none; margin-right: 8px; }
button.chat-clear { color: var(--muted); font-weight: 500; padding: 10px 6px; font-size: 14px; }
.chat-thread-top { display: flex; align-items: center; gap: 6px; }
.chat-thread-top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-thread-top .pill { flex: none; font-size: 12px; padding: 1px 8px; }
.pill.cancelled { color: var(--muted); border-style: dashed; }
.chat-list-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.chat-show-cleared { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); cursor: pointer; padding: 6px 0; }
.chat-show-cleared input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
h4.chat-cleared-h { margin: 10px 0 2px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.chat-thread-row .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rule); flex: none; }
.chat-log { display: flex; flex-direction: column; gap: 14px; padding: 0 0 12px; min-height: 30vh; }
.chat-hint { color: var(--ink); padding: 8px 2px; }
.chat-hint p { margin: 0 0 8px; }
.chat-hint .sub { color: var(--muted); font-size: 15px; }
.chat-turn { display: flex; flex-direction: column; gap: 6px; }
.chat-msg { display: flex; flex-direction: column; gap: 6px; }
.chat-msg.mine { align-items: flex-end; }
.chat-msg.theirs { align-items: flex-start; }
.chat-msg .bubble { max-width: 88%; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); overflow-wrap: anywhere; }
.chat-msg.mine .bubble { background: var(--ink); color: var(--paper); border-color: var(--ink); white-space: pre-wrap; border-bottom-right-radius: 4px; }
.chat-msg.theirs .bubble { border-bottom-left-radius: 4px; width: 88%; }
.chat-msg .bubble.failed { border-color: var(--no); }
.chat-msg .bubble.cancelled { border-style: dashed; color: var(--muted); }
.chat-msg .bubble.working { color: var(--muted); }
.chat-msg .bubble.working .progress { margin: 0; }
.chat-log-lines { margin: 6px 0 4px; padding-left: 18px; font-size: 14px; }
.chat-log-lines li { margin: 2px 0; }
.chat-meta { margin: 0 4px; font-size: 13px; color: var(--muted); }
.chat-files { display: flex; flex-wrap: wrap; gap: 8px; max-width: 88%; }
.chat-files.mine { justify-content: flex-end; }
.chat-img { padding: 0; border-radius: 10px; overflow: hidden; background: #fff; cursor: zoom-in; width: 132px; height: 132px; }
.chat-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.chat-video { width: min(100%, 320px); border-radius: 10px; }
.chat-doc { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--card); }
.chat-doc summary { cursor: pointer; font-weight: 600; overflow-wrap: anywhere; }
.chat-doc-body { margin-top: 8px; }
.chat-file { font-weight: 600; overflow-wrap: anywhere; }
.chat-compose { position: sticky; bottom: 0; background: var(--paper); padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.chat-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-input { flex: 1; min-width: 0; font: inherit; font-size: 17px; line-height: 1.4; padding: 10px 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); color: var(--ink); resize: none; max-height: 240px; }
.chat-attach { width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 24px; line-height: 1; flex: none; }
.chat-send { flex: none; height: 44px; border-radius: 22px; }
.chat-pending { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-pending:not(:empty) { margin: 0 0 8px; }
.chat-thumb { position: relative; width: 64px; height: 64px; }
.chat-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
.chat-thumb button { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; padding: 0; border-radius: 50%; font-size: 16px; line-height: 1; }
.chat-err:not(:empty) { margin: 6px 0 0; }
.chat-err:empty { display: none; }
/* Markdown in a reply */
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote, .md pre { margin: 0 0 8px; }
.md h3, .md h4, .md h5, .md h6 { margin: 12px 0 6px; font-size: 16px; }
.md h3 { font-size: 18px; }
.md ul, .md ol { padding-left: 20px; }
.md li { margin: 2px 0; }
.md code { font: 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--paper); border-radius: 4px; padding: 1px 4px; overflow-wrap: anywhere; }
.md pre { background: var(--paper); border-radius: 8px; padding: 10px; overflow-x: auto; }
.md pre code { padding: 0; background: none; white-space: pre; }
.md blockquote { border-left: 3px solid var(--line); padding-left: 10px; color: var(--muted); }
.md-table { overflow-x: auto; margin: 0 0 8px; }
.md table { border-collapse: collapse; font-size: 14px; }
.md th, .md td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
.md a { color: inherit; }

/* ---- the Publish tab (publish.js): each channel's Instagram queue ---- */
.pub { max-width: 820px; margin: 0 auto; }
.pub-pills { display: flex; gap: 6px; flex-wrap: wrap; padding: 2px 0 6px; margin: 0 0 14px; }
button.chip.pub-pill { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; padding: 7px 11px; font-size: 15px; }
.pub-days { font-size: 11px; font-weight: 700; line-height: 17px; padding: 0 6px; border-radius: 999px; background: var(--line); color: var(--ink); font-variant-numeric: tabular-nums; }
.pub-pill.on .pub-days { background: var(--paper); color: var(--ink); }
.pub-days.low, .pub-pill.on .pub-days.low { background: var(--rule); color: #fff; }
.pub-days.off, .pub-pill.on .pub-days.off { background: transparent; color: inherit; border: 1px solid currentColor; font-weight: 500; opacity: .75; }
.pub-flash.bad { background: transparent; color: var(--no); border-color: var(--no); }
.pub-head .pub-head-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pub-head h3 { margin: 0; font-size: 21px; }
.pub-handle { font-weight: 400; color: var(--muted); font-size: 16px; }
.pub-seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 14px 0 6px; }
.pub-seg button { flex: 1; border: 0; border-radius: 0; background: var(--paper); padding: 11px 6px; font-size: 16px; }
.pub-seg button + button { border-left: 1px solid var(--line); }
.pub-seg button.on { background: var(--ink); color: var(--paper); }
.pub-head .sub.pub-mode-note { font-size: 14px; margin: 0 0 4px; }
.pub-conns { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.pub-conn { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.pub-conn > span { min-width: 0; overflow-wrap: anywhere; }
.pub-conn small { display: block; color: var(--muted); font-size: 13px; }
.pub-conn.bad { border-color: var(--no); }
.pub-conn.opt { border-style: dashed; background: transparent; }
.pub-conn button { flex: none; }
.pub-conn button.link.pub-disc { font-size: 14px; font-weight: 500; color: var(--muted); }
.pub-switches { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
.pub-switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; margin: 6px 0; }
.pub-switch b { display: block; font-size: 16px; }
.pub-switch small { display: block; color: var(--muted); font-size: 14px; line-height: 1.35; }
.pub-switch input { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; margin: 0; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; }
.pub-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.35); transition: transform .15s; }
.pub-switch input:checked { background: var(--ok); }
.pub-switch input:checked::after { transform: translateX(18px); }
.pub-switch input:focus-visible { outline: 3px solid var(--rule); outline-offset: 2px; }
.pub-switch input[disabled] { opacity: .5; }
.pub-queued { padding: 10px 12px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); font-size: 15px; }
.pub-queued b { font-size: 17px; }
.pub-queued.low { border-color: var(--rule); }
.pub-queued.low b { color: var(--rule); }
.pub-warnings { margin: 8px 0 0; padding-left: 20px; color: #b7791f; font-size: 14px; }
.pub-warnings li { margin: 2px 0; }
.pub-head .sub.pub-run { font-size: 14px; margin: 10px 0 0; }
.pub-err { margin: 6px 0 0; font-size: 14px; }
.pub-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin: 26px 0 4px; }
.pub-sec-head h2 { margin: 0; }
.pub-hint { font-size: 14px; margin: 6px 0 0; }
.pub-day h3.type { margin: 18px 0 2px; }
.pub-slot { display: grid; grid-template-columns: 50px 54px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.pub-slot.past { opacity: .62; }
.pub-slot.empty-slot { align-items: center; padding: 6px 0; }
.pub-slot.empty-slot .pub-thumb { height: 28px; }
.pub-slot.st-skipped .pub-title { text-decoration: line-through; color: var(--muted); }
.pub-when { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); line-height: 1.3; }
.pub-when b { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.pub-when small { font-size: 12px; }
.pub-thumb { width: 54px; height: 72px; padding: 0; border-radius: 6px; overflow: hidden; position: relative; background: var(--line); border: 1px solid var(--line); display: block; cursor: zoom-in; }
.pub-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-thumb.none { display: flex; align-items: center; justify-content: center; color: var(--muted); background: transparent; border-style: dashed; cursor: default; }
.pub-thumb.video::after { content: "\25B6"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; line-height: 24px; text-align: center; padding-left: 2px; }
.pub-n { position: absolute; right: 3px; top: 3px; font-size: 11px; font-weight: 700; padding: 0 5px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; }
.pub-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pub-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; position: relative; }
.pub-title { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; min-width: 0; }
.pub-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 14px; }
.pub-meta .pill { font-size: 12px; padding: 1px 8px; }
.pub-meta a { color: inherit; font-weight: 600; }
.pub-set { font-size: 13px; }
.pill.pub-state.need { color: var(--rule); border-color: var(--rule); font-weight: 700; }
.pill.pub-state.ok { color: var(--ok); border-color: var(--ok); }
.pill.pub-state.busy { color: #b7791f; border-color: #b7791f; }
.pill.pub-state.bad { color: var(--no); border-color: var(--no); }
.pub-why, .pub-flag, .pub-dry, .pub-cap { margin: 0; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.pub-why { color: var(--muted); }
.pub-why.bad { color: var(--no); }
.pub-flag { color: #b7791f; }
.pub-flag::before { content: "\26A0\FE0E  "; }
.pub-dry { color: var(--ok); }
.pub-dry.bad { color: var(--no); }
.pub-dry small { color: var(--muted); }
.pub-cap { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-stats { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 14px; color: var(--muted); }
.pub-stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pub-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.pub-actions:empty { display: none; }
.pub-more { flex: none; }
.pub-more summary { list-style: none; cursor: pointer; display: inline-block; font-weight: 700; padding: 0 10px; min-width: 40px; text-align: center; border-radius: 8px; border: 1px solid var(--line); background: var(--card); line-height: 30px; }
.pub-more summary::-webkit-details-marker { display: none; }
.pub-more summary:focus-visible { outline: 3px solid var(--rule); outline-offset: 2px; }
.pub-more[open] summary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pub-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: max-content; max-width: calc(100vw - 32px); padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: var(--shadow); }
.pub-menu button { text-align: left; border-color: transparent; background: transparent; }
.pub-menu button:hover, .pub-menu button:focus-visible { background: var(--paper); border-color: var(--line); }
.pub-edit { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
textarea.pub-caption { width: 100%; font: inherit; font-size: 16px; line-height: 1.45; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); resize: vertical; }
.pub-edit-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.pub-sec { margin: 0 0 6px; }
section.pub-sec > h2 { margin: 26px 0 4px; }
details.pub-sec > summary { cursor: pointer; list-style: none; margin: 22px 0 6px; }
details.pub-sec > summary::-webkit-details-marker { display: none; }
details.pub-sec > summary h2 { display: inline; margin: 0; }
details.pub-sec > summary h2::before { content: "\25B8  "; color: var(--muted); font-size: 16px; }
details.pub-sec[open] > summary h2::before { content: "\25BE  "; }
.pub-last { display: block; font-size: 14px; margin: 2px 0 0 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.pub-sec[open] .pub-last { display: none; }
ol.pub-later { margin: 0; padding: 0; list-style: none; }
ol.pub-later li { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.pub-later-t { min-width: 0; flex: 1; overflow-wrap: anywhere; }
ol.pub-later li .pub-thumb { width: 42px; height: 56px; flex: none; }
.pub-later-t .pill { margin-left: 6px; font-size: 12px; padding: 1px 8px; }
ol.pub-later li .pub-flag { flex-basis: 100%; font-size: 13px; }
ol.pub-log { list-style: none; margin: 0; padding: 0; font-size: 14px; }
ol.pub-log li { padding: 6px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
ol.pub-log time { color: var(--muted); font-size: 13px; margin-right: 4px; }
ol.pub-log li.k-error { color: var(--no); }
ol.pub-log li.k-published { color: var(--ok); }
ol.pub-log li.k-wait { color: #b7791f; }
.pub-settings .card { margin-top: 8px; }
.pub-field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; font-size: 14px; color: var(--muted); min-width: 0; }
.pub-field > span { font-weight: 600; color: var(--ink); }
.pub-field small { font-size: 13px; }
.pub-field input[type="time"], .pub-field input.text, .pub-field select { width: 100%; font: inherit; font-size: 16px; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); min-width: 0; }
.pub-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.pub-rows { margin: 0 0 12px; }
.pub-field.pub-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 6px 0; border-bottom: 1px solid var(--line); }
.pub-rows .pub-row:last-child { border-bottom: 0; }
.pub-row-in { display: flex; align-items: center; gap: 8px; flex: none; }
.pub-field.pub-row input[type="time"] { width: 9.5em; }
.pub-field.pub-row input[type="number"] { width: 5.5em; }
.pub-row-in small { min-width: 4.5em; }
@media (max-width: 520px) { .pub-grid2 { grid-template-columns: 1fr; } }
.pub-days-row { display: flex; gap: 6px; flex-wrap: wrap; }
button.chip.pub-dayb { width: 40px; height: 40px; padding: 0; font-weight: 700; }
.pub-save { margin: 6px 0 0; }
.pub-uri { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.pub-uri-row { display: flex; gap: 8px; }
.pub-uri-row input { flex: 1; font-size: 14px !important; }
.lightbox.pub-lb { padding: 12px; }
.pub-lb-video { max-width: 100%; max-height: calc(100vh - 90px); width: auto; height: auto; border-radius: 8px; background: #000; }
.pub-lb-strip { display: flex; gap: 10px; max-width: 100%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.pub-lb-strip img, .pub-lb-strip video { flex: 0 0 auto; scroll-snap-align: center; max-height: calc(100vh - 110px); max-width: min(88vw, 540px); width: auto; height: auto; border-radius: 6px; background: #fff; object-fit: contain; }
/* the words editor, the draft-caption mark */
button.pub-title-btn { all: unset; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; min-width: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
button.pub-title-btn:hover { text-decoration-color: var(--rule); }
button.pub-title-btn:focus-visible { outline: 3px solid var(--rule); outline-offset: 2px; border-radius: 4px; }
.pill.pub-draftcap { color: #b7791f; border-color: #b7791f; font-weight: 600; white-space: normal; border-radius: 8px; }
.pub-edit { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.pub-slot > .pub-edit { grid-column: 1 / -1; margin-top: 2px; }
textarea.pub-tags { font-size: 15px; }
.pub-edit .pub-field { margin: 0 0 10px; }
.pub-field-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0 8px; font-weight: 600; color: var(--ink); }
.pub-count { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pub-count.over { color: var(--no); font-weight: 700; }
.pub-count.meh { color: #b7791f; }
.pub-edit input.text { width: 100%; font: inherit; font-size: 16px; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
ul.pub-problems, ul.pub-notes { margin: 0 0 6px; padding-left: 20px; font-size: 14px; }
ul.pub-problems:empty, ul.pub-notes:empty { display: none; }
ul.pub-problems { color: var(--no); }
ul.pub-notes { color: #b7791f; }
.pub-sec-btns { display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* the posting sheet: 30 days, printable */
.pub-sheet-bar { display: flex; justify-content: flex-end; position: sticky; top: 0; z-index: 4; background: var(--paper); padding: 8px 0; border-bottom: 1px solid var(--line); }
h2.pub-sheet-h { margin: 14px 0 2px; }
.pub-sheet-list { margin-top: 10px; }
.pub-sheet-row { display: grid; grid-template-columns: 74px 60px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.pub-sheet-when { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); line-height: 1.3; }
.pub-sheet-when b { color: var(--ink); font-size: 14px; }
.pub-sheet-when span { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pub-sheet-thumb { width: 60px; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--line); display: block; box-shadow: none; }
.pub-sheet-thumb.none { background: transparent; border-style: dashed; }
.pub-sheet-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pub-sheet-title { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.pub-sheet-title .pill { font-size: 12px; padding: 1px 8px; }
pre.pub-sheet-text { margin: 2px 0 0; font: 15px/1.45 -apple-system, "Helvetica Neue", Arial, sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 420px) {
  .pub-sheet-row { grid-template-columns: 60px minmax(0, 1fr); }
  .pub-sheet-when { grid-column: 1 / -1; flex-direction: row; gap: 8px; align-items: baseline; }
}
@media print {
  html:has(body.pub-printing), body.pub-printing { background: #fff; color: #000; }
  body.pub-printing .topbar, body.pub-printing .tabs, body.pub-printing #banner, body.pub-printing #nudge,
  body.pub-printing #error, body.pub-printing .pub-pills, body.pub-printing .pub-sheet-bar, body.pub-printing .pub-err { display: none !important; }
  body.pub-printing main { padding: 0; max-width: none; }
  body.pub-printing .pub-sheet, body.pub-printing .pub-sheet * { color: #000 !important; background: transparent !important; box-shadow: none !important; }
  body.pub-printing .pub-sheet .pill { border-color: #888 !important; }
  body.pub-printing .pub-sheet-row { grid-template-columns: 90px 54px minmax(0, 1fr); border-top: 1px solid #bbb; break-inside: avoid; page-break-inside: avoid; }
  body.pub-printing .pub-sheet-when { grid-column: auto; flex-direction: column; }
  body.pub-printing .pub-sheet-thumb { width: 54px; height: 72px; }
  body.pub-printing pre.pub-sheet-text { font-size: 11pt; }
}

/* ---- the News tab (news.js): headlines to pitch shorts from ---- */
.news { max-width: 760px; margin: 0 auto; }
.news-head { display: flex; flex-direction: column; gap: 10px; margin: 0 0 8px; }
input.news-search { width: 100%; font: inherit; font-size: 17px; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.news-chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.news-chips::-webkit-scrollbar { display: none; }
.news-chips button.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 15px; }
.news-switch { margin: 0; }
.news-meta { margin: 0; font-size: 13px; }
.news-sec { margin: 0 0 10px; }
.news-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 22px 0 2px; }
.news-sec-head h2 { margin: 0; font-size: 18px; }
.news-sec-head button.link { font-size: 14px; color: var(--muted); padding: 6px 0; }
.news-item { padding: 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.news-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13px; color: var(--muted); }
.news-top b { color: var(--ink); font-weight: 600; }
.news-top .pill { font-size: 12px; padding: 0 8px; }
.pill.news-flag { color: #b7791f; border-color: #b7791f; }
a.news-title { color: var(--ink); font-weight: 600; font-size: 17px; line-height: 1.35; text-decoration: none; overflow-wrap: anywhere; }
a.news-title:hover { text-decoration: underline; }
.news-item.flagged a.news-title { color: var(--muted); }
.news-sum { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.news-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.news-pitch { margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.news-pitch > .sub { margin: 0 0 4px; font-size: 14px; }
.news-seg { margin: 8px 0; }
.news-seg button { font-size: 15px; }
.news-pitch-msg:empty { display: none; }
.news-pitch-msg { margin: 6px 0 0; font-size: 14px; }
button.news-more { display: block; width: 100%; margin: 12px 0; }
.news-feeds { margin: 24px 0 0; font-size: 14px; color: var(--muted); }
.news-feeds summary { cursor: pointer; }
.news-feeds ul { margin: 8px 0 0; padding-left: 18px; }
.news-feeds li { margin: 3px 0; }
.news-feeds li b { color: var(--ink); font-weight: 600; }
.news-feeds li.bad b { color: var(--no); }

/* ---- Bits, the ideas inbox (bits.js): on the News tab and a reviewer's Bits tab ---- */
.bits { margin: 0 0 18px; }
.bits-page { max-width: 760px; margin: 0 auto; }
.bits-compose { display: flex; flex-direction: column; gap: 8px; padding: 12px; margin: 0 0 8px; }
textarea.bits-text { width: 100%; font: inherit; font-size: 17px; line-height: 1.4; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); resize: vertical; min-height: 48px; }
.bits-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.bits-chips button.chip { padding: 5px 12px; font-size: 14px; }
.bits-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bits-gap { flex: 1; }
button.bits-rec.on { background: var(--no); color: #fff; border-color: var(--no); font-variant-numeric: tabular-nums; }
.bits-pending { display: flex; flex-wrap: wrap; gap: 6px; }
.bits-pending:empty { display: none; }
.bits-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; background: var(--paper); }
.bits-chip button { width: 26px; height: 26px; padding: 0; border-radius: 50%; line-height: 1; }
.bits-msg { margin: 0; font-size: 14px; }
.bits-msg:empty { display: none; }
.bits-det > summary { cursor: pointer; padding: 6px 0; }
.bits-det > summary .count { margin-left: 4px; }
.bits-list { display: flex; flex-direction: column; }
.bits-item { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.bits-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.bits-meta .pill { font-size: 12px; padding: 0 8px; }
.bits-meta .bits-remove { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--muted); padding: 4px 0; }
.bits-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bits-media { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bits-img { padding: 0; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; cursor: zoom-in; background: #fff; }
.bits-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
audio.bits-audio { width: min(100%, 320px); height: 40px; }

/* ---- the Review tab (review.js): a reviewer's thumbs on the queued reels ---- */
.rv { max-width: 760px; margin: 0 auto; }
.rv-intro { margin: 0 0 6px; }
.rv-sec h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill.rv-gate { font-size: 12px; font-weight: 500; }
.rv-list { display: flex; flex-direction: column; }
.rv-card { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.rv-cover { position: relative; padding: 0; width: 104px; aspect-ratio: 9 / 16; border-radius: 8px; overflow: hidden; background: var(--line); cursor: pointer; align-self: start; }
.rv-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 15px; line-height: 38px; text-align: center; padding-left: 3px; }
.rv-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rv-title { font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.rv-cap, .rv-mine, .rv-other { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.rv-mine.up { color: var(--ok); }
.rv-mine.down { color: var(--no); }
.rv-votes { display: flex; gap: 8px; }
.rv-votes button.rv-vote { flex: 1; padding: 10px 6px; font-size: 16px; }
button.rv-vote.up.on { background: var(--ok); border-color: var(--ok); color: #fff; }
button.rv-vote.down.on { background: var(--no); border-color: var(--no); color: #fff; }
textarea.rv-note { width: 100%; font: inherit; font-size: 16px; line-height: 1.4; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); resize: vertical; }
.rv-actions { display: flex; justify-content: flex-end; }
.rv-msg { margin: 0; font-size: 14px; }
.rv-msg:empty { display: none; }
.rv-done > summary { cursor: pointer; margin: 10px 0 4px; color: var(--muted); }

/* ---- the reviewer's marks on the Publish tab (publish.js) ---- */
.pill.pub-review-up { color: var(--ok); border-color: var(--ok); }
.pill.pub-review-wait { color: #b7791f; border-color: #b7791f; }
.pill.pub-review-downpill { color: var(--no); border-color: var(--no); }
.pub-review-down { margin: 2px 0; padding: 8px 10px; border: 2px solid var(--no); border-radius: 8px; background: var(--card); }
.pub-review-down b { color: var(--no); font-size: 15px; }
.pub-review-down p { margin: 2px 0 0; font-size: 15px; overflow-wrap: anywhere; }
.pub-review-note { margin: 0; font-size: 14px; color: var(--ok); overflow-wrap: anywhere; }
button.pub-anyway { border-style: dashed; }
ul.pub-reviewers { list-style: none; margin: 4px 0 8px; padding: 0; }
ul.pub-reviewers li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--ink); overflow-wrap: anywhere; }
ul.pub-reviewers li.sub { color: var(--muted); border-bottom: 0; }
ul.pub-reviewers li button { flex: none; white-space: nowrap; }
.pub-uri-row input[type="email"] { flex: 1; min-width: 0; font: inherit; font-size: 16px !important; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }

/* ---- comments on our posts (publish.js, igcomments.py) ---- */
.pub-cmt { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.pub-cmt-thumb { width: 54px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--line); display: block; }
.pub-cmt-thumb.none { background: transparent; border-style: dashed; }
.pub-cmt-who { font-size: 14px; overflow-wrap: anywhere; }
.pub-cmt-who a { color: inherit; }
.pub-cmt-text { margin: 2px 0; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
.pub-reply-text { margin: 2px 0; padding: 6px 10px; border-left: 3px solid var(--ok); background: var(--paper); border-radius: 0 6px 6px 0; font-size: 15px; overflow-wrap: anywhere; }
.pub-reply-text:empty { display: none; }
textarea.pub-reply { font-size: 16px; }
.pub-cmt button.link.pub-disc, ol.pub-later button.link.pub-disc { font-size: 14px; font-weight: 500; color: var(--muted); padding: 6px 2px; }
.pub-cmt.st-replied .pub-reply-text, .pub-cmt.st-approved .pub-reply-text { border-left-color: var(--ok); }
/* YouTube Shorts on the Publish tab (publish.js youtubeBox, ytLine) */
.pub-yt { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.pub-yt .pub-switch select { flex: none; font-size: 16px; }
.pub-yt-line { margin: 4px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.pub-cu { font-size: 12px; padding: 1px 7px; color: #b7791f; border-color: #b7791f; }
.pub-cu-box { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.pub-cu-status { margin: 0 0 6px; font-size: 15px; overflow-wrap: anywhere; }
.pub-cu-perday { display: inline-flex; gap: 6px; align-items: center; }
.pub-cu-perday input { width: 4.5em; font-size: 16px; }
.pub-cu-list summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.pub-cu-list ol { margin: 6px 0 0; padding-left: 1.4em; }
.pub-cu-row { margin: 4px 0; font-size: 14px; overflow-wrap: anywhere; }
.pub-cu-row.bad small { color: var(--no); }

/* ---- Publish: long-form episodes (16:9, YouTube only) ---- */
.pub-ep { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
@media (min-width: 640px) { .pub-ep { grid-template-columns: 240px minmax(0, 1fr); gap: 14px; } }
.pub-ep.past { opacity: .62; }
.pub-ep.st-skipped .pub-title { text-decoration: line-through; color: var(--muted); }
.pub-ep-thumb { width: 100%; max-width: 360px; aspect-ratio: 16 / 9; padding: 0; border-radius: 8px; overflow: hidden; position: relative; background: var(--line); border: 1px solid var(--line); display: block; cursor: zoom-in; }
.pub-ep-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-ep-thumb.none { display: flex; align-items: center; justify-content: center; color: var(--muted); background: transparent; border-style: dashed; cursor: default; font-size: 14px; }
.pub-ep-thumb.video::after { content: "\25B6"; position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; line-height: 30px; text-align: center; padding-left: 2px; }
.pub-ep-when { font-size: 14px; color: var(--muted); margin: 0 0 2px; }
.pub-ep-when b { color: var(--ink); }
.pub-ep-desc { white-space: pre-wrap; font-size: 13px; line-height: 1.45; max-height: 16em; overflow: auto; margin: 6px 0 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.pub-ep-steps { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.pub-ep-steps .err { color: var(--no); }
.pub-chapters { width: 100%; border-collapse: collapse; margin: 4px 0; }
.pub-chapters td { padding: 3px 4px 3px 0; vertical-align: middle; }
.pub-chapters td:first-child { width: 5.5em; }
.pub-chapters input { width: 100%; font-size: 16px; }
.pub-chapters .bad input { border-color: var(--no); }
.pub-ep-set { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.pub-ep-open { padding: 8px 0; margin: 0; border-top: 1px solid var(--line); }
.pub-ep-open.past { opacity: .62; }
.pub-ep .pub-edit { grid-column: 1 / -1; }
