/* memorial — palette
   plum-deep:   #5a3a5b
   plum-soft:   #8a6b8c
   plum-pale:   #e6d9ee
   plum-bg:     #f6ecf7
   off-grey:    #4a4750
   ink:         #2b2630
   manilla:     #f3ead7   page bg
   manilla-2:   #ece1c8
   slate-blue:  #8aa1b6
   slate-pale:  #cfd9e2
   panel-bg:    #fffaf0   card / panel surface
   line:        #e3d6bf   subtle border
*/

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: #f3ead7;
  color: #2b2630;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, .brand-text {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #2b2630;
  letter-spacing: -0.01em;
}
h2 { font-size: 1.65rem; margin: 0 0 14px; font-weight: 600; }
h3 { font-size: 1.25rem; margin: 0 0 10px; font-weight: 600; }
h4 { font-size: 0.85rem; margin: 0 0 10px;
     text-transform: uppercase; letter-spacing: 0.10em;
     color: #5a3a5b; font-weight: 700; }

a {
  color: #5a3a5b;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
a:hover { border-bottom-color: #5a3a5b; }

/* ── top nav ──────────────────────────────────────────────────────────────── */
.topnav {
  background: #2b2630;
  border-bottom: 1px solid #1a151f;
  position: sticky; top: 0; z-index: 50;
}
.topnav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  color: #f3ead7; border-bottom: none;
}
.brand-mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, #cfb8d2 0%, #5a3a5b 100%);
  box-shadow: 0 0 0 3px rgba(207, 184, 210, 0.18);
}
.brand-text { font-size: 1.4rem; color: #f3ead7; font-weight: 600; }

.topnav-links { display: flex; gap: 24px; }
.topnav-links a {
  color: #cfb8d2;
  font-size: 1rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}
.topnav-links a:hover { color: #fffaf0; border-bottom-color: #5a3a5b; }
.nav-auth {
  display: inline-flex; align-items: center; gap: 12px;
  border-left: 1px solid #443a48;
  padding-left: 20px;
  margin-left: 6px;
  position: relative;
}

/* User button (the clickable label in the top-right) */
.user-button {
  background: transparent;
  border: 1px solid transparent;
  color: #fffaf0;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  padding: 6px 10px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 4px;
  transition: background 0.15s;
}
.user-button:hover { background: rgba(255,255,255,0.06); }
.user-button[aria-expanded="true"] { background: rgba(255,255,255,0.08); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #cfb8d2 0%, #5a3a5b 100%);
  color: #fffaf0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0;
}
.user-name {
  max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-chevron { font-size: 0.75rem; opacity: 0.7; }

/* The dropdown */
.user-menu {
  position: absolute;
  top: 100%; right: 0;
  margin-top: 8px;
  min-width: 220px;
  background: #fffaf0;
  border: 1px solid #d8c9b5;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  z-index: 60;
  padding: 6px 0;
}
.user-menu-head {
  padding: 8px 16px 10px;
  font-size: 0.85rem;
  color: #8a8590;
  border-bottom: 1px solid #ece1c8;
  margin-bottom: 4px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-menu-item {
  display: block;
  padding: 9px 16px;
  font-size: 0.95rem;
  color: #2b2630;
  border-bottom: none;
}
.user-menu-item:hover {
  background: #f6ecf7;
  color: #5a3a5b;
  border-bottom-color: transparent;
}
.user-menu-sep {
  height: 1px; background: #ece1c8; margin: 4px 0;
}

/* ── layout: side panel + content ─────────────────────────────────────────── */
.layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 28px 64px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 20px 18px 48px; }
}

.side {
  position: sticky;
  top: 70px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
@media (max-width: 900px) {
  .side { position: static; flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .side-block { flex: 1 1 200px; }
}

.side-block {
  background: #fffaf0;
  border: 1px solid #e3d6bf;
  padding: 16px;
}
.side-text { font-size: 0.95rem; color: #4a4750; margin: 0; }

.step-nav {
  list-style: none;
  margin: 0; padding: 0;
  counter-reset: step;
}
.step-nav li {
  counter-increment: step;
  margin: 0;
}
.step-nav li a {
  display: block;
  padding: 8px 0 8px 32px;
  font-size: 1rem;
  font-weight: 500;
  position: relative;
  border-bottom: 1px solid transparent;
  color: #2b2630;
}
.step-nav li a::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 7px;
  width: 24px; height: 24px;
  background: #ece1c8;
  color: #5a3a5b;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.step-nav li a:hover { color: #5a3a5b; }
.step-nav li a:hover::before { background: #5a3a5b; color: #fffaf0; }

.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { margin: 0 0 8px; font-size: 1rem; }
.side-list li:last-child { margin-bottom: 0; }

/* ── main content cards ───────────────────────────────────────────────────── */
.content { min-width: 0; }
.card {
  background: #fffaf0;
  border: 1px solid #e3d6bf;
  padding: 22px 24px;
  margin: 0 0 22px;
}
.card-pad { padding: 28px max(28px, 3vw); }

/* How it works grid */
.how {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (min-width: 1100px) { .how { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 480px)  { .how { grid-template-columns: 1fr; } }
.how > div {
  border: 1px solid #e3d6bf;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.how strong { color: #5a3a5b; font-size: 1.1rem; font-weight: 600; }
.how span:last-child { font-size: 0.98rem; color: #4a4750; }
.how .step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  background: #5a3a5b; color: #fffaf0;
  font-size: 0.78rem; font-weight: 600;
  border-radius: 50%;
  margin-bottom: 2px;
}

/* ── form ────────────────────────────────────────────────────────────────── */
form { display: block; }
.block {
  border: none; padding: 0; margin: 0 0 26px;
}
.block legend {
  font-size: 1.25rem; font-weight: 600;
  color: #5a3a5b; margin-bottom: 12px;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 600px) { .split { grid-template-columns: 1fr; } }
label { display: block; font-size: 1rem; font-weight: 500; color: #2b2630; margin-bottom: 6px; }
label .opt { color: #8a8590; font-weight: 400; }
input[type=text], input[type=email] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d8c9b5;
  background: #fffaf0;
  color: #2b2630;
  font: inherit;
  font-size: 1rem;
  border-radius: 2px;
  transition: border-color 0.15s;
}
input[type=text]:focus, input[type=email]:focus {
  outline: none; border-color: #5a3a5b;
}

/* Drop zone */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  border: 2px dashed #c4b099;
  background: #fffaf0;
  padding: 36px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.drop:hover, .drop.over {
  background: #fef4dd;
  border-color: #5a3a5b;
}
.drop-prompt { color: #5a3a5b; font-size: 1.1rem; font-weight: 500; }
.drop-meta   { color: #8a8590; font-size: 0.95rem; }

.thumbs {
  list-style: none; padding: 0; margin: 18px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.thumbs li {
  position: relative;
  aspect-ratio: 1;
  background: #ece1c8;
  border: 1px solid #d8c9b5;
  overflow: hidden;
  cursor: grab;
}
.thumbs li.drag-over { outline: 2px solid #5a3a5b; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs .num {
  position: absolute; top: 4px; left: 4px;
  font-size: 0.88rem; color: #fff; font-weight: 600;
  background: rgba(43,38,48,0.65);
  padding: 2px 7px; border-radius: 2px;
}
.thumbs .rm {
  position: absolute; top: 4px; right: 4px;
  border: none; background: rgba(43,38,48,0.55);
  color: #fff; cursor: pointer;
  width: 22px; height: 22px; line-height: 20px;
  padding: 0; border-radius: 2px;
  font-size: 16px;
}
.thumbs .rm:hover { background: #5a3a5b; }

/* ── mode picker ──────────────────────────────────────────────────────────── */
.mode-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 700px) { .mode-list { grid-template-columns: 1fr; } }

.mode-item {
  border: 1px solid #d8c9b5;
  background: #fffaf0;
  padding: 12px;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "preview preview"
    "radio   title"
    ".       desc";
  gap: 4px 10px;
  align-items: start;
}
.mode-item:hover { background: #fef4dd; }
.mode-item input { grid-area: radio; margin: 4px 0 0; accent-color: #5a3a5b; }
.mode-item:has(input:checked) {
  border-color: #5a3a5b;
  background: #f6ecf7;
}
.mode-title { grid-area: title; font-weight: 600; color: #5a3a5b; font-size: 1.05rem; }
.mode-desc  { grid-area: desc;  font-size: 0.98rem; color: #4a4750; }

.mode-preview {
  grid-area: preview;
  position: relative;
  aspect-ratio: 16 / 9;
  background: #2a2230;
  margin-bottom: 10px;
  overflow: hidden;
}
.mode-video {
  width: 100%; height: 100%;
  display: block;
  object-fit: cover;
  background: #2a2230;
}
.play-overlay {
  position: absolute; inset: 0;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.15s;
}
.play-overlay::before {
  content: "";
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(43, 38, 48, 0.55);
  backdrop-filter: blur(4px);
  border: 2px solid rgba(255, 255, 255, 0.9);
}
.play-overlay::after {
  content: "";
  position: absolute;
  width: 0; height: 0;
  margin-left: 6px;
  border-style: solid;
  border-width: 14px 0 14px 22px;
  border-color: transparent transparent transparent #fff;
}
.mode-item.playing .play-overlay { opacity: 0; }

.sample-note {
  margin: 16px 0 12px;
  font-size: 1rem;
  color: #4a4750;
  line-height: 1.55;
}
.sample-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (max-width: 600px) {
  .sample-strip { grid-template-columns: repeat(2, 1fr); }
}
.sample-strip figure { margin: 0; }
.sample-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;     /* matches output; thumbs are pre-built 16:9 face-anchored */
  overflow: hidden;
  border: 1px solid #d8c9b5;
  background: #ece1c8;
}
/* Image is sized 140% with 20% offset so even at ±10% translate the edges
   stay outside the frame — no exposed border during motion. */
.sample-frame img {
  position: absolute;
  width: 140%;
  height: 140%;
  top: -20%;
  left: -20%;
  object-fit: cover;
  display: block;
  transform-origin: center center;
}
.sample-strip figure:hover .sample-frame img {
  animation-duration: 4s;
  animation-fill-mode: forwards;
  animation-timing-function: ease-in-out;
}
.sample-strip figure[data-motion="pan-right"]:hover .sample-frame img { animation-name: thumbPanR; }
.sample-strip figure[data-motion="pan-left"]:hover .sample-frame img  { animation-name: thumbPanL; }
.sample-strip figure[data-motion="pan-down"]:hover .sample-frame img  { animation-name: thumbPanD; }
.sample-strip figure[data-motion="pan-up"]:hover .sample-frame img    { animation-name: thumbPanU; }
.sample-strip figure[data-motion="zoom-in"]:hover .sample-frame img   { animation-name: thumbZoomIn;  }
.sample-strip figure[data-motion="zoom-out"]:hover .sample-frame img  { animation-name: thumbZoomOut; }
.sample-strip figure[data-motion="pan-tl-br"]:hover .sample-frame img { animation-name: thumbDiagTLBR; }
.sample-strip figure[data-motion="pan-tr-bl"]:hover .sample-frame img { animation-name: thumbDiagTRBL; }
@keyframes thumbPanR    { from { transform: translateX(-10%); }            to { transform: translateX(10%);  } }
@keyframes thumbPanL    { from { transform: translateX(10%);  }            to { transform: translateX(-10%); } }
@keyframes thumbPanD    { from { transform: translateY(-10%); }            to { transform: translateY(10%);  } }
@keyframes thumbPanU    { from { transform: translateY(10%);  }            to { transform: translateY(-10%); } }
@keyframes thumbZoomIn  { from { transform: scale(1.0); }                  to { transform: scale(1.25); } }
@keyframes thumbZoomOut { from { transform: scale(1.25); }                 to { transform: scale(1.0); } }
@keyframes thumbDiagTLBR{ from { transform: translate(-10%, -10%); }       to { transform: translate(10%, 10%); } }
@keyframes thumbDiagTRBL{ from { transform: translate(10%, -10%); }        to { transform: translate(-10%, 10%); } }

.sample-strip figcaption {
  font-size: 0.82rem;
  color: #5a3a5b;
  margin-top: 4px;
  text-align: center;
  font-weight: 500;
}

/* Per-thumbnail pickers (overlay on user's photo thumbnails) */
.thumb-motion, .thumb-transition {
  position: absolute;
  left: 0; right: 0;
  background: rgba(43,38,48,0.92);   /* near-opaque dark — readable closed-state */
  color: #fffaf0;
  border: none;
  font: inherit;
  font-size: 0.8rem;
  padding: 3px 6px;
  cursor: pointer;
  appearance: none;
  text-align: center;
}
.thumb-motion       { bottom: 0; }
.thumb-transition   { top: 0;
                      background: rgba(74,45,76,0.95); /* deeper plum, near-opaque */ }
.thumb-motion:focus,
.thumb-transition:focus { outline: 1px solid #cfb8d2; }
/* When the native dropdown popup opens, the browser inherits color from
   the <select>, which makes white-on-light unreadable. Force the options
   to dark-on-cream so they're legible in every browser. */
.thumb-motion option,
.thumb-transition option {
  background: #fffaf0;
  color: #2b2630;
}

/* ── music ────────────────────────────────────────────────────────────────── */
.music-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}
.music-item {
  border: 1px solid #d8c9b5;
  background: #fffaf0;
  padding: 10px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  font-size: 1rem;
}
.music-item.selected {
  border-color: #5a3a5b;
  background: #f6ecf7;
}
.music-item input { margin: 0; accent-color: #5a3a5b; flex: none; }

.music-cover {
  width: 44px; height: 44px;
  object-fit: cover;
  border: 1px solid #d8c9b5;
  flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #ece1c8;
  font-size: 1.3rem;
  color: #5a3a5b;
}
.music-cover-silence { background: linear-gradient(135deg, #ece1c8, #d8c9b5); }
.music-cover-fallback { background: linear-gradient(135deg, #f6ecf7, #cfb8d2); }

.music-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.music-section-head {
  grid-column: 1 / -1;
  margin: 14px 0 4px;
  padding: 6px 0 4px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #5a3a5b;
  border-bottom: 1px solid #d8c9b5;
}
.music-section-head:first-of-type { margin-top: 6px; }

.music-play {
  margin-left: auto;
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid #cfb8d2;
  background: #fff;
  color: #5a3a5b;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.music-play:hover { background: #f6ecf7; border-color: #5a3a5b; }
.music-play.playing {
  background: #5a3a5b;
  color: #fffaf0;
  border-color: #5a3a5b;
}
.play-icon { line-height: 1; pointer-events: none; }
.muted { color: #8a8590; }
.small { font-size: 0.95rem; }

/* ── actions ──────────────────────────────────────────────────────────────── */
.actions { margin-top: 22px; text-align: center; }
.btn-primary {
  background: #5a3a5b;
  color: #fff;
  border: none;
  padding: 13px 32px;
  font: inherit; font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s;
}
.btn-primary:hover { background: #45284a; }
.btn-primary:disabled { background: #b9adba; cursor: not-allowed; }
.btn-secondary {
  background: #fffaf0; color: #5a3a5b;
  border: 1px solid #cfb8d2;
  padding: 13px 24px;
  font: inherit; cursor: pointer;
}
.btn-secondary:hover { background: #f6ecf7; }

.fineprint {
  margin-top: 14px; font-size: 0.95rem; color: #8a8590;
  max-width: 520px; margin-left: auto; margin-right: auto;
}

/* ── result panel ────────────────────────────────────────────────────────── */
#result { margin-top: 32px; text-align: center; }
.progress {
  width: 100%; height: 6px; background: #ece1c8;
  margin: 14px 0 22px; overflow: hidden;
}
#progressBar {
  display: block; height: 100%; width: 8%;
  background: linear-gradient(90deg, #8a6b8c, #5a3a5b);
  transition: width 0.4s;
}
#videoPlayer {
  width: 100%; max-width: 720px; margin: 0 auto;
  display: block; background: #000;
}
.result-actions {
  margin: 18px 0 6px;
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}
.error {
  background: #f9e7e2;
  border: 1px solid #d49a8a;
  color: #6b2f1f;
  padding: 14px;
  text-align: left;
}

/* ── new examples block (samples at the top, before the builder) ─────────── */
.example-intro {
  margin: 0 0 18px;
  color: #2b2630;
  font-size: 1.02rem;
  line-height: 1.6;
}
.example-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 12px 0 6px;
}
@media (max-width: 700px) { .example-pair { grid-template-columns: 1fr; } }
.example-mode {
  margin: 0;
  background: #fffaf0;
  border: 1px solid #d8c9b5;
}
.example-mode video {
  display: block; width: 100%; height: auto;
  background: #1f1a23;
}
.example-mode figcaption {
  padding: 10px 14px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.example-mode figcaption strong { color: #5a3a5b; font-size: 1.02rem; }
.example-mode figcaption span    { color: #6f6873; font-size: 0.92rem; }
.example-note { color: #6f6873; font-size: 0.95rem; margin: 18px 0 8px; }
.example-cta { text-align: center; margin: 18px 0 0; }
.example-cta a {
  display: inline-block;
  padding: 10px 22px;
  background: #5a3a5b; color: #fffaf0;
  text-decoration: none; font-weight: 500;
  letter-spacing: 0.02em;
}
.example-cta a:hover { background: #4a2d4c; }

/* ── compact Look radio (no embedded videos; samples live up top) ────────── */
.mode-list-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 700px) { .mode-list-compact { grid-template-columns: 1fr; } }
.mode-item-compact {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "radio title" "radio desc";
  gap: 4px 12px;
  padding: 14px 16px;
  background: #fffaf0;
  border: 1px solid #d8c9b5;
  cursor: pointer;
  align-items: start;
}
.mode-item-compact input { grid-area: radio; margin: 4px 0 0; accent-color: #5a3a5b; }
.mode-item-compact .mode-title { grid-area: title; font-weight: 600; color: #5a3a5b; }
.mode-item-compact .mode-desc  { grid-area: desc; color: #6f6873; font-size: 0.92rem; }
.mode-item-compact:hover { background: #fef4dd; }
.mode-item-compact:has(input:checked) {
  background: #f6ecf7;
  border-color: #5a3a5b;
}

/* ── music carousel ──────────────────────────────────────────────────────── */
.music-carousel { margin-top: 6px; }
.music-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 12px;
  border-bottom: 1px solid #e3d6bf;
}
.music-tab {
  background: none; border: none;
  padding: 9px 16px;
  font: inherit; font-size: 0.95rem;
  color: #8a8590; cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.music-tab[aria-selected="true"] {
  color: #5a3a5b; font-weight: 600;
  border-bottom-color: #5a3a5b;
}
.music-tab:hover { color: #5a3a5b; }

.music-deck {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: stretch;
  gap: 8px;
}
.music-nav {
  background: #fffaf0;
  border: 1px solid #d8c9b5;
  color: #5a3a5b;
  font-size: 1.6rem; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.music-nav:hover { background: #f6ecf7; border-color: #5a3a5b; }
.music-nav:disabled { opacity: 0.35; cursor: default; background: #fffaf0; border-color: #d8c9b5; }

.music-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  min-height: 200px;
}
@media (max-width: 700px) { .music-track { grid-template-columns: 1fr; } }
.music-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px;
  background: #fffaf0;
  border: 1px solid #d8c9b5;
  cursor: pointer;
  position: relative;
}
.music-card:hover { background: #fef4dd; }
.music-card.selected { background: #f6ecf7; border-color: #5a3a5b; }
.music-card-cover {
  width: 100%; aspect-ratio: 1;
  background: #ece1c8;
  border: 1px solid #d8c9b5;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; color: #5a3a5b;
}
.music-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.music-card-cover-silence { background: linear-gradient(135deg, #ece1c8, #d8c9b5); }
.music-card-title {
  font-size: 0.95rem;
  color: #2b2630;
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.music-card-row {
  display: flex; align-items: center; gap: 8px;
}
.music-card-row .music-card-title { flex: 1; }
.music-card .music-play {
  margin: 0;
  width: 32px; height: 32px;
  flex: none;
}
.music-card input[type="radio"] {
  position: absolute; top: 10px; right: 10px;
  accent-color: #5a3a5b; margin: 0;
}
.music-page {
  text-align: center;
  color: #8a8590;
  font-size: 0.85rem;
  margin-top: 10px;
  letter-spacing: 0.04em;
}

/* ── clip joiner ─────────────────────────────────────────────────────────── */
.join-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.join-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: #fffaf0;
  border: 1px solid #d8c9b5;
  cursor: grab;
}
.join-row.selected { background: #f6ecf7; border-color: #5a3a5b; }
.join-row.dragging { opacity: 0.4; }
.join-row.drag-over { outline: 2px solid #5a3a5b; outline-offset: 1px; }
.join-handle {
  color: #8a8590; font-weight: 700;
  user-select: none;
  letter-spacing: -2px;
}
.join-pick {
  display: flex; align-items: center; gap: 10px;
  flex: 1; cursor: pointer;
}
.join-pick input { accent-color: #5a3a5b; }
.join-name {
  color: #2b2630; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.join-sub { color: #8a8590; font-weight: 400; }
.join-rm {
  margin-left: auto;
  width: 24px; height: 24px; padding: 0;
  border: none; background: rgba(43,38,48,0.55); color: #fff;
  font-size: 16px; line-height: 22px;
  cursor: pointer; border-radius: 2px;
}
.join-rm:hover { background: #c89786; }
.join-fade-row {
  display: flex; align-items: center; gap: 14px;
  padding: 6px 0;
}
.join-fade-row span { color: #5a3a5b; font-weight: 500; }
.join-fade-row input[type="range"] { flex: 1; max-width: 320px; }
.join-fade-row em { font-style: normal; color: #8a8590; font-weight: 500; min-width: 40px; text-align: right; }

/* ── upload quality advisory ─────────────────────────────────────────────── */
.quality-note {
  margin: 0 0 12px;
  padding: 12px 14px;
  background: #fbf4e4;
  border: 1px solid #e3d6bf;
  border-left: 4px solid #8a6612;
  color: #5a4a2b;
  font-size: 0.93rem;
  line-height: 1.55;
}
.quality-note strong { color: #5a3a5b; }

/* ── lock icon for shared videos ─────────────────────────────────────────── */
.qj-shared, .mine-shared { margin-right: 4px; font-size: 0.9em; }

/* ── danger-styled primary button (for destructive confirms) ─────────────── */
.btn-danger { background: #6b2c2c !important; }
.btn-danger:hover { background: #8a3a3a !important; }

/* Always-visible Strip Editor card — empty-state when nothing selected. */
.result-empty {
  padding: 28px 18px;
  text-align: center;
  background: #fbf4e4;
  border: 1px dashed #d8c9b5;
}

/* ── inline editor block on the result panel ─────────────────────────────── */
.inline-editor {
  margin-top: 22px;
  padding: 16px;
  background: #fbf4e4;
  border: 1px solid #e3d6bf;
  border-left: 4px solid #5a3a5b;
}
.inline-editor h4 {
  margin: 0 0 6px;
  color: #5a3a5b;
  font-size: 1.05rem;
}
.inline-editor code {
  background: #ece1c8;
  padding: 0 6px;
  border-radius: 2px;
  font-weight: 600;
  color: #5a3a5b;
}
.inline-actions {
  margin-top: 12px;
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}

/* ── compact timeline editor ─────────────────────────────────────────────── */
.timeline-scroll {
  overflow-x: auto;
  overflow-y: visible;
  padding: 0;
  border: 1px solid #d8c9b5;
  background: #fbf4e4;
}
.timeline-strip {
  display: flex;                /* not inline-flex — avoids intrinsic-width quirks */
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;  /* hard-pin to left, kills any phantom leading gap */
  gap: 0;
  padding: 6px;
  min-height: 80px;
  width: max-content;           /* strip grows to fit content, parent scrolls it */
}
.tl-card {
  position: relative;
  flex: 0 0 116px;        /* compact width — 16:9 thumb at ~65px tall */
  height: 66px;
  background: #fffaf0;
  border: 1px solid #d8c9b5;
  cursor: grab;
  user-select: none;
  overflow: hidden;
}
.tl-card.dragging  { opacity: 0.4; }
.tl-card.drag-over { outline: 2px solid #5a3a5b; outline-offset: 1px; }
.tl-thumb-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  pointer-events: none;
}
.tl-badge {
  position: absolute;
  font-size: 0.7rem; font-weight: 700;
  background: rgba(43,38,48,0.78); color: #fffaf0;
  padding: 1px 6px;
  letter-spacing: 0.02em;
  pointer-events: none;
}
.tl-num         { top: 3px; left: 3px; min-width: 12px; text-align: center; }
.tl-motion-glyph{ bottom: 3px; right: 3px; min-width: 12px; text-align: center; font-size: 0.85rem; line-height: 1.1; }

.tl-trans {
  flex: 0 0 14px;
  height: 56px;
  border: none; background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.tl-trans-mark {
  color: #5a3a5b;
  font-weight: 700;
  letter-spacing: -2px;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.7;
}
.tl-trans:hover .tl-trans-mark { opacity: 1; color: #4a2d4c; }

/* Popover (anchored under a clicked card or transition pill) */
.tl-pop {
  position: absolute;
  z-index: 80;
  min-width: 240px;
  background: #fffaf0;
  border: 1px solid #5a3a5b;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  padding: 12px 14px;
  font-size: 0.9rem;
}
.tl-pop-head {
  font-weight: 600;
  color: #5a3a5b;
  margin-bottom: 8px;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tl-pop-row {
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: 10px;
}
.tl-pop-row > span {
  font-size: 0.8rem;
  font-weight: 600;
  color: #5a3a5b;
  display: flex; justify-content: space-between;
}
.tl-pop-row > span em { font-style: normal; color: #8a8590; font-weight: 400; }
.tl-pop-row select,
.tl-pop-row input[type="range"] {
  width: 100%;
  font: inherit; font-size: 0.9rem;
  padding: 4px 6px;
  border: 1px solid #d8c9b5;
  background: #fffaf0;
  color: #2b2630;
}
.tl-pop-row input[type="range"] { padding: 0; }
.tl-pop-actions {
  display: flex; gap: 8px; justify-content: space-between;
  margin-top: 4px;
}
.tl-pop-actions button { font-size: 0.85rem; padding: 4px 10px; }

/* "Refine timeline →" button on result panel */
.result-actions .btn-refine {
  background: #5a3a5b; color: #fffaf0;
  border: none; padding: 9px 18px;
  font: inherit; font-weight: 500;
  text-decoration: none; cursor: pointer;
  display: inline-block;
}
.result-actions .btn-refine:hover { background: #4a2d4c; }

/* ── footer ──────────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 22px 0 32px;
  font-size: 0.95rem;
  color: #8a8590;
  border-top: 1px solid #e3d6bf;
  margin-top: 24px;
}
/* Verified-Free seal link — image hosted on free.ai-ministries.com, link goes
   to /seal/<this-domain> which checks live. Can't be faked. */
.seal-link {
  display: inline-block;
  margin: 0 0 14px;
  line-height: 0;
}
.seal-link img {
  max-width: 180px;
  height: auto;
  opacity: 0.95;
  transition: opacity 0.15s;
}
.seal-link:hover img { opacity: 1; }

/* ── modal ───────────────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(43,38,48,0.55);
  z-index: 100;
  padding: 24px;
}
.modal-card {
  background: #fffaf0;
  padding: 28px;
  max-width: 420px;
  width: 100%;
  border: 1px solid #d8c9b5;
}
#modalText { white-space: pre-line; margin: 0; line-height: 1.5; }

/* ── quota panel above Create button ──────────────────────────────────────── */
.quota-panel {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #d8c9b5;
  background: #f5ecdc;
  color: #5a3a5b;
}
.quota-panel.at-limit {
  background: #f4e1da;
  border-color: #c89786;
  color: #6b2c2c;
}
.quota-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  font-size: 0.95rem;
  margin-bottom: 8px;
}
.quota-head a {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
  margin-left: auto;
  font-size: 0.85rem;
}
.quota-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.quota-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: #fffaf0;
  border: 1px solid #e7d8bf;
}
.quota-list .qj-slot {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #5a3a5b; color: #fffaf0;
  font-size: 0.78rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  letter-spacing: 0;
}
.qj-empty .qj-slot { background: #d8c9b5; color: #8a8590; }
.quota-list .qj-title {
  flex: 1;
  color: #2b2630;
  font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.quota-list .qj-sub {
  color: #8a8590;
  font-weight: 400;
  margin-left: 6px;
}
.quota-list .qj-status {
  font-size: 0.78rem;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.quota-list .qj-status.s-rendering,
.quota-list .qj-status.s-queued { color: #8a6612; border-color: #d4ad3f; background: #fff7d6; }
.quota-list .qj-status.s-done   { color: #2c6a3a; border-color: #6aa672; background: #e7f4e9; }
.quota-list .qj-status.s-failed { color: #6b2c2c; border-color: #c89786; background: #f4e1da; }
.quota-list .qj-actions {
  display: flex; gap: 6px;
}
.quota-list .qj-actions a,
.quota-list .qj-actions button {
  font-size: 0.85rem;
  padding: 4px 10px;
}
/* Clickable rows — entire slot becomes the "open in editor" target. */
.quota-list li.qj-clickable { cursor: pointer; }
.quota-list li.qj-clickable:hover { background: #f6ecf7; border-color: #5a3a5b; }

/* Empty-slot placeholder rows — match the row height of real entries */
.quota-list li.qj-empty {
  background: #fbf4e4;
  border-style: dashed;
  border-color: #d8c9b5;
  color: #a59980;
  font-style: italic;
}
.qj-empty-label { color: #a59980; font-weight: 400; }
.modal-card-wide { max-width: 540px; }
.modal-card-wide p { margin: 0 0 14px; color: #2b2630; line-height: 1.6; }
.modal-card-wide h3 { margin-bottom: 14px; color: #5a3a5b; }
.modal-actions { margin-top: 20px; text-align: right; }
.modal-actions-center {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  text-align: center;
}
.support-thanks { text-align: center; margin: 14px 0 0; }
