/* Opsajd admin. A studio run sheet on matchday: chalk-white surfaces on a pale pitch, ink for text,
   pitch green for actions, the offside flag (orange/yellow) only where something needs a look.
   Spacing on a 4px grid; depth from hairline borders only. */
:root {
  /* surfaces: canvas < card; inputs sit "inset" a touch darker */
  --pitch-wash: #f5f7f4;
  --chalk: #ffffff;
  --chalk-dim: #fafbf9;
  --inset: #f2f4f1;
  --hover: rgba(14, 40, 24, .045);
  --selected: rgba(14, 90, 42, .08);

  /* ink: four levels */
  --ink: #111a15;
  --ink-2: #3f4b44;
  --ink-3: #6a766f;
  --ink-4: #9ba59f;

  /* lines: hairlines that disappear until you look for them */
  --line: rgba(17, 26, 21, .09);
  --line-soft: rgba(17, 26, 21, .055);
  --line-strong: rgba(17, 26, 21, .16);
  --control-line: rgba(17, 26, 21, .14);

  /* brand */
  --pitch: #0f5a2b;
  --pitch-hover: #0b4a23;
  --pitch-tint: #e8f2eb;
  --flag-orange: #f0611c;
  --flag-yellow: #f7d93b;
  --flag-tint: #fff1e9;

  /* states */
  --ok: #1d7a3f;  --ok-tint: #e6f3ea;
  --warn: #a8590f; --warn-tint: #fdf2e2;
  --err: #b42318;  --err-tint: #fdecea;
  --info: #24518f; --info-tint: #e9f0fa;
  --focus: 0 0 0 3px rgba(15, 90, 43, .22);

  /* scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --side-w: 244px;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* old names still used inline by some templates */
  --green: var(--pitch); --deep: var(--pitch); --orange: var(--flag-orange); --yellow: var(--flag-yellow);
  --muted: var(--ink-3); --bg: var(--pitch-wash); --card: var(--chalk); --soft: var(--inset); --radius: var(--r-md);
}

* { box-sizing: border-box; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: "Archivo", system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--pitch-wash);
  line-height: 1.5; -webkit-font-smoothing: antialiased; font-feature-settings: "ss01";
}
a { color: var(--ink); text-decoration: none; transition: color .12s var(--ease); }
a:hover { color: var(--pitch); }
/* rows read as ink; the title only turns pitch green under the pointer. Links inside prose stay green. */
td a { color: var(--ink); font-weight: 500; }
td a:hover { color: var(--pitch); }
.panel p a, .help a, .note a, .card p a { color: var(--pitch); }
.panel p a:hover, .help a:hover { text-decoration: underline; text-underline-offset: 2px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; color: var(--ink); }
h1 { font-size: 22px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 15px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; margin-bottom: var(--s3); }
h3 { font-size: 13px; line-height: 1.3; font-weight: 700; margin-bottom: var(--s2); }
p { margin: 0 0 var(--s3); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }
code { font-family: var(--mono); font-size: 12px; background: var(--inset); padding: 1px 6px; border-radius: 4px; color: var(--ink-2); }
details > summary { cursor: pointer; }
::selection { background: rgba(247, 217, 59, .45); }

/* ---------- shell ---------- */
.layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background: var(--pitch-wash); border-right: 1px solid var(--line); padding: var(--s4) var(--s3);
}
.side .brand { display: flex; align-items: center; gap: var(--s3); padding: var(--s1) var(--s2) var(--s4); color: var(--ink); }
.side .brand img { width: 34px; height: 34px; object-fit: contain; }
.side .brand b { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; }
.side .brand span span { display: block; font-size: 11px; color: var(--ink-3); font-weight: 500; letter-spacing: .02em; }
.side .flag { display: none; }
.nav-group { margin-top: var(--s4); }
.nav-group:first-of-type { margin-top: var(--s1); }
.nav-label { padding: 0 var(--s2) var(--s1); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); }
.side nav a {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  height: 32px; padding: 0 var(--s2) 0 var(--s3); margin: 1px 0; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; font-size: 13.5px;
}
.side nav a:hover { background: var(--hover); color: var(--ink); }
.side nav a.active { background: var(--chalk); color: var(--ink); font-weight: 700; box-shadow: 0 0 0 1px var(--line); }
/* signature: the offside flag marks where you are */
.side nav a.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px;
  background: repeating-linear-gradient(180deg, var(--flag-orange) 0 4px, var(--flag-yellow) 4px 8px);
}
.side .badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--flag-orange); color: #fff; font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.side .foot { margin-top: auto; padding: var(--s4) var(--s2) 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }
.side .foot a { color: var(--ink-3); }
.side .foot a:hover { color: var(--pitch); }
.side .foot .who { display: flex; align-items: center; justify-content: space-between; margin-top: var(--s3); color: var(--ink-2); font-weight: 600; }
.side .foot .avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--pitch-tint); color: var(--pitch);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; text-transform: uppercase; margin-right: var(--s2);
}
.side .foot button.linkish { background: none; border: 0; padding: 4px 6px; font: inherit; font-size: 12px; color: var(--ink-3); cursor: pointer; border-radius: var(--r-sm); }
.side .foot button.linkish:hover { background: var(--hover); color: var(--ink); }

.main { padding: var(--s8) var(--s10) 64px; min-width: 0; width: 100%; }
.main.wide { max-width: none; }
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s4); flex-wrap: wrap;
  padding-bottom: var(--s5); margin-bottom: var(--s6); border-bottom: 1px solid var(--line);
}
.page-head > div:first-child, .page-head > h1 { min-width: 0; }
.page-head p { color: var(--ink-3); margin: var(--s1) 0 0; }
.page-head a:first-child:not(.btn) { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.page-head a:first-child:not(.btn):hover { color: var(--pitch); }

/* ---------- messages ---------- */
.messages { list-style: none; padding: 0; margin: 0 0 var(--s5); display: grid; gap: var(--s2); }
.messages li { padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--ok-tint); color: #154d2a; border: 1px solid rgba(29, 122, 63, .18); font-weight: 500; }
.messages li.error { background: var(--err-tint); color: #7a1a12; border-color: rgba(180, 35, 24, .18); }
.messages li.info, .messages li.warning { background: var(--warn-tint); color: #6b3a08; border-color: rgba(168, 89, 15, .2); }

/* ---------- surfaces ---------- */
.panel, .card {
  background: var(--chalk); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s5);
}
.panel { margin-bottom: var(--s5); }
.panel > h2:first-child, .card > h2:first-child { margin-bottom: var(--s4); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.grid2.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
td:has(> .dot:first-child) { white-space: nowrap; }
.grid2 > .card, .grid2 > div > .panel, .grid2 > div > .card { margin-bottom: var(--s5); }
.grid2 > div > .panel:last-child { margin-bottom: 0; }

/* stat strip: one surface, cells split by hairlines, number first */
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 0;
  background: var(--chalk); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: var(--s6);
}
.cards > .card {
  border: 0; border-radius: 0; background: transparent; padding: var(--s4) var(--s5);
  box-shadow: -1px 0 0 var(--line-soft), 0 -1px 0 var(--line-soft);
}
.card .n { font-size: 26px; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.card .l { color: var(--ink-3); font-size: 12px; margin-top: var(--s1); line-height: 1.35; }
.card .l a { color: var(--ink-3); }
.card .l a:hover { color: var(--pitch); }
.card.hot { background: var(--flag-tint); }
.card.hot .n { color: var(--flag-orange); }
.cards > a.card:hover, .cards > .card:has(a):hover { background: var(--chalk-dim); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px var(--s3); border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th {
  color: var(--ink-3); font-weight: 600; font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  border-bottom: 1px solid var(--line); background: transparent; white-space: nowrap;
}
tbody tr { transition: background .1s var(--ease); }
tbody tr:hover { background: var(--chalk-dim); }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: var(--s1); }
th:last-child, td:last-child { padding-right: var(--s1); }
:is(.panel, .card) > table th:first-child, :is(.panel, .card) > table td:first-child { padding-left: 0; }
:is(.panel, .card) > table th:last-child, :is(.panel, .card) > table td:last-child { padding-right: 0; }
td { overflow-wrap: break-word; }
td code { word-break: break-all; white-space: normal; }
.panel, .card, .grid2 > div { min-width: 0; }
td.num, th.num { overflow-wrap: normal; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.num { color: var(--ink-2); }
td .muted, td.muted { font-size: 12px; }
.tbl-wrap { overflow-x: auto; }

.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }

/* ---------- status ---------- */
.status {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; background: var(--inset); color: var(--ink-2);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.status.published, .status.posted, .status.scheduled, .status.done { background: var(--ok-tint); color: var(--ok); }
.status.ready, .status.approved { background: #fff6d1; color: #7a5a00; }
.status.needs_audio, .status.failed { background: var(--err-tint); color: var(--err); }
.status.live { background: var(--flag-orange); color: #fff; }
.status.live::before { opacity: 1; animation: pulse 1.4s ease-in-out infinite; }
.status.fetching, .status.processing { background: var(--info-tint); color: var(--info); }
.status.running, .status.rendering, .status.queued { background: var(--warn-tint); color: var(--warn); }
.status.titlovi { background: var(--info-tint); color: var(--info); }
table.captions { width: 100%; border-collapse: collapse; margin-top: var(--s3); }
table.captions td { padding: 3px 6px 3px 0; vertical-align: middle; }
table.captions td:first-child { width: 4.5em; text-align: right; }
table.captions td:nth-child(2) { width: 2.6em; }
table.captions input[type="text"], table.captions input:not([type]) { width: 100%; }
table.captions .seek { background: none; border: 0; padding: 0; color: var(--ink-3); font: inherit; font-size: 12px; cursor: pointer; font-variant-numeric: tabular-nums; }
table.captions .seek:hover { color: var(--ink); text-decoration: underline; }
table.captions .spk { width: 2.2em; height: 1.9em; border-radius: 999px; border: 1px solid var(--line); font-weight: 700; font-size: 12px; cursor: pointer; }
table.captions .spk.A { background: #fff; color: #0b4d22; }
table.captions .spk.B { background: #f7d93b; color: #0b4d22; border-color: #e5c42b; }
.titles { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s2); }
.titles label.check { display: flex; align-items: center; gap: var(--s2); }
.titles label.check input[type="radio"] { flex: none; }
.status.hidden, .status.draft, .status.upcoming, .status.detected { background: var(--inset); color: var(--ink-3); }
@keyframes pulse { 50% { opacity: .35; } }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: var(--s2); vertical-align: middle; background: var(--ink-4); }
.dot.ok { background: var(--ok); } .dot.error { background: var(--err); } .dot.missing { background: var(--line-strong); }

/* ---------- buttons ---------- */
form.inline { display: inline; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  font: inherit; font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap;
  border-radius: var(--r-sm); border: 1px solid var(--pitch); background: var(--pitch); color: #fff; cursor: pointer;
  transition: background .12s var(--ease), border-color .12s var(--ease), color .12s var(--ease), box-shadow .12s var(--ease);
}
.btn:hover { background: var(--pitch-hover); border-color: var(--pitch-hover); color: #fff; }
.btn:focus-visible { outline: 0; box-shadow: var(--focus); }
.btn:disabled, .btn[aria-disabled=true] { opacity: .5; cursor: default; }
.btn.secondary { background: var(--chalk); color: var(--ink); border-color: var(--control-line); }
.btn.secondary:hover { background: var(--inset); border-color: var(--line-strong); color: var(--ink); }
.btn.orange { background: var(--flag-orange); border-color: var(--flag-orange); color: #fff; }
.btn.orange:hover { background: #d9520f; border-color: #d9520f; }
.btn.danger { background: var(--chalk); color: var(--err); border-color: rgba(180, 35, 24, .28); }
.btn.danger:hover { background: var(--err-tint); color: var(--err); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.panel > .actions:last-child, form > .actions:last-child { margin-top: var(--s4); }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: 12px; color: var(--ink-2); margin: var(--s4) 0 6px; }
/* the first label in a card sits on the card's padding, every later one keeps its 16px rhythm */
.panel > label:first-child, .panel > form > label:first-child,
:is(.panel, .card) > form > input[type=hidden]:first-child + label,
:is(.panel, .card) > form > input[type=hidden]:first-child + .form-row > div > label { margin-top: 0; }
.panel > form > h2 + label, .panel > h2 + label, .panel > h2 + form > label:first-of-type { margin-top: 0; }
input:not([type]), input[type=text], input[type=url], input[type=email], input[type=number], input[type=password], input[type=search], input[type=tel],
input[type=datetime-local], input[type=date], input[type=time], textarea, select {
  width: 100%; font: inherit; font-size: 13.5px; height: 36px; padding: 0 var(--s3);
  border: 1px solid var(--control-line); border-radius: var(--r-sm); background: var(--chalk); color: var(--ink);
  transition: border-color .12s var(--ease), box-shadow .12s var(--ease);
}
textarea { height: auto; min-height: 120px; padding: 10px var(--s3); line-height: 1.55; resize: vertical; }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236a766f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input::placeholder, textarea::placeholder { color: var(--ink-4); }
input:hover, textarea:hover, select:hover { border-color: var(--line-strong); }
input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--pitch); box-shadow: var(--focus); }
input[readonly], textarea[readonly] { background: var(--inset); color: var(--ink-2); }
input[type=file] { font: inherit; font-size: 12.5px; color: var(--ink-3); }
input[type=file]::file-selector-button {
  font: inherit; font-size: 12px; font-weight: 600; height: 28px; padding: 0 10px; margin-right: var(--s3);
  border: 1px solid var(--control-line); border-radius: var(--r-sm); background: var(--chalk); color: var(--ink); cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--inset); }
input[type=checkbox], input[type=radio] { accent-color: var(--pitch); width: 15px; height: 15px; }
.help { color: var(--ink-3); font-size: 12px; margin: 6px 0 0; line-height: 1.45; }
form.form-row > div > label { margin-top: 0; }
form.form-row { row-gap: var(--s4); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 var(--s4); }
.check { display: flex; align-items: center; gap: var(--s2); font-weight: 500; font-size: 13px; color: var(--ink); }
.check input { width: auto; margin: 0; }

/* ---------- filters, tabs ---------- */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--s4); align-items: center; }
.filters a {
  height: 30px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 15px;
  background: var(--chalk); border: 1px solid var(--line); font-size: 12.5px; font-weight: 500; color: var(--ink-2);
}
.filters a:hover { border-color: var(--line-strong); color: var(--ink); }
.filters a.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.filters form { margin-left: auto; }
.filters input { width: 240px; height: 30px; border-radius: 15px; padding: 0 14px; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: var(--s4); padding: 3px; background: var(--inset); border-radius: var(--r-md); width: fit-content; max-width: 100%; }
.tabs a { height: 28px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.tabs a:hover { color: var(--ink); }
.tabs a.active { background: var(--chalk); color: var(--ink); font-weight: 700; box-shadow: 0 0 0 1px var(--line); }
.tabs a.active .muted { color: var(--ink-3); }

/* ---------- settings rows: label left, control right, readable width ---------- */
.srows { display: grid; }
.srow {
  display: grid; grid-template-columns: minmax(160px, 260px) minmax(0, 620px); gap: var(--s6); align-items: center;
  padding: var(--s3) 0; border-bottom: 1px solid var(--line-soft); margin: 0;
}
.srow:first-child { padding-top: 0; }
.srow:last-child { border-bottom: 0; padding-bottom: 0; }
.srow > label, .srow > span:first-child { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.srow.top { align-items: start; }
.srow.top > label { padding-top: 9px; }
.switch-row { cursor: pointer; font-weight: 600; }
.switch-row:hover > span:first-child { color: var(--pitch); }
input.switch {
  appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 10px; margin: 0; cursor: pointer;
  background: var(--line-strong); position: relative; transition: background .15s var(--ease); vertical-align: middle;
}
input.switch::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s var(--ease);
}
input.switch:checked { background: var(--pitch); }
input.switch:checked::before { transform: translateX(14px); }
input.switch:focus-visible { box-shadow: var(--focus); }
.integ { grid-template-columns: minmax(0, 1fr) minmax(0, 620px); }

/* ---------- long forms: section jump bar + sticky save ---------- */
.jump {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 2px; flex-wrap: wrap; margin: 0 0 var(--s5);
  padding: var(--s2) 0; margin-left: -10px; background: var(--pitch-wash); border-bottom: 1px solid var(--line-soft);
}
.jump a { height: 28px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.jump a:hover { background: var(--hover); color: var(--ink); }
.panel[id] { scroll-margin-top: 60px; }
.savebar {
  position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: var(--s2);
  margin: 0 calc(-1 * var(--s10)); padding: var(--s3) var(--s10); background: rgba(245, 247, 244, .92);
  backdrop-filter: blur(6px); border-top: 1px solid var(--line);
}
@media (max-width: 1100px) { .savebar { margin: 0 calc(-1 * var(--s6)); padding: var(--s3) var(--s6); } }
@media (max-width: 800px) { .savebar { margin: 0 calc(-1 * var(--s4)); padding: var(--s3) var(--s4); } .jump { top: 47px; } }

/* ---------- notes ---------- */
.err, .note { border-radius: var(--r-md); padding: var(--s3) var(--s4); font-size: 13px; line-height: 1.5; margin: 0 0 var(--s4); }
.err { background: var(--err-tint); color: #7a1a12; border: 1px solid rgba(180, 35, 24, .16); }
.note { background: var(--warn-tint); color: #5e3608; border: 1px solid rgba(168, 89, 15, .18); }

/* ---------- episode ---------- */
.thumbs { display: grid; grid-template-columns: 2fr 1.1fr .65fr; gap: var(--s3); align-items: start; }
.thumbs img { border-radius: var(--r-sm); border: 1px solid var(--line); }
.ep-head { display: flex; gap: var(--s4); align-items: flex-start; }
.ep-head img { width: 220px; border-radius: var(--r-md); }

/* ---------- logs, integrations ---------- */
.log { list-style: none; padding: 0; margin: 0; }
.log li { display: flex; gap: var(--s3); padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; line-height: 1.45; }
.log li:last-child { border-bottom: 0; }
.log li time { color: var(--ink-4); font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums; padding-top: 1px; min-width: 88px; }
.log li.error { color: var(--err); } .log li.warning { color: var(--warn); }
.integ { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--s5); padding: var(--s4) 0; border-bottom: 1px solid var(--line-soft); align-items: start; }
.integ:first-of-type { padding-top: 0; }
.integ:last-child { border-bottom: 0; padding-bottom: 0; }
.integ b { font-size: 13.5px; }
.integ .help { margin-top: var(--s1); }
.integ .who { font-size: 11px; color: var(--ink-3); }
.integ .who b { color: var(--flag-orange); }

/* ---------- login ---------- */
.login { max-width: 380px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: var(--s6); }
.login .panel { padding: var(--s8); }
.login img { width: 64px; display: block; margin: 0 auto var(--s4); }
.login h1 { text-align: center; margin-bottom: var(--s5); }
.login .btn { width: 100%; height: 38px; }

/* ---------- media, photos ---------- */
.photo-grid { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s1); }
.photo-pick { position: relative; width: 96px; cursor: pointer; font-weight: 500; font-size: 11px; color: var(--ink-3); text-align: center; margin: 0; }
.photo-pick input { position: absolute; top: 6px; left: 6px; margin: 0; z-index: 2; }
.photo-pick img, .photo-pick .studio {
  width: 96px; height: 72px; object-fit: cover; border-radius: var(--r-sm); border: 2px solid var(--line);
  background: var(--inset); display: flex; align-items: center; justify-content: center; transition: border-color .12s var(--ease);
}
.photo-pick input:checked ~ img, .photo-pick input:checked ~ .studio { border-color: var(--flag-orange); }
.photo-pick span { display: block; margin-top: var(--s1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- transcripts, chapters, shorts ---------- */
.tr-list { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s2) var(--s3); margin-top: var(--s3); font-size: 13.5px; background: var(--chalk-dim); }
.tr-seg { display: grid; grid-template-columns: 4.2em 5.5em 1fr; gap: var(--s2); padding: 5px var(--s1); align-items: start; border-radius: 4px; }
.tr-seg.now { background: var(--pitch-tint); }
.tr-time { border: 0; background: transparent; color: var(--pitch); font-family: var(--mono); font-size: 11.5px; cursor: pointer; text-align: left; padding: 2px 0 0; }
.tr-who { color: var(--flag-orange); font-weight: 700; font-size: 12px; }
.tr-list.editing .tr-text { outline: 1px dashed var(--line-strong); padding: 0 var(--s1); }
.ch-table td { padding: var(--s1) var(--s2) 0 0; border: 0; }
.quote { border-top: 1px solid var(--line-soft); padding: var(--s3) 0; }
.shorts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s4); }
.short-card video { width: 100%; aspect-ratio: 9 / 16; background: #000; border-radius: var(--r-md); }
svg.chart { width: 100%; height: auto; display: block; font-family: inherit; }

/* ---------- clips, placements, trim ---------- */
.clip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s4); }
.clip-card { background: var(--chalk); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3); }
.clip-card video, .clip-card img { width: 100%; max-height: 300px; object-fit: contain; background: #0c120e; border-radius: var(--r-sm); display: block; }
.clip-ph { height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--inset); border-radius: var(--r-sm); gap: var(--s2); }
.clip-title input { border: 0; background: transparent; font-weight: 700; width: 100%; padding: var(--s2) 0; height: auto; box-shadow: none; }
.placements { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s3) var(--s4); }
.pl-group b { display: block; margin-bottom: var(--s1); font-size: 12px; color: var(--ink-2); }
.pl-group label.check { display: flex; font-weight: 400; margin: 6px 0; }
.trim-stage { position: relative; background: #000; border-radius: var(--r-md); overflow: hidden; }
.trim-stage video { width: 100%; max-height: 60vh; display: block; }
.crop-box { position: absolute; border: 2px solid var(--flag-yellow); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45); pointer-events: none; display: none; }
#yt-player { display: none; width: 100%; aspect-ratio: 16 / 9; }
#yt-player iframe { width: 100%; height: 100%; display: block; }

/* ---------- push preview ---------- */
.phone-card { max-width: 360px; margin: var(--s2) auto; background: var(--chalk); border: 1px solid var(--line); border-radius: 18px; padding: var(--s3) var(--s4); box-shadow: 0 6px 20px rgba(17, 26, 21, .07); }
.phone-app { font-size: 11px; color: var(--ink-3); margin-bottom: var(--s1); }
.phone-title { font-weight: 700; } .phone-body { font-size: 13px; color: var(--ink-2); }

/* ---------- responsive, print ---------- */
@media (max-width: 1100px) {
  .main { padding: var(--s6) var(--s6) 48px; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .panel, .card { overflow-x: auto; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { align-items: flex-start; }
  .side { position: sticky; top: 0; z-index: 10; height: auto; padding: var(--s2) var(--s3); border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; align-items: center; gap: var(--s2); overflow: visible; }
  .side .brand { padding: 0; }
  .side .brand span { display: none; }
  .side nav { display: flex; overflow-x: auto; gap: 2px; scrollbar-width: none; }
  .side nav::-webkit-scrollbar { display: none; }
  .nav-group { display: contents; }
  .nav-label { display: none; }
  .side nav a { flex: none; height: 30px; padding: 0 10px; }
  .side nav a.active::before { left: 10px; right: 10px; top: auto; bottom: 2px; width: auto; height: 2px; background: repeating-linear-gradient(90deg, var(--flag-orange) 0 4px, var(--flag-yellow) 4px 8px); }
  .side .foot { display: none; }
  .main { padding: var(--s5) var(--s4) 48px; }
  .thumbs, .integ, .srow { grid-template-columns: 1fr; gap: var(--s2); }
  .filters form { margin-left: 0; width: 100%; }
  .filters input { width: 100%; }
  table { font-size: 12.5px; min-width: 620px; }
  td { overflow-wrap: break-word; }
  .side .brand img { flex: none; width: 30px; height: 30px; }
}
@media print {
  .side, .page-head .actions, .filters, .messages { display: none !important; }
  .layout { display: block; }
  .main { padding: 0; max-width: none; }
  body { background: #fff; }
  .panel, .card, .cards { border-color: #ddd; }
}

/* Grafike */
.grafike-form { display: flex; gap: var(--s4); align-items: end; flex-wrap: wrap; }
.grafike-form > div { min-width: 0; }
.grafike-form select { max-width: min(560px, 100%); }
.grafike-stage { width: 100%; }
.grafike-box { position: relative; overflow: hidden; border-radius: 10px; box-shadow: 0 1px 0 var(--line), 0 12px 32px rgba(10, 26, 16, .14); background: #0b4d22; }
.grafike-box iframe { border: 0; display: block; transform-origin: 0 0; }
.filters a .muted { font-size: .85em; margin-left: 6px; }
.filters a.active .muted { color: rgba(255, 255, 255, .7); }
