:root {
  color-scheme: light;
  --bg: #edf1ee;
  --bg-strong: #dfe8e4;
  --panel: #ffffff;
  --panel-soft: #f7faf7;
  --panel-warm: #fff9ef;
  --text: #162426;
  --text-soft: #314347;
  --muted: #6c797a;
  --line: #d7e0dc;
  --line-strong: #bdcbc6;
  --ink: #111d1f;
  --ink-2: #1a2a2d;
  --accent: #35a99d;
  --accent-dark: #1f766f;
  --accent-deep: #164f55;
  --blue: #5279a8;
  --warm: #d99a3f;
  --warm-soft: #fff3dc;
  --danger: #b2473c;
  --danger-soft: #fff3f0;
  --ok: #247d68;
  --shadow: 0 16px 44px rgba(22, 36, 38, .10);
  --shadow-soft: 0 10px 28px rgba(22, 36, 38, .07);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f7f8f5 0%, var(--bg) 100%);
  color: var(--text);
}

body.auth-page {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(19, 35, 38, .94), rgba(22, 79, 85, .88)),
    linear-gradient(180deg, #f7f8f5 0%, var(--bg) 100%);
}

button,
input,
textarea {
  font: inherit;
}

button,
.button-link {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

button:hover,
.button-link:hover {
  border-color: rgba(53, 169, 157, .72);
  box-shadow: 0 0 0 3px rgba(53, 169, 157, .12);
}

button:active,
.button-link:active {
  transform: translateY(1px);
}

button.primary,
form button[type="submit"] {
  border-color: var(--accent);
  background: var(--accent-dark);
  color: #fff;
  box-shadow: 0 10px 22px rgba(31, 118, 111, .20);
}

button.primary:hover,
form button[type="submit"]:hover {
  border-color: #4cc7bc;
  background: #208178;
}

button:disabled,
button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .55;
  box-shadow: none;
}

button:disabled:hover,
button[aria-disabled="true"]:hover {
  border-color: var(--line);
  box-shadow: none;
}

a {
  color: var(--accent-dark);
}

button:focus-visible,
.button-link:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(31, 118, 111, .72);
  outline-offset: 2px;
}

.shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px;
}

.auth-shell {
  width: min(100%, 440px);
}

.auth-card {
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
}

.auth-card .topbar-kicker {
  color: var(--accent-dark);
}

.auth-card h1 {
  color: var(--text);
}

.auth-subtitle {
  margin-bottom: 18px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  font-weight: 650;
}

.auth-form input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.auth-register-note {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid rgba(217, 154, 63, .35);
  border-radius: 6px;
  background: var(--warm-soft);
  color: var(--text-soft);
}

.auth-status {
  min-height: 22px;
  margin-top: 12px;
}

.auth-status.error {
  color: var(--danger);
}

.auth-status.ok {
  color: var(--ok);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 22px;
  color: #fff;
  background: #132326;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.topbar-kicker {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, .58);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-bottom: 6px;
  color: #fff;
  font-size: 25px;
  font-weight: 760;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0;
}

h3 {
  color: var(--text);
  font-size: 16px;
  letter-spacing: 0;
}

p {
  color: var(--muted);
}

.topbar p:not(.topbar-kicker) {
  color: rgba(255, 255, 255, .70);
}

.topbar button {
  border-color: rgba(255, 255, 255, .15);
  background: rgba(255, 255, 255, .09);
  color: #fff;
}

.topbar button:hover {
  border-color: rgba(91, 213, 203, .86);
  background: rgba(53, 169, 157, .20);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .76);
  box-shadow: var(--shadow-soft);
}

.tab {
  min-width: max-content;
  border: 0;
  background: transparent;
  color: var(--text-soft);
}

.tab:hover {
  box-shadow: none;
  background: rgba(53, 169, 157, .08);
}

.tab.active {
  background: #fff;
  color: var(--accent-dark);
  box-shadow: 0 8px 20px rgba(22, 36, 38, .07);
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: panelIn 180ms ease-out;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .84);
  box-shadow: var(--shadow-soft);
}

[hidden] {
  display: none !important;
}

.sermon-source-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .84);
  box-shadow: var(--shadow-soft);
}

.source-segment {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 4px;
}

.source-option {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.source-option.active {
  border-color: rgba(53, 169, 157, .24);
  background: rgba(53, 169, 157, .10);
  color: var(--accent-dark);
}

.source-controls {
  margin-bottom: 8px;
}

.source-author-field {
  flex: 1 1 280px;
}

.source-title-field {
  flex: 2 1 320px;
}

.source-status {
  min-height: 24px;
  margin: 0 2px 12px;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

input[type="number"],
input[type="file"],
input[type="search"],
select,
textarea {
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 150px;
  resize: vertical;
}

textarea[readonly] {
  background: var(--panel-soft);
}

input[type="number"] {
  width: 120px;
}

select,
input[type="search"] {
  width: 100%;
}

input[type="range"] {
  width: 260px;
  accent-color: var(--accent);
}

.list {
  display: grid;
  gap: 10px;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow-soft);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.row:hover {
  transform: translateY(-1px);
  border-color: rgba(53, 169, 157, .34);
  box-shadow: var(--shadow);
}

.row h3 {
  margin-bottom: 5px;
  font-size: 17px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
}

.sermon-times {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.time-pill,
.badge,
.file-chip,
.cache-pill,
.timing-pill,
.studio-check span,
.stage-timeline span {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.time-pill {
  border: 1px solid rgba(53, 169, 157, .18);
  background: rgba(53, 169, 157, .10);
  color: var(--accent-dark);
}

.time-pill.muted {
  border-color: var(--line);
  background: #eef3f0;
  color: var(--muted);
}

.badge {
  background: #eef3f0;
  color: var(--text-soft);
}

.badge.ok {
  border: 1px solid rgba(36, 125, 104, .20);
  background: rgba(36, 125, 104, .11);
  color: var(--ok);
}

.badge.warn {
  border: 1px solid rgba(217, 154, 63, .25);
  background: var(--warm-soft);
  color: #97632a;
}

.badge.bad {
  border: 1px solid rgba(178, 71, 60, .28);
  background: var(--danger-soft);
  color: var(--danger);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 18px;
  align-items: start;
}

.build-stack {
  display: grid;
  gap: 18px;
}

.build-form {
  gap: 16px;
}

.build-form-grid {
  display: grid;
  grid-template-columns: minmax(260px, .95fr) minmax(320px, 1fr) minmax(360px, 1.18fr);
  gap: 16px;
  align-items: start;
}

.build-form-column {
  display: grid;
  gap: 12px;
  min-width: 0;
  align-content: start;
}

.build-actions {
  padding-top: 2px;
}

.form,
.review,
.codebox,
.selected-sermon-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-soft);
}

.form {
  display: grid;
  gap: 13px;
}

.codebox {
  min-height: 140px;
  overflow: auto;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  color: #263331;
}

.selected-sermon-card {
  display: grid;
  gap: 14px;
  min-height: 180px;
}

.selected-sermon-card.is-empty {
  min-height: 160px;
  place-items: center;
  border-style: dashed;
  color: var(--muted);
  background: rgba(255, 255, 255, .62);
}

.selected-sermon-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.selected-sermon-head h3 {
  margin-bottom: 4px;
  font-size: 22px;
}

.sermon-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.sermon-facts div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.sermon-facts dt {
  color: var(--muted);
  font-size: 12px;
}

.sermon-facts dd {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 14px;
}

.cover-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.cover-controls legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.cover-controls input[type="range"] {
  width: 100%;
}

.cover-controls output {
  align-self: end;
  color: var(--muted);
  font-size: 12px;
}

.background-preview,
.cover-preview-grid.is-empty,
.video-preview-panel,
.performance-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel-soft);
}

.background-preview {
  display: grid;
  gap: 8px;
}

.background-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #e8eeeb;
}

.background-preview.is-empty,
.cover-preview-grid.is-empty,
.video-preview-panel.is-empty,
.performance-panel.is-empty {
  min-height: 126px;
  display: grid;
  place-items: center;
  border-style: dashed;
  color: var(--muted);
  font-size: 13px;
}

.background-caption {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 0 10px 10px;
}

.background-caption strong,
.background-caption span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.background-caption strong {
  font-size: 13px;
}

.background-caption span {
  color: var(--muted);
  font-size: 12px;
}

.cover-preview-grid {
  display: grid;
  gap: 10px;
}

.cover-preview-grid figure {
  display: grid;
  gap: 6px;
  margin: 0;
}

.cover-preview-grid figcaption {
  color: var(--muted);
  font-size: 12px;
}

.cover-preview-grid img,
.preview-image {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #111c20;
}

.video-preview-panel {
  display: grid;
  min-height: 170px;
  place-items: center;
  background: #10181d;
}

.video-preview-panel video {
  display: block;
  background: #10181d;
}

.review {
  display: grid;
  gap: 14px;
}

.review > *,
.review-grid > * {
  min-width: 0;
}

.review audio,
.review video {
  width: 100%;
  max-width: 100%;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.file-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0;
}

.file-links a,
.button-link {
  text-decoration: none;
}

.file-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.progress-panel,
.performance-summary,
.upload-progress,
.publish-fields,
.detail-actions {
  display: grid;
  gap: 10px;
}

.performance-panel {
  display: grid;
  min-height: 78px;
  padding: 12px;
  background: #f9fffc;
}

.performance-head,
.progress-head,
.publish-card-head,
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.performance-head span {
  color: var(--muted);
  font-size: 12px;
}

.cache-grid,
.timing-grid,
.publish-files,
.studio-check,
.publish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.cache-pill,
.timing-pill {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.cache-pill.is-hit {
  border-color: rgba(36, 125, 104, .25);
  background: rgba(36, 125, 104, .10);
  color: var(--ok);
}

.cache-pill.is-miss {
  border-color: rgba(217, 154, 63, .28);
  background: rgba(217, 154, 63, .11);
  color: #97632a;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4ece8;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms ease;
}

.muted {
  color: var(--muted);
}

.publish-toolbar {
  align-items: flex-start;
}

.publish-toolbar > button {
  align-self: start;
}

.schedule-panel,
.plan-panel {
  margin-bottom: 14px;
}

.schedule-card,
.plan-hero,
.plan-year,
.plan-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-soft);
}

.schedule-card,
.plan-hero,
.plan-list {
  padding: 16px;
}

.schedule-card.is-muted {
  color: var(--muted);
}

.schedule-head,
.plan-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.schedule-head h2,
.plan-hero h2 {
  margin: 2px 0 6px;
}

.time-control {
  min-width: 140px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-soft);
}

.time-control input {
  margin-top: 5px;
  width: 100%;
}

.schedule-modes {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 14px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 42, 40, .05);
}

.schedule-modes button {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.schedule-modes button.is-active {
  background: var(--accent);
  color: white;
}

.schedule-now,
.schedule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.quick-slot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.quick-slot {
  min-height: 86px;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
}

.quick-slot strong,
.quick-slot span {
  display: block;
}

.quick-slot span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.quick-slot.is-selected {
  border-color: rgba(76, 157, 142, .75);
  background: rgba(76, 157, 142, .13);
}

.schedule-actions {
  margin-top: 12px;
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  text-align: center;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  min-height: 58px;
  padding: 8px;
  border-color: rgba(108, 122, 119, .22);
  background: rgba(255, 255, 255, .8);
  color: var(--text);
  text-align: left;
  white-space: normal;
}

.calendar-day span,
.calendar-day small {
  display: block;
}

.calendar-day small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.calendar-day.is-free {
  border-color: rgba(76, 157, 142, .45);
  background: rgba(76, 157, 142, .08);
}

.calendar-day.is-occupied {
  border-color: rgba(194, 137, 62, .4);
  background: rgba(247, 226, 188, .55);
}

.calendar-day.is-past,
.calendar-day.is-outside {
  opacity: .45;
}

.calendar-day.is-selected {
  outline: 2px solid rgba(76, 157, 142, .75);
  outline-offset: 1px;
}

.schedule-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.plan-year {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
}

.plan-month {
  display: grid;
  gap: 8px;
}

.plan-month-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.plan-dot {
  min-height: 22px;
  border-radius: 5px;
  background: rgba(76, 157, 142, .13);
  color: var(--text-soft);
  font-size: 11px;
  line-height: 22px;
  text-align: center;
}

.plan-dot.is-occupied {
  background: rgba(194, 137, 62, .25);
}

.plan-dot.is-past {
  opacity: .32;
}

.publish-grid {
  display: block;
  margin-bottom: 14px;
}

.reliability-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-soft);
}

.reliability-panel.is-compact {
  gap: 8px;
  padding: 10px;
  box-shadow: none;
}

.reliability-panel.is-compact .section-head {
  align-items: center;
  padding: 10px 12px;
  box-shadow: none;
}

.reliability-panel.is-compact h2 {
  margin-bottom: 4px;
  font-size: 16px;
}

.reliability-panel.is-compact p {
  margin: 0;
}

.reliability-panel.tone-ok {
  border-color: rgba(36, 125, 104, .26);
  background: #f7fffb;
}

.reliability-panel.tone-warn {
  border-color: rgba(217, 154, 63, .30);
  background: #fffaf0;
}

.reliability-panel.tone-bad {
  border-color: rgba(178, 71, 60, .30);
  background: #fff4f1;
}

.reliability-platforms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.reliability-platform {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 12px 42px 12px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.reliability-platform div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.reliability-platform span,
.reliability-platform p,
.reliability-list span,
.reliability-list em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.reliability-platform p {
  margin: 0;
}

.reliability-platform.tone-ok strong {
  color: var(--ok);
}

.reliability-platform.tone-warn {
  border-color: rgba(217, 154, 63, .28);
  background: var(--warm-soft);
}

.reliability-platform.tone-bad {
  border-color: rgba(178, 71, 60, .28);
  background: var(--danger-soft);
}

.small-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.ghost-button {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

.ghost-button:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, .7);
}

.recovery-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(217, 154, 63, .32);
  border-radius: var(--radius);
  background: #fffaf0;
  box-shadow: var(--shadow-soft);
}

.recovery-panel .section-head {
  align-items: center;
  padding: 10px 12px;
  box-shadow: none;
}

.recovery-panel h2,
.recovery-panel p {
  margin: 0;
}

.recovery-jobs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.recovery-job {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid rgba(217, 154, 63, .28);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .76);
}

.recovery-job div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.recovery-job span,
.recovery-job small,
.recovery-job p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.override-actions {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(217, 154, 63, .34);
  border-radius: var(--radius);
  background: rgba(255, 243, 220, .70);
}

.override-actions p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
}

.override-actions div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.danger-button {
  border-color: rgba(178, 71, 60, .35);
  background: var(--danger);
  color: #fff;
}

.danger-button:hover {
  background: #96382f;
}

.reliability-details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.reliability-details summary {
  cursor: pointer;
  color: var(--text-soft);
  font-weight: 700;
}

.reliability-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.reliability-columns h3 {
  margin-bottom: 8px;
  font-size: 14px;
}

.reliability-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reliability-list li {
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.reliability-list-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.reliability-list li.tone-bad {
  border-color: rgba(178, 71, 60, .28);
  background: var(--danger-soft);
}

.reliability-list li.tone-warning {
  border-color: rgba(217, 154, 63, .28);
  background: var(--warm-soft);
}

.connections-panel {
  display: grid;
  gap: 16px;
}

.connections-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.connections-head h2,
.connection-card h2 {
  margin-bottom: 5px;
  font-size: 21px;
}

.connections-head p:last-child,
.connection-message {
  color: var(--muted);
}

.connections-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.connection-card {
  display: grid;
  grid-template-rows: auto;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  overflow: visible;
  border: 1px solid var(--line);
  border-top: 3px solid var(--warm);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.connection-card.tone-ok {
  border-top-color: var(--ok);
}

.connection-card.tone-bad {
  border-color: rgba(178, 71, 60, .34);
  border-top-color: var(--danger);
  background: #fffafa;
}

.connection-card.tone-bad .connection-message {
  color: var(--danger);
  font-weight: 700;
}

.connection-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.connection-message {
  min-height: 42px;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.connection-facts {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.connection-facts > div {
  display: grid;
  grid-template-columns: minmax(86px, .7fr) minmax(0, 1.3fr);
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.connection-facts dt,
.connection-facts dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.connection-facts dt {
  color: var(--muted);
}

.connection-facts dd {
  color: var(--text);
  font-weight: 700;
  text-align: right;
}

.connection-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}

.connection-actions > * {
  flex: 1 1 150px;
}

.connection-admin-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.connection-card .vk-auth-panel {
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.connection-card .vk-auth-actions {
  grid-template-columns: 1fr;
}

.youtube-access-note {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  font-size: 12px;
  line-height: 1.45;
}

.youtube-access-note.is-warning {
  border-color: rgba(217, 154, 63, .32);
  background: var(--warm-soft);
}

.vk-server-oauth-setup ol {
  display: grid;
  gap: 6px;
  margin: 2px 0;
  padding-left: 20px;
}

.oauth-callback-value {
  display: block;
  max-width: 100%;
  padding: 9px 10px;
  overflow-wrap: anywhere;
  border: 1px solid rgba(217, 154, 63, .25);
  border-radius: 5px;
  background: rgba(255, 255, 255, .72);
  color: var(--text);
}

.youtube-access-note.is-ready {
  border-color: rgba(36, 125, 104, .24);
  background: rgba(36, 125, 104, .07);
}

.youtube-access-note p {
  margin: 0;
  color: var(--muted);
}

.youtube-access-note a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  width: fit-content;
  color: var(--accent-dark);
  font-weight: 800;
}

.connection-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.publish-dashboard,
.publish-detail {
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-soft);
}

.publish-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 470px);
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.publish-hero h2,
.detail-head h2 {
  margin-bottom: 6px;
  font-size: 21px;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.file-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.file-chip.is-ready {
  border-color: rgba(36, 125, 104, .25);
  background: rgba(36, 125, 104, .10);
  color: var(--ok);
}

.file-chip.is-missing {
  border-color: rgba(217, 154, 63, .35);
  background: var(--warm-soft);
  color: #97632a;
}

.file-chip a {
  color: inherit;
  text-decoration: none;
}

.publish-pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.platform-step {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 116px;
  text-align: left;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.platform-step.is-static {
  padding: 16px;
  cursor: default;
}

.platform-step-main {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 116px;
  padding: 16px;
  text-align: left;
  color: inherit;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.platform-step.has-help .platform-step-main {
  padding-right: 44px;
}

.platform-step:last-child {
  border-right: 0;
}

.platform-step:hover,
.platform-step.is-active {
  background: #f6fbfa;
  box-shadow: inset 0 -3px 0 var(--accent);
}

.platform-step strong {
  font-size: 19px;
}

.platform-step span {
  color: var(--muted);
  font-size: 12px;
}

.platform-step .platform-name {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.platform-step.tone-ok strong {
  color: var(--ok);
}

.platform-step.tone-warn strong {
  color: #97632a;
}

.platform-step.tone-bad strong {
  color: var(--danger);
}

.detail-head-actions {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
}

.platform-help {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
}

.platform-help.is-detail {
  position: relative;
  top: auto;
  right: auto;
}

.platform-help.is-inline {
  position: relative;
  top: auto;
  right: auto;
  flex: 0 0 auto;
}

.platform-help.is-inline .help-trigger {
  width: 20px;
  height: 20px;
  font-size: 12px;
}

.platform-help.is-inline .platform-help-popover {
  top: 26px;
}

.platform-help[open] {
  z-index: 20;
}

.platform-help summary {
  list-style: none;
}

.platform-help summary::-webkit-details-marker {
  display: none;
}

.help-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(217, 154, 63, .34);
  border-radius: 999px;
  background: #fff8e8;
  color: #9a672e;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.help-trigger:hover,
.platform-help[open] .help-trigger {
  border-color: rgba(36, 125, 104, .34);
  background: rgba(36, 125, 104, .10);
  color: var(--accent-dark);
}

.platform-help.is-error .help-trigger {
  border-color: rgba(178, 71, 60, .42);
  background: var(--danger-soft);
  color: var(--danger);
}

.platform-help.is-error .help-trigger:hover,
.platform-help.is-error[open] .help-trigger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.platform-help-popover {
  position: absolute;
  top: 34px;
  right: 0;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 40px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.platform-help-popover strong {
  color: var(--text);
  font-size: 15px;
}

.platform-help-error {
  padding: 9px;
  border: 1px solid rgba(178, 71, 60, .25);
  border-radius: 5px;
  background: var(--danger-soft);
  color: var(--danger);
}

.platform-help-popover p,
.platform-help-popover li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.platform-help-popover p {
  margin: 0;
}

.platform-help-popover ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.publish-detail-shell {
  min-height: 260px;
}

.publish-detail {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 16px;
  align-items: start;
}

.text-preview,
.publish-text,
.checklist {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.text-preview {
  min-height: 170px;
  padding: 14px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.5;
}

.youtube-playlist-control {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.youtube-playlist-control label {
  display: grid;
  gap: 7px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.youtube-playlist-control select {
  min-height: 40px;
  width: 100%;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: #fff;
  font-size: 14px;
}

.upload-progress {
  padding: 14px;
  border: 1px solid rgba(53, 169, 157, .30);
  border-radius: var(--radius);
  background: #f7fffd;
}

.upload-progress.is-failed {
  border-color: rgba(178, 71, 60, .28);
  background: var(--danger-soft);
}

.upload-progress.is-manual,
.existing-publication {
  border-color: rgba(217, 154, 63, .34);
  background: var(--warm-soft);
}

.existing-publication {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(217, 154, 63, .34);
  border-radius: var(--radius);
}

.existing-publication p {
  color: var(--muted);
}

#publishSchedulePanel.is-locked {
  opacity: .72;
}

.platform-progress-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.platform-status {
  display: grid;
  gap: 4px;
  min-height: 100px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.platform-status span,
.platform-status p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.platform-status strong {
  font-size: 15px;
}

.platform-status.is-running {
  border-color: rgba(53, 169, 157, .42);
  background: rgba(53, 169, 157, .08);
}

.platform-status.is-done {
  border-color: rgba(36, 125, 104, .30);
  background: rgba(36, 125, 104, .08);
}

.platform-status.is-manual {
  border-color: rgba(217, 154, 63, .34);
  background: var(--warm-soft);
}

.platform-status.is-failed {
  border-color: rgba(178, 71, 60, .28);
  background: var(--danger-soft);
}

.stage-timeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.stage-timeline span {
  justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.stage-timeline span.is-active {
  border-color: var(--accent);
  background: rgba(53, 169, 157, .12);
  color: var(--accent-dark);
}

.stage-timeline span.is-done {
  border-color: rgba(36, 125, 104, .30);
  background: rgba(36, 125, 104, .10);
  color: var(--ok);
}

.studio-check {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.studio-check span {
  background: #fff;
  color: var(--muted);
}

.studio-check span:first-child {
  color: var(--text);
  font-weight: 800;
}

.youtube-monetization-notice {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(217, 154, 63, .34);
  border-radius: var(--radius);
  background: var(--warm-soft);
}

.youtube-monetization-notice strong {
  color: #7a5125;
  font-size: 14px;
}

.youtube-monetization-notice p {
  margin: 0;
  color: #85633f;
  font-size: 13px;
  line-height: 1.4;
}

.youtube-monetization-notice .button-link {
  justify-self: start;
  background: rgba(255, 255, 255, .72);
}

.vk-auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(53, 169, 157, .24);
  border-radius: var(--radius);
  background: #fbfffd;
}

.vk-auth-panel p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.vk-auth-actions {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 170px;
  gap: 8px;
  align-items: stretch;
}

.vk-auth-actions textarea {
  min-height: 42px;
}

.inline-notice {
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(36, 125, 104, .30);
  border-radius: var(--radius);
  background: rgba(36, 125, 104, .10);
  color: var(--ok);
  font-size: 13px;
}

.compact-code {
  max-height: 360px;
  min-height: 180px;
}

.publish-card textarea {
  min-height: auto;
}

.publish-text {
  min-height: 140px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  white-space: pre-wrap;
  font-size: 13px;
}

.checklist {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
}

.history-import {
  margin-bottom: 16px;
}

.history-section {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow-soft);
}

.history-build-row .performance-summary {
  margin-top: 10px;
}

.publication-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.publication-row {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.publication-row div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.publication-row strong {
  color: var(--text);
}

.publication-row span,
.publication-row p {
  color: var(--muted);
  font-size: 12px;
}

.publication-row.tone-ok {
  border-color: rgba(36, 125, 104, .25);
  background: rgba(36, 125, 104, .06);
}

.publication-row.tone-warn {
  border-color: rgba(217, 154, 63, .28);
  background: rgba(217, 154, 63, .07);
}

.publication-row.tone-bad {
  border-color: rgba(178, 71, 60, .28);
  background: var(--danger-soft);
}

.warning {
  padding: 9px 10px;
  border: 1px solid rgba(217, 154, 63, .34);
  border-radius: var(--radius);
  background: var(--warm-soft);
  color: #97632a;
  font-size: 13px;
}

.error {
  color: var(--danger);
}

@media (max-width: 1180px) {
  .build-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .build-preview-column {
    grid-column: 1 / -1;
  }

  .build-preview-column .cover-preview-grid:not(.is-empty) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .connections-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .connection-card:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .shell {
    padding: 18px;
  }

  .topbar,
  .connections-head,
  .connections-grid,
  .split,
  .build-form-grid,
  .review-grid,
  .publish-hero,
  .schedule-head,
  .quick-slot-grid,
  .plan-hero,
  .plan-year,
  .publish-pipeline,
  .recovery-jobs,
  .reliability-platforms,
  .reliability-columns,
  .detail-grid,
  .platform-progress-grid,
  .publication-list,
  .stage-timeline,
  .vk-auth-panel,
  .vk-auth-actions,
  .sermon-facts {
    display: grid;
    grid-template-columns: 1fr;
  }

  .connection-card:last-child {
    grid-column: auto;
  }

  .connection-warning {
    align-items: stretch;
    flex-direction: column;
  }

  .publish-files {
    justify-content: flex-start;
  }

  .schedule-modes {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .plan-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .build-preview-column {
    grid-column: auto;
  }

  .build-preview-column .cover-preview-grid:not(.is-empty) {
    grid-template-columns: 1fr;
  }

  .platform-step {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .platform-step:last-child {
    border-bottom: 0;
  }

  .row,
  .selected-sermon-head,
  .performance-head,
  .progress-head,
  .detail-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  input[type="range"] {
    width: 100%;
  }
}

/* Publication, schedule and history workspace */
.publish-release {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.publish-release h2 {
  margin: 2px 0 5px;
  font-size: 22px;
}

.publish-release p:last-child {
  color: var(--muted);
}

.publish-platform-list {
  display: grid;
}

.publish-platform-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.publish-platform-row::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--line-strong);
  content: "";
}

.publish-platform-row.tone-ok::before {
  background: var(--ok);
}

.publish-platform-row.tone-warn::before {
  background: var(--warm);
}

.publish-platform-row.tone-bad::before {
  background: var(--danger);
}

.publish-platform-row.is-active {
  background: #f6fbfa;
}

.publish-platform-main {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 22px;
  gap: 14px;
  align-items: center;
  min-width: 0;
  min-height: 72px;
  padding: 12px 14px 12px 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  box-shadow: none;
}

.publish-platform-main:hover {
  border-color: transparent;
  background: rgba(53, 169, 157, .05);
  box-shadow: none;
}

.publish-platform-main .platform-name {
  font-weight: 800;
}

.platform-summary {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.platform-summary strong {
  color: var(--text);
}

.publish-platform-row.tone-ok .platform-summary strong {
  color: var(--ok);
}

.publish-platform-row.tone-warn .platform-summary strong {
  color: #97632a;
}

.publish-platform-row.tone-bad .platform-summary strong {
  color: var(--danger);
}

.platform-summary small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-chevron {
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  transform: rotate(0);
  transition: transform 160ms ease;
}

.publish-platform-row.is-active .row-chevron {
  transform: rotate(90deg);
}

.publish-platform-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 10px 6px;
}

.publish-files-details,
.publish-advanced,
.payload-details,
.single-platform-actions,
.history-release-details,
.history-advanced {
  border-top: 1px solid var(--line);
}

.publish-files-details {
  padding: 11px 18px 14px;
}

.publish-files-details summary,
.publish-advanced > summary,
.payload-details summary,
.single-platform-actions summary,
.history-release-details summary,
.history-advanced > summary {
  color: var(--text-soft);
  font-weight: 750;
  cursor: pointer;
}

.publish-files-details .publish-files {
  margin-top: 10px;
}

.publish-detail-shell {
  min-height: 0;
}

.publish-advanced {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow-soft);
}

.publish-advanced > summary {
  padding: 14px 16px;
  list-style-position: inside;
}

.publish-advanced[open] > summary {
  border-bottom: 1px solid var(--line);
}

.publish-advanced-body .publish-detail {
  border: 0;
  box-shadow: none;
}

.payload-details,
.single-platform-actions {
  padding-top: 10px;
}

.payload-details > *:not(summary),
.single-platform-actions > *:not(summary) {
  margin-top: 10px;
}

.detail-actions-inline,
.reliability-actions,
.schedule-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.schedule-primary-actions {
  margin-top: 14px;
}

.schedule-primary-actions .primary {
  min-width: 260px;
}

.plan-calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.plan-calendar,
.plan-day-detail {
  min-width: 0;
  padding: 16px;
}

.plan-day-detail {
  border-left: 1px solid var(--line);
  background: var(--panel-soft);
}

.plan-day-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.plan-day-head h3 {
  margin: 0;
  font-size: 17px;
}

.plan-day-items,
.schedule-queue-list,
.ready-build-list {
  display: grid;
  gap: 8px;
}

.plan-day-items article,
.schedule-queue-row,
.ready-build-row,
.history-version,
.history-attempt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.plan-day-items article:last-child,
.schedule-queue-row:last-child,
.ready-build-row:last-child,
.history-version:last-child,
.history-attempt:last-child {
  border-bottom: 0;
}

.plan-day-items article > div,
.schedule-queue-row > div:first-child,
.ready-build-row > div,
.history-version > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.plan-day-items span,
.schedule-queue-row span,
.ready-build-row span,
.history-version span,
.history-attempt span {
  color: var(--muted);
  font-size: 12px;
}

.platform-chips,
.history-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.platform-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.platform-chip.tone-ok {
  border-color: rgba(36, 125, 104, .25);
  color: var(--ok);
}

.platform-chip.tone-warn {
  border-color: rgba(217, 154, 63, .32);
  color: #97632a;
}

.platform-chip.tone-bad {
  border-color: rgba(178, 71, 60, .28);
  color: var(--danger);
}

.schedule-queue,
.ready-backlog {
  margin-bottom: 14px;
}

.schedule-queue-list,
.ready-build-list {
  padding: 4px 16px 10px;
}

.history-head,
.history-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.history-head {
  margin-bottom: 12px;
}

.history-head h2 {
  margin: 0;
}

.history-controls {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .88);
}

.history-search {
  display: grid;
  grid-template-columns: auto minmax(220px, 360px);
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.history-search input {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.history-filters {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: rgba(17, 42, 40, .05);
}

.history-filters button {
  min-height: 32px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.history-filters button.is-active {
  background: var(--accent-dark);
  color: #fff;
}

.history-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.history-release-list {
  display: grid;
  gap: 9px;
}

.history-release-row {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.history-release-row.has-problem {
  border-color: rgba(178, 71, 60, .30);
}

.history-release-main {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(330px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 13px 14px;
}

.history-release-title {
  min-width: 0;
}

.history-release-title h3 {
  margin: 0 0 4px;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-release-title span {
  color: var(--muted);
  font-size: 12px;
}

.history-platform {
  display: grid;
  min-width: 92px;
  gap: 2px;
  padding: 7px 8px;
  border-left: 2px solid var(--line-strong);
  background: var(--panel-soft);
}

.history-platform small {
  color: var(--muted);
  font-size: 11px;
}

.history-platform.tone-ok {
  border-left-color: var(--ok);
}

.history-platform.tone-warn {
  border-left-color: var(--warm);
}

.history-platform.tone-bad {
  border-left-color: var(--danger);
}

.history-release-details summary {
  padding: 10px 14px;
  background: var(--panel-soft);
  font-size: 12px;
}

.history-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 14px;
}

.history-detail-grid h4 {
  margin: 0 0 8px;
}

.history-attempt {
  align-items: flex-start;
  flex-direction: column;
}

.history-attempt div {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}

.history-attempt p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.history-attempt.tone-bad p {
  color: var(--danger);
}

.history-load-more {
  width: 100%;
  margin-top: 10px;
}

.history-advanced {
  margin-top: 16px;
  padding-top: 12px;
}

.history-advanced .history-import {
  margin: 12px 0 0;
}

.empty-state {
  display: grid;
  gap: 4px;
  padding: 30px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .publish-release,
  .plan-calendar-layout,
  .history-release-main,
  .history-detail-grid {
    grid-template-columns: 1fr;
  }

  .publish-platform-main {
    grid-template-columns: 92px minmax(0, 1fr) 18px;
  }

  .plan-day-detail {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .history-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .history-search {
    grid-template-columns: 1fr;
  }

  .history-search input,
  .history-filters {
    width: 100%;
  }

  .history-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .sermon-source-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .source-segment {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-controls {
    align-items: stretch;
    flex-direction: column;
  }

  button,
  .button-link,
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea,
  details > summary {
    min-height: 44px;
  }

  input[type="range"] {
    min-height: 44px;
  }

  .help-trigger,
  .platform-help.is-inline .help-trigger {
    width: 44px;
    height: 44px;
  }

  details > summary {
    display: flex;
    align-items: center;
  }

  .history-filters button {
    min-height: 44px;
  }

  .publish-platform-row {
    grid-template-columns: 1fr;
  }

  .publish-platform-tools {
    justify-content: flex-end;
    padding: 0 12px 10px;
  }

  .publish-platform-main {
    grid-template-columns: 1fr 44px;
  }

  .publish-platform-main .platform-name {
    grid-column: 1 / -1;
  }

  .platform-summary small {
    white-space: normal;
  }

  .schedule-modes,
  .history-filters {
    grid-template-columns: 1fr;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 2px;
  }

  .calendar-toolbar {
    grid-template-columns: 44px 1fr 44px;
    gap: 4px;
  }

  .file-links a {
    min-height: 44px;
  }

  .calendar-weekdays span {
    font-size: 10px;
  }

  .calendar-day {
    position: relative;
    min-height: 44px;
    padding: 4px;
    text-align: center;
  }

  .calendar-day small {
    display: none;
  }

  .calendar-day.is-occupied::after {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: var(--warm);
    content: "";
  }

  .schedule-primary-actions .primary,
  .schedule-primary-actions button,
  .ready-build-row button {
    width: 100%;
    min-width: 0;
  }

  .ready-build-row,
  .schedule-queue-row,
  .history-version {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
