:root {
  --navy: #0d1321;
  --purple: #6a4cff;
  --bright-blue: #0284ff;
  --teal: #00c2b8;
  --light-gray: #f2f4f7;
  --slate: #333a45;
  --white: #ffffff;
  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface-muted: #eef2f7;
  --ink: #0d1321;
  --muted: #333a45;
  --line: #d9deea;
  --primary: #6a4cff;
  --primary-strong: #5234f6;
  --blue: #0284ff;
  --accent: #00c2b8;
  --amber: #a15c07;
  --red: #b42318;
  --green: #008f6f;
  --shadow: 0 16px 40px rgba(13, 19, 33, 0.09);
  --glow: 0 18px 50px rgba(106, 76, 255, 0.18);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-padding-top: 130px;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(2, 132, 255, 0.08), transparent 310px),
    linear-gradient(135deg, rgba(106, 76, 255, 0.08), rgba(0, 194, 184, 0.05) 44%, transparent 70%),
    var(--bg);
}

body.is-trimming {
  cursor: ew-resize;
  user-select: none;
}

body.is-positioning-subtitles {
  cursor: move;
  user-select: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--bright-blue));
  box-shadow: 0 10px 22px rgba(106, 76, 255, 0.24);
}

.primary:hover {
  background: linear-gradient(135deg, var(--primary-strong), #006fff);
}

.secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.tiktok-direct-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.tiktok-direct-card h4,
.tiktok-direct-card p {
  margin: 0;
}

.tiktok-direct-card p {
  color: var(--muted);
  line-height: 1.45;
}

.compact-steps {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.danger {
  color: #fff;
  background: var(--red);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}

.compact-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.mini-button {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 0.76rem;
}

.upload-progress-shell {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 16px 12px;
  border-bottom: 1px solid rgba(106, 76, 255, 0.28);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(26, 43, 52, 0.1);
  backdrop-filter: blur(10px);
}

.upload-progress-shell[hidden] {
  display: none;
}

.upload-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  width: min(1440px, 100%);
  margin: 0 auto 8px;
  font-size: 0.9rem;
}

.upload-progress-percent {
  font-weight: 900;
  color: var(--primary);
}

.processing-progress-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 0 0 auto;
}

.upload-progress-meta strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-progress-track {
  overflow: hidden;
  width: min(1440px, 100%);
  height: 8px;
  margin: 0 auto;
  border-radius: 999px;
  background: var(--surface-muted);
}

.upload-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--bright-blue));
  transition: width 160ms ease;
}

.processing-progress-shell {
  border-bottom-color: rgba(37, 99, 235, 0.24);
}

.processing-progress-track span {
  background: linear-gradient(90deg, var(--bright-blue), var(--teal));
}

.app-notification-stack {
  position: fixed;
  z-index: 120;
  top: 18px;
  right: 18px;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 28px));
  pointer-events: none;
}

.upload-progress-shell:not([hidden]) ~ .app-notification-stack,
.processing-progress-shell:not([hidden]) ~ .app-notification-stack {
  top: 82px;
}

.app-notification {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 30px;
  gap: 11px;
  align-items: start;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 22px 60px rgba(13, 19, 33, 0.22), 0 3px 12px rgba(13, 19, 33, 0.08);
  backdrop-filter: blur(18px);
  cursor: pointer;
  pointer-events: auto;
  animation: app-notification-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.app-notification[data-leaving="true"] {
  animation: app-notification-out 190ms ease both;
}

.app-notification:focus-visible {
  outline: 3px solid rgba(106, 76, 255, 0.26);
  outline-offset: 3px;
}

.app-notification[data-type="success"] {
  border-color: rgba(0, 194, 184, 0.26);
}

.app-notification[data-type="warning"] {
  border-color: rgba(161, 92, 7, 0.24);
  background: rgba(255, 250, 240, 0.94);
}

.app-notification[data-type="error"] {
  border-color: rgba(180, 35, 24, 0.24);
  background: rgba(255, 247, 246, 0.95);
}

.app-notification-icon {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--purple), var(--bright-blue));
  box-shadow: 0 12px 24px rgba(106, 76, 255, 0.24);
}

.app-notification-icon::before {
  position: absolute;
  inset: 12px 10px 11px 14px;
  border: 2px solid #fff;
  border-top: 0;
  border-left: 0;
  transform: rotate(42deg);
  content: "";
}

.app-notification[data-type="info"] .app-notification-icon {
  background: linear-gradient(135deg, var(--bright-blue), var(--teal));
}

.app-notification[data-type="warning"] .app-notification-icon {
  background: linear-gradient(135deg, #f6b84a, #d78308);
}

.app-notification[data-type="warning"] .app-notification-icon::before {
  inset: 9px 19px 10px;
  width: 3px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 20px 0 -1px #fff;
  transform: none;
}

.app-notification[data-type="error"] .app-notification-icon {
  background: linear-gradient(135deg, #ef5b4f, var(--red));
}

.app-notification[data-type="error"] .app-notification-icon::before,
.app-notification[data-type="error"] .app-notification-icon::after {
  position: absolute;
  top: 20px;
  left: 11px;
  width: 20px;
  height: 3px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  transform: rotate(45deg);
  content: "";
}

.app-notification[data-type="error"] .app-notification-icon::after {
  transform: rotate(-45deg);
}

.app-notification-body {
  min-width: 0;
}

.app-notification-eyebrow,
.app-notification h3,
.app-notification p {
  margin: 0;
}

.app-notification-eyebrow {
  margin-bottom: 3px;
  color: var(--primary-strong);
  font-size: 0.62rem;
  font-weight: 950;
  text-transform: uppercase;
}

.app-notification h3 {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.2;
}

.app-notification-body p:not(.app-notification-eyebrow) {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.app-notification-action {
  display: inline-block;
  margin-top: 8px;
  color: var(--primary-strong);
  font-size: 0.74rem;
  font-weight: 950;
}

.app-notification-close {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: rgba(13, 19, 33, 0.06);
  font-size: 0.86rem;
  font-weight: 950;
  line-height: 1;
}

.app-notification-close:hover,
.app-notification-close:focus-visible {
  color: var(--ink);
  background: rgba(13, 19, 33, 0.1);
  outline: none;
}

@keyframes app-notification-in {
  from {
    opacity: 0;
    transform: translateX(28px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes app-notification-out {
  to {
    opacity: 0;
    transform: translateX(24px) scale(0.98);
  }
}

.app-shell {
  width: min(1680px, calc(100% - 24px));
  margin: 0 auto;
  padding: 12px 0 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 10px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(106, 76, 255, 0.22), rgba(2, 132, 255, 0.16) 48%, rgba(0, 194, 184, 0.16)),
    var(--navy);
  box-shadow: var(--glow);
}

.topbar-brand-area {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.dashboard-back-button {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.dashboard-back-button:hover,
.dashboard-back-button:focus-visible {
  transform: translateY(-2px);
  color: var(--white);
  background: rgba(255, 255, 255, 0.17);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.3);
  outline: 3px solid rgba(0, 194, 184, 0.22);
  outline-offset: 2px;
}

.dashboard-back-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-lockup {
  display: flex;
  gap: 11px;
  align-items: center;
  min-width: 0;
}

.brand-icon {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
}

.brand-copy {
  min-width: 0;
}

.brand-wordmark {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  color: var(--white);
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.brand-gradient {
  color: transparent;
  background: linear-gradient(90deg, var(--purple), var(--bright-blue));
  -webkit-background-clip: text;
  background-clip: text;
}

.brand-tagline {
  margin: 7px 0 4px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.topbar p {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
}

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

.topbar .secondary {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.topbar .secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.topbar .primary {
  box-shadow: 0 12px 26px rgba(2, 132, 255, 0.28);
}

.workflow-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 10px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 24px rgba(13, 19, 33, 0.12);
  backdrop-filter: blur(12px);
}

.workflow-nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  color: var(--primary);
  background: var(--surface);
  border-color: var(--line);
  font-size: 0.9rem;
}

.workflow-nav button:hover {
  border-color: rgba(106, 76, 255, 0.42);
  box-shadow: 0 8px 20px rgba(106, 76, 255, 0.12);
}

.workflow-nav button.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--purple), var(--bright-blue));
  box-shadow: 0 8px 20px rgba(106, 76, 255, 0.22);
}

.workflow-nav button.active span {
  color: var(--primary);
  background: #fff;
}

.workflow-nav span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--bright-blue));
  font-size: 0.78rem;
  font-weight: 900;
}

.workspace {
  display: grid;
  gap: 12px;
}

.workspace-section-hidden {
  display: none !important;
}

.metrics {
  position: static;
  z-index: 18;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
  padding: 0;
  margin: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
}

.upload-progress-shell:not([hidden]) ~ .app-shell .metrics {
  top: 74px;
}

.metric {
  appearance: none;
  width: 100%;
  text-align: left;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.95));
  box-shadow: var(--shadow);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.metric:hover {
  border-color: rgba(106, 76, 255, 0.42);
  box-shadow: var(--glow);
  transform: translateY(-1px);
}

.metric span {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--primary);
}

.metric strong {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.metric-jump span {
  color: var(--blue);
  font-size: 1.55rem;
}

.workband {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.readiness-panel {
  display: grid;
  gap: 14px;
}

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

.panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--surface), #fbfcff);
}

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

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.18rem;
}

.review-controls,
.clip-page-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.review-controls {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.clip-page-controls {
  min-height: 38px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.clip-page-controls span {
  min-width: 132px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.clip-page-controls .icon-button {
  width: 32px;
  min-height: 30px;
}

.section-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.diagnostic-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 150px;
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--surface), #fbfcff);
}

.diagnostic-ok {
  border-left-color: var(--teal);
}

.diagnostic-warning {
  border-left-color: #d98a19;
}

.diagnostic-error {
  border-left-color: var(--red);
}

.diagnostic-card .status-pill {
  width: fit-content;
}

.diagnostic-card strong {
  font-size: 0.98rem;
}

.diagnostic-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.diagnostic-card small {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
.drag-handle:focus-visible {
  outline: 3px solid rgba(106, 76, 255, 0.24);
  outline-offset: 2px;
}

.file-drop-zone {
  position: relative;
  min-height: 132px;
  place-items: center;
  gap: 8px;
  padding: 18px;
  border: 1px dashed rgba(106, 76, 255, 0.42);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(242, 244, 247, 0.9));
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.file-drop-zone strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.file-drop-zone em {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--primary);
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 900;
}

.file-drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-drop-zone.drag-over,
.file-drop-zone.has-file {
  border-color: rgba(0, 194, 184, 0.78);
  background: linear-gradient(180deg, rgba(106, 76, 255, 0.1), rgba(0, 194, 184, 0.12));
  box-shadow: inset 0 0 0 1px rgba(0, 194, 184, 0.16);
}

.file-drop-zone.drag-over {
  transform: translateY(-1px);
}

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

fieldset {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

legend {
  color: var(--muted);
  font-weight: 800;
  padding: 0 6px;
}

.check-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.check-row input {
  width: auto;
}

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

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button-row button.is-expanded {
  border-color: rgba(106, 76, 255, 0.42);
  color: var(--primary);
  background: rgba(106, 76, 255, 0.08);
}

.connection-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.connection-layout h3,
.platform-card h3 {
  margin: 0;
  font-size: 1rem;
}

.collapsible-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.collapsible-strip h3,
.collapsible-strip p {
  margin: 0;
}

.collapsible-strip p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.collapsible-strip.is-collapsed {
  background: linear-gradient(180deg, var(--surface), #fbfcff);
}

.setup-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.45;
}

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

.platform-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--surface), #fbfcff);
}

.platform-card ul,
.platform-card ol {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.42;
}

.platform-card a {
  color: var(--primary-strong);
  font-weight: 800;
  text-decoration: none;
}

.platform-card.collapsed {
  gap: 10px;
}

.platform-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.platform-details {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.platform-details[hidden] {
  display: none;
}

.connection-account {
  margin: 0;
  overflow: hidden;
  color: var(--primary-strong);
  font-size: 0.9rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credential-note {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--red);
  background: #ffe9e7;
  font-size: 0.86rem;
  font-weight: 800;
}

.setup-copy-list {
  display: grid;
  gap: 10px;
}

.setup-copy-list label {
  display: grid;
  gap: 5px;
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 900;
}

.setup-copy-list input {
  width: 100%;
  border-color: var(--line);
  color: var(--primary-strong);
  background: var(--surface-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.setup-copy-list span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.credential-fields {
  display: grid;
  gap: 12px;
}

#social-credential-redirect {
  display: grid;
  gap: 8px;
}

#social-credential-redirect input {
  width: 100%;
  border-color: var(--line);
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 0.86rem;
}

#tunnel-status {
  display: grid;
  gap: 8px;
}

#tunnel-status input {
  width: 100%;
  border-color: var(--line);
  color: var(--primary-strong);
  background: var(--surface-muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.mode-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(106, 76, 255, 0.12);
  font-size: 0.78rem;
  font-weight: 800;
}

.status-processing,
.status-queued,
.status-publishing {
  color: var(--bright-blue);
  background: rgba(2, 132, 255, 0.12);
}

.status-error,
.status-failed,
.status-rejected,
.status-cancelled {
  color: var(--red);
  background: #ffe9e7;
}

.status-approved,
.status-published {
  color: #008272;
  background: rgba(0, 194, 184, 0.14);
}

.status-draft,
.status-scheduled,
.status-manual_ready {
  color: var(--amber);
  background: #fff2db;
}

.status-sent_to_zapier,
.status-sent_to_drive {
  color: var(--bright-blue);
  background: rgba(2, 132, 255, 0.12);
}

.sermon-list,
.calendar-list,
.log-list {
  display: grid;
  gap: 10px;
}

.sermon-row,
.calendar-row,
.log-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--surface), #fbfcff);
}

.sermon-detail {
  display: grid;
  gap: 16px;
}

.sermon-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.sermon-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--surface), #fbfcff);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.sermon-card:hover {
  border-color: rgba(106, 76, 255, 0.3);
  box-shadow: 0 12px 30px rgba(13, 19, 33, 0.08);
  transform: translateY(-1px);
}

.sermon-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: var(--navy);
}

.sermon-thumb video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.sermon-source-missing {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100%;
  color: rgba(255, 255, 255, 0.82);
  background: linear-gradient(135deg, var(--navy), #202938);
  font-weight: 900;
}

.sermon-thumb .status-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  box-shadow: 0 8px 18px rgba(13, 19, 33, 0.18);
}

.sermon-card-body {
  min-width: 0;
}

.sermon-detail[hidden] {
  display: none;
}

.sermon-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.full-sermon-video {
  width: 100%;
  max-height: 72vh;
  border-radius: 8px;
  background: var(--navy);
  box-shadow: var(--shadow);
}

.full-sermon-video.sermon-source-missing {
  min-height: 280px;
  aspect-ratio: 16 / 9;
}

.sermon-detail-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--surface), #fbfcff);
}

.sermon-detail-panel h3 {
  margin: 0;
}

.sermon-clip-list {
  display: grid;
  gap: 8px;
}

.sermon-clip-link {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  background: var(--white);
}

.sermon-clip-link img {
  width: 48px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-muted);
}

.row-title {
  margin: 0 0 5px;
  font-weight: 800;
}

.row-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.86rem;
}

.progress-track {
  overflow: hidden;
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--surface-muted);
}

.progress-track span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--purple), var(--bright-blue));
}

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.segmented button {
  min-height: 32px;
  border-color: transparent;
  background: transparent;
}

.segmented button.active {
  color: var(--white);
  background: linear-gradient(135deg, var(--purple), var(--bright-blue));
  border-color: transparent;
}

.clip-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.clip-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--surface), #fbfcff);
}

.compact-clip-card {
  grid-template-columns: minmax(118px, 158px) minmax(0, 1fr);
  gap: 14px;
  padding: 10px;
}

.clip-card-preview {
  display: grid;
  gap: 8px;
  align-content: start;
}

.clip-card-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 12px;
  align-content: start;
  min-width: 0;
}

.clip-card-body .clip-card-header,
.clip-card-body .transcript-preview,
.clip-card-body .row-meta,
.clip-card-body .clip-actions {
  grid-column: 1 / -1;
}

.clip-card-body textarea {
  min-height: 74px;
}

.clip-card-highlight {
  border-color: rgba(106, 76, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(106, 76, 255, 0.15), 0 14px 30px rgba(22, 28, 45, 0.12);
}

.clip-card video,
.clip-card img {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 8px;
  object-fit: cover;
  background: #111827;
}

.compact-clip-card video,
.compact-clip-card img,
.compact-clip-card .clip-media-placeholder {
  max-height: 220px;
}

.clip-media-placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 280px;
  aspect-ratio: 9 / 16;
  padding: 18px;
  border: 1px dashed rgba(106, 76, 255, 0.28);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: linear-gradient(180deg, rgba(106, 76, 255, 0.08), rgba(0, 194, 184, 0.08));
}

.clip-media-placeholder strong {
  color: var(--ink);
  font-size: 0.96rem;
}

.clip-media-placeholder span {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.drag-handle {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 36px;
  border: 1px dashed rgba(106, 76, 255, 0.48);
  border-radius: 8px;
  color: var(--primary);
  background: linear-gradient(90deg, rgba(106, 76, 255, 0.1), rgba(2, 132, 255, 0.1));
  font-weight: 900;
  cursor: grab;
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.approved-tray {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid rgba(106, 76, 255, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(106, 76, 255, 0.07), rgba(2, 132, 255, 0.05));
}

.silence-cut-panel {
  display: grid;
  gap: .8rem;
  padding: .95rem;
  border: 1px solid rgba(106, 76, 255, .24);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(106, 76, 255, .07), rgba(2, 132, 255, .04));
}

.silence-cut-header,
.silence-cut-actions,
.silence-segment-row {
  display: flex;
  align-items: center;
  gap: .7rem;
}

.silence-cut-header {
  justify-content: space-between;
}

.silence-cut-header strong,
.silence-cut-header small {
  display: block;
}

.silence-cut-header small,
.silence-cut-panel label span {
  color: var(--muted);
  line-height: 1.35;
}

.silence-cut-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem;
}

.silence-cut-controls label {
  margin: 0;
}

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

.silence-cut-actions {
  flex-wrap: wrap;
}

.silence-cut-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: .55rem;
}

.silence-cut-stat {
  padding: .65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.silence-cut-stat strong,
.silence-cut-stat span {
  display: block;
}

.silence-cut-stat strong {
  font-size: 1.1rem;
}

.silence-cut-stat span,
.silence-segment-row small {
  color: var(--muted);
}

.silence-segment-list {
  display: grid;
  gap: .5rem;
  max-height: 260px;
  overflow: auto;
}

.silence-segment-row {
  justify-content: space-between;
  padding: .65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .75);
}

.silence-segment-row strong,
.silence-segment-row small {
  display: block;
}

.silence-segment-row select,
.silence-segment-row input {
  width: auto;
  min-width: 92px;
}

.mini-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: .3rem .65rem;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(106, 76, 255, .12);
  font-size: .82rem;
  font-weight: 900;
}

.approved-tray-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.approved-tray-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.approved-clip-tray {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-height: min(460px, 48vh);
  overflow-y: auto;
  padding: 2px 6px 6px 2px;
  overscroll-behavior: contain;
}

.approved-group-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.approved-group-heading h4,
.approved-group-heading p {
  margin: 0;
}

.approved-group-heading h4 {
  margin-top: 2px;
  color: var(--ink);
  font-size: 1.05rem;
}

.approved-group-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 750;
}

.approved-group-kicker {
  color: var(--primary);
  font-size: .68rem;
  font-weight: 950;
  letter-spacing: .12em;
}

.approved-group-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
}

.approved-full-sermon-list,
.approved-social-clip-grid {
  display: grid;
  gap: 14px;
}

.approved-social-clip-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.approved-full-sermon-card {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  padding: 14px;
  border: 2px solid rgba(106, 76, 255, .42);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(106, 76, 255, .11), rgba(255, 255, 255, .92));
  box-shadow: 0 14px 34px rgba(106, 76, 255, .14);
  cursor: grab;
}

.approved-full-sermon-preview {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: var(--surface-muted);
}

.approved-full-sermon-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.approved-full-sermon-preview > span {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 6px 9px;
  border-radius: 999px;
  color: #fff;
  background: rgba(13, 19, 33, .86);
  font-size: .7rem;
  font-weight: 950;
  letter-spacing: .08em;
}

.approved-full-sermon-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 4px 0;
}

.approved-full-sermon-meta > strong {
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.25;
}

.approved-full-sermon-meta > span {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}

.approved-full-sermon-meta .approved-clip-actions {
  margin-top: auto;
}

.approved-clip-chip {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 142px;
  padding: 10px;
  border: 1px solid rgba(13, 19, 33, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 22px rgba(13, 19, 33, 0.06);
  cursor: grab;
  user-select: none;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.approved-clip-chip:hover,
.approved-clip-chip.dragging {
  border-color: rgba(106, 76, 255, 0.45);
  box-shadow: 0 12px 28px rgba(106, 76, 255, 0.16);
  transform: translateY(-1px);
}

.approved-clip-chip.needs-media {
  border-color: rgba(220, 38, 38, 0.24);
  background: #fff9f8;
}

.approved-clip-chip.qc-blocked {
  border-color: rgba(194, 105, 50, 0.34);
  background: #fff8ef;
  cursor: not-allowed;
}

.approved-clip-meta small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.approved-clip-chip:active {
  cursor: grabbing;
}

.approved-clip-chip img {
  width: 72px;
  height: 96px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-muted);
}

.approved-clip-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  height: 100%;
}

.approved-clip-topline {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.approved-clip-topline small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 950;
}

.approved-clip-chip strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.approved-clip-chip span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.approved-clip-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  flex-wrap: wrap;
}

.approved-clip-actions button {
  flex: 0 0 auto;
  cursor: pointer;
}

.clip-card-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.score {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.82rem;
}

.format-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 26px;
  padding: 5px 9px;
  border: 1px solid rgba(13, 19, 33, 0.1);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.84);
}

.format-pill.format-short {
  border-color: rgba(0, 194, 184, 0.25);
  color: #006f6a;
  background: rgba(0, 194, 184, 0.1);
}

.format-pill.format-regular {
  border-color: rgba(106, 76, 255, 0.24);
  color: #4731b5;
  background: rgba(106, 76, 255, 0.1);
}

.schedule-format-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(13, 19, 33, 0.42);
  backdrop-filter: blur(10px);
}

.thumbnail-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(13, 19, 33, .58);
  backdrop-filter: blur(10px);
}

.thumbnail-editor-dialog {
  display: grid;
  gap: 16px;
  width: min(100%, 900px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(13, 19, 33, .12);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(13, 19, 33, .34);
}

.thumbnail-editor-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.thumbnail-editor-heading h3,
.thumbnail-editor-heading p {
  margin: 0;
}

.thumbnail-editor-heading h3 {
  margin-top: 3px;
  color: var(--ink);
  font-size: 1.45rem;
}

.thumbnail-editor-heading p,
.thumbnail-editor-status {
  color: var(--muted);
  font-weight: 750;
}

.thumbnail-editor-close {
  flex: 0 0 auto;
  font-size: 1.5rem;
  line-height: 1;
}

.thumbnail-editor-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #101725;
}

.thumbnail-editor-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

.thumbnail-safe-area {
  position: absolute;
  inset: 7%;
  border: 1px dashed rgba(255, 255, 255, .72);
  border-radius: 4px;
  box-shadow: 0 0 0 999px rgba(13, 19, 33, .08);
  pointer-events: none;
}

.thumbnail-editor-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.thumbnail-editor-controls label {
  display: grid;
  gap: 8px;
}

.thumbnail-editor-controls label > span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: .84rem;
}

.thumbnail-editor-controls output {
  color: var(--muted);
  font-weight: 900;
}

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

.thumbnail-editor-status {
  min-height: 1.4em;
  margin: 0;
}

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

.schedule-format-dialog {
  display: grid;
  gap: 16px;
  width: min(100%, 660px);
  padding: 18px;
  border: 1px solid rgba(13, 19, 33, 0.12);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(13, 19, 33, 0.28);
}

.schedule-format-heading {
  display: grid;
  gap: 6px;
}

.schedule-format-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.35rem;
}

.schedule-format-heading p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.schedule-format-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.schedule-format-option {
  display: grid;
  gap: 8px;
  min-height: 136px;
  padding: 14px;
  border: 1px solid rgba(13, 19, 33, 0.12);
  border-radius: 8px;
  background: #fbfcff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.schedule-format-option:hover,
.schedule-format-option:focus-visible {
  border-color: rgba(106, 76, 255, 0.42);
  box-shadow: 0 12px 28px rgba(106, 76, 255, 0.14);
  outline: none;
}

.schedule-format-option.recommended {
  border-color: rgba(0, 194, 184, 0.38);
  background: rgba(0, 194, 184, 0.07);
}

.schedule-format-option.selected,
.schedule-time-option.selected {
  border-color: rgba(106, 76, 255, 0.62);
  box-shadow: 0 0 0 3px rgba(106, 76, 255, 0.16);
}

.schedule-format-option:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

.schedule-format-option strong {
  font-size: 1rem;
}

.schedule-format-option small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.35;
}

.schedule-time-section {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.schedule-time-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.schedule-time-heading strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.schedule-time-heading small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  text-align: right;
}

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

.schedule-time-option {
  display: grid;
  gap: 5px;
  min-height: 104px;
  padding: 12px;
  border: 1px solid rgba(13, 19, 33, 0.12);
  border-radius: 8px;
  background: #fbfcff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.schedule-time-option:hover,
.schedule-time-option:focus-visible {
  border-color: rgba(0, 194, 184, 0.42);
  box-shadow: 0 12px 28px rgba(0, 194, 184, 0.12);
  outline: none;
}

.schedule-time-option span {
  color: var(--accent);
  font-size: 1.08rem;
  font-weight: 950;
}

.schedule-time-option strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.schedule-time-option small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.35;
}

.schedule-custom-time {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.schedule-custom-time input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  font: inherit;
  font-size: 1rem;
  font-weight: 950;
  background: #fff;
}

.schedule-format-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.schedule-format-footer-note {
  margin-right: auto;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
}

.post-now-button {
  border: 1px solid #008e88;
  color: #fff;
  background: #008e88;
  box-shadow: 0 8px 20px rgba(0, 142, 136, .2);
}

.post-now-button:hover,
.post-now-button:focus-visible {
  border-color: #006f6a;
  background: #006f6a;
  outline: none;
}

.post-now-button:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
}

.clip-actions,
.calendar-actions,
.sermon-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.clip-editor-shell,
.file-manager-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(13, 19, 33, 0.72);
  backdrop-filter: blur(8px);
}

.clip-editor-shell[hidden],
.file-manager-shell[hidden] {
  display: none;
}

.clip-editor-panel,
.file-manager-panel {
  width: min(1120px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 28px 80px rgba(13, 19, 33, 0.32);
}

.file-manager-panel {
  display: grid;
  gap: 14px;
}

.section-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 700;
}

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

.storage-stat {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f8faff);
}

.storage-stat strong {
  color: var(--primary);
  font-size: 1.25rem;
}

.storage-stat span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.file-manager-body {
  display: grid;
  gap: 10px;
}

.file-manager-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.file-manager-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.file-manager-main img {
  width: 56px;
  height: 76px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-muted);
}

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

.file-manager-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 4px 0;
}

.managed-file-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.managed-file-list span {
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.clip-editor-grid {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.subtitle-placement-editor {
  display: grid;
  gap: 10px;
}

@media (min-width: 1121px) {
  .clip-editor-panel .subtitle-placement-editor {
    position: sticky;
    top: 0;
    align-self: start;
  }
  .clip-editor-panel .subtitle-placement-stage {
    max-height: calc(100dvh - 180px);
    width: auto;
    justify-self: center;
  }
}

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

.editor-options > summary {
  cursor: pointer;
  font-weight: 700;
  padding: 6px 0 10px;
}

.subtitle-placement-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 8px;
  background: var(--navy);
}

#clip-editor-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  background: transparent;
}

.subtitle-placement-box {
  position: absolute;
  z-index: 2;
  min-width: 22%;
  max-width: 92%;
  min-height: 42px;
  padding: 0.18em 0.32em;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  color: var(--white);
  font-family: Futura, "Helvetica Neue", Arial, sans-serif;
  font-weight: 900;
  line-height: 1.08;
  text-align: center;
  text-shadow:
    0 2px 0 rgba(13, 19, 33, 0.72),
    0 5px 14px rgba(13, 19, 33, 0.62);
  background: rgba(13, 19, 33, 0.14);
  box-shadow:
    0 0 0 1px rgba(13, 19, 33, 0.18),
    0 12px 34px rgba(13, 19, 33, 0.18);
  cursor: move;
  touch-action: none;
}

.subtitle-placement-stage.is-subtitles-disabled .subtitle-placement-box {
  display: none;
}

.subtitle-placement-stage.is-subtitles-disabled::after {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  content: "Subtitles off";
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 900;
  background: rgba(13, 19, 33, 0.62);
}

.subtitle-placement-box:focus-visible {
  outline: 3px solid rgba(2, 132, 255, 0.68);
  outline-offset: 3px;
}

.subtitle-resize-handle {
  position: absolute;
  right: -9px;
  bottom: -9px;
  width: 22px;
  height: 22px;
  border: 2px solid var(--white);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--blue));
  box-shadow: 0 8px 18px rgba(13, 19, 33, 0.28);
  cursor: nwse-resize;
}

.subtitle-placement-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f8faff);
}

.subtitle-placement-actions strong {
  color: var(--muted);
  font-size: 0.86rem;
}

.caption-sync-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(106, 76, 255, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(106, 76, 255, 0.07), rgba(2, 132, 255, 0.05));
}

.caption-sync-editor select {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
  font-weight: 800;
}

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

.subtitle-editor {
  min-height: 180px;
}

.transcript-tool-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.transcript-tool-row strong {
  color: var(--ink);
}

.copy-tool-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.suggestions-title {
  display: block;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.caption-suggestion-panel {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 250, 255, 0.84);
}

.caption-suggestion-panel summary {
  padding: 10px 12px;
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 900;
  cursor: pointer;
}

.caption-suggestion-panel .caption-suggestions {
  padding: 0 10px 10px;
}

.caption-suggestions {
  display: grid;
  gap: 8px;
}

.caption-suggestion {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: auto;
  padding: 10px;
  border: 1px solid rgba(106, 76, 255, 0.18);
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  background: linear-gradient(180deg, rgba(106, 76, 255, 0.07), rgba(2, 132, 255, 0.06));
  box-shadow: none;
}

.caption-suggestion small {
  color: var(--primary);
  font-weight: 900;
}

.caption-suggestion span {
  white-space: pre-line;
  line-height: 1.35;
  font-weight: 600;
}

.trim-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfcff, var(--white));
}

.audio-mix-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #f8faff);
}

.audio-mix-row {
  display: grid;
  gap: 7px;
}

.audio-mix-row label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.audio-mix-row label span {
  color: var(--primary);
}

.audio-mix-row input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.audio-mix-row select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  background: var(--surface);
}

.audio-mix-row select:focus {
  outline: 2px solid rgba(106, 76, 255, 0.22);
  border-color: rgba(106, 76, 255, 0.45);
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(106, 76, 255, 0.16);
  border-radius: 8px;
  background: rgba(106, 76, 255, 0.06);
}

.toggle-row span {
  display: grid;
  gap: 2px;
}

.toggle-row strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.toggle-row small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.toggle-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  accent-color: var(--primary);
}

.trim-editor-header,
.trim-time-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.trim-track {
  --filmstrip-image: linear-gradient(135deg, rgba(106, 76, 255, 0.22), rgba(2, 132, 255, 0.22));
  position: relative;
  height: 74px;
  overflow: hidden;
  border: 1px solid rgba(13, 19, 33, 0.12);
  border-radius: 12px;
  background: var(--navy);
  touch-action: none;
  user-select: none;
}

.trim-filmstrip {
  position: absolute;
  inset: 0;
  opacity: 0.72;
  background-image:
    linear-gradient(90deg, rgba(13, 19, 33, 0.52), rgba(13, 19, 33, 0.16), rgba(13, 19, 33, 0.52)),
    var(--filmstrip-image);
  background-size: auto, 58px 100%;
  background-repeat: repeat;
  filter: saturate(1.1);
}

.trim-selection {
  position: absolute;
  inset-block: 6px;
  left: 8%;
  right: 8%;
  min-width: 44px;
  border: 2px solid var(--white);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(106, 76, 255, 0.22), rgba(2, 132, 255, 0.2));
  box-shadow:
    0 0 0 999px rgba(13, 19, 33, 0.52),
    0 10px 30px rgba(106, 76, 255, 0.28);
  cursor: grab;
}

.trim-selection:active {
  cursor: grabbing;
}

.trim-handle {
  position: absolute;
  top: 50%;
  width: 28px;
  height: 56px;
  padding: 0;
  min-height: 0;
  border: 0;
  border-radius: 8px;
  background:
    linear-gradient(180deg, var(--white), #eef2ff);
  box-shadow: 0 8px 20px rgba(13, 19, 33, 0.22);
  cursor: ew-resize;
  transform: translateY(-50%);
}

.trim-handle::before {
  content: "";
  position: absolute;
  inset: 14px 11px;
  border-left: 2px solid var(--primary);
  border-right: 2px solid var(--primary);
}

.trim-handle-start {
  left: -13px;
}

.trim-handle-end {
  right: -13px;
}

.trim-time-row span {
  color: var(--ink);
}

.transcript-preview {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.calendar-month-heading {
  display: grid;
  grid-template-columns: 36px 36px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.calendar-month-heading > div {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
}

.calendar-month-heading #calendar-prev-month {
  grid-column: 1;
  grid-row: 1;
}

.calendar-month-heading #calendar-next-month {
  grid-column: 2;
  grid-row: 1;
}

.calendar-month-heading h2 {
  margin: 0;
  text-align: left;
}

.calendar-month-heading .section-subtitle {
  text-align: left;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 999px;
  font-size: 1.5rem;
  line-height: 1;
}

.calendar-row {
  grid-template-columns: 76px minmax(0, 1fr) auto;
}

.calendar-planner {
  display: grid;
  grid-template-columns: repeat(7, minmax(112px, 1fr));
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  margin-bottom: 16px;
  padding-bottom: 4px;
}

.calendar-slot {
  display: grid;
  gap: 10px;
  min-height: 168px;
  align-content: start;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  transition:
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.calendar-slot.drop-ready {
  border-color: rgba(106, 76, 255, 0.72);
  background: linear-gradient(180deg, rgba(106, 76, 255, 0.11), rgba(0, 194, 184, 0.1));
  box-shadow: inset 0 0 0 1px rgba(106, 76, 255, 0.2);
}

.calendar-slot.occupied {
  border-style: solid;
  background: linear-gradient(180deg, var(--surface), #fbfcff);
}

.calendar-slot-failed {
  border-color: rgba(220, 38, 38, 0.36);
  background: linear-gradient(180deg, #fff9f8, #fff);
}

.calendar-slot.outside-month {
  opacity: 0.58;
  background: rgba(242, 244, 247, 0.68);
}

.calendar-slot.past {
  opacity: 0.68;
}

.slot-date {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.slot-empty {
  display: grid;
  place-items: center;
  min-height: 94px;
  padding: 12px;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 0.85rem;
  background: var(--surface-muted);
}

.slot-item {
  position: relative;
  display: grid;
  gap: 7px;
}

.slot-cancel-button {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-color: rgba(220, 38, 38, 0.2);
  border-radius: 999px;
  color: #b91c1c;
  font-size: 0.9rem;
  font-weight: 1000;
  line-height: 1;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(13, 19, 33, 0.18);
}

.slot-cancel-button:hover {
  color: var(--white);
  border-color: #dc2626;
  background: #dc2626;
}

.slot-item img {
  width: 100%;
  aspect-ratio: 9 / 12;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-muted);
}

.slot-title {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.slot-warning {
  margin: 0;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
  background: #ffe9e7;
}

.slot-schedule-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

.calendar-time-field {
  display: grid;
  gap: 5px;
  max-width: 220px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.calendar-time-field input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary);
  background: var(--surface);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 1000;
}

.calendar-time-field.compact {
  max-width: none;
}

.calendar-time-field.compact input {
  min-height: 34px;
  padding: 0 8px;
  font-size: 0.88rem;
}

.slot-post-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.calendar-row img {
  width: 76px;
  height: 96px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-muted);
}

.empty {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
}

@media (max-width: 1120px) {
  .metrics,
  .platform-grid,
  .schedule-format-options,
  .schedule-time-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-column,
  .form-grid,
  .connection-layout,
  .sermon-detail-grid,
  .clip-editor-grid,
  .storage-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-notification-stack {
    top: 10px;
    right: 10px;
    width: calc(100vw - 20px);
  }

  .upload-progress-shell:not([hidden]) ~ .app-notification-stack,
  .processing-progress-shell:not([hidden]) ~ .app-notification-stack {
    top: 82px;
  }

  .app-notification {
    grid-template-columns: 38px minmax(0, 1fr) 30px;
    border-radius: 14px;
  }

  .app-notification-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .app-shell {
    width: min(100% - 20px, 1440px);
  }

  .topbar,
  .section-heading,
  .collapsible-strip,
  .sermon-row,
  .calendar-row,
  .file-manager-row,
  .file-manager-toolbar,
  .schedule-format-options,
  .schedule-time-options {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .schedule-time-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .schedule-time-heading small {
    text-align: left;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
  }

  .brand-wordmark {
    display: grid;
    gap: 0;
    font-size: 1.8rem;
  }

  .topbar-actions,
  .clip-actions,
  .calendar-actions,
  .file-manager-actions {
    justify-content: stretch;
  }

  .topbar-actions button,
  .topbar-actions .button-link,
  .clip-actions button,
  .calendar-actions button,
  .file-manager-actions button {
    flex: 1;
  }

  .metrics,
  .platform-grid {
    grid-template-columns: 1fr;
  }

  .approved-clip-tray {
    max-height: none;
  }

  .approved-full-sermon-card {
    grid-template-columns: 1fr;
  }

  .thumbnail-editor-modal {
    padding: 8px;
  }

  .thumbnail-editor-dialog {
    max-height: calc(100vh - 16px);
    padding: 14px;
  }

  .thumbnail-editor-controls {
    grid-template-columns: 1fr;
  }

  .thumbnail-editor-actions > button {
    flex: 1 1 140px;
  }

  .approved-clip-chip {
    min-height: 0;
  }

  .compact-clip-card {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
  }

  .clip-card-body {
    grid-template-columns: 1fr;
  }

  .clip-card-body > * {
    grid-column: 1;
  }

  .workflow-nav {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  .workflow-nav button {
    flex: 0 0 126px;
  }

  .metrics {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  .metrics .metric {
    flex: 0 0 138px;
    min-height: 72px;
  }

  .metrics .metric span {
    font-size: 1.45rem;
  }

  .segmented {
    width: 100%;
  }

  .review-controls {
    width: 100%;
    justify-content: stretch;
  }

  .clip-page-controls {
    justify-content: space-between;
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-notification,
  .app-notification[data-leaving="true"] {
    animation: none;
  }
}
