:root {
  color-scheme: light;
  --ink: #16181c;
  --muted: #5c6570;
  --paper: #f3f1ec;
  --panel: rgba(255, 252, 247, 0.82);
  --line: #d9d3c7;
  --amber: #d9920b;
  --amber-deep: #b87400;
  --ok: #1f6b4a;
  --ok-bg: #e7f3ec;
  --err: #9b2c2c;
  --err-bg: #f8e8e6;
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.72);
  --surface-hover: #ffffff;
  --chip: rgba(22, 24, 28, 0.07);
  --warn-bg: #fff4d8;
  --stripe: rgba(22, 24, 28, 0.035);
  --glow-amber: rgba(217, 146, 11, 0.18);
  --glow-cool: rgba(90, 120, 150, 0.12);
  --page-0: #ebe7df;
  --page-1: #f6f4ef;
  --page-2: #e4e9ef;
  --theme-meta: #b87400;
  --radius: 14px;
  --font-display: "Bebas Neue", "Arial Narrow", sans-serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8eaed;
  --muted: #9aa3ad;
  --paper: #12151c;
  --panel: rgba(24, 28, 36, 0.88);
  --line: #2c3340;
  --amber: #e0a12a;
  --amber-deep: #f0b84a;
  --ok: #6dcea3;
  --ok-bg: #163528;
  --err: #f0a4a0;
  --err-bg: #3a2222;
  --surface: #1c212b;
  --surface-soft: rgba(28, 33, 43, 0.86);
  --surface-hover: #242a36;
  --chip: rgba(255, 255, 255, 0.08);
  --warn-bg: #3a2e16;
  --stripe: rgba(255, 255, 255, 0.04);
  --glow-amber: rgba(224, 161, 42, 0.14);
  --glow-cool: rgba(90, 130, 180, 0.1);
  --page-0: #0e1117;
  --page-1: #141821;
  --page-2: #10141c;
  --theme-meta: #1c212b;
}
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  background:
    radial-gradient(ellipse 90% 60% at 10% -10%, var(--glow-amber), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 0%, var(--glow-cool), transparent 50%),
    linear-gradient(165deg, var(--page-0) 0%, var(--page-1) 42%, var(--page-2) 100%);
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    repeating-linear-gradient(
      -18deg,
      transparent 0,
      transparent 46px,
      var(--stripe) 46px,
      var(--stripe) 48px
    );
  z-index: 0;
}
.shell {
  position: relative;
  z-index: 1;
  width: min(34rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 8vh, 4.5rem) 0 3rem;
  animation: rise 0.55s ease-out both;
}
.shell.wide { width: min(52rem, calc(100% - 2rem)); }
.shell.wide.sched-shell { width: min(72rem, calc(100% - 2rem)); }
.shell.wide.lib-shell { width: min(64rem, calc(100% - 2rem)); }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse-border {
  0%, 100% { border-color: rgba(217, 146, 11, 0.45); }
  50% { border-color: rgba(217, 146, 11, 0.95); }
}
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.35rem;
}
.brand-block .brand,
.topbar .brand { margin: 0; }
.brand {
  font-family: var(--font-display);
  font-size: clamp(3rem, 11vw, 4.2rem);
  letter-spacing: 0.04em;
  line-height: 0.9;
  margin: 0;
  display: inline-block;
}
.brand span {
  display: inline-block;
  color: var(--amber-deep);
  transform-origin: left bottom;
  animation: rise 0.7s 0.08s ease-out both;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  margin-top: 0.35rem;
}
.theme-btn,
.settings-btn {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  background: var(--surface-soft);
  color: var(--muted);
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.theme-btn:hover,
.settings-btn:hover,
.settings-btn[aria-expanded="true"] {
  color: var(--ink);
  border-color: var(--amber);
  background: var(--surface-hover);
}
.theme-btn svg,
.settings-btn svg { width: 1.15rem; height: 1.15rem; display: block; }
html[data-theme="dark"] .theme-icon-moon { display: none; }
html[data-theme="light"] .theme-icon-sun,
html:not([data-theme]) .theme-icon-sun { display: none; }
.settings {
  position: relative;
  flex-shrink: 0;
  margin-top: 0;
}
.settings-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 15.5rem;
  padding: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 32px color-mix(in srgb, var(--ink) 16%, transparent);
  z-index: 40;
}
.settings-menu.open { display: block; }
.settings-menu a {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}
.settings-menu a:hover { background: color-mix(in srgb, var(--amber) 14%, transparent); }
.settings-menu .sep {
  height: 1px;
  margin: 0.3rem 0.4rem;
  background: var(--line);
}
.settings-menu .note {
  margin: 0;
  padding: 0.45rem 0.75rem 0.55rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}
a.btn-sm,
button.btn-sm {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(184, 116, 0, 0.4);
  background: rgba(255, 248, 230, 0.9);
  color: var(--amber-deep);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(184, 116, 0, 0.12);
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
a.btn-sm:hover,
button.btn-sm:hover {
  background: #fff6e4;
  border-color: var(--amber-deep);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(184, 116, 0, 0.18);
}
a.btn-sm:active,
button.btn-sm:active {
  transform: translateY(1px) scale(0.99);
}
button.btn-sm:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
  box-shadow: none;
}
button.btn-llm {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.75rem 1.2rem;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, #5a7a96 0%, #3d5a73 100%);
  box-shadow: 0 10px 22px rgba(61, 90, 115, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s;
}
button.btn-llm:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 14px 26px rgba(61, 90, 115, 0.34);
}
button.btn-llm:active {
  transform: translateY(1px) scale(0.99);
}
button.btn-llm:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}
.import-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1.15rem;
}
.lib-add-form {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}
.lib-add-progress {
  color: var(--muted);
  font-size: 0.92rem;
}
.lib-add-hint {
  margin: -0.65rem 0 1.15rem;
}
.lede {
  margin: 0 0 1.75rem;
  color: var(--muted);
  max-width: 28rem;
  font-size: 1.02rem;
}
.panel {
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.35rem 1.35rem 1.5rem;
  box-shadow: 0 18px 40px color-mix(in srgb, var(--ink) 8%, transparent);
}
.field { margin: 0 0 1.15rem; }
.field:last-of-type { margin-bottom: 0; }
label.lbl {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}
.hint {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}
textarea.context {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(22, 24, 28, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--ink);
}
textarea.context:focus {
  outline: 2px solid rgba(212, 148, 42, 0.45);
  border-color: var(--amber);
}
.hint code {
  font-size: 0.84em;
  background: rgba(22, 24, 28, 0.06);
  padding: 0.08em 0.35em;
  border-radius: 4px;
}
.drop {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 8.5rem;
  padding: 1.25rem;
  border: 1.5px dashed rgba(22, 24, 28, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.15));
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.drop:hover, .drop:focus-within {
  border-color: var(--amber);
  background: rgba(255, 248, 230, 0.55);
}
.drop.drag {
  animation: pulse-border 1s ease-in-out infinite;
  background: rgba(255, 244, 214, 0.7);
  transform: scale(1.01);
}
.drop input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.drop-title {
  font-weight: 700;
  margin: 0;
  text-align: center;
}
.drop-sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
.kind-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 1.15rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.kind-radio {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
}
.kind-radio input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--amber-deep);
}
.mode-panel[hidden] { display: none !important; }
.opt-stack {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.15rem;
}
.opt {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.85rem 1rem;
}
.opt-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  font-weight: 700;
}
.opt-check input {
  margin-top: 0.2rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--amber-deep);
}
.opt-body {
  display: none;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.opt.open .opt-body { display: block; }
.reel-table {
  width: 100%;
  border-collapse: collapse;
}
.reel-table th,
.reel-table td {
  text-align: left;
  padding: 0.45rem 0.35rem;
  vertical-align: middle;
  font-size: 0.92rem;
}
.reel-table th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.reel-table td.name {
  color: var(--ink);
  word-break: break-all;
  padding-right: 0.75rem;
}
.reel-table td.count { width: 6.5rem; }
.reel-table .num {
  font-size: 1.1rem;
  padding: 0.45rem 0.55rem;
}
.reel-table-empty {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}
.num {
  width: 100%;
  appearance: textfield;
  font-family: var(--font-body);
  font-size: 1.35rem;
  font-weight: 700;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.num::-webkit-outer-spin-button,
.num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(217, 146, 11, 0.22);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.25rem;
  margin-top: 1.35rem;
}
button.cta {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, var(--amber) 0%, var(--amber-deep) 100%);
  padding: 0.85rem 1.35rem;
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(184, 116, 0, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s;
}
button.cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 14px 26px rgba(184, 116, 0, 0.34);
}
button.cta:active { transform: translateY(1px) scale(0.99); }
button.cta:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}
.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-link:hover {
  color: var(--ink);
  border-bottom-color: var(--amber);
}
.job-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0 0 1.1rem;
}
.job-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
}
.job-tab:hover { color: var(--ink); border-color: var(--amber); }
.job-tab.active {
  color: var(--ink);
  border-color: var(--amber-deep);
  background: color-mix(in srgb, var(--amber) 18%, #fff);
}
.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}
.section-nav a {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}
.section-nav a:hover { color: var(--ink); border-color: var(--amber); }
.job-section {
  scroll-margin-top: 1.25rem;
  margin-bottom: 2rem;
}
.job-section h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: 0.02em;
  margin: 0 0 0.35rem;
}
.job-section .sec-lede {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 0.85rem;
}
.btn-danger {
  appearance: none;
  border: 1px solid #c45c4a;
  background: #fff;
  color: #a33b2b;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
}
.btn-danger:hover { background: #fdecea; }
.btn-quiet {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
}
.btn-quiet:hover { background: rgba(22, 24, 28, 0.04); }
.rename-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
}
.rename-form input[type="text"] {
  min-width: min(16rem, 100%);
  flex: 1 1 10rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(22, 24, 28, 0.18);
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.85);
}
.rename-form input[type="text"]:focus {
  outline: 2px solid rgba(212, 148, 42, 0.45);
  border-color: var(--amber);
}
.job-title {
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.25;
}
.job-id-sub {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  margin-top: 0.15rem;
}
.upload-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.upload-table th,
.upload-table td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.upload-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.upload-table td.name { word-break: break-all; }
.upload-table .check { width: 2rem; }
.file-previews {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.file-previews[hidden] { display: none !important; }
.file-preview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  align-items: center;
  overflow: hidden;
  max-width: 100%;
}
.file-preview.has-thumb {
  grid-template-columns: minmax(0, 1fr) 72px;
}
.file-preview-body {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  cursor: pointer;
}
.file-preview-check {
  display: flex;
  align-items: center;
  margin-bottom: 0.15rem;
}
.file-preview-check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--amber-deep);
}
.file-preview-name {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.25;
  word-break: break-all;
}
.analysis-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: #2f9e44;
  vertical-align: 0.1em;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(47, 158, 68, 0.25);
}
.file-preview-uses {
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.file-preview-meta {
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.file-preview-dur {
  font-weight: 600;
  color: var(--ink);
}
.library-previews {
  margin: 0 0 1.15rem;
}
.library-previews .job-thumb {
  pointer-events: auto;
}
button.job-thumb.lib-play-thumb {
  position: relative;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  display: block;
  border-radius: 8px;
  overflow: hidden;
}
button.job-thumb.lib-play-thumb:focus-visible {
  outline: 2px solid var(--amber-deep);
  outline-offset: 2px;
}
.lib-play-icon {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  background: rgba(20, 18, 14, 0.55);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.lib-play-icon::before {
  content: "";
  position: absolute;
  left: 55%;
  top: 50%;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 0.35rem 0 0.35rem 0.55rem;
  border-color: transparent transparent transparent #fff;
}
.lib-play-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  isolation: isolate;
}
.lib-play-overlay[hidden] {
  display: none !important;
}
.lib-play-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(20, 18, 14, 0.55);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  cursor: pointer;
}
.lib-play-modal {
  position: relative;
  z-index: 1;
  width: min(42rem, 100%);
  max-height: min(92vh, 48rem);
  overflow: auto;
  padding: 0.9rem 1rem 1.05rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}
.lib-play-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.lib-play-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-all;
  min-width: 0;
}
.lib-play-modal video {
  display: block;
  width: 100%;
  max-height: min(70vh, 36rem);
  background: #111;
  border-radius: 10px;
}
.lib-play-hint {
  margin: 0.65rem 0 0;
}
html.lib-play-open {
  overflow: hidden;
}
html[data-theme="dark"] .lib-play-modal {
  background: #1a1c20;
  border-color: #2c3038;
}
.banner {
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
  animation: rise 0.4s ease-out both;
}
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.err { background: var(--err-bg); color: var(--err); }
.banner.warn {
  background: #fff4d8;
  color: var(--amber-deep);
  margin: 0.75rem 0;
  padding: 0.75rem 0.9rem;
}
.orient-badge {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  background: rgba(22, 24, 28, 0.08);
  color: var(--ink);
  width: fit-content;
}
.orient-badge.orient-portrait { background: #e8eef5; color: #3d5a73; }
.orient-badge.orient-landscape { background: #eef5e8; color: #3d5a3d; }
.orient-badge.orient-square { background: #f5efe8; color: #6a4a2d; }
.lib-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin: 0 0 0.85rem;
  align-items: center;
}
.lib-layout {
  display: grid;
  grid-template-columns: minmax(9.5rem, 12rem) minmax(0, 1fr);
  gap: 1rem 1.15rem;
  align-items: start;
  margin-bottom: 1rem;
}
.lib-sidebar {
  position: sticky;
  top: 0.75rem;
  padding: 0.75rem 0.7rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(8px);
}
.lib-sidebar-head {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.55rem 0.2rem;
}
.lib-album-nav {
  display: grid;
  gap: 0.2rem;
}
.lib-album-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.lib-album-item:hover {
  background: rgba(255, 255, 255, 0.7);
}
.lib-album-item.active {
  background: #fff;
  border-color: var(--line);
  font-weight: 700;
}
.lib-album-item.drop-target {
  border-color: var(--amber-deep);
  background: rgba(217, 146, 11, 0.12);
  animation: pulse-border 1s ease-in-out infinite;
}
.lib-album-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lib-album-count {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.8rem;
}
.lib-album-create,
.lib-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
  align-items: center;
}
.lib-album-input {
  flex: 1 1 5rem;
  min-width: 0;
  font: inherit;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}
.lib-album-manage {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  margin: 0 0 0.85rem;
  align-items: center;
}
.lib-program-status,
.lib-program-form {
  flex: 1 1 100%;
}
.lib-inline-forms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.lib-program-hint {
  flex: 1 1 100%;
  margin: 0.15rem 0 0;
}
.lib-danger {
  color: var(--err) !important;
  border-color: #e2c4c0 !important;
}
.lib-main {
  margin: 0;
  min-width: 0;
}
.lib-sticky-sel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 0.9rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(217, 146, 11, 0.45);
  background: rgba(255, 248, 230, 0.95);
  font-size: 0.9rem;
  font-weight: 600;
  position: sticky;
  bottom: 0.5rem;
  z-index: 2;
}
.lib-sticky-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  align-items: center;
}
.lib-move select {
  max-width: 9rem;
}
.file-preview.dragging {
  opacity: 0.55;
}
@media (max-width: 720px) {
  .lib-layout {
    grid-template-columns: 1fr;
  }
  .lib-sidebar {
    position: static;
  }
  .lib-album-nav {
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  }
}
.lib-filter {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  color: var(--muted);
}
.lib-filter select {
  font: inherit;
  padding: 0.3rem 0.45rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}
.file-preview.orient-landscape.has-thumb,
.file-preview.orient-square.has-thumb {
  grid-template-columns: minmax(0, 1fr) auto;
}
.job-thumb.orient-landscape {
  width: 96px;
  max-width: 96px;
  height: 54px;
  max-height: 54px;
}
.job-thumb.orient-landscape img {
  width: 96px;
  height: 54px;
  max-width: 96px;
  max-height: 54px;
}
.job-thumb.orient-square {
  width: 72px;
  max-width: 72px;
  height: 72px;
  max-height: 72px;
}
.job-thumb.orient-square img {
  width: 72px;
  height: 72px;
  max-width: 72px;
  max-height: 72px;
}
.job.has-thumb.orient-landscape {
  grid-template-columns: minmax(0, 1fr) 96px;
}
.job.has-thumb.orient-square {
  grid-template-columns: minmax(0, 1fr) 72px;
}
.upload-progress {
  margin: 0.55rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-height: 1.2em;
}
.upload-progress[hidden] { display: none !important; }
.banner code {
  font-size: 0.9em;
  background: rgba(0,0,0,0.06);
  padding: 0.05em 0.35em;
  border-radius: 4px;
}
.jobs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.job {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem 1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  align-items: start;
  /* Outbox thumbs are ~540×960; never let intrinsic size expand the card. */
  overflow: hidden;
  max-width: 100%;
}
.job.has-thumb {
  grid-template-columns: minmax(0, 1fr) 72px;
}
.job-body {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}
.job-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
}
.job-id {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.job-meta {
  color: var(--muted);
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.job-kind {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.job-summary-meta {
  font-size: 0.88rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.job-compact {
  padding: 0.75rem 1rem;
}
.job-compact .job-body {
  gap: 0.2rem;
}
/* Long album-program rec_ids / labels must ellipsize, not blow the card. */
.job-compact .job-id,
.job-compact .job-id a,
.job-compact .job-title,
.job-compact .job-title a,
.job-compact .job-id-sub,
.job-compact .job-id-sub code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  display: block;
  min-width: 0;
}
.job-compact .job-head {
  flex-wrap: nowrap;
}
.job-compact .job-id {
  flex: 1 1 auto;
}
.job-compact .job-badges {
  flex: 0 0 auto;
}
.job-detail-meta {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 1rem;
}
.job-detail-meta-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
}
.job-detail-meta .job-meta {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}
.job-detail-meta .job-actions {
  margin-top: 0.25rem;
}
.job-tags {
  font-size: 0.78rem;
  color: var(--muted);
}
.job-tags::before {
  content: "Tags: ";
  font-weight: 600;
}
.rename-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.rename-form input[type="text"] {
  min-width: 10rem;
  flex: 1 1 8rem;
}
.yt-schedule {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.yt-schedule .context {
  width: 100%;
  box-sizing: border-box;
}
.yt-schedule .yt-title {
  min-height: 0;
  padding: 0.55rem 0.7rem;
}
.yt-when {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: end;
}
.yt-when .lbl {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.yt-cal {
  display: inline-block;
  width: 1.05rem;
  height: 1.05rem;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  position: relative;
  opacity: 0.75;
}
.yt-cal::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0.28rem;
  border-top: 1.5px solid currentColor;
}
.yt-date,
.yt-time {
  font: inherit;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}
.btn-youtube {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: #c4302b;
  cursor: pointer;
  width: fit-content;
}
.btn-youtube:hover { background: #a82520; }
.btn-youtube:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-instagram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: #c13584;
  cursor: pointer;
  width: fit-content;
  margin-top: 0.35rem;
}
.btn-instagram:hover { background: #a12d6e; }
.btn-instagram:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.ig-schedule {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(22, 24, 28, 0.1);
}
.yt-stagger {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}
.yt-stagger .hint {
  flex: 1 1 100%;
  margin: 0;
}
.yt-stagger .inline-form {
  display: inline-flex;
}
.yt-redraft {
  margin: 0.85rem 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.9);
}
.yt-redraft .banner {
  margin: 0 0 0.75rem;
}
.yt-redraft .hint {
  margin: 0.55rem 0 0;
}
.job-thumb {
  display: block;
  box-sizing: border-box;
  width: 72px;
  max-width: 72px;
  height: 96px;
  max-height: 96px;
  min-width: 0;
  min-height: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #0e1014;
  border: 1px solid var(--line);
  flex-shrink: 0;
  justify-self: end;
  contain: strict;
}
.job-thumb img {
  display: block;
  width: 72px;
  height: 96px;
  max-width: 72px;
  max-height: 96px;
  object-fit: cover;
}
.job-thumb-empty {
  pointer-events: none;
  background:
    linear-gradient(145deg, rgba(22, 24, 28, 0.06), rgba(22, 24, 28, 0.14));
}
.badge {
  align-self: start;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: rgba(22, 24, 28, 0.07);
  white-space: nowrap;
}
.badge.done { background: var(--ok-bg); color: var(--ok); }
.badge.failed { background: var(--err-bg); color: var(--err); }
.badge.running { background: #fff4d8; color: var(--amber-deep); }
.badge.waiting { background: #e8eef5; color: #3d5a73; }
.badge.queued { background: #fff4d8; color: var(--amber-deep); }
.badge.scheduled {
  background: #e8eef8;
  color: #1a4a8a;
}
.badge.uploaded {
  background: var(--ok-bg);
  color: var(--ok);
}
.badge.plat-yt {
  background: #fde8e6;
  color: #c4302b;
  border: 1px solid rgba(196, 48, 43, 0.35);
}
.badge.plat-ig {
  background: #fce4ec;
  color: #c13584;
}

/* Schedule capacity calendar */
.sched-cal {
  margin: 0 0 1.1rem;
  padding: 0.85rem 1rem 1rem;
}
.sched-cal-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}
.sched-cal-heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.sched-cal-lede {
  margin: 0.15rem 0 0;
}
.sched-cal-summary {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 650;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.45rem;
  align-items: baseline;
}
.sched-cal-sum-yt { color: #c4302b; }
.sched-cal-sum-ig { color: #c13584; }
.sched-cal-sum-sep { color: var(--muted); font-weight: 500; }
.sched-cal-sum-note {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.8rem;
}
.sched-cal-mini {
  display: block;
  width: 100%;
  max-width: 22rem;
  margin: 0;
  padding: 0.55rem 0.65rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel, #fff) 88%, var(--amber) 12%);
  cursor: zoom-in;
  text-align: left;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sched-cal-mini:hover,
.sched-cal-mini:focus-visible {
  border-color: color-mix(in srgb, var(--amber) 55%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 22%, transparent);
  outline: none;
}
.sched-cal-mini-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}
.sched-cal-month-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sched-cal-dow,
.sched-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}
.sched-cal-dow {
  margin-bottom: 2px;
}
.sched-cal-dow span {
  text-align: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sched-cal-dow-lg span {
  font-size: 0.72rem;
}
.sched-cal-day {
  position: relative;
  min-height: 2.15rem;
  border-radius: 5px;
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sched-cal-day.empty {
  background: transparent;
  border: none;
  min-height: 2.15rem;
}
.sched-cal-day.is-today {
  border-color: color-mix(in srgb, var(--amber) 70%, transparent);
}
.sched-cal-day.is-hole {
  border-color: color-mix(in srgb, var(--ink) 22%, transparent);
  border-style: dashed;
}
.sched-cal-day.is-full {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok, #2e7d32) 35%, transparent);
}
.sched-cal-day.is-past {
  opacity: 0.72;
}
.sched-cal-num {
  position: absolute;
  top: 1px;
  left: 3px;
  z-index: 1;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  text-shadow: 0 0 3px color-mix(in srgb, var(--panel, #fff) 90%, transparent);
  pointer-events: none;
}
.sched-cal-fills {
  display: flex;
  flex: 1;
  min-height: 2.15rem;
}
.sched-cal-half {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sched-cal-slot {
  flex: 1;
  min-height: 0;
  background: transparent;
}
.sched-cal-half.plat-yt .sched-cal-slot.on {
  background: rgba(198, 40, 40, 0.38);
}
.sched-cal-half.plat-ig .sched-cal-slot.on {
  background: rgba(193, 53, 132, 0.38);
}
.sched-cal-half.plat-yt.full .sched-cal-slot.on {
  background: rgba(198, 40, 40, 0.55);
}
.sched-cal-half.plat-ig.full .sched-cal-slot.on {
  background: rgba(193, 53, 132, 0.55);
}
.sched-cal-plus {
  position: absolute;
  right: 1px;
  bottom: 0;
  font-size: 0.55rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  opacity: 0.75;
}

.sched-reschedule-overlay {
  position: fixed;
  inset: 0;
  z-index: 230;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  isolation: isolate;
}
.sched-reschedule-overlay[hidden] {
  display: none !important;
}
.sched-reschedule-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(20, 18, 14, 0.45);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  cursor: pointer;
}
.sched-reschedule-modal {
  position: relative;
  z-index: 1;
  width: min(22rem, 100%);
  padding: 1.1rem 1.15rem 1.15rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}
.sched-reschedule-msg {
  margin: 0 0 1rem;
  font-size: 0.98rem;
  line-height: 1.4;
}
.sched-reschedule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}
html[data-theme="dark"] .sched-reschedule-modal {
  background: #1c1a16;
  border-color: #3a352c;
}

.sched-cal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  /* Escape .shell stacking; always portal to body via JS */
  isolation: isolate;
}
.sched-cal-overlay[hidden] {
  display: none !important;
}
.sched-cal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(20, 18, 14, 0.45);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  cursor: pointer;
}
.sched-cal-modal {
  position: relative;
  z-index: 1;
  width: min(34rem, 100%);
  max-height: min(92vh, 40rem);
  overflow: auto;
  padding: 1rem 1.1rem 1.15rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  /* Opaque — --panel is translucent and disappears into the blur */
  background: #fffdf8;
  color: var(--ink);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}
.sched-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}
.sched-cal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 750;
  text-align: center;
  flex: 1;
}
.sched-cal-grid-lg {
  gap: 4px;
  margin-top: 0.35rem;
}
.sched-cal-grid-lg .sched-cal-day {
  min-height: 3.4rem;
  border-radius: 8px;
}
.sched-cal-grid-lg .sched-cal-day.empty {
  min-height: 3.4rem;
}
.sched-cal-grid-lg .sched-cal-fills {
  min-height: 3.4rem;
}
.sched-cal-grid-lg .sched-cal-num {
  top: 4px;
  left: 5px;
  font-size: 0.78rem;
}
.sched-cal-modal .sched-cal-summary {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
}
html.sched-cal-open {
  overflow: hidden;
}

.sched-col-plat {
  width: 5.5rem;
  white-space: nowrap;
}
/* Scheduled: desktop = wide table; mobile = stacked cards */
.sched-desktop { display: block; }
.sched-mobile { display: none; }
.sched-panel {
  overflow-x: visible;
}
.sched-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.sched-table th,
.sched-table td {
  text-align: left;
  padding: 0.85rem 0.75rem;
  vertical-align: middle;
  font-size: 0.98rem;
  border-bottom: 1px solid var(--line);
}
.sched-table th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.sched-col-thumb {
  width: 5.5rem;
}
.sched-thumb {
  display: block;
  width: 64px;
  height: 84px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(22, 24, 28, 0.06);
  flex-shrink: 0;
}
.sched-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sched-thumb-empty {
  background:
    linear-gradient(145deg, rgba(22, 24, 28, 0.06), rgba(22, 24, 28, 0.14));
}
.sched-col-name {
  width: 38%;
}
.sched-col-name .nav-link {
  font-weight: 700;
  font-size: 1.02rem;
}
.sched-job-id {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.sched-job-id code {
  font-size: inherit;
}
.sched-col-status {
  width: 8rem;
  white-space: nowrap;
}
.sched-col-when {
  white-space: normal;
  color: var(--ink);
  width: 15rem;
  vertical-align: top;
}
.sched-col-views {
  white-space: normal;
  font-variant-numeric: tabular-nums;
  text-align: right;
  width: 7.5rem;
  font-weight: 600;
  vertical-align: top;
}
.sched-table th.sched-col-views {
  text-align: right;
}
.sched-plat-stack {
  display: grid;
  gap: 0.4rem;
  justify-items: start;
}
.sched-col-views .sched-plat-stack {
  justify-items: end;
}
.sched-plat-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.45rem;
  line-height: 1.35;
  min-width: 0;
}
.sched-col-views .sched-plat-line {
  justify-content: flex-end;
}
.sched-plat-tag {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  line-height: 1.2;
}
.sched-plat-tag.plat-yt {
  background: #fde8e6;
  color: #c4302b;
}
.sched-plat-tag.plat-ig {
  background: #fce4ec;
  color: #c13584;
}
.sched-plat-val {
  min-width: 0;
  overflow-wrap: anywhere;
}
.sched-col-link {
  white-space: nowrap;
  width: 4.5rem;
  vertical-align: top;
}
.sched-link {
  color: var(--amber-deep);
  font-size: 0.95rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.sched-link:hover {
  border-bottom-color: var(--amber);
}

/* Mobile card stack */
.sched-card {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.9rem 0.15rem;
  border-bottom: 1px solid var(--line);
}
.sched-card:last-child {
  border-bottom: none;
}
.sched-card-thumb .sched-thumb {
  width: 72px;
  height: 96px;
}
.sched-card-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.35rem;
}
.sched-card-title {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.25;
}
.sched-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.sched-card-when {
  font-size: 0.9rem;
  color: var(--ink);
  min-width: 0;
}
.sched-card-when .sched-plat-stack,
.sched-card-views .sched-plat-stack {
  gap: 0.3rem;
}
.sched-card-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 0.15rem;
}
.sched-card-views {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.95rem;
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}
.sched-card-views .sched-plat-stack {
  justify-items: start;
}
.sched-card-views .sched-plat-line {
  justify-content: flex-start;
}
.sched-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 800px) {
  .shell.wide.sched-shell {
    width: min(100%, calc(100% - 1.25rem));
    padding-left: 0.15rem;
    padding-right: 0.15rem;
  }
  .sched-desktop { display: none; }
  .sched-mobile { display: block; }
}
.job-badges {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.job-up-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.empty {
  color: var(--muted);
  margin: 0;
}
.reels {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}
.reel-set {
  display: grid;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.reel-set-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.reel-set-label {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}
.reel-set-inner {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}
.reel-set-break {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  list-style: none;
  margin: 0.35rem 0 0.15rem;
  padding: 0;
}
.reel-set-rule {
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
  opacity: 0.9;
}
.reel-set-break-label {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.reel-set .dual-schedule {
  margin-top: 0.15rem;
}
.reel {
  display: grid;
  gap: 0.75rem;
  padding: 0;
  border: 0;
  background: transparent;
}
.reel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
}
.reel-title {
  font-weight: 700;
  font-size: 1.05rem;
}
button.reel-title-btn {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  color: inherit;
  text-align: left;
  cursor: pointer;
  max-width: 100%;
}
button.reel-title-btn:hover,
button.reel-title-btn:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.15em;
  outline: none;
}
button.reel-title-btn[aria-expanded="true"] {
  color: var(--primary, #9e6000);
}
.story-approach {
  flex: 1 1 100%;
  order: 5;
  margin: 0.35rem 0 0.15rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--line, var(--border, #d9d3c7));
  background: var(--surface-2, rgba(127, 127, 127, 0.08));
  font-size: 0.82rem;
  line-height: 1.45;
}
.story-approach-label {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.story-approach-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.78rem;
}
.reel-meta {
  color: var(--muted);
  font-size: 0.86rem;
}
.reel video {
  width: 100%;
  max-height: min(70vh, 720px);
  border-radius: 12px;
  background: #0e1014;
  display: block;
}
.reel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  align-items: center;
}
.job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.15rem;
}
.linkish {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  text-align: left;
}
.linkish:hover {
  color: var(--ink);
  border-bottom-color: var(--amber);
}
.page-layout {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  width: 100%;
}
.page-main {
  flex: 1 1 auto;
  min-width: 0;
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(22, 24, 28, 0.35);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.drawer {
  display: flex;
  flex-direction: column;
  background: #14171c;
  color: #e8ebe6;
  min-height: 0;
}
/* Floating overlay (default, unpinned) */
.drawer.mode-float {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(34rem, 100%);
  z-index: 50;
  box-shadow: -16px 0 40px rgba(0,0,0,0.28);
  transform: translateX(105%);
  transition: transform 0.22s ease;
}
.drawer.mode-float.open { transform: none; }
/* Pinned: part of the main window */
.drawer.mode-pinned {
  position: sticky;
  top: 0;
  align-self: stretch;
  height: 100vh;
  width: min(28rem, 42vw);
  flex: 0 0 min(28rem, 42vw);
  border-left: 1px solid rgba(255,255,255,0.08);
  box-shadow: none;
  transform: none;
  z-index: 5;
}
.drawer.mode-pinned.collapsed {
  width: 2.6rem;
  flex-basis: 2.6rem;
}
.drawer.mode-pinned.collapsed .drawer-head {
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  padding: 0.65rem 0.35rem;
  height: 100%;
}
.drawer.mode-pinned.collapsed .drawer-title,
.drawer.mode-pinned.collapsed .drawer-tools,
.drawer.mode-pinned.collapsed .drawer-body,
.drawer.mode-pinned.collapsed .drawer-close {
  display: none;
}
.drawer.mode-pinned.collapsed .drawer-chrome {
  flex-direction: column;
  width: 100%;
}
.drawer-rail {
  display: none;
  appearance: none;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: #ffd27a;
  border-radius: 8px;
  padding: 0.55rem 0.2rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  cursor: pointer;
  width: 100%;
  min-height: 7rem;
}
.drawer.mode-pinned.collapsed .drawer-rail { display: block; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: #1b1f26;
  flex-shrink: 0;
}
.drawer-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}
.drawer-chrome,
.drawer-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  flex-shrink: 0;
}
.drawer-tools button,
.drawer-chrome button,
.drawer-close {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: #e8ebe6;
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.drawer-tools button.active,
.drawer-chrome button.active {
  border-color: rgba(217, 146, 11, 0.7);
  background: rgba(217, 146, 11, 0.18);
  color: #ffd27a;
}
.drawer-close { font-size: 1rem; line-height: 1; padding: 0.3rem 0.55rem; }
.drawer-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.75rem 0.9rem 1.25rem;
}
.drawer-split {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 0.75rem;
  height: 100%;
  min-height: 0;
}
@media (max-width: 900px) {
  .page-layout.dock-pinned {
    flex-direction: column;
  }
  .drawer.mode-pinned {
    position: relative;
    width: 100%;
    flex: 0 0 auto;
    height: min(42vh, 22rem);
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .drawer.mode-pinned.collapsed {
    width: 100%;
    height: 2.6rem;
    flex-basis: 2.6rem;
  }
  .drawer.mode-pinned.collapsed .drawer-head {
    flex-direction: row;
    align-items: center;
    height: auto;
    padding: 0.45rem 0.75rem;
  }
  .drawer.mode-pinned.collapsed .drawer-rail {
    writing-mode: horizontal-tb;
    transform: none;
    min-height: 0;
    width: auto;
    padding: 0.35rem 0.75rem;
  }
}
@media (max-width: 640px) {
  .drawer-split { grid-template-columns: 1fr; }
}
.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  border-right: 1px solid rgba(255,255,255,0.08);
  padding-right: 0.5rem;
}
.file-list button {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #c5cbc3;
  font-family: var(--font-body);
  font-size: 0.78rem;
  padding: 0.4rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
  word-break: break-all;
}
.file-list button:hover,
.file-list button.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.log-view, .text-view {
  margin: 0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: #d7ddd4;
}
.log-line { display: block; }
.log-line.INFO { color: #b8c4b4; }
.log-line.WARNING { color: #e6b35c; }
.log-line.ERROR { color: #f07178; }
.log-line.DEBUG { color: #7f8b99; }
.log-line.meta { color: #6f7a88; }
.drawer-empty { color: #8a93a0; font-size: 0.9rem; margin: 0.5rem 0; }

/* --- layout helpers (refactor) --- */
.brand-block {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}
a.brand {
  text-decoration: none;
  color: inherit;
}
a.brand:hover span { color: var(--amber-deep); }
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.15rem;
}
.site-nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}
.site-nav-link:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.site-nav-link.active {
  color: var(--amber-deep);
  background: color-mix(in srgb, var(--amber) 16%, var(--surface));
}
.crumb { margin: 0 0 1rem; }
.field-compact { margin: 0; max-width: 10rem; }
.field-top { margin-top: 1rem; }
.field-top.field-compact { max-width: 12rem; }
.legend-flush { margin: 0 0 0.35rem; }
.inline-form { display: inline; }
.actions.flush { margin-top: 0; }
.actions.spaced { margin-top: 1.5rem; }
.panel.spaced { margin-top: 1rem; }
.job-actions.spaced { margin-top: 0.75rem; }
.job-actions.stacked { margin: 0 0 1rem; }
.hint.tight { margin: 0 0 0.35rem; }
.kind-radio em {
  font-style: normal;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.82rem;
  margin-left: 0.2rem;
}
.more-opts {
  margin-top: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
  padding: 0.15rem 0.85rem 0.85rem;
}
.more-opts > summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.7rem 0.15rem;
  color: var(--ink);
  user-select: none;
}
.more-opts > summary::-webkit-details-marker { display: none; }
.more-opts > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.45rem;
  color: var(--amber-deep);
  transition: transform 0.15s;
}
.more-opts[open] > summary::before { transform: rotate(90deg); }
.more-opts-body { padding: 0 0.15rem 0.25rem; }
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.55rem 1rem;
  margin-bottom: 0.35rem;
}
.opt-check.emph { font-weight: 600; }
@media (max-width: 520px) {
  .topbar { flex-wrap: wrap; }
  .site-nav { width: 100%; }
}

/* —— Live progress / system status / review / remix —— */
.system-status {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 1rem;
}
.system-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.85rem;
}
.system-status-row.muted { color: var(--muted); font-size: 0.88rem; }
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.status-pill.ok { background: var(--ok-bg); color: var(--ok); }
.status-pill.err { background: var(--err-bg); color: var(--err); }
.system-meta { font-size: 0.9rem; }
.system-actions { gap: 0.45rem; margin-top: 0.15rem; }
.job-progress { display: grid; gap: 0.35rem; margin: 0.15rem 0 0.25rem; }
.job-progress-track {
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(22, 24, 28, 0.08);
  overflow: hidden;
}
.job-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber-deep), var(--amber));
  transition: width 0.4s ease;
}
.job-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.job-progress-stage { font-weight: 600; color: var(--ink); }
.job-live .badge { align-self: flex-start; }
.job-compact.has-thumb {
  grid-template-columns: minmax(0, 1fr) 72px;
}
.review-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.85rem 0.85rem;
  margin: 0 0 0.85rem;
  background: #fff;
}
.review-group legend {
  font-weight: 700;
  padding: 0 0.35rem;
}
.review-clip {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.45rem 0.2rem;
  border-bottom: 1px solid rgba(217, 211, 199, 0.55);
  cursor: pointer;
}
.review-clip:last-child { border-bottom: 0; }
.review-clip input { margin-top: 0.3rem; }
.review-clip-body { font-size: 0.92rem; line-height: 1.35; }
.remix-panel .sec-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.03em;
  margin: 0 0 0.35rem;
}
.remix-form { display: grid; gap: 0.85rem; max-width: 28rem; }
.remix-slider {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
}
.remix-slider em { font-style: normal; color: var(--amber-deep); }
.remix-slider input[type="range"] { width: 100%; accent-color: var(--amber-deep); }
.hint.tight { margin: 0; }
.banner.warn {
  background: #fff6e5;
  color: #7a4e00;
  border: 1px solid #efd09a;
}

.job-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.45rem;
  margin: 0.15rem 0 0.1rem;
}
.job-options.muted { color: var(--muted); font-size: 0.86rem; }
.job-options-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.15rem;
}
.opt-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(217, 146, 11, 0.14);
  color: #7a4e00;
  border: 1px solid rgba(217, 146, 11, 0.35);
}
.opt-chip[data-opt="add_cc"] {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: rgba(31, 107, 74, 0.35);
}
.opt-chip[data-opt="narration"] {
  background: #eef2ff;
  color: #3730a3;
  border-color: rgba(55, 48, 163, 0.25);
}

/* Learning report */
.learn-sched {
  margin: 0.65rem 0 0;
  padding-left: 1.15rem;
  line-height: 1.55;
}
.report-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}
.report-stat {
  padding: 0.9rem 1rem;
  margin: 0;
}
.report-k {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.report-v {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.report-chart-wrap {
  margin: 0.5rem 0 1.25rem;
}
.report-chart {
  width: 100%;
  max-width: 40rem;
  height: auto;
  display: block;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 12px;
  border: 1px solid rgba(22, 24, 28, 0.08);
}
.report-chart-grid {
  stroke: rgba(22, 24, 28, 0.08);
  stroke-width: 1;
}
.report-chart-label {
  fill: var(--muted);
  font-size: 10px;
  font-family: inherit;
}
.report-line {
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.report-line.score { stroke: #b45309; }
.report-line.avp { stroke: #1f6b4a; stroke-dasharray: 5 4; }
.report-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}
.report-legend .lg::before {
  content: "";
  display: inline-block;
  width: 1.1rem;
  height: 0;
  border-top: 2.5px solid;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.report-legend .lg.score::before { border-color: #b45309; }
.report-legend .lg.avp::before {
  border-color: #1f6b4a;
  border-top-style: dashed;
}

/* ---- Dark theme: surfaces / forms / chips that hard-code light whites ---- */
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .lib-album-input,
html[data-theme="dark"] .yt-date,
html[data-theme="dark"] .yt-time,
html[data-theme="dark"] .num,
html[data-theme="dark"] .context,
html[data-theme="dark"] .yt-title,
html[data-theme="dark"] .file-preview,
html[data-theme="dark"] .job,
html[data-theme="dark"] .sched-card,
html[data-theme="dark"] .lib-sidebar,
html[data-theme="dark"] .lib-sticky-sel,
html[data-theme="dark"] .yt-redraft,
html[data-theme="dark"] .dropzone,
html[data-theme="dark"] .mode-card,
html[data-theme="dark"] .output-opt,
html[data-theme="dark"] .extra-opt {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme="dark"] .banner.warn,
html[data-theme="dark"] .badge.running,
html[data-theme="dark"] .badge.queued {
  background: var(--warn-bg);
  color: var(--amber-deep);
}
html[data-theme="dark"] .badge.waiting,
html[data-theme="dark"] .badge.scheduled {
  background: #1e2a3a;
  color: #8eb6e8;
}
html[data-theme="dark"] .badge {
  background: var(--chip);
  color: var(--ink);
}
html[data-theme="dark"] .badge.done { background: var(--ok-bg); color: var(--ok); }
html[data-theme="dark"] .badge.failed { background: var(--err-bg); color: var(--err); }
html[data-theme="dark"] .badge.uploaded { background: var(--ok-bg); color: var(--ok); }
html[data-theme="dark"] .badge.plat-yt { background: #3a1c1a; color: #f0a09a; }
html[data-theme="dark"] .badge.plat-ig { background: #3a1a2c; color: #e1306c; }
html[data-theme="dark"] .sched-plat-tag.plat-yt { background: #3a1c1a; color: #f0a09a; }
html[data-theme="dark"] .sched-plat-tag.plat-ig { background: #3a1a2c; color: #e1306c; }
html[data-theme="dark"] .sched-cal-sum-yt { color: #f0a09a; }
html[data-theme="dark"] .sched-cal-sum-ig { color: #e1306c; }
html[data-theme="dark"] .sched-cal-mini {
  background: color-mix(in srgb, var(--panel) 90%, var(--amber) 10%);
}
html[data-theme="dark"] .sched-cal-half.plat-yt .sched-cal-slot.on {
  background: rgba(240, 160, 154, 0.42);
}
html[data-theme="dark"] .sched-cal-half.plat-ig .sched-cal-slot.on {
  background: rgba(225, 48, 108, 0.42);
}
html[data-theme="dark"] .sched-cal-backdrop {
  background: rgba(0, 0, 0, 0.55);
}
html[data-theme="dark"] .sched-cal-modal {
  background: #1c212b;
  color: var(--ink);
}
html[data-theme="dark"] .job-progress-track {
  background: color-mix(in srgb, var(--ink) 12%, transparent);
}
html[data-theme="dark"] .job-progress-fill {
  background: linear-gradient(90deg, var(--amber-deep), var(--amber));
}
html[data-theme="dark"] .site-nav-link {
  color: var(--muted);
}
html[data-theme="dark"] .site-nav-link.active,
html[data-theme="dark"] .site-nav-link:hover {
  color: var(--ink);
}
html[data-theme="dark"] .job-tab {
  color: var(--muted);
}
html[data-theme="dark"] .job-tab.active {
  color: var(--ink);
  border-color: var(--amber);
}
html[data-theme="dark"] .btn-sm,
html[data-theme="dark"] a.btn-sm {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme="dark"] .btn-danger {
  background: var(--err-bg);
  color: var(--err);
}
html[data-theme="dark"] .empty,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .crumb,
html[data-theme="dark"] .sched-job-id,
html[data-theme="dark"] code {
  color: var(--muted);
}
html[data-theme="dark"] .lib-album-item.active,
html[data-theme="dark"] .lib-album-item:hover {
  background: color-mix(in srgb, var(--amber) 16%, transparent);
}
html[data-theme="dark"] .orient-badge.orient-portrait { background: #1e2a3a; color: #8eb6e8; }
html[data-theme="dark"] .orient-badge.orient-landscape { background: #1e2e1e; color: #9dca9d; }
html[data-theme="dark"] .orient-badge.orient-square { background: #2e261c; color: #d0b08a; }
html[data-theme="dark"] .report-line.score { stroke: var(--amber-deep); }
html[data-theme="dark"] .report-line.avp { stroke: var(--ok); }
html[data-theme="dark"] .report-legend .lg.score::before { border-color: var(--amber-deep); }
html[data-theme="dark"] .report-legend .lg.avp::before { border-color: var(--ok); }

/* Background library upload banner (classic shell) */
.rr-bg-upload {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%);
  z-index: 115; display: flex; align-items: center; gap: 0.75rem;
  width: min(28rem, calc(100% - 1.5rem)); padding: 0.7rem 0.9rem;
  border-radius: 12px; background: rgba(20, 23, 28, 0.94); color: #e8ebe6;
  box-shadow: 0 12px 40px rgba(0,0,0,0.28); font-size: 0.9rem; font-weight: 600;
}
.rr-bg-upload[hidden] { display: none !important; }
.rr-bg-upload-link { margin-left: auto; color: #ffd27a; text-decoration: none; font-weight: 700; }

/* In-app README / docs */
.doc-shell { max-width: 52rem; }
.doc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0.75rem 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border, #333);
}
.doc-nav-link {
  font-size: 0.9rem;
  text-decoration: none;
  opacity: 0.75;
}
.doc-nav-link:hover { opacity: 1; }
.doc-nav-link.active {
  opacity: 1;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.doc-path { margin: 0 0 1rem; opacity: 0.7; }
.doc-prose { line-height: 1.55; font-size: 0.95rem; }
.doc-prose h1, .doc-prose h2, .doc-prose h3, .doc-prose h4 {
  margin: 1.4em 0 0.5em;
  line-height: 1.25;
}
.doc-prose h1 { font-size: 1.45rem; }
.doc-prose h2 { font-size: 1.2rem; }
.doc-prose h3 { font-size: 1.05rem; }
.doc-prose p, .doc-prose ul, .doc-prose ol { margin: 0.65em 0; }
.doc-prose li { margin: 0.25em 0; }
.doc-prose code {
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: var(--code-bg, rgba(127,127,127,0.15));
}
.doc-prose pre {
  overflow-x: auto;
  padding: 0.85rem 1rem;
  border-radius: 6px;
  background: var(--code-bg, rgba(127,127,127,0.12));
  font-size: 0.82rem;
}
.doc-prose pre code { padding: 0; background: transparent; }
.doc-prose table.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.88rem;
}
.doc-prose table.doc-table th,
.doc-prose table.doc-table td {
  border: 1px solid var(--border, #444);
  padding: 0.4rem 0.55rem;
  text-align: left;
  vertical-align: top;
}
.doc-prose table.doc-table th { background: var(--code-bg, rgba(127,127,127,0.12)); }
.doc-prose hr {
  border: 0;
  border-top: 1px solid var(--border, #444);
  margin: 1.5rem 0;
}

