:root {
  --bg: #0d1117; --panel: #161b22; --line: #30363d; --text: #e6edf3; --muted: #9ba5b0;
  --accent: #7cf29a; --no: #ff7b72; --yes: #7cf29a; --warn: #f0b72f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
/* An app, not a page: the document itself never scrolls or rubber-bands (iPhone); the views and the README screenshot
   scroll inside and keep their edge pull to themselves. No double-tap zoom on the buttons; pinch zoom stays. */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { touch-action: manipulation; }
.view, .card .shot, .card .info, #collect-log { overscroll-behavior: contain; }
nav, .actions { user-select: none; -webkit-user-select: none; }
button, input { font: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 10px; padding: .6em 1em; min-height: 44px; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .4; cursor: default; }
a.button { display: inline-flex; align-items: center; min-height: 44px; padding: .6em 1em; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--accent); }
.warn { color: var(--warn); }
/* Phone: read by screen readers, not shown (the Show select's label, the phase titles its tabs already name) */
@media (max-width: 999px) {
  .filters .show .lbl, .phase header h2 { position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap; }
}
/* At the top, over the header: at the bottom it covered the ✕/✓ buttons. Taps go through it to whatever is under. */
#toast { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 32px); background: var(--text); color: var(--bg); border-radius: 18px;
  padding: 8px 14px; font-size: .9em; font-weight: 600; text-align: center; z-index: 30; pointer-events: none; }
#toast.brief { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }
input { width: 100%; padding: .6em; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); min-height: 44px; }
label { display: block; margin: .6em 0; color: var(--muted); font-size: .9em; }
label input { margin-top: .25em; color: var(--text); }
h2 { font-size: 1em; margin: 1em 0 .3em; }
.panel > h2:first-child { margin-top: 0; }  /* else a panel's top padding looked twice its bottom one */
[hidden] { display: none !important; }
.error { color: var(--no); min-height: 1.4em; }

.login { max-width: 320px; margin: 20vh auto 0; padding: 0 16px; }
.login button { width: 100%; margin-top: .6em; background: var(--accent); color: #000; border: 0; font-weight: 700; }
.login button.secondary { background: none; color: var(--muted); border: 1px solid var(--line); font-weight: 400; }

#app { display: flex; flex-direction: column; height: 100dvh; }
header { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 16px 4px; }
header h1 { margin: 0; font-size: 1.3em; }
#count { color: var(--muted); font-size: .9em; }
.view { flex: 1; overflow-y: auto; padding: 8px 16px 16px; }
nav { display: flex; border-top: 1px solid var(--line); background: var(--panel); padding-bottom: env(safe-area-inset-bottom); }
nav button { flex: 1; border: 0; border-radius: 0; background: none; color: var(--muted); font-size: .8em; padding: .9em 0; }
nav button[aria-current="page"] { color: var(--accent); font-weight: 700; }

#view-swipe { display: flex; flex-direction: column; overflow: hidden; }
#deck { flex: 1; position: relative; min-height: 0; }
.card { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; user-select: none; transition: transform .2s ease-out; }
.card .name { color: var(--muted); font-size: .85em; overflow-wrap: anywhere; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: .15em .6em; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 0 16px; }
#deck .empty, #stats .empty { margin-top: 30%; }  /* a whole view that is empty; list placeholders stay in place */
/* "Connecting to the PC…" while the start probe runs; its own class: tests match `.empty` for an empty deck */
#boot { color: var(--muted); text-align: center; padding: 0 16px; margin-top: 30%; }
#boot[hidden] { display: none; }
.actions { display: flex; justify-content: center; gap: 22px; padding: 14px 0 4px; }
.round { width: 64px; height: 64px; border-radius: 50%; font-size: 1.6em; padding: 0; }
.round.no { color: var(--no); } .round.yes { color: var(--yes); } .round.undo { width: 48px; height: 48px; font-size: 1.2em; align-self: center; }
.round.later { width: 48px; height: 48px; font-size: .8em; font-weight: 600; align-self: center; color: var(--accent); }

.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.panel + .panel { margin-top: 10px; }
.panel.alert { border-color: var(--no); }
.panel.alert h2 { color: var(--no); }
.muted { color: var(--muted); }
.offscreen { position: fixed; opacity: 0; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.list li, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.status { font-size: .75em; padding: .15em .6em; border-radius: 999px; border: 1px solid var(--line); }
.status.posted { color: var(--yes); } .status.failed { color: var(--no); }
video { width: 100%; max-height: 60vh; border-radius: 8px; background: #000; margin: 8px 0; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.buttons a { color: var(--accent); align-self: center; }
.buttons .primary { background: var(--accent); color: #000; border: 0; font-weight: 700; }
textarea { width: 100%; padding: .6em; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; margin-top: .25em; }
.review label { color: var(--muted); }
.review .error { margin: .3em 0; min-height: 0; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: .4em 0; color: var(--text); }
.switch input { --sw: 52px; --sh: 30px; min-height: 0; flex: none; }
/* role=switch checkboxes draw as toggles: a square box next to "Online" didn't read as on/off */
input[role=switch] { appearance: none; -webkit-appearance: none; width: var(--sw, 52px); height: var(--sh, 30px);
  min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 999px; background: var(--line); position: relative;
  flex: none; cursor: pointer; transition: background .15s; }
input[role=switch]::after { content: ""; position: absolute; top: 3px; left: 3px; width: calc(var(--sh, 30px) - 6px);
  height: calc(var(--sh, 30px) - 6px); border-radius: 50%; background: var(--text); transition: transform .15s; }
input[role=switch]:checked { background: var(--accent); }
input[role=switch]:checked::after { transform: translateX(calc(var(--sw, 52px) - var(--sh, 30px))); background: var(--bg); }
@media (prefers-reduced-motion: reduce) { input[role=switch], input[role=switch]::after { transition: none; } }
.offline-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.offline-bar span { flex: 1; text-align: center; color: var(--muted); font-size: .85em; }
.offline-bar span.pending { color: var(--accent); font-weight: 700; }
select { font: inherit; width: 100%; padding: .6em; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); min-height: 44px; margin-top: .25em; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; align-items: end; }
fieldset.skips { border: 1px solid var(--line); border-radius: 10px; margin: .6em 0; padding: 4px 12px; }
fieldset.skips legend { color: var(--muted); font-size: .9em; padding: 0 4px; }
progress { width: 100%; height: 10px; accent-color: var(--accent); }
#collect-log:empty, h2:has(+ #collect-log:empty) { display: none; }
#collect-log { max-height: 40vh; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: .8em; white-space: pre-wrap; margin: 0; }
.collect { display: grid; gap: 10px; margin-bottom: 10px; }
@media (min-width: 1000px) { .collect { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
  #collect-status { position: sticky; top: 0; } }
@media (max-width: 999px) { nav .pc, .pc-only { display: none; } }
/* panels in a grid get the grid's gap, not the stacked panels' top margin (it pushed the second column down) */
:is(.collect, .accounts, #stats) > .panel + .panel { margin-top: 0; }
.card .info { padding: 8px 10px 6px; flex: none; border-bottom: 1px solid var(--line); }
.card .title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card .name { color: var(--text); font-weight: 700; overflow-wrap: anywhere; font-size: .92em; }
.card .meta { display: flex; flex-wrap: wrap; gap: 3px; font-size: .7em; margin-top: 4px; }
.card .meta .chip { padding: .05em .5em; }
.card .meta.warn .chip { color: var(--warn); border-color: #6b5214; }
.card .hook { font-size: 1.05em; font-weight: 700; margin: .4em 0 .2em; }
.card .summary { margin: 0; color: #c9d1d9; font-size: .9em; }
.card .ai-btn { min-height: 32px; padding: .2em .8em; font-size: .8em; margin-top: 6px; color: var(--accent); }
.card .gh { flex: none; min-height: 32px; padding: .2em .7em; font-size: .78em; }
.card .legend { display: none; font-size: .75em; margin: 8px 0 0; }
.card .shot { flex: 1; overflow-y: auto; background: #0d1117; -webkit-overflow-scrolling: touch; }
.card .shot img { display: block; width: 100%; height: auto; pointer-events: none; }
.card .noimg { color: var(--muted); text-align: center; margin-top: 30%; }
@media (min-width: 1000px) {
  .card { flex-direction: row-reverse; }
  .card .info { flex: 1; min-width: 300px; border-bottom: 0; border-left: 1px solid var(--line); overflow-y: auto; padding: 16px; }
  .card .title { flex-direction: column; align-items: flex-start; }
  .card .meta { font-size: .88em; gap: 5px; }
  .card .legend { display: block; }
  .card .shot { flex: 0 1 720px; }
  .card .name { font-size: 1.1em; }
}
.offline-bar .mode { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--text); font-size: .85em; }
.offline-bar .mode input { --sw: 44px; --sh: 26px; }
/* Swipe filters. Phone: Show + a Filters button in one row, Trending/Sort/Topic/Search fold out below it. PC: one
   row, all open. 16 px text in the fields: iPhone Safari zooms into any smaller field on focus. */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px; margin-bottom: 8px; }
.filters label { flex: 1; margin: 0; font-size: .72em; }
.filters select, .filters input { min-height: 40px; padding: .3em .5em; font-size: 16px; margin-top: 2px; }
#filters-btn { min-height: 40px; padding: .3em .9em; font-size: .9em; }
#filters-btn.on { border-color: var(--accent); color: var(--accent); font-weight: 700; }
#filters-btn[aria-expanded="true"] { border-color: var(--accent); }
.more-filters { display: none; width: 100%; grid-template-columns: 1fr 1fr; gap: 6px; }
.more-filters.open { display: grid; }
.more-filters .grow { grid-column: 1 / -1; }
@media (min-width: 1000px) {
  #filters-btn { display: none; }
  .more-filters, .more-filters.open { display: contents; }
  .filters .grow { flex: 2; }
}
#offer-offline, #conflicts { margin-bottom: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#offer-offline[hidden], #conflicts[hidden] { display: none; }
#conflicts h2 { margin: 0; font-size: .9em; width: 100%; }
#conflict-list { width: 100%; font-size: .85em; }
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.modal .panel { width: 100%; max-width: 420px; }
.modal h2 { margin-top: 0; }
.picker-list { display: grid; gap: 8px; margin-bottom: 10px; }
.picker-list button { text-align: left; font-size: 1.05em; }
.picker-list .key { margin-right: .7em; opacity: .6; }  /* no display here: .pc-only hides it on the phone */
.picker-list .primary, .buttons .primary { background: var(--accent); color: #000; border: 0; font-weight: 700; }
.card .keys { display: none; }
@media (min-width: 1000px) { .modal { align-items: center; } .card .keys { display: block; } }
.pipe-bar { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 8px; }
.pipe-bar label { margin: 0; min-width: 180px; }
.pipe-bar span { font-size: .85em; }
.board { display: grid; gap: 12px; }
.phase { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-width: 0; }
.phase header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.phase h2 { margin: 0; }
@media (max-width: 999px) { .phase header { justify-content: flex-end; } }  /* its title is the tab above */
.phase .bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.phase .pauses { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.switch.auto { font-size: .8em; color: var(--muted); margin: 0; gap: 6px; }
.switch.auto input { --sw: 40px; --sh: 24px; }
.items { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.item { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.item .row { justify-content: flex-start; }
.item .row strong { flex: 1; overflow-wrap: anywhere; }
.item .row input[type=checkbox] { width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--accent); }
.item .meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 6px 0; font-size: .8em; }
.item .meta select { width: auto; min-height: 32px; padding: .2em .4em; margin: 0; font-size: 1em; }
.item details p { white-space: pre-wrap; font-size: .9em; }
.item .buttons button, .item .buttons .button { min-height: 36px; padding: .3em .7em; font-size: .85em; }
.chip.stale { color: var(--warn); border-color: #6b5214; }
.items .empty { color: var(--muted); font-size: .9em; padding: 6px; }
/* Export rows on a phone: the week's text first, the buttons on their own line underneath */
#exports .row { flex-wrap: wrap; }
#exports .row > span:first-child { flex: 1 1 200px; }
#exports .row .buttons, #exports .row > a { margin-left: auto; }
@media (min-width: 1000px) { .board { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; } }
.accounts { display: grid; gap: 12px; }
.account h2 { margin: 0; }
.account h3 { margin: 1em 0 .2em; font-size: .95em; }
.account.archived { opacity: .7; }
.add-account { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 8px; }
.add-account label { flex: 1; margin: 0; }
@media (min-width: 1000px) {
  #app { display: grid; grid-template-columns: 170px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  #app > header { grid-column: 2; }
  #app > .view { grid-column: 2; grid-row: 2; padding: 8px 24px 24px; }
  #app > nav { grid-column: 1; grid-row: 1 / 3; flex-direction: column; justify-content: flex-start; border-top: 0;
    border-right: 1px solid var(--line); padding: 16px 0; gap: 2px; }
  #app > nav button { flex: none; text-align: left; padding: .7em 20px; font-size: .95em; }
  #app > header { padding: 16px 24px 4px; }
  .accounts { grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); }
}
@media (min-width: 1000px) { #toast { max-width: 460px; } }
/* Settings: the form is long, its Save stays in reach (the feature switches save at once anyway) */
#settings-form > button[type=submit] { position: sticky; bottom: 8px; width: 100%; margin-top: 12px; z-index: 1;
  background: var(--accent); color: #000; border: 0; font-weight: 700; box-shadow: 0 0 0 8px var(--panel); }
#stats { display: grid; gap: 10px; }
/* PC: text and forms at a readable width instead of 1,250 px lines; Stats as cards, not label…far…number rows */
@media (min-width: 1000px) {
  #steps, #r-tabs, #review, #view-settings > .panel { max-width: 820px; }
  .stats-account { max-width: 320px; }
  #stats { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-items: start; }
  #stats > .panel:first-child { grid-column: 1 / -1; }
}
meter { width: 100%; height: 14px; margin: 6px 0; }
/* Review, the phone's phase tabs, the topic filter (owner, 25 Oct 2026) */
.badge { display: inline-block; min-width: 1.5em; padding: 0 .35em; border-radius: 999px; background: var(--accent);
  color: #000; font-size: .85em; font-weight: 700; line-height: 1.5em; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; }
.tabs button { flex: 1 1 auto; min-height: 38px; padding: .3em .5em; font-size: .85em; white-space: nowrap; }
.tabs button[aria-selected="true"] { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.tabs button.dot::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px;
  border-radius: 50%; background: var(--accent); vertical-align: middle; }
@media (max-width: 999px) { .board .phase:not(.open) { display: none; } }
@media (min-width: 1000px) { .tabs.phone { display: none; } }
.steps { display: grid; gap: 6px; margin-bottom: 10px; }
.steps:empty { display: none; }
.step { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 3px 3px 3px 12px; font-size: .9em; }
.step button { min-height: 36px; padding: .25em .9em; }
/* one filled button per screen: the item's Approve. The steps' batch buttons are outlined, else four green
   buttons competed for the thumb */
.step .primary { background: none; color: var(--accent); border: 1px solid var(--accent); font-weight: 700; }
.ractions .primary { background: var(--accent); color: #000; border: 0; font-weight: 700; }
.step .muted { padding-right: 8px; }
.ritem { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 0; }
.rhead { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rhead button { flex: none; width: 44px; padding: 0; font-size: 1.4em; }
.rtitle { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: center; }
.rtitle a { color: var(--text); overflow-wrap: anywhere; }
.rtitle span { font-size: .8em; }
.ritem label { margin: .4em 0; }
.ritem video { height: min(62vh, 640px); width: auto; max-width: 100%; aspect-ratio: 9 / 16; display: block; margin: 8px auto; }
.ritem .caption, .ritem .script { white-space: pre-wrap; font-size: .9em; }
.ritem details { margin: 6px 0; }
.ritem details summary { cursor: pointer; padding: 6px 0; color: var(--muted); }
.ritem details.readme { max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; }
.ritem details.readme img { display: block; width: 100%; }
/* the decision buttons stay in reach while the script scrolls */
.ractions { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px; padding: 10px 0; background: var(--panel); }
.ractions button { padding: .6em .4em; white-space: nowrap; }
.ractions .primary { grid-column: 1 / -1; font-size: 1.05em; }  /* the OK: full width, under the thumb */
.ractions .no { color: var(--no); }
.steps .busy { margin: 0 4px; font-size: .85em; }
.card .meta.topics .chip { min-height: 26px; padding: 0 .55em; border-radius: 999px; background: none; color: var(--accent);
  font: inherit; }
.card .meta.topics .chip.on { background: var(--accent); color: #000; }
