/* Shared two-step general composer, with three choices for the lyrics step. */
.general-lyrics-tabs[hidden] { display: none !important; }
.general-lyrics-tabs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-column: 1 / -1;
  gap: 2px;
  width: 100%;
  max-width: 560px;
  margin: 12px auto 20px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 999px;
  background: rgba(31, 108, 65, .06);
  box-shadow: inset 0 1px 2px rgba(16, 82, 46, .08);
  overflow-anchor: none;
}
.general-lyrics-tabs button {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #4b6355;
  font: 500 15px/1.3 var(--font-ui);
  letter-spacing: -.005em;
  cursor: pointer;
  white-space: nowrap;
  transition: color 180ms ease, scale 140ms cubic-bezier(.2,.8,.2,1);
}
.general-lyrics-tabs button:hover,
.general-lyrics-tabs button[aria-selected="true"] { color: #12291c; }
.general-lyrics-tabs:not(.has-thumb) button[aria-selected="true"] { background: #fff; box-shadow: 0 1px 2px #10522e24, 0 6px 14px -8px #10522e59; }
.general-lyrics-tabs button:active:not(:disabled) { scale: .95; }
.general-lyrics-tabs button:disabled { opacity: .45; cursor: not-allowed; }
.general-lyrics-tabs button:focus-visible { outline: 2px solid #079e55; outline-offset: 3px; }
.general-lyrics-tabs .av-segment-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--thumb-w);
  height: var(--thumb-h);
  transform: translate(var(--thumb-x), var(--thumb-y));
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px #10522e24, 0 6px 14px -8px #10522e59;
  transition: transform 260ms cubic-bezier(.2,.8,.2,1), width 260ms cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}
.general-lyrics-tabs .av-segment-thumb.is-instant { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .general-lyrics-tabs button, .general-lyrics-tabs .av-segment-thumb { transition: none; }
  .general-lyrics-tabs button:active:not(:disabled) { scale: none; }
}
body.general-combined-active #song-form .ai-step-choice-group,
body.general-combined-active #song-form .mobile-lyrics-mode,
body.general-combined-active #song-form .lyrics-toggle-block,
body.general-combined-active #song-form #mobile-lyrics-hint-card { display: none !important; }
body.general-dedication-active #song-form .ai-step-hero { display: none !important; }
body.general-combined-active #song-form #advanced-fields,
body.general-combined-active #song-form #wizard-step-lyrics { overflow-anchor: none; }
body.general-combined-active .wizard-progress[data-current-step="ai"]::after { display: none; }
@media (min-width: 861px) {
  body.general-combined-active #song-form #wizard-step-sound .sound-language-card { grid-template-columns: minmax(0, 1fr); }
  body.general-combined-active .sound-language-card > .sound-field-stack { width: 100%; container: language-choices / inline-size; }
  body.general-combined-active .desktop-language-card-grid { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.general-combined-active .language-search-picker-desktop { width: 100%; }
  body.general-combined-active #generator-main-grid > .form-card:not(.generator-intro-active):not([data-wizard-step="sound"]) {
    grid-template-rows: max-content minmax(0, 1fr) max-content;
  }
  body.general-combined-active .form-card:not([data-wizard-step="sound"]) #song-form > #wizard-progress { grid-row: 1; }
  body.general-combined-active .form-card:not([data-wizard-step="sound"]) #song-form > #post-lyrics-fields,
  body.general-combined-active .form-card:not([data-wizard-step="sound"]) #song-form > #wizard-step-lyrics { grid-row: 2; }
  body.general-combined-active .form-card:not([data-wizard-step="sound"]) #song-form > .wizard-footer { grid-row: 3; }
  body.general-combined-active .form-card[data-wizard-step="ai"] #song-form #advanced-fields { margin-top: 0; }
}
@media (max-width: 860px) {
  body.gift-generator-active .form-card.gift-details-step.mobile-form-stage-active #song-form {
    min-height: calc(100dvh - 71px - env(safe-area-inset-bottom)) !important;
    align-content: start;
  }
  /* Short forms still need enough height to scroll the main header out of view. */
  body.general-combined-active .form-card.mobile-form-stage-active #song-form {
    min-height: calc(100dvh - 79px - env(safe-area-inset-bottom));
    align-content: start;
  }
  .general-lyrics-tabs button { min-height: 30px; padding: 0 9px; font-size: clamp(12px, 3.6vw, 14px); font-weight: 400; }
  body:not(.gift-generator-active) #song-form .sound-step-hero {
    display: none !important;
  }
  body:not(.gift-generator-active) #song-form #wizard-progress {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto;
    align-items: stretch;
    justify-items: stretch;
    gap: 2px;
    width: 100%;
    max-width: none;
    min-height: 0;
    margin: 0 0 8px;
    padding: 5px 5px 0;
    border: 1px solid #e6eeed;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 3px 12px #264b3810;
    color: #101735;
    font-family: var(--font-ui);
  }
  body:not(.gift-generator-active) #song-form #wizard-progress[data-step-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body:not(.gift-generator-active) #song-form #wizard-progress::before,
  body:not(.gift-generator-active) #song-form #wizard-progress::after,
  body:not(.gift-generator-active) #song-form .wizard-progress-connector { display: none; }
  body:not(.gift-generator-active) #wizard-progress .wizard-progress-item {
    position: relative;
    display: flex;
    grid-column: auto;
    grid-row: auto;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 47px;
    padding: 3px 3px 6px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: #101735;
    transform: none;
    transition: none;
  }
  body:not(.gift-generator-active) #wizard-progress .wizard-progress-item.hidden { display: none; }
  body:not(.gift-generator-active) #wizard-progress .wizard-progress-item.is-active { border-bottom-color: #08ac56; }
  body:not(.gift-generator-active) #wizard-progress .wizard-progress-index {
    position: static;
    display: grid;
    place-items: center;
    flex: 0 0 25px;
    width: 25px;
    height: 25px;
    min-width: 0;
    min-height: 0;
    border: 1px solid #d7dfec;
    border-radius: 50%;
    color: #152040;
    background: #fff;
    box-shadow: none;
    transform: none;
  }
  body:not(.gift-generator-active) #wizard-progress .wizard-progress-index::before,
  body:not(.gift-generator-active) #wizard-progress .wizard-progress-index::after { display: none; }
  body:not(.gift-generator-active) #wizard-progress .wizard-progress-index-value {
    position: static;
    display: block;
    color: inherit;
    font-size: 13px;
    font-weight: 650;
    line-height: 1;
    transform: none;
  }
  body:not(.gift-generator-active) #wizard-progress :is(.is-active, .is-complete) .wizard-progress-index {
    background: linear-gradient(135deg, #21b366, #02934a);
    color: #fff;
    border-color: #15a558;
  }
  body:not(.gift-generator-active) #wizard-progress .wizard-progress-label {
    position: static;
    width: auto;
    min-width: 0;
    color: #101735;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: -.3px;
    line-height: 1.2;
    text-align: left;
    white-space: normal;
    transform: none;
  }
  body:not(.gift-generator-active) #wizard-progress .wizard-progress-label::after {
    display: block;
    position: static;
    margin-top: 3px;
    color: #7384a5;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.1;
  }
  body:not(.gift-generator-active) #wizard-progress [data-wizard-indicator="sound"] .wizard-progress-label::after { content: 'Alege stilul'; }
  body:not(.gift-generator-active) #wizard-progress [data-wizard-indicator="lyrics"] .wizard-progress-label::after { content: 'Alege sau scrie versurile'; }
  body:not(.gift-generator-active) #wizard-progress [data-wizard-indicator="ai"] .wizard-progress-label::after { content: 'Personalizează piesa'; }

  body:not(.gift-generator-active) .form-card.mobile-form-stage-active #song-form .wizard-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    bottom: 0;
    padding: 10px max(10px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    border-top: 1px solid #edf2ef;
    background: #fffffff5;
    box-shadow: 0 -5px 20px #214e3508;
    backdrop-filter: blur(12px);
  }
  body:not(.gift-generator-active) #song-form .wizard-footer::before,
  body:not(.gift-generator-active) #song-form .wizard-footer::after { display: none; }
  body:not(.gift-generator-active) #song-form .wizard-footer-copy {
    position: relative;
    display: block;
    flex: 1;
    min-width: 0;
    padding: 0 0 0 36px;
    margin: 0;
    color: #101735;
    text-align: left;
  }
  body:not(.gift-generator-active) #song-form .wizard-footer-copy::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 30px;
    height: 30px;
    transform: translateY(-50%);
    border-radius: 50%;
    background: #edfbf4 url('/lucide-music-4.svg') center / 21px no-repeat;
  }
  body:not(.gift-generator-active) #song-form .wizard-footer-copy strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.4px;
    white-space: nowrap;
  }
  body:not(.gift-generator-active) #song-form .wizard-footer-copy span {
    display: block;
    margin-top: 3px;
    font-size: 8px;
    line-height: 1.3;
    color: #7384a5;
  }
  body:not(.gift-generator-active) #song-form .wizard-footer-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: auto;
    margin: 0;
    padding: 0;
    background: none;
    box-shadow: none;
  }
  body:not(.gift-generator-active) #song-form .wizard-footer-actions :is(.primary-button, .secondary-button) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    gap: 7px;
    width: auto;
    min-width: 0;
    min-height: 42px;
    height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
    box-shadow: none;
  }
  body:not(.gift-generator-active) #song-form .wizard-footer-actions .primary-button { min-width: 101px; background: linear-gradient(125deg, #12b865, #049a4a); }
  body:not(.gift-generator-active) #song-form .wizard-footer-actions .secondary-button { color: #14213b; background: #fff; border: 1px solid #e3eae7; }
  body:not(.gift-generator-active) #song-form .wizard-footer-actions .primary-button::after,
  body:not(.gift-generator-active) #song-form #wizard-back::before {
    content: '→';
    flex: none;
    width: auto;
    height: auto;
    background: none;
    -webkit-mask: none;
    mask: none;
    color: inherit;
    font-size: 17px;
  }
  body:not(.gift-generator-active) #song-form #wizard-back::before { content: '←'; }
  body:not(.gift-generator-active) #song-form .wizard-footer-actions .hidden { display: none; }
}
@media (max-width: 359px) {
  .general-lyrics-tabs button { font-size: 11px; }
  body:not(.gift-generator-active) #wizard-progress .wizard-progress-item { gap: 4px; }
  body:not(.gift-generator-active) #wizard-progress .wizard-progress-index { width: 22px; height: 22px; flex-basis: 22px; }
  body:not(.gift-generator-active) #song-form .wizard-footer-copy { padding-left: 0; }
  body:not(.gift-generator-active) #song-form .wizard-footer-copy::before { display: none; }
}

/* General sound choices are always visible on mobile. */
.general-sound-heading { display: none; }
@media (max-width: 860px) {
  body.general-combined-active #wizard-step-sound .mobile-collapsible-card:is([data-mobile-card-key="genre"], [data-mobile-card-key="voice"]) {
    border: 1px solid #e6eeed; border-radius: 18px; background: #fff; box-shadow: 0 5px 20px #264b3808;
  }
  body.general-combined-active #wizard-step-sound .general-sound-heading { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px; }
  body.general-combined-active #wizard-step-sound .general-sound-heading .mobile-collapsible-icon { width: 38px; height: 38px; flex: 0 0 38px; }
  body.general-combined-active #wizard-step-sound .general-sound-heading .mobile-collapsible-title { font-size: 16px; font-weight: 650; color: #101735; }
  body.general-combined-active #wizard-step-sound .mobile-collapsible-card:is([data-mobile-card-key="genre"], [data-mobile-card-key="voice"]) > .mobile-collapsible-trigger { display: none !important; }
  body.general-combined-active #wizard-step-sound .mobile-collapsible-card:is([data-mobile-card-key="genre"], [data-mobile-card-key="voice"]) > .mobile-collapsible-body { display: grid !important; padding: 0 14px 14px; border-top: 0; }
  body.general-combined-active #wizard-step-sound :is(.mobile-genre-style-panel, .mobile-voice-choice-panel) .mobile-style-caption { display: none; }
  body.general-combined-active #wizard-step-sound .mobile-style-chip { border-radius: 12px; border: 1px solid #e5ebed; background: #fff; box-shadow: 0 3px 10px #264b3806; }
  body.general-combined-active #wizard-step-sound .mobile-style-chip.is-selected { border-color: #00a65a; background: linear-gradient(120deg, #0bbd6b, #00964f); color: #fff; }
}

/* Match the gift generator's compact voice card; both use the shared select. */
@media (max-width: 860px) {
  body.general-combined-active #wizard-step-sound .mobile-collapsible-card[data-mobile-card-key="voice"] {
    padding: 11px 10px; border: 1px solid #e7eeec; border-radius: 16px;
    box-shadow: 0 4px 16px #244e3610;
  }
  body.general-combined-active #wizard-step-sound [data-mobile-card-key="voice"] .general-sound-heading { padding: 0 0 10px; }
  body.general-combined-active #wizard-step-sound [data-mobile-card-key="voice"] .general-sound-heading .mobile-collapsible-icon { display: none; }
  body.general-combined-active #wizard-step-sound [data-mobile-card-key="voice"] .mobile-collapsible-title { font-size: 18px; font-weight: 700; letter-spacing: -.5px; }
  body.general-combined-active #wizard-step-sound .mobile-collapsible-card[data-mobile-card-key="voice"] > .mobile-collapsible-body { padding: 0; }
  body.general-combined-active #wizard-step-sound .mobile-voice-chip-row { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 7px; }
  body.general-combined-active #wizard-step-sound .mobile-voice-option {
    display: flex; flex-direction: row; justify-content: center; align-items: center;
    gap: 3px; padding: 7px 3px; min-width: 0; min-height: 40px;
    font-size: clamp(8px, 2.3vw, 11px); font-weight: 400; color: #101735; background: #fff;
    border: 1px solid #e2eae6; border-radius: 9px; box-shadow: 0 3px 9px #203e3108;
  }
  body.general-combined-active #wizard-step-sound .mobile-voice-option-none { display: none; }
  body.general-combined-active #wizard-step-sound .mobile-voice-option > span:first-child { font: inherit; line-height: 1.2; min-width: 0; }
  body.general-combined-active #wizard-step-sound [data-mobile-card-key="language"] :is(.mobile-collapsible-title, .mobile-collapsible-summary) { font: 400 13.3333px Inter, Arial, sans-serif; }
  body.general-combined-active #wizard-step-sound .mobile-voice-outline { order: -1; display: grid; place-items: center; flex: 0 0 16px; width: 16px; height: 23px; color: #08a755; }
  body.general-combined-active #wizard-step-sound .mobile-voice-outline svg { width: 16px; height: 20px; stroke-width: 1.8; }
  body.general-combined-active #wizard-step-sound .mobile-voice-option.is-selected { background: #00b743; border-color: #00b743; color: #fff; }
  body.general-combined-active #wizard-step-sound .mobile-voice-option.is-selected > span { color: #fff; }
}

@media (max-width: 359px) {
  body.general-combined-active #wizard-step-sound .mobile-voice-chip-row { gap: 4px; }
  body.general-combined-active #wizard-step-sound .mobile-voice-option { gap: 3px; padding: 6px 2px; font-size: 8px; }
}

@media (max-width: 860px) {
  body.general-combined-active #wizard-step-sound .mobile-style-chip.is-selected > span { color: #fff; }
}

@media (max-width: 860px) {
  #song-form .language-search-picker-mobile { margin-top: 6px; }
  #song-form .language-search-picker-mobile .language-search-control {
    grid-template-columns: 16px minmax(0, 1fr) 26px;
    gap: 7px; min-height: 38px; padding: 0 6px 0 10px;
    border: 1px solid #e1e8e9; border-radius: 11px;
    background: #fff; box-shadow: none;
  }
  #song-form .language-search-picker-mobile .language-search-input {
    width: 100%; height: 36px; min-height: 0; padding: 0;
    border: 0; border-radius: 0; background: transparent; box-shadow: none;
    font: 400 13px/1.3 var(--font-ui); color: #30485a;
  }
  #song-form .language-search-picker-mobile .language-search-icon { transform: scale(.78); transform-origin: left center; }
  #song-form .language-search-picker-mobile .language-search-toggle { width: 26px; height: 34px; min-height: 0; padding: 0; color: #648477; }
  #song-form .language-search-picker-mobile .language-search-toggle span { width: 7px; height: 7px; }
  #song-form .language-search-picker-mobile:focus-within .language-search-control { border-color: #09a660; box-shadow: 0 0 0 2px #09a66014; }
}

@media (max-width: 860px) {
  body.general-combined-active .form-card.mobile-form-stage-active {
    padding-bottom: calc(71px + env(safe-area-inset-bottom));
  }
}
