:root {
  --bg: #ffffff; --fill: #f5f5f5; --fill-hover: #ebebeb; --line: #e8e8e8;
  --ink: #222222; --ink-hover: #000000; --on-ink: #ffffff; --muted: #6f6f6f; --faint: #9a9a9a;
  --star: #f5a524; --ok: #12805c; --warn: #b54708; --danger: #d92d20; --scrim: rgb(0 0 0 / 0.35);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23222222' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  --font: "Google Sans", "Noto Sans Thai", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141414; --fill: #1f1f1f; --fill-hover: #2a2a2a; --line: #2e2e2e;
    --ink: #ececec; --ink-hover: #ffffff; --on-ink: #141414; --muted: #a3a3a3; --faint: #6b6b6b;
    --ok: #3fbf8f; --warn: #f0a35c; --danger: #ff6b5e; --scrim: rgb(0 0 0 / 0.6);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23ececec' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141414; --fill: #1f1f1f; --fill-hover: #2a2a2a; --line: #2e2e2e;
  --ink: #ececec; --ink-hover: #ffffff; --on-ink: #141414; --muted: #a3a3a3; --faint: #6b6b6b;
  --ok: #3fbf8f; --warn: #f0a35c; --danger: #ff6b5e; --scrim: rgb(0 0 0 / 0.6);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23ececec' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font); }
h1, h2, p { margin: 0; }

.rail { position: fixed; inset: 0 auto 0 0; width: 72px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 0; overflow-y: auto; scrollbar-width: none; background: var(--bg); border-right: 1px solid var(--line); }
.rail a { text-decoration: none; }
.mark { display: grid; place-items: center; width: 44px; height: 44px; flex: none; margin-bottom: 8px; color: var(--ink); }
.item { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.item[aria-current] { color: var(--ink); font-weight: 500; }
.ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; }
.rail .item { flex: none; }
.item[aria-current] .ico { background: var(--fill); }
.item:hover .ico { background: var(--fill-hover); }

main { max-width: calc(1440px + 136px); margin-inline: auto; padding: 48px 32px 48px 104px; }
.sub, .notice p, .empty p, .premise, .caption, .facts { max-width: 68ch; }
.head { margin-bottom: 48px; }
h1 { font-size: 32px; font-weight: 500; line-height: 1.25; }
.sub { color: var(--muted); margin-top: 4px; }
.keys { color: var(--muted); font-size: 13px; margin-top: 16px; }
kbd { font: 500 13px ui-monospace, monospace; padding: 2px 10px; border-radius: 999px; background: var(--fill); color: var(--ink); margin: 0 4px 0 12px; }
kbd:first-child { margin-left: 0; }

.card { max-width: 720px; margin-bottom: 24px; padding: 24px; background: var(--bg); border: 1px solid var(--line); border-radius: 24px; transition: opacity 150ms; }
.card.htmx-swapping { opacity: 0; }
.card h2 { font-size: 20px; font-weight: 500; line-height: 1.35; margin-top: 16px; }
.card p { margin-top: 4px; }
.meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
code { font: 500 13px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; padding: 4px 12px; border-radius: 12px; background: var(--fill); }
.who { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: var(--fill); font-size: 15px; font-weight: 500; }
.pl { margin-top: 16px; }
.pl-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pl-all { background: var(--bg); color: var(--ink); font: 500 15px var(--font); cursor: pointer; }
.pl-all:hover { background: var(--fill); }
.pl-all:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pl-facts { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.pl-cost { margin-top: 4px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.pl-cost b { color: var(--ink); font-size: 15px; font-weight: 500; }
.pl-strip { display: flex; gap: 2px; margin: 12px 0 0; padding: 0; list-style: none; }
.pl-strip li { min-width: 20px; }
.pl-strip a { display: grid; place-items: center; height: 20px; border-radius: 4px; background: var(--fill); color: var(--muted); font-size: 12px; font-weight: 500; text-decoration: none; }
.pl-strip a:hover { background: var(--fill-hover); color: var(--ink); }
.pl-strip li:first-child a { border-radius: 999px 4px 4px 999px; }
.pl-strip li:last-child a { border-radius: 4px 999px 999px 4px; }
.pl-strip li:only-child a { border-radius: 999px; }
.pl-strip .peak a { background: var(--ink); color: var(--on-ink); }
.pl-warn { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; color: var(--warn); font-size: 13px; }
.pl-fields { margin: 0; display: grid; gap: 8px; }
.pl-fields > div { display: grid; grid-template-columns: 112px 1fr; gap: 12px; }
.pl-fields dt { color: var(--muted); font-size: 13px; line-height: 22px; }
.pl-fields dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pl-clip { margin-top: 16px; }
.pl-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.pl-dim { color: var(--muted); font-size: 13px; }
.pl-scenes { margin: 16px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.pl-scenes > li { border-bottom: 1px solid var(--line); }
.pl-scene summary { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; cursor: pointer; list-style: none; }
.pl-scene summary::-webkit-details-marker { display: none; }
.pl-scene summary::after { content: ""; flex: none; width: 16px; height: 16px; margin-top: 4px; background: var(--chevron); transition: transform 150ms; }
.pl-scene[open] summary::after { transform: rotate(180deg); }
.pl-scene summary:hover .pl-line { color: var(--ink-hover); }
.pl-scene summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 12px; }
.pl-n { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; background: var(--fill); font-size: 13px; font-weight: 500; }
.pl-sum { flex: 1; min-width: 0; display: grid; }
.pl-when { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.pl-role { padding: 0 8px; border-radius: 12px; background: var(--fill); color: var(--ink); font-size: 12px; font-weight: 500; }
.pl-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-scene[open] .pl-line, .pl-scene[open] .pl-when > .pl-dim { display: none; }
.pl-body { display: grid; gap: 12px; padding: 0 0 16px 36px; }
.pl-still { width: 120px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 12px; background: var(--fill); }
.pl-beats { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.pl-fields b { font-weight: 500; }
.pl-say { padding-left: 12px; border-left: 2px solid var(--line); }
.pl-caption { white-space: pre-line; }
@media (max-width: 719px) {
  .pl-fields > div { grid-template-columns: 1fr; gap: 0; }
  .pl-body { padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .pl-scene summary::after { transition: none; } }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.reject { display: flex; flex: 1; gap: 12px; min-width: 240px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 20px; border: 0; border-radius: 999px; font: 500 15px var(--font); cursor: pointer; }
.approve { background: var(--ink); color: var(--on-ink); }
.approve:hover { background: var(--ink-hover); }
.secondary { background: var(--fill); color: var(--ink); }
.secondary:hover { background: var(--fill-hover); }
input { flex: 1; min-width: 0; height: 40px; padding: 0 16px; border: 0; border-radius: 999px; font: 400 15px var(--font); color: var(--ink); background: var(--fill); }
input::placeholder { color: var(--muted); }
input:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; }
.btn:focus-visible, .rail a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.outline { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.outline:hover { background: var(--fill); }
.htmx-request { opacity: .6; }
.btn.htmx-request { pointer-events: none; }
.btn:disabled { opacity: .6; cursor: default; }
.progress { position: fixed; inset: 0 0 auto 0; z-index: 100; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left; opacity: 0; pointer-events: none; }
.progress.on { opacity: 1; transform: scaleX(.9); transition: transform 8s cubic-bezier(.1, .7, .2, 1); }
@media (prefers-reduced-motion: reduce) { .progress.on { transform: scaleX(1); transition: none; } }
.err, .stale { color: var(--danger); font-size: 13px; }
.err:not(:empty), .stale:not(:empty) { margin-top: 12px; }

.title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.notice { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; padding: 16px 24px; background: var(--fill); border-radius: 24px; }
.notice svg { flex: none; }
.notice-title { font-weight: 500; }
.notice p + p { color: var(--muted); }
.stats { display: inline-flex; margin: 16px 0 48px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 20px; }
.stats div { display: flex; flex-direction: column-reverse; align-items: center; padding: 0 16px; }
.stats dd { margin: 0; font-size: 20px; font-weight: 500; line-height: 1.3; }
.stats dt { font-size: 13px; color: var(--muted); }
.stats-note { margin: -36px 0 48px; font-size: 13px; color: var(--muted); }
.group { margin-bottom: 48px; }
.group > h2 { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; font-size: 20px; font-weight: 500; }
.group .n { font-size: 15px; font-weight: 400; color: var(--muted); }
.group .card:last-child { margin-bottom: 0; }
.facts { font-size: 13px; color: var(--muted); }
.facts span { white-space: nowrap; margin-right: 4px; }
.facts span:not(:last-child)::after { content: "·"; margin-left: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; font-weight: 500; }

.empty { padding: 48px 24px; text-align: center; background: linear-gradient(var(--fill), var(--bg)); border-radius: 24px; }
.empty h2 { font-size: 20px; font-weight: 500; }
.empty p { color: var(--muted); margin: 4px auto 0; }
.card ~ .empty { display: none; }

@media (max-width: 719px) {
  .rail { inset: auto 0 0 0; width: auto; flex-direction: row; padding: 0 16px env(safe-area-inset-bottom); height: calc(64px + env(safe-area-inset-bottom)); justify-content: center; gap: 24px; border-right: 0; border-top: 1px solid var(--line); }
  .mark { display: none; }
  .item { flex-direction: row; gap: 8px; }
  .ico { width: 40px; height: 40px; }
  main { padding: 32px 16px calc(96px + env(safe-area-inset-bottom)); }
  .head { margin-bottom: 32px; }
  .reject { min-width: 100%; }
  .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 0; margin-bottom: 32px; padding: 12px 4px; }
  .stats div { padding: 0 8px; min-width: 0; }
  .stats dd { overflow-wrap: anywhere; }
  .stats-note { margin-top: -20px; margin-bottom: 32px; }
  .group { margin-bottom: 32px; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }
@media (pointer: coarse) { .btn, input { min-height: 44px; } }

.rail button.item { padding: 0; border: 0; background: none; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.rail button.item:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.login main { max-width: 400px; margin-inline: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 48px 16px; }
.login .logo { margin-bottom: 24px; }
.login form { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.login .btn { flex: none; }
@media (max-width: 719px) {
  .login main { padding: 32px 16px; justify-content: flex-start; padding-top: 96px; }
}

.no-play { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }
.premise { color: var(--muted); }
.notes { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; }
.notes:empty { display: none; }
.notes li { display: flex; gap: 12px; align-items: baseline; overflow-wrap: anywhere; }
.tc { flex: none; padding: 2px 10px; border: 0; border-radius: 12px; background: var(--fill); color: var(--ink); font: 500 13px ui-monospace, SFMono-Regular, Menlo, monospace; cursor: pointer; }
.tc:hover { background: var(--fill-hover); }
.tc.whole { font-family: var(--font); color: var(--muted); cursor: default; }
.note-form { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.note-form input { flex: 1 1 160px; }
.chip.at { flex: none; min-width: 96px; justify-content: center; background: var(--bg); color: var(--ink); font: 500 13px ui-monospace, SFMono-Regular, Menlo, monospace; cursor: pointer; }
.chip.at[aria-pressed="false"] { font-family: var(--font); color: var(--muted); }
.chip.at:hover { background: var(--fill); }
.chip.at:focus-visible, .tc:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 160px; min-width: 0; }
.field span { font-size: 13px; color: var(--muted); padding-left: 16px; }
.field input, select { flex: none; width: 100%; }
select { height: 40px; padding: 0 40px 0 16px; border: 0; border-radius: 999px; font: 400 15px var(--font); color: var(--ink); background: var(--fill) var(--chevron) no-repeat right 16px center; appearance: none; }
select:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; }
.fields .btn { flex: none; }
.card h2.first { margin-top: 0; }
#settings .card .facts { margin-top: 8px; }
.more { margin-top: 16px; }
.more summary { list-style: none; width: fit-content; }
.more summary::-webkit-details-marker { display: none; }
.more[open] summary { background: var(--fill); }
.rail .item[href="/instructions"] { margin-top: auto; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 12px 24px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-weight: 500; box-shadow: 0 2px 12px rgb(0 0 0 / 0.06); }
@media (max-width: 719px) {
  .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .rail .item[href="/instructions"] { margin-top: 0; }
  .rail { gap: 0; justify-content: space-around; padding-left: 4px; padding-right: 4px; }
  .rail .item { flex: 1 1 0; flex-direction: column; gap: 0; min-width: 0; }
  .rail .item .ico { width: 36px; height: 36px; }
}
@media (pointer: coarse) { select { min-height: 44px; } }
#settings .facts span { white-space: normal; }
.toast:empty { display: none; }
.card.task { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.card.task h3, .empty h3 { margin: 0; font-size: 20px; font-weight: 500; line-height: 1.35; }
a.btn { text-decoration: none; }
.tabs { display: flex; gap: 24px; margin: -24px 0 32px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a { flex: none; display: flex; align-items: baseline; gap: 8px; padding: 12px 0; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current] { color: var(--ink); font-weight: 500; border-bottom-color: var(--ink); }
.tabs a:hover { color: var(--ink); }
.tabs a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.tabs .n { font-size: 13px; font-weight: 400; color: var(--muted); }
.ages { display: grid; grid-template-columns: repeat(4, 1fr); margin: 16px 0 0; border: 1px solid var(--line); border-radius: 20px; padding: 12px 8px; }
.ages div { display: flex; flex-direction: column; padding: 0 8px; min-width: 0; }
.ages dt { order: 3; font-size: 13px; color: var(--muted); }
.ages dd { margin: 0; font-size: 20px; font-weight: 500; line-height: 1.3; }
.ages .vs { order: 2; font-size: 13px; font-weight: 500; min-height: 19.5px; }
.stat h2 { margin-top: 12px; }
.arms { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.arm { padding: 16px; border: 1px solid var(--line); border-radius: 20px; min-width: 0; }
.arm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; font-weight: 500; }
.card .arm-views { margin-top: 8px; font-size: 20px; font-weight: 500; }
.arm-caption { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.card .lead { margin-top: 16px; }
.start { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.start select { width: auto; flex: 1 1 160px; }
select:hover { background-color: var(--fill-hover); }
.evidence { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (max-width: 719px) {
  .tabs { margin-top: -16px; }
  .ages { grid-template-columns: 1fr 1fr; gap: 12px 0; }
  .arms { grid-template-columns: 1fr; }
  .start select, .start .btn { flex: 1 1 100%; }
}
.ages dd.none { font-size: 15px; font-weight: 400; color: var(--muted); line-height: 26px; }
@media (max-width: 719px) {
  .rail { gap: 0; justify-content: space-around; padding-left: 8px; padding-right: 8px; }
  .rail .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.variant { font-size: 13px; color: var(--muted); }
.caption { margin-top: 8px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
#settings .card h3 { margin: 0; font-size: 20px; font-weight: 500; line-height: 1.35; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 999px; }
.dot.run { background: var(--ink); }
.dot.wait { border: 1.5px solid var(--muted); }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--danger); }
.dot.off { background: var(--muted); }

.wide .tabs { margin: 0 0 16px; }
.wide .notice { margin-bottom: 24px; }
.money { margin-bottom: 32px; }
.bar { display: flex; height: 8px; overflow: hidden; border-radius: 999px; background: var(--fill); }
.bar .settled { background: var(--ink); }
.bar .held { background: var(--muted); }
.money-line { margin-top: 8px; }
.wide .stats-note { margin: 4px 0 32px; }

.rows > .err:not(:empty) { margin: 0 0 12px; }
.bulk { display: flex; align-items: center; gap: 12px; width: fit-content; margin-bottom: 12px; padding: 4px 4px 4px 20px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-weight: 500; }
.bulk[hidden] { display: none; }
.bulk .btn { height: 32px; padding: 0 16px; background: var(--on-ink); color: var(--ink); }
.bulk .btn:hover { background: var(--fill-hover); }
.frame { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th { height: 36px; padding: 0 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.table td { height: 36px; padding: 0 12px; white-space: nowrap; }
.table .num { text-align: right; }
.table .sel { width: 40px; padding-right: 0; }
.table .act { width: 1%; text-align: right; }
.table .code { font: 500 13px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.job-sub { display: block; font: 400 13px var(--font); letter-spacing: normal; color: var(--muted); }
.job-model { display: inline-block; vertical-align: bottom; max-width: 144px; overflow: hidden; text-overflow: ellipsis; }
.table tbody + tbody { border-top: 1px solid var(--line); }
.table tbody:hover { background: var(--fill-hover); }
.table tbody:has(> tr:not(.more-row) input:checked) { background: var(--fill); }
.table tbody:focus { outline: none; }
.table tbody.cursor { outline: 2px solid var(--ink); outline-offset: -2px; }
.table input[type=checkbox] { flex: none; width: 16px; height: 16px; margin: 0; vertical-align: middle; accent-color: var(--ink); }
.btn.small { height: 28px; padding: 0 12px; font-size: 13px; }
.err-row td { max-width: 0; height: auto; padding: 0 12px 8px 52px; white-space: normal; }
.job-err { color: var(--danger); font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.job-err summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; list-style: none; }
.job-err summary::-webkit-details-marker { display: none; }
.job-err[open] summary { white-space: normal; overflow-wrap: anywhere; }
.job-err pre { margin: 4px 0 0; font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.rows .empty .btn { margin-top: 16px; }

@media (max-width: 719px) {
  .table thead { display: none; }
  .table, .table tbody, .table td { display: block; }
  .table tr { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; padding: 8px 12px; }
  .table tr::after { content: ""; order: 5; flex-basis: 100%; }
  .table td { height: auto; padding: 0; }
  .table td:empty { display: none; }
  .table .sel { width: auto; order: 0; }
  .table .act { order: 4; width: auto; margin-left: auto; }
  .table .fact { order: 6; font-size: 13px; color: var(--muted); }
  .table .fact:not(:nth-last-child(2))::after { content: "·"; margin-left: 8px; }
  .table .err-row { padding-top: 0; }
  .table .err-row td { flex: 1 1 100%; min-width: 0; max-width: none; padding: 0; }
  .table .err-row::after { display: none; }
}

/* The jobs table needs about 1130px, so a narrower frame shows its rows as phones do. */
.jobs-frame { container: jobs / inline-size; }
@container jobs (max-width: 1139px) {
  .table thead { display: none; }
  .table, .table tbody, .table td { display: block; }
  .table tr { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; padding: 8px 12px; }
  .table tr::after { content: ""; order: 5; flex-basis: 100%; }
  .table td { height: auto; padding: 0; }
  .table td:empty { display: none; }
  .table .sel { width: auto; order: 0; }
  .table .act { order: 4; width: auto; margin-left: auto; }
  .table .fact { order: 6; font-size: 13px; color: var(--muted); }
  .table .fact:not(:nth-last-child(2))::after { content: "·"; margin-left: 8px; }
  .table .err-row { padding-top: 0; }
  .table .err-row td { flex: 1 1 100%; min-width: 0; max-width: none; padding: 0; }
  .table .err-row::after { display: none; }
}

.week { overflow-x: auto; }
.week table { width: 100%; min-width: 880px; border-collapse: collapse; table-layout: fixed; font-size: 14px; font-variant-numeric: tabular-nums; }
.week th, .week td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.week tr:last-child > * { border-bottom: 0; }
.week td + td, .week th + th, .week tbody th + td { border-left: 1px solid var(--line); }
.week thead th { height: 36px; font-size: 13px; font-weight: 400; color: var(--muted); }
.week thead th.today { color: var(--ink); font-weight: 500; }
.week td.today { background: var(--fill); }
.week tbody th { width: 136px; font-weight: 500; }
.week tbody th span { display: block; font-size: 13px; font-weight: 400; color: var(--muted); overflow-wrap: anywhere; }
.week td > * { display: flex; align-items: center; gap: 4px; width: 100%; height: 28px; margin-bottom: 4px; padding: 0 8px; overflow: hidden; border-radius: 999px; font-size: 13px; white-space: nowrap; }
.post-chip { border: 1px solid var(--line); background: var(--bg); color: var(--ink); text-decoration: none; }
.post-chip:hover { background: var(--fill-hover); }
.post-chip:focus-visible, .agenda-row:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.open-slot { border: 1px dashed var(--line); color: var(--muted); }
.week .code, .agenda .code, .drawer .code { font: 500 13px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.week .code { letter-spacing: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.agenda { display: none; }
.agenda section { margin-bottom: 24px; }
.agenda h2 { margin-bottom: 4px; font-size: 15px; font-weight: 500; }
.agenda-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 4px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; text-decoration: none; }
.agenda-row .who { margin-left: auto; color: var(--muted); font-size: 13px; }
.agenda-open { padding: 8px 4px; color: var(--muted); font-size: 13px; }
.drawer .facts { margin-top: 4px; }
.drawer .post-caption { margin-top: 16px; white-space: pre-line; overflow-wrap: anywhere; }
.drawer .post-caption ~ p { margin-top: 12px; }
.drawer .post-caption ~ p a { color: var(--ink); }
.drawer .post-caption + .caption-src { margin-top: 4px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.post-err { color: var(--danger); font-size: 13px; overflow-wrap: anywhere; }
.drawer article { margin-top: 24px; }
.takes h3 { margin: 0; font-size: 15px; font-weight: 500; }
.takes-gens { display: grid; gap: 16px; margin: 12px 0 0; padding: 0; list-style: none; }
.takes-gens > li { display: grid; gap: 8px; justify-items: start; }
.takes-head { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; }
.takes .pl-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
@media (max-width: 719px) {
  .week, .legend { display: none; }
  .agenda { display: block; }
}

.head .count { margin-left: 8px; font-size: 15px; font-weight: 400; color: var(--muted); }
.inbox .head { margin-bottom: 24px; }
.inbox > .keys { margin: -8px 0 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
a.chip, summary.chip { background: var(--bg); color: var(--ink); text-decoration: none; cursor: pointer; }
a.chip:hover, summary.chip:hover { background: var(--fill); }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.menu-body { position: absolute; z-index: 10; top: calc(100% + 8px); left: 0; display: flex; flex-direction: column; min-width: 200px; padding: 8px; background: var(--bg); color: var(--ink); font-weight: 400; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 12px rgb(0 0 0 / 0.06); }
.menu-body a { padding: 8px 12px; border-radius: 999px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.menu-body a:hover { background: var(--fill-hover); }
.menu-body a[aria-current] { background: var(--fill); font-weight: 500; }
.bulk .menu-body { width: min(360px, calc(100vw - 32px)); padding: 16px; gap: 12px; }
.bulk .menu-body .btn.approve { align-self: flex-start; background: var(--ink); color: var(--on-ink); height: 40px; }
.bulk .menu-body .reasons { margin: 0; }

.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 24px; align-items: start; }
.rows-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rows-list li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; transition: opacity 150ms; }
.rows-list li + li { border-top: 1px solid var(--line); }
.rows-list li:hover { background: var(--fill-hover); }
.rows-list li:has(input:checked), .rows-list li:has([aria-current]) { background: var(--fill); }
.rows-list li:focus { outline: none; }
.rows-list li:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.rows-list input[type=checkbox] { flex: none; width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--ink); }
.rows-list a { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: var(--ink); text-decoration: none; }
.rows-list a:focus-visible { outline: none; }
.rows-list .line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.rows-list .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.rows-list a[aria-current] .title { font-weight: 500; }
.rows-list .code { flex: none; font: 500 13px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; color: var(--muted); }
.inbox.htmx-swapping .rows-list:has(input:checked) li:has(input:checked),
.inbox.htmx-swapping .rows-list:not(:has(input:checked)) li:has([aria-current]) { opacity: 0; }
.pane { position: sticky; top: 24px; }
.record { padding: 24px; border: 1px solid var(--line); border-radius: 24px; }
.record h2 { margin-top: 16px; font-size: 20px; font-weight: 500; line-height: 1.35; max-width: 68ch; }
.record .premise { margin-top: 8px; }
.record .label { margin-top: 24px; font-size: 13px; color: var(--muted); }
.record .evidence { margin-top: 8px; }
.back { display: none; margin-bottom: 16px; }
.reasons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.reasons input[name=tags] { flex: 1 1 200px; }
.chip.toggle { position: relative; cursor: pointer; }
.chip.toggle:hover { background: var(--fill); }
.chip.toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.chip.toggle:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.chip.toggle:has(input:checked) { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.table td.rule { min-width: 240px; padding-top: 8px; padding-bottom: 8px; white-space: normal; }

@media (max-width: 719px) {
  .inbox > .keys, .inbox .head .keys { display: none; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .pane { display: none; position: static; }
  .inbox.reading > :not(.split), .inbox.reading .list { display: none; }
  .inbox.reading .pane { display: block; }
  .record { padding: 0; border: 0; border-radius: 0; }
  .back { display: inline-flex; }
  .record { padding-bottom: 72px; }
  .record .actions { position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); margin: 0; padding: 12px 16px; background: var(--bg); border-top: 1px solid var(--line); }
  .record .actions .btn { flex: 1; }
  .table td.rule { order: 1; flex: 1 1 0; min-width: 0; padding: 0; }
}
@media (prefers-reduced-motion: reduce) { .rows-list li { transition: none; } }
.inbox > .err:not(:empty) { margin: -8px 0 16px; }
.rv { display: grid; grid-template-columns: minmax(200px, 260px) minmax(min-content, 1fr) minmax(360px, 480px); gap: 32px; align-items: start; }
.rv-queue { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 48px); overflow-y: auto; scrollbar-width: none; }
.rv-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px; border-radius: 12px; color: var(--ink); font-size: 14px; text-decoration: none; }
.rv-row:hover { background: var(--fill-hover); }
.rv-row[aria-current] { background: var(--fill); font-weight: 500; }
.rv-row:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.rv-row code { padding: 0; background: none; }
.rv-hook { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-ver { font-size: 13px; color: var(--muted); }
.rv-stage { position: sticky; top: 24px; }
.head:has(+ .rv) { margin-bottom: 24px; }
@media (min-width: 1100px) {
  .head:has(> .keys) { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 32px; align-items: end; }
  .head > * { grid-column: 1; }
  .head > .keys { grid-column: 2; grid-row: 1 / span 3; max-width: 640px; margin: 0; line-height: 2; text-align: right; }
  .inbox > .keys { text-align: right; }
  .rv-stage { justify-self: center; }
}
.player { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; height: min(70vh, calc(100vh - 280px), 720px); aspect-ratio: 9 / 16; overflow: hidden; border-radius: 20px; background: var(--fill); }
.player video, .player img { display: block; width: 100%; height: 100%; object-fit: contain; }
.timeline { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.track { position: relative; flex: 1; height: 24px; cursor: pointer; }
.track::before, .played { content: ""; position: absolute; left: 0; top: 10px; height: 4px; border-radius: 999px; }
.track::before { right: 0; background: var(--fill-hover); }
.played { background: var(--muted); }
.tl-dot { position: absolute; top: 6px; width: 12px; height: 12px; margin-left: -6px; padding: 0; border: 2px solid var(--bg); border-radius: 999px; background: var(--ink); cursor: pointer; }
.tl-dot:hover { background: var(--ink-hover); }
.tl-dot:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.clock { font: 500 13px ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.panel { padding: 24px; background: var(--bg); border: 1px solid var(--line); border-radius: 24px; }
.rv-panel { min-width: 0; }
.rv-panel h2 { margin-top: 16px; font-size: 20px; font-weight: 500; line-height: 1.35; }
.rv-panel .premise { margin-top: 4px; }
.vtabs { display: flex; gap: 24px; margin-top: 24px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.vtabs button { flex: none; margin-bottom: -1px; padding: 12px 0; border: 0; border-bottom: 2px solid transparent; background: none; font: 400 15px var(--font); color: var(--muted); cursor: pointer; }
.vtabs button:hover { color: var(--ink); }
.vtabs [aria-selected="true"] { color: var(--ink); font-weight: 500; border-bottom-color: var(--ink); }
.vtabs button:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.rv-panel .notes { margin-top: 16px; }
.decision { margin-top: 16px; color: var(--muted); }
.decision + .decision { margin-top: 4px; }
.rv:not(:has(video)) .chip.at { display: none; }
.rv-actions { display: flex; gap: 12px; margin-top: 24px; }
.rv-actions .btn { flex: 1; }
.rv-panel[data-older] .rv-actions, .rv-panel[data-older] .rv-caption { display: none; }
.note-scene { margin-right: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.rv-caption { display: grid; gap: 8px; margin: 24px 0 0; padding: 0; border: 0; min-width: 0; }
.rv-caption legend { margin-bottom: 8px; padding: 0; font-weight: 500; }
.cap { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border: 1px solid transparent; border-radius: 16px; background: var(--fill); cursor: pointer; overflow-wrap: anywhere; }
.cap:hover { background: var(--fill-hover); }
.cap:has(input:checked) { border-color: var(--ink); background: var(--bg); }
.cap input { flex: none; width: 16px; height: 16px; min-height: 0; margin: 3px 0 0; padding: 0; accent-color: var(--ink); }
.rv-caption textarea { width: 100%; min-height: 72px; padding: 12px 16px; border: 0; border-radius: 16px; font: 400 15px/1.5 var(--font); color: var(--ink); background: var(--fill); resize: vertical; field-sizing: content; }
.rv-caption textarea::placeholder { color: var(--muted); }
.rv-caption textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; }
.cap:has(input[value=""]:not(:checked)) + textarea { display: none; }
@media (pointer: coarse) { .tl-dot { top: 4px; width: 16px; height: 16px; margin-left: -8px; } }
@media (max-width: 1099px) {
  .rv { grid-template-columns: auto minmax(0, 1fr); }
  .rv-queue { grid-column: 1 / -1; position: static; flex-direction: row; max-height: none; overflow-x: auto; }
  .rv-row { flex: none; max-width: 240px; }
}
@media (max-width: 719px) {
  .head:has(+ .rv) .keys { display: none; }
  .rv { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-bottom: 72px; }
  .rv-stage { position: static; }
  .player { width: 100%; height: min(calc((100vw - 32px) * 16 / 9), 70vh, calc(100dvh - 360px - env(safe-area-inset-bottom))); }
  .rv-panel { padding: 8px 0 0; border: 0; border-radius: 0; }
  .rv-actions { position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); margin: 0; padding: 12px 16px; background: var(--bg); border-top: 1px solid var(--line); }
}


#drawer:empty { display: none; }
.scrim { position: fixed; inset: 0; z-index: 10; background: var(--scrim); backdrop-filter: blur(8px); }
.drawer { position: fixed; inset: 0 0 0 auto; z-index: 11; width: 480px; overflow-y: auto; padding: 32px; background: var(--bg); border-left: 1px solid var(--line); border-radius: 12px 0 0 12px; box-shadow: 0 2px 12px rgb(0 0 0 / 0.06); animation: drawer-in 150ms ease-out; }
@keyframes drawer-in { from { transform: translateX(100%); } }
.drawer-close { position: absolute; top: 24px; right: 24px; width: 40px; padding: 0; }
.drawer-close:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.drawer h2 { margin-top: 16px; font-size: 20px; font-weight: 500; line-height: 1.35; }
.drawer .premise { margin-top: 8px; }
.drawer-status { display: flex; align-items: center; gap: 8px; min-height: 40px; padding-right: 56px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 24px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.kv div { display: contents; }
.kv dt { font-size: 13px; line-height: 22px; color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 719px) {
  .drawer { width: 100%; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); border: 0; border-radius: 0; }
  .drawer-close { top: 16px; right: 16px; }
}
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } }

h1 .count { margin-left: 4px; font-size: 20px; font-weight: 400; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin: -24px 0 24px; }
.switch { display: flex; gap: 8px; }
.filters .chip { background: var(--bg); color: var(--ink); text-decoration: none; }
.filters .chip:hover { background: var(--fill); }
.filters .chip[aria-current], .filters .chip[aria-pressed="true"] { background: var(--fill); border-color: var(--ink); }
.filters .chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.lanes { display: grid; grid-template-columns: repeat(6, minmax(176px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; }
.lane { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px; background: var(--fill); border-radius: 12px; }
.lane h2 { display: flex; align-items: baseline; gap: 8px; padding: 0 4px 4px; font-size: 15px; font-weight: 500; }
.lane .n { font-size: 13px; font-weight: 400; color: var(--muted); }
.lane-more { padding: 0 4px; font-size: 13px; color: var(--muted); }
.bcard { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.bcard:hover { border-color: var(--muted); }
.bcard:focus, .bcard a:focus { outline: none; }
.bcard.cursor, .bcard:has(a:focus-visible) { outline: 2px solid var(--ink); outline-offset: -1px; }
.bcard a { display: flex; flex-direction: column; gap: 4px; padding: 12px; color: var(--ink); text-decoration: none; }
.bcard-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.bcard .code, .table .code a { font: 500 13px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; color: var(--ink); }
.bcard .hook { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 14px; overflow-wrap: anywhere; }
.bcard .state { display: flex; align-items: center; font-size: 13px; color: var(--muted); }
.bcard .state > span:first-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.table th a { color: inherit; text-decoration: none; }
.table th a:hover, .table th[aria-sort] a { color: var(--ink); }
.table th[aria-sort] { font-weight: 500; }
.table .code a { text-decoration: none; }
.table .hook-cell { width: 100%; max-width: 0; overflow: hidden; text-overflow: ellipsis; }
.table .data-cell { width: 100%; max-width: 0; overflow: hidden; text-overflow: ellipsis; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.trend-link { color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 719px) {
  .filters { margin-top: -16px; }
  .lanes { grid-template-columns: repeat(6, 82%); margin: 0 -16px; padding: 0 16px; scroll-snap-type: x mandatory; scroll-padding: 0 16px; }
  .lane { scroll-snap-align: start; }
  .table .hook-cell { flex: 1 1 0; min-width: 0; max-width: none; }
  .table .data-cell { flex: 1 1 100%; order: 7; min-width: 0; max-width: none; white-space: nowrap; }
  .table.log-table td.fact::after { content: none; }
  .tabs + .filters { margin-top: 0; }
  .log-table td.fact ~ td.fact::before { content: "·"; margin-right: 8px; }
}
@media (max-width: 719px) { .table .fact[data-label]::before { content: attr(data-label) " "; } }
@media (max-width: 719px) {
  .table td.fact:last-child::after { content: none; }
  .board-table td.fact:nth-last-child(2)::after { content: "·"; margin-left: 8px; }
}
@media (max-width: 400px) { .rail .item .ico { width: 32px; height: 32px; } }

.ov-stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin-bottom: 32px; border: 1px solid var(--line); border-radius: 20px; }
.ov-stats > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 16px 24px; }
.ov-stats > div + div { border-left: 1px solid var(--line); }
.ov-label, .ov-note { font-size: 13px; color: var(--muted); }
.ov-num { font-size: 20px; font-weight: 500; line-height: 1.3; font-variant-numeric: tabular-nums; }
.ov-num.warn { color: var(--warn); }
.ov-num .of { font-size: 15px; font-weight: 400; color: var(--muted); }
.ov-stats .bar { margin-top: 8px; }
.ov-stats .bar, .ov-stats svg { margin-top: 8px; }
.ov-stats svg { display: block; width: 100%; overflow: visible; }
.ov-stats .dots { max-width: 168px; }
.spark rect { fill: var(--ink); }
.spark rect.today { fill: var(--faint); }
.spark .base { stroke: var(--line); }
.spark .mark { stroke: var(--muted); stroke-dasharray: 3 3; }
.spark .fail { fill: var(--danger); }
.dots circle { fill: none; stroke: var(--faint); stroke-width: 1.5; }
.dots .up { fill: var(--ok); stroke: none; }
.dots .down { fill: var(--danger); stroke: none; }
.dots .flat { fill: var(--muted); stroke: none; }
.ov-note a { color: inherit; }
.ov-runway { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.ov-runway ol { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; list-style: none; margin: 8px 0; padding: 0; }
.ov-runway .day { display: block; margin-bottom: 6px; font-size: 13px; line-height: 1.3; color: var(--muted); }
.ov-runway .day b { display: block; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.ov-runway .slots { display: flex; flex-wrap: wrap; gap: 4px; }
.ov-runway .slots span { width: 14px; height: 14px; border: 1px dashed var(--faint); border-radius: 4px; }
.ov-runway .slots .held { border: 1px solid var(--ink); background: var(--ink); }
.ov-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-bottom: 32px; align-items: start; }
.ov-panel { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 24px; }
.ov-panel h2, .ov-pipe h2 { margin-bottom: 12px; font-size: 20px; font-weight: 500; }
.ov-empty { color: var(--muted); }
.ov-list { list-style: none; margin: 0; padding: 0; }
.ov-list li + li { border-top: 1px solid var(--line); }
.ov-list a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 8px; margin: 0 -8px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.ov-list a:hover { background: var(--fill-hover); }
.ov-list a:focus-visible, .ov-pipe a:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.ov-list .status { flex: 1; min-width: 0; white-space: normal; }
.ov-key { margin-left: auto; white-space: nowrap; }
.ov-key kbd { margin: 0 0 0 4px; }
.ov-time { flex: none; min-width: 48px; font-variant-numeric: tabular-nums; font-weight: 500; }
.ov-what { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-what .code { font: 500 13px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.ov-open { color: var(--muted); }
.ov-open .ov-time { font-weight: 400; color: var(--muted); }
.ov-pipe ol { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ov-pipe li + li { border-left: 1px solid var(--line); }
.ov-pipe a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; color: var(--muted); font-size: 13px; text-decoration: none; }
.ov-pipe a:hover { background: var(--fill-hover); }
.ov-pipe .n { font-size: 20px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 719px) {
  .ov-stats { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-stats > div { padding: 12px 16px; }
  .ov-stats > div:nth-child(odd) { border-left: 0; }
  .ov-stats > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .ov-runway ol { gap: 4px; }
  .ov-runway .slots { gap: 3px; }
  .ov-runway .slots span { width: 10px; height: 10px; border-radius: 3px; }
  .ov-stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .ov-cols { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ov-panel { padding: 16px; }
  .ov-pipe ol { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ov-pipe li:nth-child(4) { border-left: 0; }
  .ov-pipe li:nth-child(n+4) { border-top: 1px solid var(--line); }
  .ov-pipe a { padding: 12px; }
}

.table th .sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; }
.table th[aria-sort="ascending"] .sort, .table th[aria-sort="descending"] .sort, .table th .sort:hover { color: var(--ink); }
.table th .sort:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.wide .stats { margin: 0 0 8px; }
.wide .stats + .stats-note { margin: 0 0 24px; }
.table .none { color: var(--muted); }
.ratio { margin-left: 6px; }
.ratio.up { color: var(--ok); }
.ratio.down { color: var(--warn); }
.ratio.flat { color: var(--muted); }
.stats-legend { max-width: 68ch; margin-top: 12px; font-size: 13px; color: var(--muted); }
@media (max-width: 719px) {
  .table td[data-label]::before { content: attr(data-label) " "; color: var(--muted); }
  .stats-table .fact::after { content: "·"; margin-left: 8px; }
  .stats-table .fact:last-child::after { content: none; }
}

.more-row td { max-width: 0; height: auto; padding: 0 12px 8px; white-space: normal; }
.row-more { font-size: 13px; color: var(--muted); }
.row-more summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; list-style: none; }
.row-more summary::-webkit-details-marker { display: none; }
.row-more[open] summary { white-space: normal; color: var(--ink); }
.row-more p { overflow-wrap: anywhere; }
.pair { display: inline-flex; gap: 8px; }
.table select { width: auto; height: 32px; padding: 0 36px 0 12px; font-size: 14px; background-position: right 12px center; }
@media (max-width: 719px) {
  .table .more-row td { flex: 1 1 100%; min-width: 0; max-width: none; padding: 0; }
  .table .more-row::after { display: none; }
  .ready-table .fact:nth-child(4)::after { content: none; }
  .ready-table tr::before { content: ""; order: 7; flex-basis: 100%; }
  .table .pick { order: 8; flex: 1 1 0; min-width: 0; margin-top: 8px; }
  .table .pick select { width: 100%; }
}

.frame { overflow-x: auto; position: relative; }
.settings { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 32px; align-items: start; }
.section-menu { display: flex; flex-direction: column; gap: 4px; }
.section-menu a { display: flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px; color: var(--muted); text-decoration: none; }
.section-menu a:hover { color: var(--ink); background: var(--fill-hover); }
.section-menu a[aria-current] { color: var(--ink); font-weight: 500; background: var(--fill); }
.section-menu a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.section-pane { min-width: 0; }
.section-pane > h2 { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; font-size: 20px; font-weight: 500; line-height: 40px; }
.section-pane > h2 .n { font-size: 15px; font-weight: 400; color: var(--muted); }
.section-pane .rows + .card { margin-top: 24px; }
[data-edit] input { flex: none; width: 112px; height: 32px; padding: 0 12px; font-size: 14px; }
[data-edit] .num input { text-align: right; }
[data-edit] [data-save] { visibility: hidden; }
[data-edit] [data-dirty] [data-save] { visibility: visible; }
.table tr[hidden] { display: none; }
.more-row .fields { margin: 0 0 8px; }
.models-table .price { width: 100%; height: auto; padding-top: 8px; padding-bottom: 8px; white-space: normal; }
.models-table .source { display: block; font-size: 13px; color: var(--muted); }
@media (max-width: 719px) {
  .settings { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .section-menu { flex-direction: row; gap: 24px; margin: -16px 0 32px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .section-menu a { flex: none; height: auto; padding: 12px 0; border-radius: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; }
  .section-menu a:hover { background: none; }
  .section-menu a[aria-current] { background: none; border-bottom-color: var(--ink); }
  [data-edit] td[data-label] { order: 8; flex: 1 1 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; white-space: normal; text-align: left; }
  [data-edit] td[data-label]::before { content: attr(data-label); }
  [data-edit] input { width: 50%; }
  .table.edit-table .fact::after { content: none; }
  .models-table .fact { white-space: normal; }
  .models-table .price { width: auto; padding: 0; }
}
.table .variant { margin-left: 4px; font-family: var(--font); letter-spacing: 0; }

/* Stills: one contact sheet per idea, one card per scene that starts from a picture. */
.ss { margin-top: 32px; }
.ss-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.ss-head h2 { margin-top: 4px; font-size: 20px; font-weight: 500; line-height: 1.35; }
.ss-grid { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 456px), 1fr)); gap: 24px 16px; }
.ss-group-title { font-size: 14px; font-weight: 500; color: var(--muted); }
.ss-pair { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ss-qc { font-size: 13px; color: var(--muted); }
@media (max-width: 559px) { .ss-pair { grid-template-columns: minmax(0, 1fr); } }
.ss-card { height: 100%; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.ss-pic { aspect-ratio: 9 / 16; max-height: 320px; padding: 0 16px; text-align: center; display: grid; place-items: center; background: var(--fill); color: var(--muted); font-size: 13px; }
.ss-pic img { width: 100%; height: 100%; object-fit: cover; }
.ss-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.ss-title { display: flex; align-items: center; gap: 8px; }
.ss-line { overflow-wrap: anywhere; }
.ss-body .notes, .ss-body .note-form { margin-top: 4px; }
.ss-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.ss-actions .btn { flex: 1; padding: 0 12px; }

/* Triage: send an idea back with a note per scene. */
.redo { margin-top: 16px; padding: 16px; border-radius: 16px; background: var(--fill); }
.redo .label { margin-top: 0; }
.redo ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.redo li { display: flex; gap: 12px; align-items: baseline; overflow-wrap: anywhere; }
.redo .tc { background: var(--bg); }
.sendback { margin-top: 16px; }
.sendback summary { list-style: none; }
.sendback summary::-webkit-details-marker { display: none; }
.sendback form { display: grid; gap: 8px; margin-top: 8px; }
.sendback form .label { margin-top: 8px; }
.sb-row { display: flex; align-items: center; gap: 12px; }
.sb-row .tc { width: 88px; text-align: center; }
.sendback form .btn { justify-self: start; margin-top: 8px; }

/* Settings: a character's rules take a full row. */
.field.wide { flex-basis: 100%; }
.field textarea { width: 100%; min-height: 96px; padding: 12px 16px; border: 0; border-radius: 16px; font: 400 15px/1.5 var(--font); color: var(--ink); background: var(--fill); resize: vertical; field-sizing: content; }
.field textarea::placeholder { color: var(--muted); }
.field textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; }
.section-pane > .sub { margin: 8px 0 16px; max-width: 68ch; }
.ss-upload label { position: relative; overflow: hidden; }
.ss-upload label:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.ss-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Settings: agent tokens. A new token shows once, in a field chk can copy. */
.row-actions { display: flex; justify-content: flex-end; gap: 8px; }
.token-row { display: flex; gap: 12px; margin-top: 16px; }
.token { font: 500 13px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.token-row .btn { flex: none; }
.scopes { margin: 0; padding: 0; border: 0; }
.scopes legend { padding: 0 0 4px 16px; font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.record .sequel { margin-top: 8px; font-size: 14px; }
.record .sequel a { color: var(--ink); font: 500 13px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }

/* Settings: a character's reference images. */
.refs { margin: 8px 0 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.refs .label { margin: 0; font-size: 13px; font-weight: 400; color: var(--muted); }
.ref-grid { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.ref-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); }
.ref-pic { height: 160px; padding: 8px; display: grid; place-items: center; background: var(--fill); color: var(--muted); font-size: 13px; text-align: center; }
.ref-pic img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.ref-body { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; }
.ref-body .field { flex: 1 1 120px; }
.ref-body .field.order { flex: 0 0 72px; }
.ref-body .field.wide { flex-basis: 100%; }
.refs .fields .field { flex: 0 1 240px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.checks { flex-flow: row wrap; gap: 8px 24px; margin: 0; padding: 0 0 0 16px; border: 0; }
.checks legend { float: left; width: 100%; margin: 0 0 4px; padding: 0; font-size: 13px; color: var(--muted); }
.checks .check span { padding: 0; font-size: 15px; color: var(--ink); }
.btn.upload { position: relative; overflow: hidden; }
.btn.upload:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.switcher { position: relative; flex: none; margin-bottom: 8px; }
.switcher summary { list-style: none; cursor: pointer; }
.switcher summary::-webkit-details-marker { display: none; }
.switcher .badge { font: 500 13px var(--font); color: var(--ink); background: var(--fill); }
.switcher[open] .badge { outline: 2px solid var(--ink); outline-offset: -2px; }
.switcher .label { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch-menu { position: fixed; top: 72px; left: 80px; z-index: 20; display: flex; flex-direction: column; min-width: 220px; padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); box-shadow: 0 2px 12px rgb(0 0 0 / 0.06); }
.switch-title { padding: 4px 12px 8px; font-size: 13px; color: var(--muted); }
.switch-menu a { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 999px; color: var(--ink); font-size: 15px; }
.switch-menu a:hover { background: var(--fill-hover); }
.switch-menu a[aria-current] { font-weight: 500; background: var(--fill); }
.switch-menu .code { margin-left: auto; font-size: 13px; color: var(--muted); }
.switch-status { font-size: 13px; color: var(--warn); }
@media (max-width: 719px) {
  .rail .switcher { position: fixed; top: 12px; right: 16px; margin: 0; }
  .rail .switcher .item { flex-direction: row; gap: 8px; height: 40px; padding: 0 16px 0 4px; border-radius: 999px; background: var(--fill); }
  .rail .switcher .ico { width: 32px; height: 32px; background: var(--bg); }
  .rail .switcher .label { position: static; width: auto; height: auto; overflow: hidden; clip-path: none; max-width: 120px; color: var(--ink); font-weight: 500; }
  .switch-menu { top: 60px; left: auto; right: 16px; }
}
.proj-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; margin-bottom: 32px; }
.proj-card { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); text-decoration: none; }
.proj-card:hover { background: var(--fill-hover); }
.proj-card[aria-current] { border-color: var(--ink); }
.proj-name { font-weight: 500; }
.proj-name .code { margin-left: 4px; font-size: 13px; font-weight: 400; color: var(--muted); }
.proj-counts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); }
.proj-counts b { font-weight: 500; color: var(--ink); }
.proj-need { font-size: 13px; color: var(--warn); }
.proj-tag { display: inline-flex; align-items: center; height: 20px; margin-left: 8px; padding: 0 8px; border-radius: 999px; font: 500 12px var(--font); letter-spacing: 0; color: var(--muted); background: var(--fill); vertical-align: middle; white-space: nowrap; }

/* The setup prompt chk pastes into an agent, on /instructions and the Mint card. */
.card.setup a { color: var(--ink); }
.card.setup .facts { margin-top: 8px; }
.setup-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card.setup .setup-head h3 { margin: 0; font-size: 20px; font-weight: 500; line-height: 1.35; }
.minted-prompt { margin-top: 24px; }
#settings .minted-prompt h3 { margin: 0; font-size: 16px; font-weight: 500; }
.setup-text { display: block; width: 100%; margin-top: 16px; padding: 12px 16px; border: 0; border-radius: 16px; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); background: var(--fill); resize: vertical; field-sizing: content; }
.setup-text:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; }
