/* =====================================================================
   Sound of the Vibe — Creator Flow stylesheet (v6.2.0)
   Light app theme · brand pink→purple gradient · landscape-first capture
   ===================================================================== */

/* ---------- Root + screen container ---------- */

.sovus-root {
  --sovus-grad: linear-gradient(135deg, #FF2D6F, #A435F0);
  --sovus-violet: #6D28D9;
  --sovus-bg: #F4F2F8;
  --sovus-card: #fff;
  --sovus-preview-bg: #F8F4FE;
  --sovus-hair: #E7DFF4;
  --sovus-ink: #1a1726;
  --sovus-ink-2: #2a2740;
  --sovus-body: #5e5872;
  --sovus-muted: #7a748c;
  --sovus-muted-2: #8a849c;
  --sovus-muted-3: #9a93ad;
  --sovus-tag-bg: #EEF1F6;
  --sovus-tag-fg: #475569;
  --sovus-zoom-active: #FFC83A;
  --sovus-gps-dot: #34d27b;
  --sovus-shadow-card: 0 10px 30px rgba(30,20,60,.07);
  --sovus-shadow-card-sel: 0 14px 34px rgba(164,53,240,.22);
  --sovus-shadow-primary: 0 10px 26px rgba(164,53,240,.34);
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  font-family: -apple-system, 'SF Pro Display', system-ui,
    'PingFang HK', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft JhengHei', 'Microsoft YaHei', 'Noto Sans CJK HK',
    sans-serif;
  color: var(--sovus-ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.sovus-screen {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--sovus-bg);
  overflow: hidden;
}

.sovus-screen[hidden] { display: none; }

.sovus-legacy-hooks { position: absolute; left: -9999px; top: -9999px; }

/* =====================================================================
   SCREEN: CHOOSE A CLIP FROM THE ALBUM
   Replaces the recorder's viewfinder. The recorder rotated its chrome 90deg
   because the phone was held sideways to shoot; picking a file is done with
   the phone held normally, so everything here reads upright.
   ===================================================================== */

.sovus-capture {
  background: #0d0a16;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 16px 0;
}

/* Preview stage.
   --sovus-clip-ar is set from the file's own videoWidth/videoHeight in JS, so
   the box always matches the clip: no letterboxing, no cropping, whichever way
   up it was shot. A portrait clip is additionally width-limited from its
   height so it cannot run off the bottom of a phone screen. */
.sovus-up-stage {
  position: relative;
  width: 100%;
  margin: 0 auto;
  aspect-ratio: var(--sovus-clip-ar, 16 / 9);
  max-height: 58vh;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(60% 38% at 40% 44%, rgba(255,217,160,.18) 0%, rgba(255,168,118,.08) 50%, rgba(120,70,90,0) 80%),
    linear-gradient(150deg,#221d33,#332a4a 40%,#2a2138 100%);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sovus-up-stage.is-portrait {
  /* height-led sizing: width follows from the capped height and the real ratio */
  width: calc(58vh * var(--sovus-clip-arnum, 0.5625));
  max-width: 100%;
  max-height: none;
}

.sovus-up-preview {
  width: 100%;
  height: 100%;
  /* contain, not cover: with the box already matching the file this changes
     nothing, but if a ratio ever fails to apply it letterboxes instead of
     silently cutting the sides off the user's shot. */
  object-fit: contain;
  display: block;
  background: #000;
}

.sovus-up-preview[hidden] { display: none; }

.sovus-up-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 20px;
  pointer-events: none;
}

.sovus-up-icon { color: rgba(255,255,255,0.62); line-height: 0; }

.sovus-up-empty-title {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: rgba(255,255,255,0.92);
}

.sovus-up-empty-sub {
  font-size: 12.5px;
  color: rgba(255,255,255,0.55);
  max-width: 240px;
  line-height: 1.45;
}

.sovus-cam-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.18) 0%, transparent 26%, transparent 66%, rgba(0,0,0,0.30) 100%);
  pointer-events: none;
}

/* GPS pill — upright, above the stage */
.sovus-gps-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 12px;
  z-index: 4;
}

.sovus-gps-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  background: rgba(30, 22, 42, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.sovus-gps-pill svg { color: #fff; flex-shrink: 0; }

.sovus-gps-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sovus-gps-dot);
}

/* ---- manual location ---- */

.sovus-gps-wrap { flex-wrap: wrap; gap: 8px; }

.sovus-loc-toggle {
  background: none;
  border: 0;
  padding: 6px 4px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.62);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.sovus-loc-toggle.is-open { color: #fff; }

.sovus-loc-manual {
  margin: 0 0 12px;
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
}
.sovus-loc-manual[hidden] { display: none; }

.sovus-loc-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.72);
  margin-bottom: 5px;
}

.sovus-loc-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 11px;
  padding: 11px 12px;
  /* 16px, or iOS zooms the whole page when the field is focused */
  font-size: 16px;
  font-family: inherit;
  color: #fff;
}
.sovus-loc-input::placeholder { color: rgba(255,255,255,0.35); }
.sovus-loc-input:focus {
  outline: none;
  border-color: #A435F0;
  box-shadow: 0 0 0 3px rgba(164,53,240,0.22);
}

.sovus-loc-help {
  font-size: 11.5px;
  line-height: 1.5;
  color: rgba(255,255,255,0.5);
  margin: 6px 0 12px;
}

.sovus-loc-status {
  font-size: 12px;
  line-height: 1.5;
  border-radius: 10px;
  padding: 9px 11px;
  margin-top: 11px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.82);
}
.sovus-loc-status[hidden] { display: none; }
.sovus-loc-status[data-kind="ok"] {
  background: rgba(52, 210, 123, 0.15);
  border: 1px solid rgba(52, 210, 123, 0.34);
  color: #d6ffe8;
}
.sovus-loc-status[data-kind="error"] {
  background: rgba(255, 86, 86, 0.13);
  border: 1px solid rgba(255, 86, 86, 0.38);
  color: #ffd9d9;
}

.sovus-loc-actions {
  display: flex;
  gap: 9px;
  margin-top: 12px;
}

.sovus-loc-apply,
.sovus-loc-reset {
  flex: 1;
  border-radius: 12px;
  padding: 11px 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 0;
}
.sovus-loc-apply { background: #A435F0; color: #fff; }
.sovus-loc-reset {
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.82);
}

/* ---- file details, notices, actions ---- */

.sovus-file-input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.sovus-up-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
  font-size: 12.5px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 10px;
  word-break: break-word;
}
.sovus-up-meta span { color: rgba(255,255,255,0.5); font-size: 11.5px; }
.sovus-up-meta[hidden] { display: none; }

.sovus-snap-state {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
}
.sovus-snap-state[hidden] { display: none; }
.sovus-snap-state[data-kind="warn"] {
  background: rgba(255, 196, 86, 0.12);
  border-color: rgba(255, 196, 86, 0.36);
}

.sovus-snap-thumb {
  width: 54px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 7px;
  background-color: #000;
  background-size: cover;
  background-position: center;
}

.sovus-snap-text {
  font-size: 11.5px;
  line-height: 1.45;
  color: rgba(255,255,255,0.78);
}
.sovus-snap-state[data-kind="warn"] .sovus-snap-text { color: #ffe9c2; }
.sovus-snap-text b { color: #fff; font-weight: 700; }

.sovus-up-note,
.sovus-up-error {
  font-size: 12.5px;
  line-height: 1.5;
  border-radius: 12px;
  padding: 10px 13px;
  margin-bottom: 12px;
}
.sovus-up-note[hidden], .sovus-up-error[hidden] { display: none; }

.sovus-up-note {
  background: rgba(164, 53, 240, 0.14);
  border: 1px solid rgba(164, 53, 240, 0.34);
  color: rgba(255,255,255,0.88);
}

.sovus-up-error {
  background: rgba(255, 86, 86, 0.13);
  border: 1px solid rgba(255, 86, 86, 0.38);
  color: #ffd9d9;
}

.sovus-up-note code,
.sovus-up-error code {
  font-size: 11.5px;
  background: rgba(0,0,0,0.32);
  padding: 1px 5px;
  border-radius: 5px;
}

.sovus-up-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sovus-pick-btn,
.sovus-use-btn {
  width: 100%;
  border: 0;
  border-radius: 15px;
  padding: 15px 18px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: inherit;
}

.sovus-pick-btn {
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.16);
  color: #fff;
}
.sovus-pick-btn:active { background: rgba(255,255,255,0.15); }

.sovus-use-btn {
  background: linear-gradient(135deg, #A435F0, #7B2FD6);
  color: #fff;
  box-shadow: 0 8px 22px rgba(164, 53, 240, 0.32);
}
.sovus-use-btn:disabled {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.32);
  box-shadow: none;
  cursor: default;
}

/* Bottom block: in the recorder this was absolutely positioned over the live
   viewfinder, alongside a shutter, zoom dial and flip button. There is no live
   feed to overlay here, so it sits in normal flow under the preview, and the
   shutter / zoom / flash / flip rules are gone with the controls themselves. */
.sovus-cap-bottom {
  padding: 16px 0 calc(env(safe-area-inset-bottom, 0px) + 22px);
  z-index: 3;
}

/* =====================================================================
   SCREEN: ANALYZING
   ===================================================================== */

.sovus-analyzing {
  background: linear-gradient(150deg, #1a1428, #3a2c46 30%, #5a3e58 60%, #3a2640 90%);
  color: #fff;
}

.sovus-analyzing::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(16, 12, 26, 0.42);
  pointer-events: none;
}

/* Orb */
.sovus-orb {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  width: 128px;
  height: 128px;
  z-index: 2;
}

.sovus-orb-ring {
  position: absolute;
  inset: -8px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-top-color: rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  animation: sovus-orb-spin 1.6s linear infinite;
}

@keyframes sovus-orb-spin { to { transform: rotate(360deg); } }

.sovus-orb-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #FF6FA3, #A435F0 70%);
  box-shadow: 0 0 60px rgba(164, 53, 240, 0.55);
  animation: sovus-orb-pulse 2.4s ease-in-out infinite;
}

@keyframes sovus-orb-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

.sovus-orb-bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.sovus-orb-bars i {
  width: 4px;
  background: #fff;
  border-radius: 2px;
  animation: sovus-bar 1s ease-in-out infinite;
}

.sovus-orb-bars i:nth-child(1) { height: 24px; animation-delay: 0.0s; }
.sovus-orb-bars i:nth-child(2) { height: 40px; animation-delay: 0.15s; }
.sovus-orb-bars i:nth-child(3) { height: 18px; animation-delay: 0.30s; }
.sovus-orb-bars i:nth-child(4) { height: 34px; animation-delay: 0.45s; }

@keyframes sovus-bar {
  0%, 100% { transform: scaleY(0.6); }
  50%      { transform: scaleY(1.2); }
}

.sovus-analyzing-title {
  position: absolute;
  top: 46%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  z-index: 2;
  padding: 0 28px;
}

.sovus-analyzing-sub {
  position: absolute;
  top: calc(46% + 38px);
  left: 0;
  right: 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.62);
  z-index: 2;
  padding: 0 28px;
}

.sovus-steps {
  position: absolute;
  left: 22px;
  right: 22px;
  top: 62%;
  display: flex;
  flex-direction: column;
  gap: 9px;
  z-index: 2;
}

.sovus-step {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13.5px;
  font-weight: 600;
}

.sovus-step.is-active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 700;
}

.sovus-step-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sovus-gps-dot);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sovus-step-spinner {
  background: transparent;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  animation: sovus-orb-spin 0.9s linear infinite;
}

/* =====================================================================
   SCREEN: RESULTS
   ===================================================================== */

.sovus-results-screen {
  background: var(--sovus-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.sovus-results-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 20px;
}

.sovus-results-head {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 12px;
  background: rgba(244, 242, 248, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.sovus-circle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sovus-ink);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(30, 20, 60, 0.06);
  padding: 0;
  flex-shrink: 0;
}

.sovus-circle-btn:active { transform: scale(0.92); }

.sovus-results-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--sovus-ink);
}

/* Loop clip. The recorder build could pin this to 16:9 with object-fit: cover,
   because every clip it produced was re-encoded onto a fixed 1280x720 canvas.
   An album file has no such guarantee, and cover on a mismatched box centre-
   crops the user's shot — so --sovus-clip-ar is set from the file's real
   videoWidth/videoHeight in JS and the box follows the clip instead.
   A portrait clip is sized from a capped height so it cannot swallow the
   screen and push the song cards out of view. */
.sovus-clip {
  position: relative;
  margin: 0 16px 12px;
  aspect-ratio: var(--sovus-clip-ar, 16 / 9);
  max-height: 46vh;
  border-radius: 18px;
  overflow: hidden;
  background: #1a1428;
}

.sovus-clip.is-portrait {
  width: calc(46vh * var(--sovus-clip-arnum, 0.5625));
  max-width: calc(100% - 32px);
  max-height: none;
  margin-left: auto;
  margin-right: auto;
}

.sovus-clip-vid {
  width: 100%;
  height: 100%;
  /* contain rather than cover: with the box matching the file this is
     identical, but it fails safe to letterboxing instead of cropping. */
  object-fit: contain;
  object-position: center;
  display: block;
  background: #1a1428;
}

.sovus-clip-loop {
  position: absolute;
  bottom: 8px;
  right: 10px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

/* Now-playing card (horizontal) */
.sovus-nowplaying {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 16px 14px;
  background: var(--sovus-card);
  border-radius: 18px;
  padding: 11px 13px;
  box-shadow: 0 6px 18px rgba(30, 20, 60, 0.05);
}

.sovus-np-thumb {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: var(--sovus-grad);
  flex-shrink: 0;
}

.sovus-np-main {
  flex: 1;
  min-width: 0;
}

.sovus-np-kicker {
  font-size: 9px;
  font-weight: 800;
  color: #A435F0;
  letter-spacing: 0.09em;
}

.sovus-np-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--sovus-ink);
  margin: 2px 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sovus-np-sub { display: none; }
.sovus-np-sub[hidden] { display: none; }

.sovus-np-bar {
  height: 3px;
  background: var(--sovus-hair);
  border-radius: 2px;
  overflow: hidden;
}

.sovus-np-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--sovus-grad);
  transition: width 0.15s linear;
}

.sovus-np-time {
  font-size: 11px;
  font-weight: 700;
  color: var(--sovus-body);
  flex-shrink: 0;
}

/* WHAT I SAW */
.sovus-scene {
  margin: 0 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sovus-scene b {
  font-size: 10px;
  font-weight: 800;
  color: #A435F0;
  letter-spacing: 0.09em;
}

.sovus-scene span {
  font-size: 12.5px;
  font-style: italic;
  color: var(--sovus-body);
  line-height: 1.45;
}

/* Section label */
.sovus-section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 6px 16px 10px;
}

.sovus-section-label span {
  font-size: 13px;
  font-weight: 700;
  color: var(--sovus-ink);
}

.sovus-section-label em {
  font-size: 11px;
  font-style: italic;
  color: var(--sovus-muted-2);
}

/* Card list */
.sovus-cards {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- Song card ---------- */

.sovus-card {
  position: relative;
  background: var(--sovus-card);
  border-radius: 26px;
  padding: 14px;
  box-shadow: var(--sovus-shadow-card);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
}

.sovus-card:active { transform: scale(0.995); }

.sovus-card.is-voted {
  box-shadow: var(--sovus-shadow-card-sel);
}

.sovus-card.is-voted::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 28px;
  padding: 2px;
  background: var(--sovus-grad);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
          mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

.sovus-check {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sovus-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(164, 53, 240, 0.4);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.18s, transform 0.18s;
  z-index: 3;
}

.sovus-card.is-voted .sovus-check {
  opacity: 1;
  transform: scale(1);
}

.sovus-card-inner { display: flex; flex-direction: column; gap: 10px; }

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

.sovus-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  flex-shrink: 0;
}

.sovus-mood-chip {
  background: var(--sovus-grad);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  text-transform: lowercase;
}

.sovus-family {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #FFEDD5;
  color: #C2410C;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.sovus-mood {
  font-size: 11px;
  font-style: italic;
  color: var(--sovus-muted);
  text-align: right;
  line-height: 1.4;
  max-width: 48%;
  padding-top: 4px;
}

.sovus-card-body {
  display: flex;
  gap: 12px;
  align-items: center;
}

.sovus-album-art {
  width: 66px;
  height: 66px;
  border-radius: 14px;
  background: linear-gradient(135deg, #d8c5e8, #b89cd8);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  object-fit: cover;
  overflow: hidden;
}

img.sovus-album-art { padding: 0; }

.sovus-track-info { min-width: 0; flex: 1; }

.sovus-track-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--sovus-violet);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sovus-track-artist {
  font-size: 13.5px;
  color: var(--sovus-muted);
  margin-top: 2px;
}

.sovus-genres-row { display: flex; gap: 6px; flex-wrap: wrap; }

.sovus-tag {
  background: var(--sovus-tag-bg);
  color: var(--sovus-tag-fg);
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sovus-reasoning { display: flex; flex-direction: column; gap: 4px; }

.sovus-reasoning b {
  font-size: 10px;
  font-weight: 800;
  color: #A435F0;
  letter-spacing: 0.09em;
}

.sovus-reasoning p {
  margin: 0;
  font-size: 13px;
  font-style: italic;
  color: var(--sovus-body);
  line-height: 1.45;
}

/* Preview panel */
.sovus-preview-panel {
  background: var(--sovus-preview-bg);
  border-radius: 16px;
  padding: 11px 12px;
}

.sovus-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--sovus-body);
}

.sovus-preview-head::before {
  content: '🎧';
  margin-right: 5px;
  font-size: 13px;
}

.sovus-mini-time {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--sovus-muted);
}

.sovus-mini-bar {
  height: 3px;
  background: rgba(164, 53, 240, 0.12);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.sovus-mini-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--sovus-grad);
}

.sovus-card-actions { display: flex; gap: 7px; }

.sovus-preview-btn {
  flex: 1;
  background: var(--sovus-grad);
  color: #fff;
  border: none;
  border-radius: 13px;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.12s;
}

.sovus-preview-btn:active { transform: scale(0.97); }

.sovus-preview-btn.is-playing {
  background: #fff;
  color: var(--sovus-violet);
  border: 1.5px solid var(--sovus-violet);
}

.sovus-media-link {
  flex: 1;
  background: #fff;
  color: var(--sovus-ink);
  border: 1.5px solid var(--sovus-hair);
  border-radius: 13px;
  padding: 9px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.sovus-no-preview {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--sovus-muted-2);
  padding: 11px;
}

/* Card error variant */
.sovus-card-error { background: #fff5f5; }
.sovus-error-note {
  font-size: 12px;
  color: #b91c1c;
  padding: 8px 0;
  font-style: italic;
}
.sovus-error-note code {
  background: rgba(0,0,0,0.05);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}

/* Sticky confirm bar */
.sovus-confirm-bar {
  flex: 0 0 auto;
  padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 14px);
  background: rgba(244, 242, 248, 0.95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 0.5px solid var(--sovus-hair);
  z-index: 2;
}

.sovus-confirm-btn {
  width: 100%;
  background: var(--sovus-grad);
  color: #fff;
  border: none;
  border-radius: 17px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  box-shadow: var(--sovus-shadow-primary);
  transition: transform 0.12s, opacity 0.18s;
}

.sovus-confirm-btn:active { transform: scale(0.98); }

.sovus-confirm-btn:disabled {
  background: #d6d2e0;
  color: #fff;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.85;
}

/* =====================================================================
   SCREEN: CONFIRMED
   ===================================================================== */

.sovus-confirmed {
  min-height: 100vh;
  padding-bottom: 40px;
}

.sovus-confirmed-hero {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 330px;
  background: radial-gradient(120% 90% at 50% 0%, #A435F0 0%, #FF2D6F 55%, #F4F2F8 100%);
  z-index: 0;
}

.sovus-confirmed-inner {
  position: relative;
  z-index: 1;
  padding: calc(env(safe-area-inset-top, 0px) + 36px) 16px 0;
  text-align: center;
}

.sovus-locked-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
  letter-spacing: 0.08em;
}

.sovus-confirmed-title {
  margin: 14px 0 26px;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.15;
}

.sovus-map-card {
  background: var(--sovus-card);
  border-radius: 28px;
  padding: 14px;
  text-align: left;
  box-shadow: 0 14px 40px rgba(30, 20, 60, 0.12);
}

.sovus-song-id {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 13px;
}

.sovus-song-art {
  width: 62px;
  height: 62px;
  border-radius: 13px;
  background: linear-gradient(135deg, #d8c5e8, #b89cd8);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  overflow: hidden;
}

img.sovus-song-art { width: 62px; height: 62px; object-fit: cover; }

.sovus-song-meta { flex: 1; min-width: 0; }

.sovus-song-mood {
  display: inline-block;
  background: var(--sovus-grad);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: lowercase;
}

.sovus-song-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--sovus-violet);
  margin-top: 5px;
}

.sovus-song-artist {
  font-size: 13px;
  color: var(--sovus-muted);
  margin-top: 1px;
}

/* Stylized map + album-cover pin (matches confirmed-drop reference) */
.sovus-map {
  position: relative;
  aspect-ratio: 16 / 13;
  border-radius: 18px;
  overflow: hidden;
  background: #e6e2ee;
  margin-bottom: 14px;
}

/* Road grid drawn with layered gradients */
.sovus-map-tiles {
  position: absolute;
  inset: 0;
  background:
    /* horizontal roads (white) */
    linear-gradient(#fff, #fff) 0 33% / 100% 10px no-repeat,
    linear-gradient(#fff, #fff) 0 66% / 100% 9px no-repeat,
    /* vertical roads (white) */
    linear-gradient(#fff, #fff) 33% 0 / 10px 100% no-repeat,
    linear-gradient(#fff, #fff) 66% 0 / 9px 100% no-repeat,
    /* green park block, top-right */
    linear-gradient(#d4ecc4, #d4ecc4) 70% 12% / 26% 30% no-repeat,
    /* blue water strip, bottom */
    linear-gradient(#c9e0f0, #c9e0f0) 0 86% / 100% 14% no-repeat,
    /* base land */
    linear-gradient(#e6e2ee, #e6e2ee);
}

.sovus-map-pin {
  position: absolute;
  /* sits left-of-center on a road junction, like the reference */
  top: 44%;
  left: 44%;
  transform: translate(-50%, -60%);
  width: 56px;
  height: 66px;
  z-index: 2;
}

.sovus-pin-pulse {
  position: absolute;
  top: 40%;
  left: 50%;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(164, 53, 240, 0.22);
  transform: translate(-50%, -50%);
  animation: sovus-pin-pulse 1.8s ease-out infinite;
}

@keyframes sovus-pin-pulse {
  0%   { transform: translate(-50%, -50%) scale(0.7); opacity: 0.7; }
  100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}

/* Teardrop body */
.sovus-pin-body {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 52px;
  height: 52px;
  background: var(--sovus-grad);
  border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
  border-bottom-left-radius: 50%;
  box-shadow: 0 8px 18px rgba(164, 53, 240, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  /* teardrop point at bottom */
  clip-path: none;
}

.sovus-pin-body::before {
  /* the downward point of the teardrop */
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 20px;
  height: 20px;
  background: var(--sovus-grad);
  transform: translateX(-50%) rotate(45deg);
  border-radius: 0 0 6px 0;
  z-index: -1;
}

.sovus-pin-body::after {
  /* album-art head, clipped into a circle with a white ring */
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d8c5e8, #b89cd8);
  border: 2.5px solid #fff;
  background-size: cover;
  background-position: center;
}

/* When JS provides album art, paint it into the pin head */
.sovus-pin-body.has-art::after {
  background-image: var(--pin-art);
}

.sovus-loc-place {
  font-size: 17px;
  font-weight: 700;
  color: var(--sovus-ink);
  margin-bottom: 8px;
}

.sovus-loc-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 13px;
}

.sovus-loc-row svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.sovus-loc-sub {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--sovus-muted-2);
  line-height: 1.4;
}

.sovus-public-badge {
  align-self: flex-start;
  background: #ECFCF3;
  color: #1F8A5B;
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.sovus-public-badge i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #1FAE6A;
  display: inline-block;
}

.sovus-apple-btn {
  width: 100%;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 13px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  margin-bottom: 8px;
  cursor: pointer;
}

.sovus-share-btn {
  width: 100%;
  background: #fff;
  color: var(--sovus-ink);
  border: 1.5px solid var(--sovus-hair);
  border-radius: 13px;
  padding: 11px;
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.sovus-again-btn {
  margin: 18px auto 0;
  background: none;
  border: none;
  color: #A435F0;
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* =====================================================================
   Small-screen tightening for narrow phones (<= 360px)
   ===================================================================== */
@media (max-width: 360px) {
  .sovus-album-art { width: 56px; height: 56px; border-radius: 12px; }
  .sovus-track-name { font-size: 15px; }
  .sovus-card { padding: 12px; }
  .sovus-confirmed-title { font-size: 22px; }
}

/* ===== FOLDABLE: WHY THIS / WHAT I SAW ===== */
.sovus-reasoning[data-fold], .sovus-scene[data-fold] { position: relative; }
.sovus-fold-toggle {
  box-sizing: border-box; width: calc(100% + 20px); margin: 0 -10px; padding: 8px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 44px; border-radius: 12px; background: transparent; border: 0;
  cursor: pointer; text-align: left; -webkit-tap-highlight-color: transparent; transition: background .15s ease;
}
.sovus-fold-toggle:hover { background: #FAF7FE; }
.sovus-fold-toggle:active { background: #F1EBFB; }
.sovus-fold-toggle:focus-visible { outline: 2px solid #A435F0; outline-offset: 2px; }
.sovus-fold-cta { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; font-size: 13px; font-weight: 700; color: #8a8598; }
.sovus-fold-cta .sovus-fold-chev { color: #A435F0; transition: transform .22s ease; }
.is-open > .sovus-fold-toggle .sovus-fold-cta .sovus-fold-chev { transform: rotate(180deg); }
.sovus-fold-body { position: relative; overflow: hidden; max-height: 2.9em; transition: max-height .22s ease; }
.is-open .sovus-fold-body { max-height: 360px; }
.sovus-fold-body p { margin: 0; }
.sovus-fold-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 1.4em;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff); pointer-events: none; transition: opacity .18s ease; }
.is-open .sovus-fold-fade { opacity: 0; }
.sovus-scene[data-fold] .sovus-fold-body { max-height: 0; }
.sovus-scene[data-fold].is-open .sovus-fold-body { max-height: 120px; }
.sovus-scene[data-fold] .sovus-fold-fade { display: none; }
.sovus-fold-toggle b { pointer-events: none; }

/* ===== STICKY HERO — video + player pinned; body scrolls beneath ===== */
.sovus-hero {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  background: var(--sovus-bg);
  box-shadow: 0 10px 16px -12px rgba(30, 20, 60, 0.22);
}
/* header now rides inside the pinned hero, so drop its own sticky */
.sovus-hero .sovus-results-head {
  position: static;
}

/* =====================================================================
   COVER SCREEN — choose an AI provider, then Start
   First screen in the flow. Everything after Start is unchanged.

   Sizing notes:
   - min-height (not height) matches the other screens and lets the panel
     grow rather than clip.
   - overflow-y:auto overrides .sovus-screen's overflow:hidden so a short
     viewport (landscape phone, split view) scrolls instead of cutting the
     Start button off.
   - clamp() ties padding and type to the viewport, so one rule covers
     a 320px iPhone SE through to the 480px max-width desktop column.
   ===================================================================== */
.sovus-cover {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-left: clamp(18px, 5.5vw, 28px);
  padding-right: clamp(18px, 5.5vw, 28px);
  padding-top: calc(env(safe-area-inset-top, 0px) + clamp(30px, 7vh, 62px));
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(22px, 5vh, 44px));
  background: var(--sovus-bg);
}

/* This plugin has no global border-box reset, so width:100% + padding would
   overflow the screen horizontally. Scoped to the cover so no other screen
   is affected. */
.sovus-cover,
.sovus-cover *,
.sovus-cover *::before,
.sovus-cover *::after { box-sizing: border-box; }

/* ---- top ---- */
.sovus-cover-top { text-align: center; flex: 0 0 auto; }
.sovus-cover-kick {
  font-size: clamp(9.5px, 2.8vw, 11px);
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #A435F0;
}
.sovus-cover-title {
  font-size: clamp(21px, 6.4vw, 28px);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.2;
  margin: clamp(7px, 2vh, 11px) 0 0;
  color: var(--sovus-ink);
}

/* ---- middle: sits centred in whatever space is left ---- */
.sovus-cover-mid { margin: auto 0; width: 100%; flex: 0 0 auto; padding: 18px 0; }

.sovus-cover-label {
  display: block;
  font-size: clamp(9.5px, 2.8vw, 11px);
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--sovus-muted);
  margin-bottom: 9px;
}

.sovus-select-wrap { position: relative; }
.sovus-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding: clamp(13px, 3.6vw, 16px) 42px clamp(13px, 3.6vw, 16px) 16px;
  font-size: 16px;               /* 16px or more, else iOS zooms on focus */
  font-weight: 700;
  font-family: inherit;
  line-height: 1.3;
  color: var(--sovus-ink);
  background: var(--sovus-card);
  border: 1.5px solid var(--sovus-hair);
  border-radius: 14px;
  cursor: pointer;
  text-overflow: ellipsis;
}
.sovus-select:focus-visible,
.sovus-select:focus {
  outline: none;
  border-color: #A435F0;
  box-shadow: 0 0 0 3px rgba(164, 53, 240, .13);
}
.sovus-select-wrap svg {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--sovus-muted);
}

.sovus-cover-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 0 2px;
}
.sovus-lamp {
  width: 12px;
  height: 12px;
  margin-top: 2px;
  border-radius: 50%;
  background: #C3BCD4;
  flex: 0 0 auto;
  transition: background .25s ease, box-shadow .25s ease;
}
.sovus-lamp[data-state="ok"] {
  background: #22C55E;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .15), 0 0 12px 2px rgba(34, 197, 94, .55);
}
.sovus-lamp[data-state="fail"] {
  background: #F43F5E;
  box-shadow: 0 0 0 4px rgba(244, 63, 94, .14);
}
.sovus-lamp[data-state="wait"] {
  background: #FBBF24;
  box-shadow: 0 0 0 4px rgba(251, 191, 36, .16);
  animation: sovus-lamp-pulse 1s ease-in-out infinite;
}
@keyframes sovus-lamp-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }

.sovus-status-text {
  font-size: clamp(12px, 3.3vw, 13px);
  color: var(--sovus-muted);
  line-height: 1.45;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;      /* long API errors can't blow out the layout */
}
.sovus-status-text b { color: var(--sovus-ink); font-weight: 700; }

/* ---- bottom ---- */
.sovus-cover-btm { flex: 0 0 auto; }
.sovus-start-btn {
  width: 100%;
  min-height: 52px;             /* comfortable touch target */
  border: 0;
  border-radius: 16px;
  padding: clamp(15px, 4vw, 18px);
  font-size: clamp(15.5px, 4.2vw, 17px);
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  background: #DDD7E7;
  color: #9990AC;
  transition: background .3s ease, color .3s ease, box-shadow .3s ease, transform .14s ease;
}
.sovus-start-btn:not(:disabled) {
  background: var(--sovus-grad);
  color: #fff;
  box-shadow: var(--sovus-shadow-primary);
}
.sovus-start-btn:not(:disabled):active { transform: scale(.98); }
.sovus-start-btn:disabled { cursor: not-allowed; }

.sovus-cover-hint {
  text-align: center;
  font-size: clamp(11px, 3vw, 12px);
  color: var(--sovus-muted);
  margin-top: 11px;
  min-height: 15px;
}

/* ---- short viewports: landscape phones, split view, small laptops ---- */
@media (max-height: 620px) {
  .sovus-cover { padding-top: calc(env(safe-area-inset-top, 0px) + 22px); }
  .sovus-cover-title { font-size: 20px; }
  .sovus-cover-mid { padding: 14px 0; }
  .sovus-cover-hint { margin-top: 8px; }
}
@media (max-height: 460px) {
  .sovus-cover { justify-content: flex-start; }
  .sovus-cover-mid { margin: 18px 0; }
  .sovus-cover-title { font-size: 18px; margin-top: 5px; }
  .sovus-start-btn { min-height: 46px; padding: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .sovus-lamp[data-state="wait"] { animation: none; }
  .sovus-start-btn, .sovus-lamp { transition: none; }
}
