/* ===============================================================
   Wishly — Customize page styles
   (deduplicated)
=============================================================== */

/* ---------------------------------------------------------------
   Base / shared
--------------------------------------------------------------- */
.customize-body {
  background-color: #FFFFFF;
}

.pill-btn {
  border: none;
  outline: none;
  background: transparent;
  color: #14161B;
  padding: 10px 18px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.pill-btn:hover { transform: translateY(-1px); }
.pill-btn--accent {
  background: #FF4D6D;
  color: #fff;
  box-shadow: 0 10px 24px 0 rgba(255, 77, 109, 0.29);
}
.pill-btn--accent:hover { background: var(--gold); }
.pill-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.pill-btn--danger {
  border-color: #FF4D6D;
  color: #FF4D6D;
}
.pill-btn--danger:hover {
  background: #FF4D6D;
  color: #fff;
}

.reset-box {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.reset-btn {
  border: 1px solid #DDE1E7;
  background: transparent;
  color: #14161B;
  padding: 10px 18px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
}

.generate-video-btn {
  margin-top: 4px;
  border: 1px solid #DDE1E7;
}

/* ---------------------------------------------------------------
   Editor layout
--------------------------------------------------------------- */
.editor {
  display: grid;
  grid-template-columns: 300px 1fr 330px;
  gap: 0;
  min-height: calc(100vh - 76px);
}
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } }

.side {
  padding: 24px 20px;
  border-right: 1px solid #F0F2F5;
  overflow-y: auto;
  background-color: #FFFFFF;
}
.side--right {
  border-right: none;
  border-left: 1px solid var(--line);

  /* Fixed height + column layout so tabs stay pinned and only
     the active panel scrolls inside this fixed box. */
  height: calc(120vh - 140px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  padding-bottom: 0px;
}

.side__title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  color: rgba(36,27,47,0.55);
  margin: 22px 0 10px;
}
.side__title:first-child { margin-top: 0; }

/* ---------------------------------------------------------------
   Tabs
--------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
}

.tab {
  background: none;
  border: 1px solid #DDE1E7;
  padding: 10px 20px;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 12px;
  color: rgba(36,27,47,0.5);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  border-radius: 100px;
}
.tab:hover { color: var(--ink); }
.tab.is-active {
  background-color: #14161B;
  border-radius: 100px;
  color: #FFFFFF;
  padding: 0px 20px;
}

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.subtabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.subtab {
  background: rgba(36,27,47,0.06);
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.subtab:hover { background: rgba(36,27,47,0.12); }
.subtab.is-active { background: var(--ink); color: #fff; }

.subpanel { display: none; }
.subpanel.is-active { display: block; }

/* ---------------------------------------------------------------
   Right sidebar: fixed-height box.
   - Tabs stay pinned at the top.
   - Only the active panel scrolls internally.
   - Scrollbar is hidden (still scrollable by wheel/touch/keyboard).
--------------------------------------------------------------- */
.side--right .tabs {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 1;
  background: #FFFFFF;
}

.side--right .tab-panel.is-active {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.side--right .tab-panel.is-active::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* ---------------------------------------------------------------
   Swatch grids
--------------------------------------------------------------- */
.swatch-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 6px;
}
.swatch-list:empty::after {
  content: "Nothing here yet.";
  grid-column: 1 / -1;
  font-size: 12px;
  color: rgba(36,27,47,0.45);
  padding: 6px 0;
}

.swatch {
  border: 1px solid #ECEEF2;
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  background: #FBFCFD;
  cursor: pointer;
}
.swatch img { width: 100%; height: 100%; object-fit: cover; }
.swatch.is-active { border-color: var(--gold); }

/* ---------------------------------------------------------------
   Upload
--------------------------------------------------------------- */
.upload-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.upload-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: #FBFCFD;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: rgba(36,27,47,0.65);
  text-align: center;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.upload-drop:hover,
.upload-drop.is-dragover {
  border-color: rgba(15, 181, 166, 0.5);
  background: rgba(15, 181, 166, 0.01);
  color: var(--ink);
}
.upload-drop input[type="file"] { display: none; }

.upload-status {
  margin: 0;
  font-size: 12px;
  min-height: 16px;
  color: rgba(36,27,47,0.6);
}
.upload-status.is-error { color: #d24b4b; }
.upload-status.is-ok    { color: #2a8c5a; }

/* ---------------------------------------------------------------
   Canvas
--------------------------------------------------------------- */
.canvas-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 24px 24px 48px;
  background: var(--paper);
}

.canvas-topbar {
  width: min(360px, 92vw);
  display: flex;
  justify-content: center;
}
.video-length {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.video-length input[type="range"] {
  accent-color: #0FB5A6;
  width: 140px;
}
.video-length output {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink);
  min-width: 30px;
  text-align: right;
}
.card--canvas {
  width: min(360px, 80vw);
  box-shadow: var(--shadow);
  opacity: 1 !important;
  animation: none !important;
}

/* Fixed art ratio so the canvas has a box even before the bg image
   loads, and so absolutely positioned draggables have bounds. */
.canvas-wrap .card__art {
  aspect-ratio: 3 / 4;
  min-height: 630px;
}

.card--canvas [data-draggable] {
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform: rotate(var(--rot, 0deg));
  transform-origin: center;
}
.card--canvas [data-draggable]:active { cursor: grabbing; }

.card--canvas [data-draggable].is-selected {
  outline: 1.5px dashed rgba(242,169,59,0.85);
  outline-offset: 3px;
}

.canvas-hint {
  margin: 0;
  font-size: 13px;
  color: rgba(36,27,47,0.55);
}

/* Global resize handle — positioned absolutely over the currently
   selected draggable element. */
.resize-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.28);
  cursor: nwse-resize;
  z-index: 20;
  touch-action: none;
}

/* ---------------------------------------------------------------
   Form fields
--------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(36,27,47,0.7);
}

.field input[type="text"],
.field textarea,
.field select {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #FBFCFD;
}
.field textarea { resize: vertical; }

.field input[type="range"] { accent-color: var(--gold); }
.field input[type="color"] {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px;
  background: #fff;
}

/* Field focus — gray border + soft gray ring instead of the
   default blue outline browsers paint on focused inputs. */
.field input[type="text"]:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: #e5e7ea;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.25);
}
.field input[type="range"]:focus-visible,
.field input[type="color"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.35);
}
.field input[type="color"]:focus {
  outline: none;
  border-color: #9ca3af;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.25);
}

/* ---------------------------------------------------------------
   Default idle motion for the canvas elements.
   Mirrors the always-on float/wiggle/bob/soft loop that the
   template-gallery cards use so a template feels the same the
   moment it lands on the canvas — before the visitor touches the
   "Animation" dropdown for any element.

   Each keyframe layers its motion on top of rotate(var(--rot, 0deg))
   so it doesn't fight the drag/rotate feature.

   Placed BEFORE the per-element "chosen from the options bar" rules
   below: both target the same elements at equal specificity, so
   source order decides the winner — an explicit
   anim-pulse/anim-float/anim-wiggle/anim-spin pick always overrides
   this default.
--------------------------------------------------------------- */
@keyframes canvasProfileFloat {
  0%, 100% { transform: rotate(var(--rot, 0deg)) translateY(0)    scale(1);    }
  50%      { transform: rotate(var(--rot, 0deg)) translateY(-6px) scale(1.035); }
}
@keyframes canvasStickerWiggle {
  0%, 100% { transform: rotate(calc(var(--rot, 0deg) - 5deg)) translateY(0);    }
  50%      { transform: rotate(calc(var(--rot, 0deg) + 5deg)) translateY(-5px); }
}
@keyframes canvasNameBob {
  0%, 100% { transform: rotate(var(--rot, 0deg)) translateY(0);    }
  50%      { transform: rotate(var(--rot, 0deg)) translateY(-4px); }
}
@keyframes canvasMessageSoft {
  0%, 100% { transform: rotate(var(--rot, 0deg)) translateY(0);    opacity: 1;   }
  50%      { transform: rotate(var(--rot, 0deg)) translateY(-2px); opacity: .92; }
}

.card--canvas .card__profile { animation: canvasProfileFloat  3.4s ease-in-out infinite; }
.card--canvas .card__sticker { animation: canvasStickerWiggle 3.8s ease-in-out .4s infinite; }
.card--canvas .card__name    { animation: canvasNameBob       3.1s ease-in-out .8s infinite; }
.card--canvas .card__message { animation: canvasMessageSoft   3.6s ease-in-out 1.2s infinite; }

/* Freeze the idle loop while an element is selected/dragged so the
   resize handle (positioned via getBoundingClientRect on select)
   doesn't drift away from a moving target. */
.card--canvas [data-draggable].is-selected {
  animation-play-state: paused;
}

/* ---------------------------------------------------------------
   Per-element animations (chosen from the options bar)
--------------------------------------------------------------- */
@keyframes optPulse {
  0%, 100% { transform: rotate(var(--rot, 0deg)) scale(1); }
  50%      { transform: rotate(var(--rot, 0deg)) scale(1.12); }
}
@keyframes optFloat {
  0%, 100% { transform: rotate(var(--rot, 0deg)) translateY(0); }
  50%      { transform: rotate(var(--rot, 0deg)) translateY(-12px); }
}
@keyframes optWiggle {
  0%, 100% { transform: rotate(calc(var(--rot, 0deg) - 8deg)); }
  50%      { transform: rotate(calc(var(--rot, 0deg) + 8deg)); }
}
@keyframes optSpin {
  from { transform: rotate(var(--rot, 0deg)); }
  to   { transform: rotate(calc(var(--rot, 0deg) + 360deg)); }
}

.card--canvas .anim-pulse  { animation: optPulse  1.4s ease-in-out infinite; }
.card--canvas .anim-float  { animation: optFloat  2.6s ease-in-out infinite; }
.card--canvas .anim-wiggle { animation: optWiggle 1.8s ease-in-out infinite; }
.card--canvas .anim-spin   { animation: optSpin   4s   linear      infinite; }

/* ---------------------------------------------------------------
   Element options bar
--------------------------------------------------------------- */
.element-options {
  width: min(560px, 92vw);
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(36,27,47,0.07);
}

.element-options__hint {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 400;
  color: #9AA1AC;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.element-options__hint span { color: var(--ink); }

.element-options__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 640px) { .element-options__grid { grid-template-columns: 1fr; } }

.opt {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: rgba(36,27,47,0.7);
}
.opt input[type="range"] { accent-color: var(--gold); width: 100%; }
.opt select {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.element-options__actions {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
.element-options__actions .pill-btn {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 400;
  font-family: 'Plus Jakarta Sans', sans-serif;
  border: 1px solid #DDE1E7;
}

/* ---------------------------------------------------------------
   Header cluster: video length + generate button, right-aligned
--------------------------------------------------------------- */
.header-video-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: space-between;
  background-color: #FFFFFF;
  padding: 5px 10px 5px 20px;
}
.top-bar__tag {
  color: #7B838F;
  font-size: 12px;
  font-weight: 400;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.header-video-controls .video-length {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(36,27,47,0.7);
  background: #fff;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.header-video-controls .video-length span {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 400;
  color: #616977;
}
.header-video-controls .video-length output, span {
  font-variant-numeric: tabular-nums;
  min-width: 30px;
  text-align: right;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 400;
  color: #616977;
}

/* On small screens, stack the header controls */
@media (max-width: 720px) {
  .top-bar--slim { flex-wrap: wrap; }
  .header-video-controls { width: 100%; justify-content: flex-start; }
}

/* ---------------------------------------------------------------
   Range inputs — track #EEF0F3, thumb + fill #FF4D6D
--------------------------------------------------------------- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  outline: none;
  background: #EEF0F3; /* fallback, JS overrides this for the fill */
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: transparent;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FF4D6D;
  cursor: pointer;
  margin-top: -6px;
  box-shadow: 0 0 0 3px rgba(255, 77, 109, 0.15);
  position: relative;
  z-index: 2;
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: #EEF0F3;
}

input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 3px;
  background: #FF4D6D;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: #FF4D6D;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(255, 77, 109, 0.15);
}

/* ---------------------------------------------------------------
   Confetti overlay for the editor canvas.
   The <canvas class="card__confetti"> is created by customize.js
   and appended to #canvasArt. z-index: 1 → below the stack
   (.card__stack is z-index: 2), above the background image.
   pointer-events:none so drags and clicks pass through.
--------------------------------------------------------------- */
.card--canvas .card__confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 100%);
}
@media (prefers-reduced-motion: reduce) {
  .card--canvas .card__confetti { display: none; }
}

.cta {
  padding: 100px;
  background-color: #FFFFFF;
}

/* ---------------------------------------------------------------
   On-load animations for the editor page.
   All effects use `both` fill mode so the final state persists
   after the animation completes — no flicker, no flash.
--------------------------------------------------------------- */
@keyframes editorSlideDown {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes editorSlideInLeft {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes editorSlideInRight {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes editorZoomIn {
  from { opacity: 0; transform: scale(.94) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes editorFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes editorFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.header-video-controls {
  animation: editorSlideDown .55s cubic-bezier(.4, 0, .2, 1) .12s both;
}
.side--left {
  animation: editorSlideInLeft .55s cubic-bezier(.4, 0, .2, 1) .2s both;
}
.side--right {
  animation: editorSlideInRight .55s cubic-bezier(.4, 0, .2, 1) .2s both;
}
.canvas-wrap {
  animation: editorZoomIn .7s cubic-bezier(.34, 1.15, .64, 1) .28s both;
}

.side--left .side__title,
.side--left .upload-block,
.side--left .field,
.side--left .reset-box {
  animation: editorFadeUp .5s ease both;
}
.side--left .side__title:nth-of-type(1)     { animation-delay: .35s; }
.side--left .upload-block                   { animation-delay: .42s; }
.side--left .side__title:nth-of-type(2)     { animation-delay: .5s;  }
.side--left .field:nth-of-type(1)           { animation-delay: .55s; }
.side--left .field:nth-of-type(2)           { animation-delay: .6s;  }
.side--left .field:nth-of-type(3)           { animation-delay: .65s; }
.side--left .field:nth-of-type(4)           { animation-delay: .7s;  }
.side--left .reset-box                      { animation-delay: .78s; }

.side--right .tab {
  animation: editorFadeUp .45s ease both;
}
.side--right .tab:nth-child(1) { animation-delay: .45s; }
.side--right .tab:nth-child(2) { animation-delay: .5s;  }
.side--right .tab:nth-child(3) { animation-delay: .55s; }

.canvas-hint {
  animation: editorFadeUp .5s ease .8s both;
}
#canvas.card--canvas {
  animation: editorFadeIn .6s ease .4s both !important;
}
.element-options:not([hidden]) {
  animation: editorFadeUp .4s cubic-bezier(.34, 1.4, .64, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .header-video-controls,
  .side--left,
  .side--right,
  .canvas-wrap,
  .canvas-hint,
  #canvas.card--canvas,
  .element-options,
  .side--left .side__title,
  .side--left .upload-block,
  .side--left .field,
  .side--left .reset-box,
  .side--right .tab {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  /* Idle loop + any per-element pick both fall under "animation":
     kill both, but keep the drag rotation (--rot) intact. */
  .card--canvas .card__profile,
  .card--canvas .card__sticker,
  .card--canvas .card__name,
  .card--canvas .card__message {
    animation: none !important;
    transform: rotate(var(--rot, 0deg)) !important;
  }
}

/* ===============================================================
   GENERATE VIDEO MODAL — full-screen on every viewport
=============================================================== */
body.video-modal-open {
  overflow: hidden;
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100vw;
  height: 100vh;
  display: block;
  padding: 0;
}
.video-modal[hidden] { display: none; }

.video-modal__backdrop {
  position: absolute;
  inset: 0;
}

/* ---- Panel: 100% width and height ---- */
.video-modal__panel {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  padding: 40px 32px;
  overflow-y: auto;
  animation: vmPop .32s cubic-bezier(.34, 1.4, .64, 1) both;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Stage: fills the panel, responsive content width ---- */
.video-modal__stage {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 440px;
}
.video-modal__stage[hidden] { display: none; }

/* ---- Typography ---- */
.video-modal__title {
  margin: 0 0 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #14161B;
  text-align: center;
  line-height: 1.3;
}

.video-modal__subtitle {
  margin: 0 0 24px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 400;
  color: #7B838F;
  text-align: center;
  line-height: 1.5;
}

/* ---------------------------------------------------------------
   Circular progress ring
--------------------------------------------------------------- */
.progress-ring {
  position: relative;
  width: clamp(110px, 30vw, 160px);
  height: clamp(110px, 30vw, 160px);
  margin: 4px auto 24px;
  flex: 0 0 auto;
}

.progress-ring__svg {
  width: 100%;
  height: 100%;
  display: block;
}

.progress-ring__track {
  stroke: #EEF0F3;
}

.progress-ring__fill {
  /* r=52 → circumference = 2π·52 ≈ 326.726 */
  stroke-dasharray: 326.726;
  stroke-dashoffset: 326.726;
  stroke: url(#ringGradient);
  transition: stroke-dashoffset .35s cubic-bezier(.4, 0, .2, 1);
}

.progress-ring__pct {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(20px, 5vw, 26px);
  font-weight: 700;
  color: #14161B;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

/* ---------------------------------------------------------------
   Steps
--------------------------------------------------------------- */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #FBFCFD;
  border: 1px solid #EEF0F3;
  border-radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: #4B515A;
  transition: background .25s ease, border-color .25s ease, color .25s ease;
}

.step__label {
  line-height: 1.3;
}

/* Guaranteed-circle tick */
.step__icon {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  aspect-ratio: 1 / 1;
  min-width: 22px;
  min-height: 22px;

  padding: 0;
  margin: 0;
  box-sizing: border-box;

  border-radius: 50%;
  color: transparent;
  font-size: 0;
  line-height: 0;
  overflow: hidden;

  transition: color .2s ease, transform .25s ease;
}

.step__icon svg {
  display: block;
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 auto;
}

.step.is-done {
  background: #FFEDF1;
  border-color: rgba(255, 77, 109, 0.2);
  color: #FF4D6D;
}

.step.is-done .step__icon,
.step.is-done .step__label {
  color: #FF4D6D;
  transform: scale(1.06);
}

/* ---------------------------------------------------------------
   Preview + done stage
--------------------------------------------------------------- */
.video-modal__preview {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 16px;
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid #EEF0F3;
  margin: 0 0 20px;
}

.video-modal__preview video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 60vh;
  background: #FFFFFF;
}

/* The stage gets more breathing room while the video is visible. */
.video-modal__panel.is-showing-video .video-modal__stage {
  max-width: 640px;
}

/* ---------------------------------------------------------------
   Action buttons
--------------------------------------------------------------- */
.video-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

.video-modal__actions .pill-btn {
  padding: 12px 22px;
  font-size: 13.5px;
  border: 1px solid #DDE1E7;
  border-radius: 999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
}

.video-modal__primary {
  border: none !important;
}

.video-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #F0F2F5;
  color: #14161B;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s ease;
}
.video-modal__close:hover { background: #E2E6EC; }

/* ---------------------------------------------------------------
   Animations
--------------------------------------------------------------- */
@keyframes vmFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes vmPop {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ---------------------------------------------------------------
   Responsive tweaks (panel is already 100vw × 100vh everywhere)
--------------------------------------------------------------- */
@media (max-width: 820px) {
  .video-modal__panel {
    padding: 32px 24px;
  }
  .video-modal__stage { max-width: 400px; }
  .video-modal__panel.is-showing-video .video-modal__stage {
    max-width: 100%;
  }
}

@media (max-width: 560px) {
  .video-modal__panel {
    padding: 28px 20px 24px;
  }
  .video-modal__stage {
    max-width: 100%;
    width: 100%;
  }

  .video-modal__title { font-size: 19px; }
  .video-modal__subtitle { font-size: 13px; margin-bottom: 20px; }

  .progress-ring {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
  }
  .progress-ring__pct { font-size: 22px; }

  .step {
    font-size: 13px;
    padding: 11px 13px;
    gap: 10px;
  }

  .video-modal__actions {
    flex-direction: column;
    gap: 8px;
  }
  .video-modal__actions .pill-btn {
    width: 100%;
    min-width: 0;
    padding: 13px 20px;
  }

  .video-modal__preview video {
    max-height: 42vh;
  }
}

@media (max-width: 380px) {
  .video-modal__panel { padding: 22px 16px 20px; }
  .video-modal__title { font-size: 17px; }
  .progress-ring { width: 100px; height: 100px; }
  .progress-ring__pct { font-size: 19px; }
  .step { font-size: 12.5px; }
}

/* ===============================================================
   Music tab — one row per track
   Row border: #ECEEF2       Hover border: #FFC2D0
   Hover bg:   #FFEEF2       Active bg:    #FFF6F8
   Toggle default: bg #F2F4F7 / icon #14161B
   Toggle playing: bg #FF4D6D / icon #FFFFFF
   Accent (title, tick, active border): #FF4D6D
=============================================================== */
.music-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.music-list:empty::after {
  content: "No tracks available.";
  font-size: 12px;
  color: rgba(36,27,47,0.45);
  padding: 6px 0;
}

.music-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid #ECEEF2;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  text-align: left;
}
.music-item:hover {
  background: #FFEEF2;
  border-color: #FFC2D0;
}
.music-item.is-active {
  background: #FFF6F8;
  border-color: #FFC2D0;
  box-shadow: 0 0 0 1px rgba(255, 77, 109, 0.15);
}

/* --- Play / pause button (per track) --- */
.music-item__toggle {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #F2F4F7;
  color: #14161B;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.music-item__toggle:hover {
  transform: translateY(-1px);
}
.music-item__toggle svg {
  display: block;
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.music-item__toggle .music-item__icon-play { margin-left: 2px; }

/* Playing → swap to the pink accent */
.music-item.is-playing .music-item__toggle {
  background: #FF4D6D;
  color: #FFFFFF;
}

/* --- Track title --- */
.music-item__title {
  flex: 0 1 auto;      /* was: 1 1 auto  →  no longer stretches */
  min-width: 0;
  font-weight: 600;
  color: #24272B;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.music-item.is-active .music-item__title { color: #FF4D6D; }

/* --- Tick icon: only visible while this track is playing --- */
.music-item__tick {
  flex: 0 0 auto;
  margin-left: auto;   /* NEW: eats the leftover space */
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: #FF4D6D;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.music-item__tick svg { display: block; width: 16px; height: 16px; }

.music-item.is-playing .music-item__tick {
   opacity: 1;
  transform: scale(1);
}

/* --- Bottom player bar --- */
.music-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid #FFD9E1;
  border-radius: 14px;
}

.music-player__toggle {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: #F2F4F7;
  color: #14161B;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.music-player__toggle:hover:not(:disabled) {
  transform: translateY(-1px);
}
.music-player__toggle:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Playing → pink accent */
.music-player__toggle.is-playing {
  background: #FF4D6D;
  color: #FFFFFF;
}

.music-player__toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.music-player__toggle .icon-play { margin-left: 2px; }

.music-player__info {
  min-width: 0;
  flex: 1 1 auto;
}
.music-player__title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #24272B;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* `hidden` doesn't work on SVG, so we toggle this class instead */
.music-item__toggle svg.is-hidden,
.music-player__toggle svg.is-hidden {
  display: none;
}