/* Sermon Clipper — operator UI, Ace product-screen pattern.
   Foundation (tokens, fonts, reset, shared components) lives in tokens.css.
   This file is the operator-app layout only. Light + dark
   (dark tokens: tokens.css [data-theme="dark"], set by index.html).
   Sizes follow the ace-inspired-websites JSON: 232px sidebar, 44px header,
   28px controls, 40px table rows, 30px key-value rows, 12-15px type. */

/* ============================ App shell ============================ */
.app-canvas {
  min-height: 100vh;
  background: var(--paper-500);
}
/* Full-bleed: the app fills the whole window and the PAGE scrolls (no boxed
   inner-scroll, no floating card). Rail + topbar are sticky. */
.shell {
  display: flex;
  min-height: 100vh;
  background: var(--paper-500);
}

/* ---------- Nav rail ---------- */
.nav-rail {
  width: var(--rail-width);
  flex: none;
  background: var(--sidebar);
  border-right: 1px solid var(--hair);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
}
.rail-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 6px;
  margin-bottom: 10px;
}
.brand-mark {
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 5px;
  background: var(--ink-fill);
  color: var(--on-ink-text);
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.brand-name { font-size: 13px; font-weight: 500; }

.rail-nav { display: flex; flex-direction: column; gap: 1px; }
.rail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  text-align: left;
  padding: 0 8px;
  border-radius: var(--r-8);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-1);
  background: transparent;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.rail-item:hover { background: var(--paper-450); color: var(--ink-900); }
.rail-icon { width: 15px; height: 15px; flex: none; color: var(--text-2); }
/* Active: the selected-row grey, ink text, weight 500 (Ace sidebar). */
.rail-item.is-active { background: var(--selected); color: var(--ink-900); font-weight: 500; }
.rail-item.is-active .rail-icon { color: var(--ink-900); }
.rail-item.is-active:hover { background: var(--selected); }
.rail-count { margin-left: auto; font-size: 11px; color: var(--text-2); }
.rail-item.is-active .rail-count { color: var(--text-1); }
/* The "This week" count is sermons waiting for approval: the one number in the nav
   that asks for action, so it is the one that gets colour. */
#railThisWeekCount:not(:empty) { color: var(--blue); font-weight: 500; }

.rail-spacer { flex: 1; min-height: 20px; }


.rail-user { display: flex; align-items: center; gap: 8px; padding: 8px 6px 0; border-top: 1px solid var(--hair); }
.rail-avatar {
  width: 22px; height: 22px; flex: none;
  border-radius: var(--r-8);
  background: var(--ink-fill);
  color: var(--on-ink-text);
  font-size: 11px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
}
.rail-user-meta { min-width: 0; display: flex; flex-direction: column; }
.rail-user-name { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-user-sub { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Main column ---------- */
.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 44px;
  flex: none;
  background: var(--paper-500);
  border-bottom: 1px solid var(--hair);
  padding: 0 12px 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
/* Breadcrumb: workspace (muted) › current section (ink). */
.topbar-crumb { display: flex; align-items: center; gap: 6px; flex: none; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.topbar-crumb svg { width: 13px; height: 13px; color: var(--text-3); }
.topbar-crumb-here { color: var(--ink-900); font-weight: 500; }
.topbar-search {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  max-width: 280px;
  height: 28px;
  margin-left: auto;
  background: var(--paper-500);
  border: 1px solid var(--hair-strong);
  border-radius: var(--r-8);
  box-shadow: var(--shadow-lift);
  padding: 0 8px;
  color: var(--text-2);
}
.topbar-search svg { width: 13px; height: 13px; flex: none; }
/* Reset so the shared input rule (tokens.css input[type=text]) doesn't inflate
   the search pill — it lives inside the .topbar-search pill, not on its own. */
.topbar-search input {
  flex: 1; min-width: 0;
  background: none; border: none; outline: none;
  height: auto; padding: 0; box-shadow: none; border-radius: 0;
  font-size: 12.5px; color: var(--ink-900);
}
.topbar-search input:focus { box-shadow: none; border: none; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px var(--paper-500), 0 0 0 4px var(--blue); }

.shell-body { flex: 1; min-width: 0; padding: 20px 24px; }

/* ---------- View scaffolding ---------- */
.view { max-width: 1280px; }
.view-narrow { max-width: 720px; }
.view-head {
  display: flex;
  flex-wrap: wrap;          /* a long action row drops under the title instead of crushing it */
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 16px;
}
.view-head-titles { min-width: 0; flex: 1 1 320px; }
.view-title { font-size: 15px; font-weight: 500; line-height: 1.3; margin: 0 0 2px; }
.view-sub { font-size: 12.5px; color: var(--text-2); margin: 0; }
.view-actions { display: flex; gap: 6px; flex: none; }
.crumb {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; color: var(--text-2);
  background: none; border: none; padding: 0 0 6px;
}
.crumb:hover { color: var(--ink-900); }
.link-btn { background: none; border: none; color: var(--blue); font-size: 12.5px; font-weight: 500; }
.link-btn:hover { color: var(--blue-hover); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }

/* ============================ Dashboard ============================
   Inbox-first. Reading order is the operator's job order: approve what is
   waiting, glance at the newest finished sermon and the pipeline, then scan.
   Numbers are mono (Ace: money, counts, timestamps). */
.dash-grid { display: grid; gap: 16px; margin-bottom: 16px; }

.dash-sec-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.dash-sec-title { font-size: 13px; font-weight: 500; margin: 0; }
.dash-sec-note { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.dash-card-title { font-size: 12px; font-weight: 400; color: var(--text-2); margin: 0 0 8px; }
.dash-quiet { font-size: 12.5px; color: var(--text-2); margin: 4px 0 0; max-width: 40ch; }

/* ---- Waiting for your approval ----
   One bordered list, not a card per row: the queue reads as one stack of work. */
.dash-needs-list {
  border: 1px solid var(--hair);
  border-radius: var(--r-14);
  background: var(--paper-500);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.appr-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "film main actions";
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}
.appr-row + .appr-row { border-top: 1px solid var(--paper-350); }
.appr-film { grid-area: film; display: flex; gap: 4px; }
.appr-film .film-frame { width: 26px; height: 46px; border-radius: var(--r-5); }
.appr-main { grid-area: main; min-width: 0; }
.appr-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 13px; font-weight: 500; line-height: 1.35;
  text-align: left; padding: 0; overflow-wrap: anywhere;
}
.appr-title:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.appr-facts { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 2px; font-size: 12.5px; color: var(--text-2); }
.appr-facts span { min-width: 0; overflow-wrap: anywhere; }
.appr-facts span:last-child { color: var(--text-2); }   /* how long it has waited */
.appr-flag { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; height: 20px; padding: 0 7px;
  border-radius: var(--r-5); background: var(--paper-400); color: var(--ink-900); font-size: 11.5px; }
.appr-flag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--amber-dot); }
.appr-actions { grid-area: actions; display: flex; gap: 6px; }
.appr-actions .btn { min-width: 72px; }
.appr-row.is-skeleton { height: 67px; background: linear-gradient(90deg, var(--paper-400) 25%, var(--paper-350) 50%, var(--paper-400) 75%);
  background-size: 200% 100%; animation: sc-shimmer 1.4s infinite; }
@media (prefers-reduced-motion: reduce) { .appr-row.is-skeleton { animation: none; } }
.dash-clear { display: flex; align-items: center; gap: 10px; margin: 0; height: 40px; padding: 0 12px; font-size: 12.5px; color: var(--text-1); }
.dash-clear.is-error { color: var(--red); }
.dash-clear-mark { flex: none; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
  background: var(--green-dot); color: #fff; font-size: 11px; font-weight: 500; }

/* Poster frames — shared by the approval rows and the hero. */
.film-frame { flex: none; display: block; object-fit: cover; background: var(--paper-400); }
.film-frame { position: relative; }
/* No thumbnail (not rendered yet, or its file expired): a quiet tile with a small
   play mark, so the strip still counts clips without looking broken. */
.film-frame.is-blank { background: var(--paper-400); box-shadow: inset 0 0 0 1px var(--hair); }
.film-frame.is-blank::after { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%);
  border-left: 7px solid var(--text-3); border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; }
.film-more { display: grid; place-items: center; font-size: 12px; font-weight: 500; color: var(--text-1); }

/* ---- Latest finished sermon + pipeline ----
   A light card, not an ink hero: it is context for the queue above, not the
   page's headline. Facts appear once, inline. */
.dash-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.dash-hero { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 12px 16px 16px; }
.dash-hero-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.dash-hero-head .dash-card-title { margin: 0; }
.dash-hero-date { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); }
.dash-hero-body { display: flex; gap: 12px; align-items: center; min-width: 0; padding-bottom: 12px; border-bottom: 1px dashed var(--dashed); }
.dash-hero-film { display: flex; gap: 4px; flex: none; }
.dash-hero-film .film-frame { width: 26px; height: 46px; border-radius: var(--r-5); }
.dash-hero-main { min-width: 0; }
.dash-hero-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  padding: 0; text-align: left; font-size: 15px; font-weight: 500; line-height: 1.3;
  overflow-wrap: anywhere; }
.dash-hero-title:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.dash-hero-facts { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 2px; font-size: 12.5px; color: var(--text-2); }
.dash-hero-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Page state is a word with a dot, not another pill: the status column already
   has pills, and two pill columns side by side read as one noisy band. */
.page-state { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.page-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); flex: none; }
.page-state.is-live::before { background: var(--green-dot); }
.page-state.is-waiting::before { background: var(--blue-bright); }

.dash-pipeline { padding: 12px 16px; min-width: 0; }
.dash-pipeline-list { display: grid; }
.pipe-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 30px; padding: 4px 8px; margin: 0 -8px; width: calc(100% + 16px); text-align: left;
  border-radius: var(--r-8); transition: background var(--dur) var(--ease); }
.pipe-row + .pipe-row { border-top: 1px dashed var(--dashed); border-radius: 0; }
.pipe-row:hover { background: var(--paper-450); }
.pipe-dot { width: 6px; height: 6px; border-radius: 50%; }
.pipe-dot.is-failed { background: var(--red-dot); }
.pipe-dot.is-running { background: var(--amber-dot); }
.pipe-main { min-width: 0; display: flex; flex-direction: column; }
.pipe-title { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-sub { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-sub:empty { display: none; }
.pipe-state { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.pipe-state.is-failed { color: var(--red); }
.pipe-state.is-running { color: var(--text-1); }

/* ---- Recent sermons ---- */
.queue-card { padding: 0; overflow: hidden; }
.queue-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px; }
.queue-title { font-size: 13px; font-weight: 500; margin: 0; }
.queue-sub { font-size: 12px; color: var(--text-2); margin-top: 0; }
.queue-cols, .queue-row {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.4fr) 64px 60px minmax(0, 1.3fr) 64px 176px;
  align-items: center; gap: 16px;
}
.queue-cols { height: 32px; padding: 0 12px; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); font-size: 11.5px; font-weight: 400; color: var(--text-2); }
.queue-row { min-height: 40px; padding: 4px 12px; border-top: 1px solid var(--paper-350); font-size: 12.5px; cursor: pointer;
  transition: background var(--dur) var(--ease); }
.queue-row:hover { background: var(--paper-450); }
#dashQueueRows > .queue-row:first-child { border-top: none; }
.queue-asset { min-width: 0; display: flex; }
.queue-title-btn.is-untitled { color: var(--text-2); font-weight: 400; }
.queue-title-btn { min-width: 0; max-width: 100%; padding: 0; text-align: left; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-cell { font-size: 12.5px; color: var(--text-1); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-status { min-width: 0; font-size: 12.5px; }
/* Status as dot + text, not a pill: dense rows read as one noisy band once
   every row carries a badge. */
.queue-row .chip { height: auto; padding: 0; background: none; font-size: 12.5px; }
.queue-row .chip:not([class*="chip-"]) { color: var(--text-2); }
.ralign { text-align: right; }
.queue-cost { font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; }

@media (max-width: 1180px) {
  .queue-cols, .queue-row { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr) 60px 56px minmax(0, 1.4fr) 60px 168px; gap: 12px; }
}

.submit-card { position: relative; }

/* ---------- Submit form ---------- */
.submit-form { display: flex; flex-direction: column; gap: 16px; }
.form-row-primary { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 11.5px; font-weight: 400; color: var(--text-2); }
.field-url { flex: 1; min-width: 240px; position: relative; }
.field-church { width: 200px; }
.field-count { width: auto; }
.form-row-primary .btn-primary { flex: none; }

.drop-hint {
  position: absolute; top: -20px; right: 0;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text-2); background: none; border: none;
}
.drop-hint:hover { color: var(--blue); }
.drop-hint svg { width: 13px; height: 13px; }

.file-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper-400); border: 1px solid var(--hair);
  border-radius: var(--r-8); height: 28px; padding: 0 10px; font-size: 12.5px;
}
.file-chip-icon { width: 15px; height: 15px; flex: none; color: var(--text-2); }
.file-chip-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip-remove { flex: none; width: 20px; height: 20px; border-radius: var(--r-5); color: var(--text-2); font-size: 16px; line-height: 1; }
.file-chip-remove:hover { background: var(--paper-500); color: var(--red); }

.stepper { display: inline-flex; align-items: stretch; height: 28px; border: 1px solid var(--hair-strong); border-radius: var(--r-8); box-shadow: var(--shadow-lift); overflow: hidden; background: var(--paper-500); }
.stepper-btn { width: 28px; font-size: 14px; color: var(--text-2); background: var(--paper-500); }
.stepper-btn:hover { background: var(--paper-400); color: var(--ink-900); }
.stepper input { width: 40px; height: auto; text-align: center; font-family: var(--font-mono); font-size: 12px; border: none; border-left: 1px solid var(--hair); border-right: 1px solid var(--hair); border-radius: 0; padding: 0; box-shadow: none; }
.stepper input:focus { box-shadow: none; border-color: var(--hair); }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.field-label-row { display: flex; align-items: center; gap: 10px; }

/* Source preview: a 16:9 tile left of the timeframe slider. */
.form-row-timeframe { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; }
.form-row-timeframe .field-timeframe { flex: 1 1 280px; }
.source-preview { flex: none; width: 200px; display: flex; flex-direction: column; gap: 4px; }
.source-preview-media { aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--hair); border-radius: var(--r-16);
  background: var(--ink-950); }
.source-preview-media img, .source-preview-media video { width: 100%; height: 100%; object-fit: cover; }
.source-preview-title { margin-top: 4px; font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-preview-title:empty, .source-preview-sub:empty { display: none; }
.source-preview-sub { font-size: 12px; color: var(--text-2); }
.badge-saver { flex: none; }
.timeframe-hint { font-size: 12.5px; color: var(--text-2); margin: 0; }

/* Dual-handle processing-timeframe slider */
.range-slider { position: relative; height: 28px; display: flex; align-items: center; }
.range-track { position: absolute; left: 0; right: 0; height: 4px; border-radius: var(--r-chip); background: var(--paper-400); }
.range-fill { position: absolute; height: 4px; border-radius: var(--r-chip); background: var(--blue); }
.range-input {
  position: absolute; left: 0; right: 0; width: 100%;
  margin: 0; height: 28px; background: none; pointer-events: none;
  -webkit-appearance: none; appearance: none;
}
.range-input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  pointer-events: auto;
  width: 14px; height: 14px; border-radius: var(--r-chip);
  background: var(--paper-500); border: 2px solid var(--blue);
  box-shadow: var(--shadow-lift); cursor: pointer;
}
.range-input::-moz-range-thumb {
  pointer-events: auto;
  width: 14px; height: 14px; border-radius: var(--r-chip);
  background: var(--paper-500); border: 2px solid var(--blue);
  box-shadow: var(--shadow-lift); cursor: pointer;
}
.range-input::-webkit-slider-runnable-track { background: none; }
.range-input::-moz-range-track { background: none; }
.timeframe-labels { display: flex; justify-content: space-between; margin-top: 8px; }
.timeframe-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }

.form-row-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 16px; align-items: start; padding-top: 16px; border-top: 1px dashed var(--dashed); }
.field-aspect .segmented { align-self: flex-start; }
.field-headline { justify-content: flex-end; }
.field-headline .switch-control { padding-top: 4px; }

.form-hint { font-size: 12.5px; color: var(--text-1); margin: 0; min-height: 1px; }
.form-hint:empty { display: none; }

/* Dropzone overlay */
.dropzone-overlay {
  position: absolute; inset: 0;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; font-size: 13px; font-weight: 500; color: var(--blue);
  background: var(--blue-pale);
  border: 1px dashed var(--blue); border-radius: var(--r-16);
  z-index: 5;
}
.dropzone-overlay svg { width: 20px; height: 20px; }
.submit-card.is-dropzone .dropzone-overlay { display: flex; }

/* ============================ Job / stage rail ============================ */
.job-card { margin-bottom: 16px; }
.job-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.stage-rail { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.stage { display: flex; align-items: center; gap: 6px; }
.stage-dot { width: 6px; height: 6px; border-radius: var(--r-chip); background: var(--hair-strong); transition: background var(--dur) var(--ease); }
.stage-label { font-size: 11px; font-weight: 500; text-transform: uppercase; color: var(--text-2); font-family: var(--font-mono); }
.stage.is-filled .stage-dot { background: var(--ink-900); }
.stage.is-filled .stage-label { color: var(--text-1); }
.stage.is-current .stage-dot { background: var(--blue); }
.stage.is-current .stage-label { color: var(--blue); }
.stage.is-error .stage-dot { background: var(--red-dot); }
.stage.is-error .stage-label { color: var(--red); }

.job-meta { display: flex; align-items: center; gap: 12px; flex: none; }
.elapsed { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); }
.cost { font-family: var(--font-mono); font-size: 12px; color: var(--ink-900); cursor: default; }

.progress-bar { height: 4px; border-radius: var(--r-chip); background: var(--hair); overflow: hidden; }
.progress-bar-fill { height: 100%; width: 0; background: var(--blue); border-radius: var(--r-chip); transition: width 400ms var(--ease); }

.quality-warning {
  margin-top: 12px;
  border-top: 1px dashed var(--dashed);
  color: var(--text-1);
  padding: 10px 0 0 12px;
  position: relative;
  font-size: 12.5px;
  line-height: 1.45;
}
.quality-warning::before { content: ""; position: absolute; left: 0; top: 16px; width: 6px; height: 6px; border-radius: 50%; background: var(--amber-dot); }

.error-block { margin-top: 12px; border: 1px solid var(--hair); background: var(--paper-500); border-radius: var(--r-11); padding: 10px 12px; }
.error-block summary { font-size: 12.5px; font-weight: 500; color: var(--red); cursor: pointer; }
.error-body { margin-top: 8px; font-size: 12px; color: var(--text-1); font-family: var(--font-mono); white-space: pre-wrap; }
.error-actions { margin-top: 12px; }

/* ============================ Sermon detail tabs ============================ */
.tab-panels { margin-top: 16px; }
.tab-panel { min-height: 200px; }
.panel-note { font-size: 12.5px; color: var(--text-2); padding: 12px 0; }
.transcript-text {
  font-family: var(--font-mono);
  font-size: 12px; line-height: 1.7;
  color: var(--text-1);
  white-space: pre-wrap; word-break: break-word;
  background: var(--paper-500); border: 1px solid var(--hair);
  border-radius: var(--r-11); padding: 20px; margin: 0;
  max-height: 60vh; overflow-y: auto;
}

/* devotional / study-guide read-only cards */
#sermonDevotional { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; align-items: start; }
.res-card { background: var(--paper-500); border: 1px solid var(--hair); border-radius: var(--r-16); box-shadow: var(--shadow-lift); padding: 16px; }
.res-card-title { font-size: 15px; font-weight: 500; margin: 6px 0 4px; }
.res-card-scripture { font-size: 12.5px; color: var(--blue); margin: 0 0 10px; }
.res-prose p { font-size: 13px; line-height: 1.6; color: var(--text-1); margin: 0 0 8px; }
.res-block { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--dashed); }
.res-block p { font-size: 12.5px; color: var(--text-1); margin: 4px 0 0; }
#sermonStudyGuide { display: grid; gap: 12px; }
.res-study-section { background: var(--paper-500); border: 1px solid var(--hair); border-radius: var(--r-14); padding: 16px; }
.res-study-list { margin: 8px 0 0; padding-left: 20px; list-style: decimal; display: grid; gap: 6px; }
.res-study-list li { font-size: 13px; line-height: 1.5; color: var(--text-1); }

/* Two-column resource layouts (study guide, transcript) */
.res-2col { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.res-2col-side { display: grid; gap: 16px; align-content: start; }
.res-guide-title { font-size: 15px; font-weight: 500; margin: 8px 0 16px; }
.res-guide-blocks { display: grid; gap: 12px; }
.res-guide-head { font-size: 12px; font-weight: 400; color: var(--text-2); margin-bottom: 6px; }
.res-guide-items { display: grid; gap: 6px; }
.res-guide-item { display: flex; gap: 10px; font-size: 13px; line-height: 1.55; color: var(--text-1); }
.res-guide-n { flex: none; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); padding-top: 2px; }
.res-takeaways { display: grid; gap: 8px; margin-top: 10px; }
.res-takeaways li { position: relative; padding-left: 12px; font-size: 13px; line-height: 1.5; color: var(--text-1); }
.res-takeaways li::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: var(--r-chip); background: var(--blue); }
.res-transcript-main { padding: 0; overflow: hidden; }
.res-transcript-head { padding: 12px 16px; border-bottom: 1px solid var(--hair); }
.res-card-h { font-size: 13px; font-weight: 500; }
.res-sub { font-size: 12px; color: var(--text-2); margin-top: 0; }
.res-transcript-body { max-height: 62vh; overflow-y: auto; }
.transcript-row { display: flex; gap: 12px; padding: 8px 16px; border-top: 1px solid var(--paper-350); font-size: 13px; }
.transcript-row:first-child { border-top: none; }
.transcript-t { flex: none; width: 46px; font-family: var(--font-mono); font-size: 11px; color: var(--blue); padding-top: 2px; font-variant-numeric: tabular-nums; }
.res-dl { width: 100%; margin-top: 12px; }

/* ============================ Results / clip cards ============================ */
.results { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }

.clip-card {
  display: flex; flex-direction: column;
  background: var(--paper-500); border: 1px solid var(--hair);
  border-radius: var(--r-14); box-shadow: var(--shadow-lift); overflow: hidden;
  transition: opacity var(--dur) var(--ease);
}
.clip-card.is-loading { opacity: 0.55; pointer-events: none; }
.clip-media { position: relative; background: var(--ink-950); }
.clip-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.clip-shimmer { display: none; }
.clip-card.is-loading .clip-shimmer {
  display: block; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  background-size: 200% 100%; animation: sc-shimmer 1.2s infinite;
}
.clip-media-top {
  position: absolute; top: 8px; left: 8px; right: 8px; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  pointer-events: none;
}
.clip-range {
  font-family: var(--font-mono); font-size: 11px; color: var(--on-ink-text);
  background: rgba(10, 10, 10, 0.6); border-radius: var(--r-5);
  padding: 4px 6px; font-variant-numeric: tabular-nums;
}
/* Ace statusMono: uppercase mono label on a dark tag, the colour in a dot. */
.clip-score-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--on-ink-text);
  background: rgba(10, 10, 10, 0.6); border-radius: var(--r-5); padding: 4px 6px;
  font-variant-numeric: tabular-nums; text-transform: uppercase;
}
.clip-score-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green-dot); }
.clip-score-chip.is-good::before { background: var(--blue-bright); }
.clip-score-chip.is-weak::before { background: var(--amber-dot); }
.clip-body { padding: 10px 12px 10px; display: flex; flex-direction: column; gap: 4px; }
.clip-title { font-size: 12.5px; font-weight: 500; margin: 0; }
.clip-hook { font-size: 12px; line-height: 1.45; color: var(--text-2); margin: 0; }

.clip-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 8px 10px; border-top: 1px dashed var(--dashed); }
.action-group { display: inline-flex; align-items: center; gap: 4px; }
.action-divider { width: 1px; align-self: stretch; background: var(--hair); margin: 2px 2px; }
.nudge-label { font-size: 11px; color: var(--text-2); }
.nudge-btn { min-width: 28px; padding: 0 6px; font-family: var(--font-mono); font-size: 11px; }

/* ============================ Empty state ============================ */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 6px; min-height: 240px;
  border: 1px solid var(--hair); border-radius: var(--r-16); background: var(--paper-500);
}
/* 36px bordered square around a stroke icon. */
.empty-icon { width: 36px; height: 36px; padding: 8px; margin-bottom: 6px; color: var(--text-2);
  border: 1px solid var(--hair); border-radius: var(--r-16); box-shadow: var(--shadow-lift); }
.empty-title { font-size: 13px; font-weight: 500; margin: 0; }
.empty-text { font-size: 12.5px; color: var(--text-2); margin: 0 0 8px; max-width: 42ch; }

/* ============================ Library table ============================ */
.lib-card { padding: 0; overflow: hidden; }
.lib-cols, .lib-row { display: grid; grid-template-columns: 2.4fr 1.3fr 1fr 0.7fr 0.8fr 0.9fr 168px 34px; align-items: center; gap: 12px; }
/* Row actions (copy link / hide) reveal on hover so the table stays quiet at rest,
   but stay visible on focus so they remain keyboard-reachable. */
/* Was `opacity: 0` until hover. That is fine for a convenience like copy-link and
   wrong for approval: a sermon waiting on a human showed no control at all unless
   the mouse happened to cross its row, so the queue looked like a list you could
   only read. The row's actions are always visible now. */
.lib-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
/* Hide page and Approve share one slot. Right-aligned at their own widths, the
   narrower Approve pushed Copy link ~10px right in every unapproved row. */
.lib-actions [data-action="toggle-page"] { min-width: 6.5em; }
/* A device with no hover never fires the rule above, so on touch the buttons would
   simply never appear — and the row itself is clickable, so there is no way in.
   Show them permanently there. */
.btn-approve { height: 28px; padding: 0 8px; border-radius: var(--r-8); border: 1px solid transparent;
  background: var(--blue); color: var(--on-blue); font-size: 12px; font-weight: 500;
  white-space: nowrap; cursor: pointer; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.btn-approve:hover { background: var(--blue-hover); color: var(--on-blue); }
.btn-approve:disabled { opacity: 0.55; cursor: default; }
.lib-actions .btn-icon { min-width: 28px; height: 28px; padding: 0 6px; }
/* Row actions are words, not glyphs: a chain link and an eye each meant something
   different to whoever read them. */
.btn-row { height: 28px; padding: 0 8px; border-radius: var(--r-8); border: 1px solid var(--hair-strong);
  box-shadow: var(--shadow-lift);
  background: var(--paper-500); color: var(--ink-900); font-size: 12px; font-weight: 500; white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.btn-row:hover { background: var(--paper-400); color: var(--ink-900); }
.btn-row:disabled { opacity: 0.55; cursor: default; }
/* Armed "Approve anyway?" on a page with a non-verbatim quote. Amber, not red:
   it is a caution, and red already means "delete". */
.is-confirm-warn, .is-confirm-warn:hover:not(:disabled) { background: var(--paper-500); border-color: var(--amber-dot); color: var(--ink-900); }
.lib-actions .btn-icon svg { width: 13px; height: 13px; }
.lib-cols { height: 32px; padding: 0 12px; background: var(--paper-500); border-bottom: 1px solid var(--hair); font-size: 11.5px; color: var(--text-2); }
.lib-row { min-height: 40px; padding: 4px 12px; border-top: 1px solid var(--paper-350); cursor: pointer; font-size: 12.5px; transition: background var(--dur) var(--ease); }
.lib-cols + * > .lib-row:first-child { border-top: none; }
.lib-row:hover { background: var(--paper-450); }
.lib-row.is-active { background: var(--selected); }
.lib-title { min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.church-cols, .church-row { grid-template-columns: 2.2fr 1.6fr 0.7fr 0.8fr 0.6fr 0.7fr 0.7fr 0.8fr 164px; cursor: default; }
.church-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.church-actions .btn-sm { white-space: nowrap; }
.church-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.church-filters .select-control { width: auto; min-width: 0; }
/* A filter that is narrowing the list reads as set, so a forgotten one is visible. */
.church-filters .select-control.is-set { border-color: var(--blue); color: var(--ink-900); }
.church-filters-clear { height: 28px; padding: 0 8px; border-radius: var(--r-5); color: var(--blue); font-size: 12.5px; }
.church-filters-clear:hover { background: var(--paper-450); }
/* Name truncates, the marker never does: it is the reason to scan the column. */
.church-name-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.church-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.church-week { flex: none; height: 18px; font-size: 11px; }
.church-nofb { color: var(--amber-dot); font-family: var(--font-sans); }
.church-head-sub { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.church-head-sub a { color: var(--ink-900); }

/* Add sermon opened from a church: the church is settled, shown as a fixed value. */
/* Own line above the link: the church is context, the link is the one thing left to do. */
.church-lock { order: -1; flex: 1 1 100%; min-width: 0; margin-bottom: 14px; }
.church-lock-box {
  display: flex; align-items: center; gap: 10px; height: 28px; padding: 0 4px 0 10px;
  border: 1px solid var(--hair-strong); border-radius: var(--r-8); background: var(--paper-400); font-size: 12.5px;
}
.church-lock-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.church-lock-fb { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.church-lock-clear { margin-left: auto; flex: none; height: 22px; padding: 0 8px; border-radius: var(--r-5);
  color: var(--blue); font-size: 12px; }
.church-lock-clear:hover { background: var(--paper-500); }

/* The one loud element in the console: a customer started a sermon on their own. */
.cust-alert { margin: 0 auto 16px; max-width: 1280px; padding: 10px 12px 6px 14px;
  border: 1px solid var(--blue); border-radius: var(--r-16); background: var(--blue-pale); }
.cust-alert-head { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.cust-alert-dot { flex: none; width: 8px; height: 8px; border-radius: var(--r-chip); background: var(--blue); }
.cust-alert-title { flex: 1; margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-900); }
.cust-alert-list { margin-top: 4px; }
.cust-alert-row { display: grid; grid-template-columns: 1.6fr 1fr 1.4fr 0.6fr auto; align-items: center; gap: 12px;
  min-height: 32px; padding: 2px 6px 2px 18px; border-top: 1px solid color-mix(in srgb, var(--blue) 18%, transparent);
  border-radius: var(--r-5); font-size: 12.5px; cursor: pointer; }
.cust-alert-row:hover { background: color-mix(in srgb, var(--paper-500) 60%, transparent); }
.cust-alert-church { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-alert-meta { color: var(--text-1); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-alert-more { margin: 4px 0 2px 18px; font-size: 12px; color: var(--text-2); }
.church-slug { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--text-2); }
.church-capped { color: var(--red); font-weight: 500; }
.church-actions { opacity: 1; }
.church-row.is-link, .church-sermon.is-link { cursor: pointer; }
.church-back { font-size: 12.5px; color: var(--text-2); text-decoration: none; }
.church-card { margin-top: 12px; padding: 12px 16px; }
.church-card-title { margin: 0 0 6px; font-size: 12px; font-weight: 400; color: var(--text-2); }
.church-card-title .mono { color: var(--text-2); font-weight: 400; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 24px; }
/* Ace kvList: 30px rows, grey label left, value right, dashed separators. */
.kv-row { display: flex; align-items: center; gap: 12px; min-height: 30px; padding: 4px 0; border-top: 1px dashed var(--dashed); font-size: 12.5px; }
.kv-key { flex: none; width: 108px; color: var(--text-2); }
.kv-val { min-width: 0; overflow-wrap: anywhere; }
.church-sermon { grid-template-columns: 0.9fr 0.8fr 2.4fr 0.6fr 0.8fr; min-height: 40px; padding: 4px 0; }
.lib-cell { font-size: 12.5px; color: var(--text-1); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-del { justify-self: end; width: 28px; height: 28px; border-radius: var(--r-5); color: var(--text-2); font-size: 16px; line-height: 1; }
.lib-del:hover { background: var(--paper-400); color: var(--red); }
.lib-del.is-confirm { background: var(--paper-500); box-shadow: inset 0 0 0 1px var(--hair-strong); color: var(--red); width: auto; padding: 0 8px; font-size: 12px; }
.history-empty { padding: 20px 12px; font-size: 12.5px; color: var(--text-2); }

/* library table scrolls horizontally on narrow screens */
@media (max-width: 920px) {
  .lib-card { overflow-x: auto; }
  .lib-cols, .lib-row { min-width: 720px; }
}

/* ============================ Editor modal ============================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(10, 10, 10, 0.32);
}
.editor-panel {
  width: 100%; max-width: 760px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper-500); border: 1px solid var(--hair); border-radius: var(--r-shell);
  box-shadow: var(--shadow-shell);
}
.editor-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--hair); }
.editor-header h2 { font-size: 15px; font-weight: 500; margin: 0; }
.editor-body { flex: 1; overflow-y: auto; padding: 16px; display: grid; gap: 16px; }
.editor-section { display: grid; gap: 8px; }
.editor-section + .editor-section { padding-top: 16px; border-top: 1px dashed var(--dashed); }
.editor-section-title { font-size: 12px; color: var(--text-2); margin: 0; }
.editor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.list-editor { display: grid; gap: 8px; }
.list-editor-row { display: flex; gap: 8px; align-items: center; }
.list-editor-input { flex: 1; }
.list-editor-remove { flex: none; width: 28px; height: 28px; border-radius: var(--r-8); border: 1px solid var(--hair-strong); box-shadow: var(--shadow-lift); color: var(--text-2); font-size: 14px; line-height: 1; }
.list-editor-remove:hover { background: var(--paper-400); color: var(--red); }
.editor-study-groups { display: grid; gap: 16px; }
.study-editor-group { display: grid; gap: 10px; }
.study-editor-group h4 { font-size: 12.5px; font-weight: 500; margin: 0; }
.day-editor-group { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--hair); border-radius: var(--r-11); background: var(--paper-500); }
.day-editor-header { font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; color: var(--text-2); }
.editor-clip-checks { display: grid; gap: 8px; }
.clip-check-row { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 8px; border-radius: var(--r-8); }
.clip-check-row:hover { background: var(--paper-450); }
.clip-check-thumb { width: 28px; height: 28px; flex: none; border-radius: var(--r-8); object-fit: cover; }
.clip-check-title { font-size: 12.5px; }
.editor-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--hair); }
.editor-status { font-size: 12px; color: var(--text-2); font-family: var(--font-mono); }
.editor-footer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
body.modal-open { overflow: hidden; }
.post-panel { max-width: 520px; }
.post-note { font-size: 12.5px; color: var(--text-2); margin: 0; }
.post-reason { font-size: 12px; color: var(--text-2); margin-left: auto; }
.post-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 12.5px; }
.post-history .is-failed { color: var(--red); }
.quote-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 16px; }
.quote-card { margin: 0; display: grid; gap: 6px; font-size: 12.5px; }
.quote-card img { width: 100%; height: auto; border: 1px solid var(--hair); border-radius: var(--r-11); }

/* ============================ Toast ============================ */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px);
  z-index: 80;
  background: var(--ink-fill); color: var(--on-ink-text);
  font-size: 12.5px; padding: 8px 12px; border-radius: var(--r-11);
  box-shadow: var(--shadow-shell);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ============================ Share mode ============================ */
.shell[data-mode="share"] .nav-rail,
.shell[data-mode="share"] .topbar-search,
.shell[data-mode="share"] .topbar-crumb,
.shell[data-mode="share"] #addSermonBtn,
.shell[data-mode="share"] #sermonTabs,
.shell[data-mode="share"] .view-actions,
.shell[data-mode="share"] .crumb { display: none; }
.shell[data-mode="share"] .topbar-actions { margin-left: auto; }

/* ============================ Responsive ============================ */
@media (max-width: 920px) {
  .shell { flex-direction: column; min-height: 0; }
  /* The rail becomes one bar: brand left, theme + sign out right, and the nav as
     a single row that scrolls sideways — it used to wrap into 2-3 rows and hide
     sign out entirely. */
  .nav-rail {
    position: static; height: auto; align-self: auto; overflow: visible;
    width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center;
    border-right: none; border-bottom: 1px solid var(--hair); padding: 10px 12px 8px; gap: 8px 10px;
  }
  .rail-brand { padding: 0; margin: 0; }
  .rail-user { order: 1; margin-left: auto; padding: 0; gap: 4px; border-top: none; }
  .rail-avatar, .rail-user-meta { display: none; }
  .rail-nav {
    order: 2; flex: 1 0 100%; flex-direction: row; flex-wrap: nowrap; gap: 4px;
    overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px;
  }
  .rail-nav::-webkit-scrollbar { display: none; }
  .rail-item { flex: none; }
  .rail-spacer { display: none; }
  .view-actions { flex-wrap: wrap; flex: initial; }
  .shell-body { padding: 16px; }
  .view-head { flex-direction: column; align-items: flex-start; }
  /* In a column the titles' 320px flex-basis is a HEIGHT: it left ~200px of blank
     space under every view title on tablets and phones. */
  .view-head-titles { flex-basis: auto; width: 100%; }
  .dash-row { grid-template-columns: 1fr; }
  .res-2col { grid-template-columns: 1fr; }
  /* Clip counts already sit in the approval rows and the hero; the page state
     needs the width more. */
  /* Cost is the least-scanned column; the library keeps it. */
  .queue-cols, .queue-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) 56px 52px minmax(0, 1.4fr) 160px; }
  .queue-cols > :nth-child(6), .queue-row > .queue-cost { display: none; }
}

/* Phones: tables become stacked rows (title on its own line, the rest wrapping
   under it) instead of a 640-740px grid clipped inside a 390px card, where
   status, cost and the actions were simply off-screen. */
@media (max-width: 640px) {
  .topbar { padding: 0 12px; gap: 8px; }
  /* The rail bar already names the section; crumb + search + primary don't fit. */
  .topbar-crumb { display: none; }
  .topbar-search { margin-left: 0; max-width: none; }
  .shell-body { padding: 16px 12px; }
  .lib-cols, .queue-cols { display: none; }
  .lib-row, .queue-row {
    min-width: 0; display: flex; flex-wrap: wrap; align-items: center;
    gap: 4px 12px; padding: 10px 12px;
  }
  .lib-row > .lib-title, .queue-row > .queue-asset { flex: 1 0 100%; min-width: 0; }
  /* The title already says "N clips"; the bare count column is noise here. */
  #libraryRows .lib-row > :nth-child(4) { display: none; }
  .lib-row .lib-actions { margin-left: auto; }
  .cust-alert-row { display: flex; flex-wrap: wrap; gap: 2px 12px; padding: 8px 6px 8px 18px; }
  .cust-alert-church { flex: 1 0 100%; }
  .ralign { text-align: left; }
  .tabs { overflow-x: auto; scrollbar-width: none; gap: 20px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn { flex: none; }
  /* Approval rows: title beside a small filmstrip, actions full-width under it
     so both buttons are real thumb targets. */
  .appr-row { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "film main" "actions actions";
    gap: 10px 12px; padding: 10px 12px; align-items: start; }
  .appr-facts { gap: 0 10px; }
  .appr-film .film-frame:nth-child(n+2) { display: none; }
  .appr-actions .btn { flex: 1; }
  .dash-hero-body { flex-direction: column; align-items: flex-start; gap: 10px; }
  .queue-row { gap: 2px 10px; padding: 10px 12px; }
  .queue-asset { flex: 1 0 100%; }
  .queue-row > .queue-cell { color: var(--text-2); }
  .queue-row > .queue-church { flex: 0 1 auto; max-width: 55%; }
  .queue-row > .queue-cost { display: none; }
  /* 60% can't share a line with church + date + clips, so status starts line 3;
     the labelled actions (~150px) sit beside it or wrap under it on narrow phones. */
  .queue-status { flex: 1 0 60%; display: flex; align-items: center; min-height: 28px; }
  .queue-row .queue-actions { margin-left: auto; }
}

/* Share card preview — the picture a sermon gets shared as. 1200x630, so it is
   shown at its own ratio rather than cropped into a square. */
.card-preview { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.card-preview-img { width: 100%; aspect-ratio: 1200 / 630; object-fit: contain;
  border: 1px solid var(--hair); border-radius: var(--r-11); background: var(--paper-400); }
.card-preview-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-preview-note { font-size: 12px; color: var(--text-2); }

/* ============================ Site copy editor ============================ */
.site-copy-form { display: grid; gap: 12px; max-width: 820px; padding-bottom: 32px; }
.sc-group { display: grid; gap: 10px; padding: 12px 16px 16px; border: 1px solid var(--hair); border-radius: var(--r-11); background: var(--paper-500); box-shadow: var(--shadow-lift); }
.sc-group > .sc-legend { font-size: 13px; font-weight: 500; color: var(--ink-900); padding: 0; }
.sc-item { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--hair); border-radius: var(--r-8); background: var(--sidebar); }
.sc-item-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-2); }
.sc-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.sc-hint { font-size: 12px; color: var(--text-2); margin: 0; }

/* ============================ Operator sign-in (/login) ============================ */
.login-canvas { display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--paper-500);
  border: 1px solid var(--hair);
  border-radius: var(--r-shell);
}
.login-brand { padding: 0; height: auto; margin: 0 0 8px; }
.login-title { font-size: 13px; margin: -10px 0 4px; }
.login-card .overline { order: 0; }
/* Ace onboardingForm: 11.5px labels, filled chip-grey inputs with no border. */
.login-card .input { height: 28px; background: var(--paper-400); border-color: transparent; box-shadow: none; }
.login-card .input:focus { background: var(--paper-500); border-color: var(--blue); box-shadow: 0 0 0 2px var(--paper-500), 0 0 0 4px var(--blue); }
.login-error { margin: 0; padding: 8px 10px; border: 1px solid var(--hair); border-radius: var(--r-8); background: var(--paper-500);
  color: var(--red); font-size: 12.5px; }
.login-submit { margin-top: 4px; width: 100%; }
.login-card .login-submit { background: var(--ink-fill); color: var(--on-ink-text); }
.login-card .login-submit:hover:not(:disabled) { background: var(--ink-fill-hover); }

/* Motion: the card settling in (after the window behind it has lit) with its rows staggered,
   a macOS-style shake on a wrong password, and a spinner while the form submits.
   One spring curve for all of it; everything stops under prefers-reduced-motion. */
.login-canvas { --login-spring: cubic-bezier(0.16, 1, 0.3, 1); position: relative; overflow: hidden; isolation: isolate; }
.login-card { position: relative; z-index: 1; }

.login-card { animation: login-in 640ms var(--login-spring) 450ms both; }
.login-card > * { animation: login-rise 560ms var(--login-spring) 450ms both; }
.login-card > :nth-child(2) { animation-delay: 510ms; }
.login-card > :nth-child(3) { animation-delay: 550ms; }
.login-card > :nth-child(4) { animation-delay: 590ms; }
.login-card > :nth-child(5) { animation-delay: 630ms; }
.login-card > :nth-child(6) { animation-delay: 670ms; }
.login-card > :nth-child(n+7) { animation-delay: 710ms; }

.login-card.is-error { animation: login-in 640ms var(--login-spring) both, login-shake 480ms var(--ease) 200ms; }
.login-card.is-error > * { animation-delay: 0s; }

.login-submit { position: relative; transition: background var(--dur) var(--ease), transform var(--dur) var(--ease); }
.login-card.is-busy { transform: scale(0.99); transition: transform 300ms var(--login-spring); }
.login-card.is-busy .login-submit { color: transparent; pointer-events: none; }
.login-card.is-busy .login-submit::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--on-ink-text);
  border-right-color: var(--on-ink-text);
  animation: sc-spin 700ms linear infinite;
}

/* Motion only, never opacity: a card that starts invisible has no contentful paint,
   so /login reported no LCP at all (verify's trace ends before the 450ms delay). */
@keyframes login-in {
  from { transform: translateY(8px); }
  to   { transform: none; }
}
@keyframes login-rise {
  from { transform: translateY(4px); }
  to   { transform: none; }
}
@keyframes login-shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-9px); }
  30% { transform: translateX(8px); }
  45% { transform: translateX(-6px); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .login-card, .login-card > *, .login-card.is-error, .login-card.is-busy .login-submit::after {
    animation: none;
  }
  .login-card.is-busy { transform: none; }
}

/* ==== Stained-glass window (/login) ==== */
/* Three lancet windows behind the sign-in card, drawn as monochrome line art: the
   leading first, then the panes filling in from the top (each pane's --d; the side
   windows a beat later). Nothing animates after the intro. The markup's
   .login-beam and .window-light layers (the old glow and light sweep) are hidden:
   Ace has no glows or gradients. */
.login-beam, .window-light { display: none; }
.login-windows {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 4vw, 32px);
  pointer-events: none;
}
.window-frame {
  position: relative;
  flex: none;
  height: min(94vh, 900px);
  aspect-ratio: 360 / 760;
}
.window-frame.is-side { height: min(78vh, 740px); --lag: 250ms; }
.window-frame.is-left { order: -1; }
.window-frame.is-right { order: 1; }
@media (max-width: 900px) {
  .window-frame.is-side { display: none; }
}
.login-window { display: block; width: 100%; height: 100%; overflow: visible; }
.window-arch { fill: none; stroke: var(--text-3); stroke-width: 2; stroke-linejoin: round; }
.pane {
  stroke: var(--hair-strong);
  stroke-width: 1.2;
  stroke-linejoin: round;
  fill-opacity: var(--o, 0.88);
  animation: pane-light 700ms var(--login-spring) calc(var(--d, 0s) + var(--lag, 0s)) both;
}
.glass-blue   { fill: var(--paper-400); }
.glass-bright { fill: var(--sidebar); }
.glass-red    { fill: var(--selected); }
.glass-green  { fill: var(--hair-strong); }
.glass-amber  { fill: var(--paper-350); }
.glass-pale   { fill: var(--paper-500); }

/* Only `from`: each pane animates up to its own --o. */
@keyframes pane-light {
  from { fill-opacity: 0.04; }
}

/* Back after a wrong password: the windows are already lit. */
.login-canvas.is-returning .pane { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .pane, .login-beam { animation: none; }
  .window-light { display: none; }
}

/* ============================ Sermons pager + sign-out ============================ */
.lib-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 40px; padding: 0 12px; border-top: 1px solid var(--hair); background: var(--paper-500); }
.lib-pager-range { font-size: 12px; color: var(--text-2); }
.lib-pager-btns { display: flex; gap: 6px; }
/* Theme toggle + sign out sit together at the right edge of the user row. */
.rail-user .theme-toggle { margin-left: auto; }
.rail-signout .btn-icon { color: var(--text-2); }

.church-logo { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; vertical-align: middle;
  border: 1px solid var(--hair); }
