/* ===== Base Reset & Variables ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ===== Design Tokens =====
   Structural scale shared by every theme (themes.css owns the color
   tokens - --primary, --shadow, --card-bg, etc). Radius/spacing/motion
   values here match what the components already used, just named once
   instead of repeated as magic numbers everywhere. */
:root {
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-pill: 50px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.18s var(--ease);
  --transition-base: 0.3s var(--ease);

  --control-height: 3rem;

  /* Success/error are semantic, not brand colors - kept the same across
     every theme (including the dark ones) so they stay legible instead
     of the previous hardcoded #2e7d32 / #c62828, which were hard to see
     against the deep/dark themes' near-black backgrounds. */
  --status-success: #22a55e;
  --status-error: #ef4444;

  /* Fluid scale (v36): sizes glide between phone and desktop with clamp()
     instead of jumping at a few breakpoints. Breakpoints below only change
     structure (columns, stacking), not sizes. */
  --gutter: clamp(1rem, 0.4rem + 3vw, 2rem);
  --sec-y: clamp(2.5rem, 7vw, 4rem);
  --fs-hero: clamp(2.25rem, 1.2rem + 5.2vw, 5rem);
  --fs-title: clamp(2rem, 1.2rem + 2vw, 2.75rem);
  --fs-script: clamp(2rem, 1.3rem + 2.2vw, 3rem);
}

/* Single consistent keyboard-focus ring for every interactive element.
   :focus-visible only shows for keyboard/assistive-tech use (not mouse
   clicks), and :where() keeps its specificity at zero so any element's
   own, more specific focus style (e.g. the text inputs' box-shadow ring
   below) still wins where one already exists. */
:where(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.5s ease, color 0.5s ease;
}

/* ===== Sections ===== */
.section {
  min-height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(var(--gutter), env(safe-area-inset-top, 0px))
           max(var(--gutter), env(safe-area-inset-right, 0px))
           max(var(--gutter), env(safe-area-inset-bottom, 0px))
           max(var(--gutter), env(safe-area-inset-left, 0px));
  background: var(--gradient-bg);
}

.section.active {
  display: flex;
}

.section-inner {
  max-width: 50rem;
  width: 100%;
  text-align: center;
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--fs-title);
  color: var(--text);
  margin-bottom: 0.5rem;
  scroll-margin-top: 6rem;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.section-subtitle {
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.25rem);
  color: var(--text-light);
  margin-bottom: clamp(1.25rem, 4vw, 2rem);
  text-wrap: balance;
}

/* ===== Hero Section ===== */
#section-hero {
  background: var(--gradient-bg);
  position: relative;
  overflow: hidden;
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 2;
}

.fixed-back-btn {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.fixed-back-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.song-external-tools {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--card-border);
}

.song-search-row {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.song-search-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
}

.btn-compact-sm {
  min-height: 44px;
  padding: 0.5rem 0.95rem;
  font-size: 0.86rem;
  white-space: nowrap;
}

.song-search-results {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.song-search-note {
  font-size: 0.82rem;
  color: var(--text-light);
  padding: 0.2rem 0.1rem;
}

.song-ext-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  text-align: start;
  cursor: pointer;
  font-family: var(--font-body);
}

.song-ext-item:hover {
  border-color: var(--primary);
}

.song-ext-art {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.song-ext-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.song-ext-title {
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-ext-artist {
  font-size: 0.76rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 1.05rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-pill);
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  box-shadow: 0 4px 16px var(--shadow);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--primary);
}

.hero-brand svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.hero-title {
  font-family: var(--font-script);
  font-size: var(--fs-hero);
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.hero-title .script-text {
  display: block;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title .ampersand {
  font-family: var(--font-heading);
  font-size: calc(var(--fs-hero) * 0.66);
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}

.hero-subtitle {
  font-size: clamp(1.05rem, 0.9rem + 0.8vw, 1.5rem);
  color: var(--text-light);
  margin-bottom: clamp(1.75rem, 5vw, 2.5rem);
  max-width: 31.25rem;
  margin-left: auto;
  margin-right: auto;
}

.hero-hearts {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* ===== Buttons ===== */
.btn-primary, .btn-secondary, .btn-copy {
  font-family: var(--font-body);
  font-size: 1rem;
  min-height: var(--control-height);
  padding: 0.85rem 2.5rem;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-base),
    background var(--transition-base), color var(--transition-base), opacity var(--transition-fast);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: var(--gradient);
  color: #ffffff;
  box-shadow: 0 4px 20px var(--shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--shadow-lg);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 3px 12px var(--shadow);
}

.btn-secondary {
  background: transparent;
  color: var(--primary-ink, var(--primary));
  border: 2px solid var(--primary-ink, var(--primary));
}

.btn-secondary:hover {
  background: var(--btn-active-bg, var(--primary));
  border-color: var(--btn-active-bg, var(--primary));
  color: var(--btn-active-fg, #ffffff);
}

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

.btn-copy {
  background: var(--primary);
  color: #ffffff;
  padding: 0.85rem 1.5rem;
}

.btn-copy:hover {
  opacity: 0.9;
}

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

/* Brief affirmation state after a successful copy - toggled by app.js
   alongside the existing "Copied!" text swap, purely visual. */
.btn-copy.copy-success {
  background: var(--status-success);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-copy:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===== Card Grid ===== */
.card-grid {
  --cols: 2;
  --gap: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap);
  max-width: 37.5rem;
  margin: 0 auto;
}

.card-grid > .card {
  flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  min-width: 0;
}

.card {
  position: relative;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-base), border-color var(--transition-base), background var(--transition-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px var(--shadow);
  border-color: var(--primary);
}

.card:active {
  transform: translateY(-2px) scale(0.99);
}

.card.selected {
  border-color: var(--btn-active-bg, var(--primary));
  background: var(--card-hover);
  box-shadow: 0 0 0 1px var(--btn-active-bg, var(--primary)), 0 6px 20px var(--shadow);
}

.card.selected::after {
  content: '\2713';
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--btn-active-bg, var(--primary));
  color: var(--btn-active-fg, #ffffff);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon {
  font-size: clamp(2rem, 1.5rem + 1.5vw, 2.75rem);
}

.card-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* ===== Customize Form ===== */
.customize-form {
  text-align: left;
  max-width: 37.5rem;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.75rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="datetime-local"],
.form-group input[type="number"],
.form-group textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--shadow);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* ===== Photo Upload ===== */
.photo-upload-area {
  position: relative;
  border: 2px dashed var(--card-border);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.photo-upload-area:hover {
  border-color: var(--primary);
}

.photo-upload-area.is-converting {
  opacity: 0.72;
  cursor: wait;
  border-color: var(--primary);
}

.photo-upload-area.is-converting .file-input {
  pointer-events: none;
  cursor: wait;
}

.photo-upload-area.is-converting .photo-placeholder {
  animation: photoConvertPulse 1.2s ease-in-out infinite;
}

@keyframes photoConvertPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-light);
}

.upload-icon {
  font-size: 2rem;
}

.photo-preview {
  position: relative;
  display: inline-block;
}

.photo-preview img {
  max-width: 200px;
  max-height: 200px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid var(--card-border);
}

.btn-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ===== Toggle Group ===== */
.toggle-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.toggle-btn {
  min-height: 46px;
  padding: 0.65rem 0.85rem;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition-base), background var(--transition-base), color var(--transition-base), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.toggle-btn:hover {
  border-color: var(--primary);
}

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

.toggle-btn.active {
  border-color: var(--btn-active-bg, var(--primary));
  background: var(--btn-active-bg, var(--primary));
  color: var(--btn-active-fg, #ffffff);
  font-weight: 700;
  box-shadow: 0 3px 10px var(--shadow);
}

/* ===== Message Preview ===== */
.message-preview {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  font-style: italic;
  color: var(--text-light);
  line-height: 1.7;
  min-height: 80px;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ===== Theme Grid ===== */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}

.theme-swatch {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 0.85rem 0.65rem 0.75rem;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  cursor: pointer;
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-fast);
}

.theme-swatch:hover {
  border-color: var(--primary);
}

.theme-swatch:active {
  transform: scale(0.97);
}

.theme-swatch.active {
  border-color: var(--btn-active-bg, var(--primary));
  box-shadow: 0 0 0 2px var(--btn-active-bg, var(--primary)), 0 6px 16px var(--shadow);
}

.theme-swatch.active::after {
  content: '\2713';
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--btn-active-bg, var(--primary));
  color: var(--btn-active-fg, #ffffff);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.swatch-color {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: block;
}

.swatch-label {
  font-size: 0.8rem;
  color: var(--text);
}

/* ===== Music Toggle ===== */
.music-toggle {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 52px;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
}

.form-group label.switch,
.form-group label.toggle-label {
  margin-bottom: 0;
}

.switch {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--card-border);
  border-radius: 28px;
  transition: 0.3s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: 0.3s;
}

.switch input:checked + .slider {
  background: var(--btn-active-bg, var(--primary));
}

.switch input:checked + .slider::before {
  transform: translateX(22px);
}

/* RTL: the knob travels right-to-left instead. */
html[dir="rtl"] .switch input:checked + .slider::before {
  transform: translateX(-22px);
}

html[dir="rtl"] .slider::before {
  left: auto;
  right: 3px;
}

.toggle-label {
  flex: 1;
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
  cursor: pointer;
}

/* Song choice box (pick + preview a site song) */
.song-choice-box {
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  padding: 0.85rem 1rem;
  margin-top: 0.85rem;
  text-align: center;
}

.song-choice-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 0.65rem;
}

.song-choice-note {
  font-size: 1.1rem;
  flex-shrink: 0;
}

#song-choice-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: italic;
  color: var(--text-light);
  text-align: start;
}

.song-preview-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid var(--primary-ink, var(--primary));
  background: transparent;
  color: var(--primary-ink, var(--primary));
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.song-preview-btn:hover {
  background: var(--btn-active-bg, var(--primary));
  border-color: var(--btn-active-bg, var(--primary));
  color: var(--btn-active-fg, #ffffff);
}

.song-preview-btn.playing {
  animation: musicInvite 1.6s ease infinite;
}

#song-choice-picker {
  margin-top: 0.75rem;
  text-align: start;
}

.song-choice-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  background: none;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.song-choice-item:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.song-choice-item.selected {
  border-color: var(--primary);
  background: var(--card-hover);
}

.song-choice-item.selected::after {
  content: '\2713';
  margin-inline-start: auto;
  color: var(--primary-ink, var(--primary));
  font-weight: 700;
}

.song-choice-item .song-play-icon {
  font-size: 1.1rem;
  flex: 0 0 auto;
}

.song-choice-item .song-choice-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Form Actions ===== */
.form-actions {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0.85rem;
  margin-top: 2rem;
  direction: ltr;
}

.form-actions > button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

@media (min-width: 600px) {
  .form-actions > button {
    min-width: 155px;
  }
}

/* ===== Preview Frame ===== */
.preview-frame {
  max-width: 31.25rem;
  margin: 0 auto 2rem;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 10px 40px var(--shadow);
  background: var(--card-bg);
}

.preview-content {
  min-height: 400px;
  padding: 2rem;
  background: var(--gradient-bg);
}

/* ===== Share Box ===== */
.share-box {
  max-width: 34rem;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.share-link-container {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0;
}

.tinyurl-box {
  margin-bottom: 1.5rem;
  padding: 1rem 1.1rem;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  text-align: start;
}

.tinyurl-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.55rem;
}

.tinyurl-input-row {
  display: flex;
  align-items: center;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  background: var(--bg);
  overflow: hidden;
  direction: ltr;
}

.tinyurl-input-row:focus-within {
  border-color: var(--primary);
}

.tinyurl-prefix {
  padding: 0.7rem 0.65rem 0.7rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-light);
  background: rgba(0, 0, 0, 0.04);
  border-right: 1px solid var(--card-border);
  white-space: nowrap;
  user-select: none;
}

.tinyurl-alias-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  padding: 0.7rem 0.8rem;
  direction: ltr;
  text-align: left;
}

.tinyurl-actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

.btn-compact {
  min-height: 46px;
  padding: 0.6rem 1.15rem;
  font-size: 0.9rem;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.tinyurl-status {
  margin-top: 0.55rem;
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.4;
}

.tinyurl-status.is-ok {
  color: #1b7f44;
  font-weight: 600;
}

.tinyurl-status.is-err {
  color: #c62828;
  font-weight: 600;
}

.tinyurl-status.is-info {
  color: var(--primary-ink, var(--primary));
}

.share-link {
  flex: 1;
  padding: 0.85rem 1rem;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--card-bg);
  color: var(--text);
  /* URLs are always LTR, even on the Arabic (RTL) share screen. */
  direction: ltr;
  text-align: left;
}

html[dir="rtl"] .share-link {
  text-align: right;
}

.share-qr {
  margin: 0.25rem 0 0;
  padding: 1.35rem 1.25rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.share-qr img {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: 24px;
  border: 2px solid var(--card-border);
  background: #ffffff;
  padding: 6px;
  box-shadow: 0 12px 32px var(--shadow);
  image-rendering: auto;
}

.qr-download {
  display: inline-block;
  margin-top: 0;
  font-size: 0.9rem;
  color: var(--primary-ink, var(--primary));
  text-decoration: underline;
  cursor: pointer;
}

.share-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* ===== Photos Grid ===== */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
  gap: 1rem;
}

.add-photo-wrap {
  text-align: center;
  margin-top: 0.75rem;
}

.photo-slot {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.photo-text-input {
  width: 100%;
  padding: 0.75rem 0.75rem;
  min-height: 44px;
  box-sizing: border-box;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  background: var(--card-bg);
  color: var(--text);
  text-align: center;
  transition: border-color 0.3s ease;
}

.photo-url-input {
  width: 100%;
  padding: 0.75rem 0.75rem;
  min-height: 44px;
  box-sizing: border-box;
  border: 1px dashed var(--card-border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  background: var(--bg-alt);
  color: var(--text);
  text-align: center;
  transition: border-color 0.3s ease;
}

.photo-url-input:focus {
  outline: none;
  border-color: var(--primary);
  border-style: solid;
}

.photo-url-input::placeholder {
  color: var(--text-light);
  font-style: italic;
}

.photo-url-status {
  display: none;
  font-size: 0.78rem;
  text-align: center;
  font-style: italic;
}

.photo-url-status.status-ok {
  color: var(--status-success);
}

.photo-url-status.status-bad {
  color: var(--status-error);
}

.gallery-picker {
  position: relative;
  border: 2px solid var(--card-border);
  border-radius: 12px;
  background: var(--card-bg);
  padding: 1rem;
  margin-bottom: 1rem;
}

.gallery-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

.photo-text-input:focus {
  outline: none;
  border-color: var(--primary);
}

.photo-text-input::placeholder {
  color: var(--text-light);
  font-style: italic;
}

.photo-slot .photo-upload-area {
  width: 100%;
  height: 200px;
  min-height: 200px;
  padding: 0.5rem;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.photo-slot .photo-preview {
  width: 100%;
  height: 100%;
}

.photo-slot .photo-preview img {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border: none;
  border-radius: 10px;
  display: block;
}

.photo-slot .btn-remove {
  top: 4px;
  right: 4px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  font-size: 1rem;
  line-height: 1;
}

.form-hint {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.5rem;
  font-style: italic;
}

/* ===== Recipient View (Scrolling Page) ===== */
.recipient-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  scroll-behavior: smooth;
  scroll-padding-bottom: 7rem;
}

.recipient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* Recipient Sections */
.recipient-section {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sec-y) var(--gutter);
  box-sizing: border-box;
  text-align: center;
}

/* Hero Section */
.recipient-hero-section {
  min-height: 100vh;
  background: transparent;
}

.recipient-hero-content {
  text-align: center;
  max-width: 37.5rem;
  width: 100%;
  margin: 0 auto;
}

.recipient-main-photo {
  margin-bottom: 2rem;
  position: relative;
}

/* Candlelight halo behind the keepsake photo. */
.recipient-main-photo::before {
  content: "";
  position: absolute;
  inset: -28px;
  background: radial-gradient(closest-side, var(--shadow-lg), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.recipient-main-photo img {
  position: relative;
  z-index: 1;
  width: clamp(9.5rem, 22vw + 3.5rem, 15rem);
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--accent);
  box-shadow: 0 10px 40px var(--shadow-lg);
}

/* Photo Captions */
.photo-caption {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-light);
  font-style: italic;
  margin-top: 1rem;
  text-align: center;
  animation: fadeInUp 0.7s ease 0.7s both;
}

.gallery-item-text {
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  text-align: center;
  padding: 0.75rem 0.75rem;
  background: var(--card-bg);
  border-top: 1px solid var(--card-border);
  animation: fadeIn 0.6s ease 0.35s both;
}

.recipient-greeting {
  font-family: var(--font-script);
  font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.75rem);
  overflow-wrap: anywhere;
  text-wrap: balance;
  margin-bottom: 2rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
}

.recipient-scroll-hint {
  margin-top: 3rem;
  color: var(--text-light);
  font-size: 0.9rem;
  opacity: 0.7;
}

.scroll-arrow {
  font-size: 1.5rem;
  margin-top: 0.5rem;
}

/* Birthday Cake Section */
.recipient-cake-section {
  min-height: 100vh;
  padding-bottom: 5.5rem;
  background: rgba(0, 0, 0, 0.01);
}

.cake-wrap {
  text-align: center;
  max-width: 35rem;
  width: 100%;
  margin: 0 auto;
}

.cake-heading {
  font-family: var(--font-script);
  font-size: var(--fs-script);
  margin-bottom: 0.25rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cake-sub {
  font-size: 0.95rem;
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 1.5rem;
}

.cake-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  position: relative;
  /* One variable scales the whole cake: 210px on narrow phones up to 272px. */
  --cake-w: clamp(13rem, 62vw, 17rem);
  padding: 1.75rem 1rem 1.25rem;
}

/* Warm studio candlelight halo behind the cake — dims gently once candles are out */
.cake-scene::before {
  content: "";
  position: absolute;
  top: 44%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(calc(var(--cake-w) * 1.56), 94vw);
  height: calc(var(--cake-w) * 1.56);
  background: radial-gradient(closest-side, rgba(255, 240, 210, 0.85), rgba(255, 224, 236, 0.42) 55%, transparent 76%);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.8s ease;
}

.cake-scene.all-out::before {
  opacity: 0.35;
}

/* Soft realistic table shadow under the pedestal plate */
.cake-scene::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  width: calc(var(--cake-w) * 1.12);
  height: calc(var(--cake-w) * 0.11);
  background: radial-gradient(ellipse at center, rgba(45, 14, 26, 0.28), rgba(45, 14, 26, 0.08) 55%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}

.candles-row {
  display: flex;
  gap: clamp(0.1rem, 2vw, 0.95rem);
  align-items: flex-end;
  margin-bottom: -6px;
  z-index: 3;
}

.candle {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 40px 14px 8px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  scroll-margin: 1rem;
  touch-action: manipulation;
  --candle-h: 62px;
}

/* Subtle organic height variation across the 5 candles */
.candle:nth-child(1) { --candle-h: 56px; }
.candle:nth-child(2) { --candle-h: 62px; }
.candle:nth-child(3) { --candle-h: 67px; }
.candle:nth-child(4) { --candle-h: 61px; }
.candle:nth-child(5) { --candle-h: 57px; }

.candle .stick {
  display: block;
  width: 13px;
  height: var(--candle-h);
  margin: 0 auto;
  border-radius: 6px 6px 3px 3px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.58) 0%, rgba(255, 255, 255, 0.05) 42%, rgba(90, 25, 48, 0.16) 100%),
    repeating-linear-gradient(135deg, #fffdf9 0 6px, #f7bfd2 6px 9px, #d9b252 9px 11px);
  box-shadow: 0 3px 8px rgba(45, 14, 26, 0.18), inset 0 2px 3px rgba(255, 255, 255, 0.9);
  position: relative;
}

/* Slight melted wax lip at the top of each candle */
.candle .stick::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 5px;
  border-radius: 999px;
  background: radial-gradient(ellipse at 50% 35%, #fffef9 0%, #f5e5cb 100%);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.12);
}

.candle .wick {
  position: absolute;
  bottom: calc(8px + var(--candle-h));
  left: 50%;
  width: 2.2px;
  height: 9px;
  border-radius: 2px;
  background: linear-gradient(180deg, #1b1210 0%, #4b3832 100%);
  transform: translateX(-50%);
}

/* Glowing orange ember tip right after blow-out */
.candle .wick::after {
  content: "";
  position: absolute;
  top: -2px;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff3a1 0%, #ff7315 55%, #b82500 100%);
  opacity: 0;
  transform: translateX(-50%);
  pointer-events: none;
}

.candle.out .wick::after {
  animation: emberCool 1.85s ease-out forwards;
}

.candle .flame {
  position: absolute;
  bottom: calc(8px + var(--candle-h) + 7px);
  left: 50%;
  width: 16px;
  height: 27px;
  transform: translateX(-50%);
  transform-origin: 50% 95%;
  background: radial-gradient(ellipse at 50% 72%, #fffbe0 0%, #ffd94a 36%, #ff9324 68%, rgba(255, 92, 20, 0.88) 92%, transparent 100%);
  border-radius: 50% 50% 50% 50% / 68% 68% 32% 32%;
  box-shadow:
    0 0 12px 4px rgba(255, 185, 65, 0.55),
    0 0 32px 12px rgba(255, 140, 40, 0.24);
  animation: flameFlicker 1.1s ease-in-out infinite;
}

/* Staggered organic flicker so the 5 candles never move in robot unison */
.candle:nth-child(2) .flame { animation-delay: -0.25s; }
.candle:nth-child(3) .flame { animation-delay: -0.55s; }
.candle:nth-child(4) .flame { animation-delay: -0.15s; }
.candle:nth-child(5) .flame { animation-delay: -0.4s; }

/* Inner bright core + subtle blue flame base */
.candle .flame::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  width: 7px;
  height: 13px;
  border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
  background: radial-gradient(ellipse at 50% 60%, #ffffff 0%, #fff6c2 60%, rgba(110, 175, 255, 0.55) 100%);
}

/* Wind-gust blow-out phase before full extinguish */
.candle.blowing .flame {
  animation: flameBlowOut 0.23s cubic-bezier(0.3, 0.05, 0.7, 0.9) forwards;
}

.candle.out .flame {
  animation: none;
  transform: translateX(-50%) scale(0);
  opacity: 0;
}

/* Soft curling smoke wisps rising from cooled wick */
.candle .smoke {
  position: absolute;
  bottom: calc(8px + var(--candle-h) + 8px);
  left: 50%;
  width: 10px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(165, 158, 165, 0.58) 0%, rgba(180, 175, 180, 0) 75%);
  filter: blur(2.5px);
  opacity: 0;
  transform: translateX(-50%);
  pointer-events: none;
}

.candle .smoke::before,
.candle .smoke::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 8px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(185, 180, 188, 0.5) 0%, transparent 75%);
  filter: blur(3px);
  opacity: 0;
}

.candle.out .smoke {
  animation: smokeCurl1 2.2s ease-out forwards;
}

.candle.out .smoke::before {
  animation: smokeCurl2 2.4s ease-out 0.14s forwards;
}

.candle.out .smoke::after {
  animation: smokeCurl1 2s ease-out 0.28s forwards;
}

/* Top vanilla-cream tier with piped pearl border and organic glaze drips */
.cake-top {
  width: var(--cake-w);
  height: calc(var(--cake-w) * 0.175);
  position: relative;
  background:
    radial-gradient(ellipse 70% 80% at 50% 6%, rgba(255, 200, 110, 0.32), transparent 68%),
    linear-gradient(180deg, #fffefb 0%, #fcf4e6 55%, #f5e3cc 100%);
  border-radius: 22px 22px 6px 6px;
  box-shadow:
    0 3px 10px rgba(45, 14, 26, 0.14),
    inset 0 3px 5px rgba(255, 255, 255, 0.95),
    inset 0 -3px 6px rgba(190, 145, 100, 0.22);
  z-index: 2;
}

/* Warm candlelight glow fades nicely when candles go out */
.cake-scene.all-out .cake-top {
  background:
    linear-gradient(180deg, #fffefb 0%, #faf0e2 60%, #f1dec6 100%);
}

/* Piped cream pearl rim across the top cake edge */
.cake-top::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -4px;
  height: 10px;
  background-image: radial-gradient(circle at 50% 50%, #fffdf8 4.5px, #ecd7bc 6px, transparent 6.5px);
  background-size: 16px 10px;
  background-repeat: repeat-x;
  z-index: 2;
}

/* Multi-length glossy cream drips over the berry sponge */
.cake-top::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 100%;
  height: 22px;
  background-image:
    radial-gradient(ellipse 9px 14px at 14px 0, #faf0e2 90%, transparent 95%),
    radial-gradient(ellipse 11px 21px at 42px 0, #f6e7d4 90%, transparent 95%),
    radial-gradient(ellipse 8px 12px at 72px 0, #faf0e2 90%, transparent 95%),
    radial-gradient(ellipse 10px 18px at 98px 0, #f6e7d4 90%, transparent 95%);
  background-size: 112px 22px;
  background-repeat: repeat-x;
  filter: drop-shadow(0 3px 3px rgba(80, 20, 42, 0.14));
  z-index: 2;
}

/* Layered rose-velvet sponge cake body with cream filling band and gold ribbon */
.cake-body {
  width: var(--cake-w);
  height: calc(var(--cake-w) * 0.49);
  border-radius: 4px 4px 20px 20px;
  background:
    /* Center cream mousse filling layer */
    linear-gradient(180deg,
      transparent 44%,
      rgba(255, 252, 245, 0.94) 44%,
      rgba(255, 252, 245, 0.94) 51%,
      rgba(244, 224, 198, 0.96) 51%,
      rgba(244, 224, 198, 0.96) 53.5%,
      transparent 53.5%),
    /* Base champagne gold ribbon near bottom */
    linear-gradient(180deg,
      transparent 82%,
      rgba(212, 175, 55, 0.92) 82%,
      rgba(245, 222, 148, 0.95) 86%,
      rgba(190, 148, 42, 0.94) 90%,
      transparent 90%),
    /* 3D cylindrical berry velvet shading (bright left highlight -> rich plum shadow) */
    linear-gradient(90deg,
      rgba(255, 255, 255, 0.28) 0%,
      rgba(255, 255, 255, 0.08) 24%,
      rgba(0, 0, 0, 0) 52%,
      rgba(85, 10, 38, 0.22) 100%),
    linear-gradient(180deg, #f8b4cd 0%, #ee87b0 38%, #dc5b90 74%, #c24278 100%);
  box-shadow:
    inset 0 -16px 26px rgba(95, 15, 45, 0.24),
    inset 0 6px 10px rgba(255, 255, 255, 0.22),
    0 12px 26px rgba(60, 18, 35, 0.22);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* Soft studio specular sheen across cylinder curve */
.cake-body::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 12%;
  width: 20%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.04));
  pointer-events: none;
}

/* Glossy porcelain pedestal plate with champagne gold rim */
.cake-plate {
  width: calc(var(--cake-w) * 1.28);
  height: calc(var(--cake-w) * 0.098);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 34%, #ffffff 0%, #f5efe4 58%, #dfd3bf 100%);
  margin-top: -5px;
  box-shadow:
    0 0 0 2.5px rgba(212, 175, 55, 0.58),
    inset 0 2px 5px rgba(255, 255, 255, 0.9),
    0 12px 26px rgba(45, 14, 26, 0.22);
  position: relative;
  z-index: 0;
}

.wish-text {
  font-family: var(--font-script);
  font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.25rem);
  margin-top: 1.5rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.8s ease both;
}

.cake-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

/* Topic Centerpiece Section (valentine heart / thanks bouquet / surprise gift) */
.recipient-centerpiece-section {
  min-height: auto;
  padding: var(--sec-y) var(--gutter);
  background: rgba(0, 0, 0, 0.01);
}

.centerpiece-wrap {
  max-width: 36.25rem;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  cursor: pointer;
}

.centerpiece-visual {
  font-size: clamp(3.5rem, 2.5rem + 4vw, 6rem);
  line-height: 1.2;
  margin-bottom: 1rem;
  filter: drop-shadow(0 6px 14px var(--shadow-lg));
}

/* Realistic handcrafted centerpiece stages (matching .cake-scene studio craft) */
.centerpiece-visual.centerpiece-art {
  font-size: initial;
  line-height: normal;
  width: clamp(13rem, 58vw, 17.5rem);
  margin: 0 auto 1.25rem;
  padding: 0.75rem 0.5rem 1rem;
  position: relative;
  filter: none;
  user-select: none;
}

.centerpiece-visual.centerpiece-art::before {
  content: "";
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 132%;
  height: 132%;
  background: radial-gradient(closest-side, rgba(255, 244, 246, 0.85), rgba(255, 222, 234, 0.36) 56%, transparent 76%);
  pointer-events: none;
  z-index: 0;
}

.centerpiece-visual.centerpiece-art::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  width: 72%;
  height: 16px;
  background: radial-gradient(ellipse at center, rgba(45, 14, 26, 0.24), transparent 72%);
  pointer-events: none;
  z-index: 0;
}

.cp-scene {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 12px 24px rgba(55, 16, 30, 0.18));
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.centerpiece-visual.beat {
  animation: heartbeat 2.1s ease-in-out infinite;
}

.centerpiece-visual.sway {
  animation: gentleBounce 3.1s ease-in-out infinite;
}

.centerpiece-visual.twinkle {
  animation: showcaseFloat 3.4s ease-in-out infinite;
}

.centerpiece-visual.centerpiece-art.is-tapped .cp-scene {
  transform: scale(1.07) translateY(-4px);
}

/* Hinged keepsake gift box open animation for Just Because */
.cp-box-lid {
  transform-box: fill-box;
  transform-origin: 18% 95%;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.cp-box-glow {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.4s ease, transform 0.5s ease;
}

.centerpiece-visual.is-open .cp-box-lid {
  transform: translateY(-22px) rotate(-13deg);
}

.centerpiece-visual.is-open .cp-box-glow {
  opacity: 1;
  transform: scale(1.25);
}

@media (prefers-reduced-motion: reduce) {
  .centerpiece-visual.beat,
  .centerpiece-visual.sway,
  .centerpiece-visual.twinkle {
    animation: none !important;
  }
}

.centerpiece-heading {
  font-family: var(--font-script);
  font-size: var(--fs-script);
  margin-bottom: 0.25rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.centerpiece-sub {
  font-size: 0.95rem;
  color: var(--text-light);
  font-style: italic;
}

/* Per-topic accents on the gift page */
.recipient-view[data-occasion="valentine"] .recipient-message-card {
  border-color: rgba(230, 57, 70, 0.5);
  box-shadow: 0 10px 44px rgba(230, 57, 70, 0.28);
}

.recipient-view[data-occasion="anniversary"] .recipient-message-card {
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 10px 44px rgba(212, 175, 55, 0.28);
}

.recipient-view[data-occasion="thankYou"] .recipient-message-card {
  border-color: rgba(212, 163, 115, 0.55);
  box-shadow: 0 10px 44px rgba(212, 163, 115, 0.3);
}

.recipient-view[data-occasion="justBecause"] .recipient-message-card {
  border-color: rgba(201, 160, 220, 0.5);
  box-shadow: 0 10px 44px rgba(201, 160, 220, 0.3);
}

/* Creator occasion banner */
.occasion-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  max-width: 26.25rem;
  margin: 0 auto 1.5rem;
  padding: 0.7rem 1.2rem;
  border: 2px solid var(--primary);
  border-radius: var(--radius-pill);
  background: var(--card-bg);
  box-shadow: 0 4px 16px var(--shadow);
  font-weight: 600;
  color: var(--text);
}

.occasion-banner-icon {
  font-size: 1.4rem;
}

/* Gallery Section */
.recipient-gallery-section {
  min-height: auto;
  padding: var(--sec-y) var(--gutter);
  background: rgba(0, 0, 0, 0.01);
}

.recipient-gallery-wrap {
  max-width: 35rem;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.recipient-gallery-heading {
  font-family: var(--font-script);
  font-size: var(--fs-script);
  margin-bottom: 0.25rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.recipient-gallery-sub {
  font-size: 0.95rem;
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 2rem;
}

.recipient-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  max-width: 35rem;
  width: 100%;
}

.recipient-gallery-item {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 5px 20px var(--shadow);
  background: var(--card-bg);
  border: 1px solid transparent;
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
  scroll-margin: 1rem;
}

.recipient-gallery-item.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}

/* Restrained stagger when several photos enter together (capped). */
.recipient-gallery-item:nth-child(3n + 2).visible {
  transition-delay: 0.06s;
}

.recipient-gallery-item:nth-child(3n).visible {
  transition-delay: 0.12s;
}

/* Rich but soft hover / tap interactions on gift photos */
.recipient-gallery-item {
  position: relative;
}

/* Scrapbook memory lane: each photo rests at a slight hand-placed angle. */
.recipient-gallery-item:nth-child(odd) {
  rotate: -0.6deg;
}

.recipient-gallery-item:nth-child(even) {
  rotate: 0.6deg;
}

.recipient-gallery-item.visible:hover,
.recipient-gallery-item.visible:active {
  transform: translateY(-8px) scale(1.01) perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  box-shadow: 0 18px 44px var(--shadow-lg);
  border: 1px solid var(--accent);
}

.recipient-gallery-item.visible:hover img,
.recipient-gallery-item.visible:active img {
  transform: scale(1.09);
  filter: saturate(1.08) brightness(1.03);
}

.recipient-gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 48%, transparent 62%);
  transform: translateX(-130%);
  pointer-events: none;
}

.recipient-gallery-item.visible:hover::after {
  transform: translateX(130%);
  transition: transform 1s ease;
}

html[dir="rtl"] .recipient-gallery-item::after {
  transform: translateX(130%);
}

html[dir="rtl"] .recipient-gallery-item.visible:hover::after {
  transform: translateX(-130%);
}

.recipient-gallery-item .gallery-item-text {
  transition: background 0.4s ease;
}

.recipient-gallery-item.visible:hover .gallery-item-text,
.recipient-gallery-item.visible:active .gallery-item-text {
  background: var(--card-hover);
}

.recipient-gallery-item img {
  width: 100%;
  height: auto;
  max-height: 75vh;
  max-height: 75dvh;
  object-fit: contain;
  display: block;
  background: #000;
  transform: scale(1.03);
  transition: transform 0.9s ease, filter 0.5s ease;
}

.recipient-gallery-item.visible img {
  transform: scale(1);
}

.recipient-gallery-item.full-width {
  grid-column: 1 / -1;
}

.recipient-gallery-item.full-width img {
  height: auto;
  max-height: 75vh;
  max-height: 75dvh;
}

/* Message Section */
.recipient-message-section {
  min-height: 100vh;
  background: rgba(0, 0, 0, 0.02);
}

.recipient-message-card {
  max-width: 37.5rem;
  width: 100%;
  margin: 0 auto;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  padding: clamp(2rem, 6vw, 3rem) clamp(1.25rem, 5vw, 3rem);
  box-shadow: 0 10px 40px var(--shadow);
  box-sizing: border-box;
  position: relative;
}

/* Wax seal: the one memorable flourish on the love letter. */
.recipient-message-card .seal {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%) rotate(-8deg);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%, var(--primary-light), var(--primary) 70%);
  color: #ffffff;
  font-size: 1.4rem;
  line-height: 1;
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 14px var(--shadow-lg), inset 0 2px 4px rgba(255, 255, 255, 0.35), inset 0 -3px 6px rgba(0, 0, 0, 0.25);
}

.recipient-message {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.4rem);
  line-height: 2;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  margin-bottom: 2rem;
  text-align: center;
}

.recipient-footer {
  font-size: 1rem;
  color: var(--text-light);
  font-style: italic;
  text-align: center;
}

/* Details Section */
.recipient-details-section {
  min-height: auto;
  padding: var(--sec-y) var(--gutter);
}

.recipient-details-card {
  max-width: 31.25rem;
  width: 100%;
  margin: 0 auto;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  text-align: center;
  box-sizing: border-box;
}

.recipient-details-card .detail-label {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.recipient-details-card .detail-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--primary-ink, var(--primary));
}

/* Live birthday countdown */
.countdown-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.countdown-box {
  background: var(--card-bg);
  border: 2px solid var(--accent);
  border-radius: 50%;
  width: 78px;
  height: 78px;
  min-width: 78px;
  padding: 0.4rem 0.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px var(--shadow);
}

.countdown-num {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--primary-ink, var(--primary));
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  direction: ltr;
  unicode-bidi: isolate;
}

.countdown-label {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: none;
  letter-spacing: 0.2px;
  margin-top: 0.2rem;
}

/* RTL: keep countdown order + numerals LTR so they never scramble. */
html[dir="rtl"] .countdown-grid {
  direction: ltr;
}

html[dir="rtl"] .countdown-label {
  direction: rtl;
}

/* Closing Section */
.recipient-closing-section {
  min-height: 50vh;
  background: rgba(0, 0, 0, 0.02);
  padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
}

/* Keep keyboard focus visible above fixed pills/bars. */
.recipient-gallery-item,
.recipient-message-card,
.recipient-details-card,
.candle,
.btn-music,
.music-prompt,
#btn-blow,
#btn-relight {
  scroll-margin-bottom: 6rem;
}

.recipient-closing {
  text-align: center;
  max-width: 37.5rem;
  width: 100%;
  margin: 0 auto;
}

.recipient-closing-hearts {
  font-size: 2rem;
  /* shrink-wrap so the heartbeat scale can never push past the screen edge */
  width: fit-content;
  margin-inline: auto;
  margin-bottom: 1rem;
  color: var(--primary);
  animation: heartbeat 1.5s ease infinite;
}

.recipient-closing-text {
  font-family: var(--font-script);
  font-size: 1.5rem;
  color: var(--text-light);
}

/* Language toggle (pinned top-right in EN & AR) */
.lang-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  left: auto;
  bottom: auto;
  /* Above the full-screen gift overlay (z-index 1000) */
  z-index: 1002;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-pill);
  padding: 0 0.85rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  background: var(--card-bg);
  box-shadow: 0 4px 16px var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: border-color 0.3s ease, transform 0.2s ease, color 0.2s ease;
}

.lang-toggle:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Arabic fonts */
html[lang="ar"] {
  --font-heading: 'Aref Ruqaa', 'Playfair Display', serif;
  --font-body: 'Cairo', 'Lora', sans-serif;
  --font-script: 'Aref Ruqaa', 'Dancing Script', serif;
}

/* Arabic script is cursive: letter-spacing disconnects letters, and
   synthetic italics slant a script that has no italic form. */
html[lang="ar"] .btn-primary,
html[lang="ar"] .btn-secondary,
html[lang="ar"] .btn-copy {
  letter-spacing: 0;
}

html[lang="ar"] .message-preview,
html[lang="ar"] .form-hint,
html[lang="ar"] .recipient-message,
html[lang="ar"] .recipient-footer,
html[lang="ar"] .photo-url-input::placeholder,
html[lang="ar"] .photo-text-input::placeholder {
  font-style: normal;
}

html[lang="ar"] .recipient-message,
html[lang="ar"] .message-preview,
html[lang="ar"] textarea,
html[lang="ar"] input[type="text"],
html[lang="ar"] .recipient-greeting,
html[lang="ar"] .recipient-signature,
html[lang="ar"] .recipient-footer,
html[lang="ar"] .gallery-item-text {
  unicode-bidi: plaintext;
}

/* Right-to-left layout fixes */
html[dir="rtl"] .customize-form,
html[dir="rtl"] .custom-relationship-wrap {
  text-align: right;
}

html[dir="rtl"] .btn-remove {
  right: auto;
  left: -8px;
}

html[dir="rtl"] .photo-slot .btn-remove {
  right: auto;
  left: 4px;
}

/* ===== Music Controls ===== */
.music-controls {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  /* Above the full-screen gift overlay (z-index 1000) */
  z-index: 1002;
}

.btn-music {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: var(--gradient);
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 18px var(--shadow-lg);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-music:hover {
  transform: scale(1.08);
}

.btn-music:active {
  transform: scale(0.96);
}

/* Spinning accent ring while the song plays */
.btn-music.playing::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  animation: spin 1.4s linear infinite;
  pointer-events: none;
}

/* Tap-to-play music prompt on the gift page */
.music-prompt {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  border: none;
  border-radius: 50px;
  padding: 0.85rem 1.8rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--gradient);
  box-shadow: 0 4px 20px var(--shadow-lg);
  cursor: pointer;
  animation: musicInvite 2s ease infinite;
}

/* Custom relationship input */
.custom-relationship-wrap {
  max-width: 31.25rem;
  margin: 1.5rem auto 0;
  text-align: left;
}

.custom-relationship-wrap label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 0.95rem;
}

.custom-relationship-row {
  display: flex;
  gap: 0.5rem;
}

.custom-relationship-row input {
  flex: 1;
  padding: 0.85rem 1rem;
  border: 2px solid var(--card-border);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--card-bg);
  color: var(--text);
}

.custom-relationship-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--shadow);
}

.custom-relationship-row .btn-primary {
  padding: 0.85rem 1.5rem;
  white-space: nowrap;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--card-border);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

.loading-text {
  color: #ffffff;
  font-size: 1.1rem;
}

.loading-sub {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  font-style: italic;
  max-width: min(320px, calc(100vw - 2rem));
  text-align: center;
}

/* ===== Responsive (v36) =====
   Sizes are fluid (clamp tokens in :root); the breakpoints below only change
   structure. Verified at 320 / 360 / 390 / 430 / 667 (landscape) / 768 /
   1024 / 1366 / 1920 / 2560 px wide, LTR and RTL. */

/* Cards: centered rows (a short last row stays centered, not left-stuck). */
@media (max-width: 559px) {
  #relationship-grid .card[data-relationship="other"] {
    flex: 1 0 100%;
  }
}

@media (min-width: 560px) {
  .card-grid {
    --cols: 3;
    --gap: 1.2rem;
  }
}

@media (min-width: 900px) {
  #occasion-grid {
    --cols: 4;
    max-width: 860px;
  }
}

@media (min-width: 1024px) {
  #relationship-grid {
    --cols: 4;
    max-width: 860px;
  }
}

/* Theme + photo grids step down consistently with viewport width. */
@media (max-width: 899px) {
  .photos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 599px) {
  .form-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .form-actions > button {
    width: 100%;
  }

  .share-actions {
    flex-direction: column;
  }
}

@media (max-width: 559px) {
  .share-link-container,
  .tinyurl-actions {
    flex-direction: column;
  }

  .tinyurl-alias-input {
    font-size: 1rem;
  }
}

@media (max-width: 479px) {
  .photos-grid {
    grid-template-columns: 1fr;
  }

  .custom-relationship-row {
    flex-direction: column;
  }

  .card {
    padding: 1rem 0.75rem;
  }

  .music-prompt {
    padding: 0.75rem 1.4rem;
    font-size: 0.9rem;
  }

  .recipient-gallery-item img,
  .recipient-gallery-item.full-width img {
    height: auto;
    max-height: 60vh;
    max-height: 60dvh;
  }

  .recipient-details-card {
    padding: 1.5rem 1rem;
  }

  .countdown-grid {
    gap: 0.4rem;
  }

  .countdown-box {
    width: 66px;
    height: 66px;
    min-width: 66px;
    padding: 0.4rem 0.2rem;
  }

  .countdown-num {
    font-size: 1.3rem;
  }
}

@media (max-width: 440px) {
  .theme-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 360px) {
  .countdown-box {
    width: 58px;
    height: 58px;
    min-width: 58px;
    padding: 0.3rem 0.15rem;
  }

  .countdown-num {
    font-size: 1.1rem;
  }
}

/* The fixed language pill (bottom-left) must never sit on top of the last
   buttons of a screen, on tablets and small laptops as well as phones. */
@media (max-width: 1279px) {
  .section-inner {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }
}

/* Tablet portrait and up: the photo memory lane uses two columns. */
@media (min-width: 720px) {
  .recipient-gallery-wrap {
    max-width: min(100%, 62rem);
  }

  .recipient-gallery {
    max-width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    column-gap: 2rem;
    row-gap: 2.5rem;
  }

  /* An odd last photo (or a single one) is centered instead of stuck left. */
  .recipient-gallery-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(100%, 35rem);
  }
}

/* Laptop and up: the creator form uses two columns instead of a thin strip. */
@media (min-width: 900px) {
  #section-customize .section-inner {
    max-width: 56rem;
  }

  .customize-form {
    max-width: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2rem;
  }

  .customize-form > .form-group,
  .customize-form > .form-actions {
    grid-column: 1 / -1;
  }

  /* Row 1 cleanly pairs Recipient Name + Sender Name; Birthday Date and
     Anniversary Date span full width cleanly. */
  .customize-form > .form-group:nth-child(1),
  .customize-form > .form-group:nth-child(2) {
    grid-column: auto;
  }

  .theme-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* Big monitors: everything sized in rem (containers, cake, text) scales up
   instead of floating as a small island in a huge screen. */
@media (min-width: 1600px) {
  html {
    font-size: 18px;
  }
}

@media (min-width: 1920px) {
  html {
    font-size: 20px;
  }
}

@media (min-width: 2400px) {
  html {
    font-size: 24px;
  }
}

/* Real mobile viewport height instead of the classic 100vh browser-toolbar bug
   (address bar showing/hiding shrinks the usable area on phones). Kept as a
   progressive enhancement — 100vh above still applies on older browsers. */
@supports (height: 100dvh) {
  body,
  .section,
  .recipient-section,
  .recipient-hero-section,
  .recipient-cake-section,
  .recipient-message-section {
    min-height: 100dvh;
  }

  .recipient-view,
  .recipient-bg,
  .loading-overlay {
    height: 100dvh;
  }
}

/* Landscape phones / short screens: 100vh sections shouldn't force extra
   scrolling past content that already fits. */
@media (max-height: 500px) and (orientation: landscape) {
  .recipient-section {
    min-height: auto;
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  /* Creator screens keep their full-height themed background (min-height
     stays 100vh/100dvh and never forces extra scrolling - content taller
     than the screen just grows); only the padding tightens. */
  .section {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }
}

/* ===== Accessibility helpers / music states / theme preview (v30 audit) === */

/* Screen-reader-only text (labels for icon-only inputs/buttons). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link: hidden until keyboard focus. */
.skip-link {
  position: fixed;
  top: 0.5rem;
  inset-inline-start: 0.5rem;
  z-index: 3000;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-300%);
  transition: transform var(--transition-fast);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.noscript-note {
  max-width: 35rem;
  margin: 1rem auto;
  padding: 0.85rem 1rem;
  text-align: center;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  color: var(--text);
}

/* Never let media overflow narrow viewports (320px safety). */
img,
video,
canvas {
  max-width: 100%;
  height: auto;
}

#qr-image {
  width: 100%;
  max-width: 280px;
  height: auto;
}

/* Theme preview: live swatch + name + HEX before generation. */
.theme-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.85rem;
  padding: 0.7rem 1rem;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  font-size: 0.9rem;
}

.theme-preview-dot {
  width: 1.6rem;
  height: 1.6rem;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid var(--card-border);
}

.theme-preview-text {
  font-weight: 700;
  color: var(--text);
}

.theme-preview-hex {
  font-size: 0.8rem;
  color: var(--text-light);
  direction: ltr;
}

/* Music control & language pill stay physically anchored across LTR/RTL */
.music-controls {
  bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  right: max(2rem, env(safe-area-inset-right, 0px));
  left: auto;
}

.lang-toggle {
  top: 1rem;
  right: 1rem;
  left: auto;
  bottom: auto;
}

.btn-music {
  min-width: 48px;
  min-height: 48px;
}

.btn-music:focus-visible,
.music-prompt:focus-visible,
#song-choice-preview:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

/* Loading: dotted ring + pause the decorative spin elsewhere. */
.btn-music.loading::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px dotted var(--accent);
  animation: spin 1s linear infinite;
  pointer-events: none;
}

.btn-music[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Text label under the icon state is handled via aria-label in JS;
   the visible glyph also changes shape (▶ / ⏸ / … / !) so state
   never relies on color alone. */
.btn-music .btn-music-state {
  font-size: 0.65rem;
  display: block;
}

.music-prompt {
  bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  max-width: calc(100vw - 2rem);
  box-sizing: border-box;
}

#song-choice-preview {
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-md);
}

@media (max-width: 480px) {
  .music-controls {
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    right: max(1rem, env(safe-area-inset-right, 0px));
    left: auto;
  }

  .form-actions {
    margin-bottom: 0.5rem;
  }

  .music-prompt {
    bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }
}

/* ===== Touch, input and short-screen polish (v36) ===== */

/* iOS Safari zooms the whole page when a field under 16px gets focus. */
@media (pointer: coarse), (max-width: 768px) {
  .photo-text-input,
  .photo-url-input,
  .share-link,
  .custom-relationship-row input {
    font-size: 1rem;
  }
}

/* iOS renders date/datetime inputs wider/shorter than text inputs; normalise them. */
.form-group input[type="date"],
.form-group input[type="datetime-local"] {
  display: block;
  min-width: 0;
  max-width: 100%;
  min-height: var(--control-height);
  -webkit-appearance: none;
  appearance: none;
  text-align: start;
}

/* 44px touch targets without changing the drawn size of small controls. */
.switch::after {
  content: "";
  position: absolute;
  inset: -6px -4px;
}

.btn-remove::after {
  content: "";
  position: absolute;
  inset: -8px;
}

@media (pointer: coarse) {
  .photo-slot .btn-remove {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .toggle-btn,
  .song-choice-item {
    min-height: 44px;
  }
}

/* Touch screens have no real hover: don't leave a tapped control stuck in
   its hover look until the next tap elsewhere. */
@media (hover: none) {
  .card:hover:not(.selected) {
    transform: none;
    box-shadow: none;
    border-color: var(--card-border);
  }

  .btn-primary:hover {
    transform: none;
    box-shadow: 0 4px 20px var(--shadow);
  }

  .btn-secondary:hover {
    background: transparent;
    color: var(--primary-ink, var(--primary));
    border-color: var(--primary-ink, var(--primary));
  }

  .theme-swatch:hover:not(.active),
  .toggle-btn:hover:not(.active),
  .song-choice-item:hover:not(.selected),
  .lang-toggle:hover {
    border-color: var(--card-border);
    transform: none;
  }

  .song-preview-btn:hover {
    background: transparent;
    color: var(--primary-ink, var(--primary));
    border-color: var(--primary-ink, var(--primary));
  }

  .btn-music:hover {
    transform: none;
  }
}

/* Landscape phones: the stacked 4-line hero title would be taller than the
   screen, so lay it out on one line. */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-title {
    font-size: min(var(--fs-hero), 13vh);
    margin-bottom: 0.75rem;
  }

  .hero-title .script-text {
    display: inline-block;
    margin-inline: 0.12em;
  }

  .hero-subtitle {
    margin-bottom: 1.25rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .section-subtitle {
    margin-bottom: 1rem;
  }
}

/* ===== Step Progress Bar (Creator Flow) ===== */
.step-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 990;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 1rem 0.45rem;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
  pointer-events: none;
}

[data-theme="deep"] .step-progress,
[data-theme="dark"] .step-progress {
  background: rgba(24, 10, 14, 0.86);
}

.step-progress-track {
  width: min(340px, 68vw);
  height: 4px;
  background: var(--card-border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.step-progress-fill {
  height: 100%;
  width: 20%;
  background: var(--gradient);
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.step-progress-dots {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  pointer-events: auto;
}

.step-dot {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  color: var(--text-light);
  cursor: default;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.2s ease;
}

.step-dot.done {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  cursor: pointer;
}

.step-dot.done:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.22);
}

.step-dot.active {
  background: var(--gradient);
  border-color: var(--primary);
  color: #ffffff;
  transform: scale(1.15);
  box-shadow: 0 2px 8px var(--shadow);
}

.step-progress-label {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
}

/* ===== Message Font Style Selector ===== */
.font-style-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.font-style-btn {
  min-height: 46px;
  padding: 0.6rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

@media (max-width: 340px) {
  .font-style-group {
    grid-template-columns: 1fr;
  }
}

.font-style-btn[data-font="handwritten"] {
  font-family: var(--font-script);
  font-size: 1.1rem;
}

.font-style-btn[data-font="classic"] {
  font-family: var(--font-heading);
}

.font-style-btn[data-font="modern"] {
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
}

.font-style-btn.active {
  border-color: var(--btn-active-bg, var(--primary));
  background: var(--btn-active-bg, var(--primary));
  color: var(--btn-active-fg, #ffffff);
  font-weight: 700;
  box-shadow: 0 3px 10px var(--shadow);
}

.font-handwritten {
  font-family: var(--font-script) !important;
  font-size: 1.28rem !important;
  line-height: 1.75 !important;
}

.font-classic {
  font-family: var(--font-body) !important;
}

.font-modern {
  font-family: 'Cairo', system-ui, -apple-system, sans-serif !important;
  font-size: 1.06rem !important;
  line-height: 1.8 !important;
}

/* ===== One-Tap WhatsApp & Native Share ===== */
.btn-whatsapp {
  background: #25d366;
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: var(--control-height);
}

.btn-whatsapp:hover {
  background: #1fb857;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.38);
}

/* ===== Interactive Envelope Unwrap Intro ===== */
.gift-intro-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: clip;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg);
  background-image: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.55), transparent 70%);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.65s;
}

[data-theme="deep"] .gift-intro-overlay,
[data-theme="dark"] .gift-intro-overlay {
  background-image: radial-gradient(circle at 50% 35%, rgba(230, 57, 70, 0.14), transparent 70%);
}

.gift-intro-overlay.unwrapped {
  opacity: 0;
  transform: scale(1.05);
  visibility: hidden;
  pointer-events: none;
}

.gift-envelope-card {
  width: min(440px, 92vw);
  padding: 3.1rem 1.85rem 2.25rem;
  border-radius: 26px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-alt) 42%, var(--card-bg)) 0%, var(--card-bg) 100%);
  border: 1.5px solid color-mix(in srgb, var(--accent) 42%, var(--card-border));
  box-shadow: 0 28px 68px var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  text-align: center;
  position: relative;
  overflow: hidden;
  perspective: 1200px;
}

.gift-envelope-card::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  pointer-events: none;
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 112px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--primary) 10%, var(--bg-alt)), color-mix(in srgb, var(--accent) 16%, var(--card-bg)));
  clip-path: polygon(0 0, 100% 0, 50% 96%);
  border-bottom: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 10px 24px rgba(24, 6, 12, 0.12);
  transform-origin: top center;
  transition: transform 0.62s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
  z-index: 2;
  pointer-events: none;
}

.envelope-inner-glow {
  position: absolute;
  top: -20px;
  left: 50%;
  width: 240px;
  height: 140px;
  transform: translateX(-50%) scale(0.6);
  background: radial-gradient(circle, rgba(255, 226, 145, 0.52) 0%, rgba(230, 57, 70, 0.16) 50%, transparent 74%);
  opacity: 0;
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 1;
}

.gift-intro-overlay.unwrapping .envelope-flap {
  transform: rotateX(-165deg);
  opacity: 0.2;
}

.gift-intro-overlay.unwrapping .envelope-inner-glow {
  opacity: 1;
  transform: translateX(-50%) scale(1.25);
}

.gift-envelope-logo {
  position: relative;
  z-index: 3;
  width: 92px;
  height: 92px;
  margin: 0 auto 1.15rem;
  color: var(--primary-ink, var(--primary));
  animation: envelopeFloat 3s ease-in-out infinite;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.38s ease;
}

.gift-envelope-logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

.gift-intro-overlay.unwrapping .gift-envelope-logo {
  animation: none;
  transform: translateY(-18px) scale(1.18) rotate(-8deg);
  opacity: 0;
}

@keyframes envelopeFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.gift-intro-badge {
  position: relative;
  z-index: 3;
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-ink, var(--primary));
  margin-bottom: 0.55rem;
}

.gift-intro-to {
  position: relative;
  z-index: 3;
  font-family: var(--font-heading);
  font-size: clamp(1.55rem, 5vw, 2rem);
  color: var(--text);
  margin-bottom: 0.45rem;
}

.gift-intro-from {
  position: relative;
  z-index: 3;
  font-family: var(--font-script);
  font-size: 1.35rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.btn-unwrap-gift {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 280px;
  font-size: 1.08rem;
}

[data-theme="deep"] .gift-envelope-card,
[data-theme="dark"] .gift-envelope-card {
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 224, 160, 0.14);
}

/* ===== Recipient Signature & Reactions ===== */
.recipient-signature {
  margin-top: 1.25rem;
  font-family: var(--font-script);
  font-size: 1.45rem;
  color: var(--primary-ink, var(--primary));
  font-weight: 600;
}

.recipient-reaction-wrap {
  margin-top: 1.65rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

.btn-send-love {
  font-size: 1rem;
  padding-inline: 1.6rem;
}

.reaction-sent-note {
  margin-top: 0.75rem;
  font-size: 0.92rem;
  color: var(--primary-ink, var(--primary));
  font-weight: 600;
}

/* ===== Gallery Skeleton & Lightbox ===== */
.recipient-gallery-item.loading-img {
  position: relative;
  min-height: 190px;
}

.photo-skeleton {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.05) 25%, rgba(0, 0, 0, 0.11) 50%, rgba(0, 0, 0, 0.05) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.recipient-gallery-item img {
  cursor: zoom-in;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(12, 6, 10, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.lightbox-close {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  max-width: 96vw;
  max-height: 80vh;
}

.lightbox-stage img {
  max-width: min(82vw, 900px);
  max-height: 76vh;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.lightbox-nav {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 1.4rem;
  cursor: pointer;
  flex-shrink: 0;
}

.lightbox-caption {
  margin-top: 0.9rem;
  color: #f8f0f2;
  font-size: 0.98rem;
  text-align: center;
  max-width: 600px;
}

/* ===== Header Clearance, Uniform Dots & Equal Share Buttons ===== */
#section-occasion,
#section-relationship,
#section-customize,
#section-preview,
#section-share,
#section-track,
#section-broken {
  align-items: flex-start;
  padding-top: calc(6.25rem + env(safe-area-inset-top, 0px));
  padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
}

#section-occasion .section-inner,
#section-relationship .section-inner,
#section-customize .section-inner,
#section-preview .section-inner,
#section-share .section-inner,
#section-track .section-inner,
#section-broken .section-inner {
  margin-block: auto;
}

#section-share .section-inner {
  padding-top: 0.75rem;
}

.step-dot {
  width: 26px;
  height: 26px;
  font-size: 0.78rem;
  line-height: 1;
  flex-shrink: 0;
}

.step-dot.active {
  transform: none;
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.22), 0 2px 8px var(--shadow);
}

@media (min-width: 541px) {
  .step-progress {
    padding-inline: 7.25rem;
  }
}

@media (max-width: 540px) {
  .step-progress {
    padding-left: 5.8rem;
    padding-inline-start: 5.8rem;
    padding-right: 5.8rem;
    padding-inline-end: 5.8rem;
  }

  .step-progress-track {
    width: min(190px, 100%);
  }

  .step-progress-dots {
    gap: 0.45rem;
  }

  .fixed-back-btn {
    top: max(0.65rem, env(safe-area-inset-top, 0px));
    left: 0.75rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
  }
}

.share-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  width: 100%;
  max-width: 560px;
  margin: 1.5rem auto 0;
  align-items: stretch;
}

.share-actions > button,
.share-actions > a {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  box-sizing: border-box;
  margin: 0;
}

@media (min-width: 600px) and (max-width: 899px) {
  .share-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 100%;
  }
}

@media (max-width: 599px) {
  .share-actions {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .recipient-reaction-wrap {
    flex-direction: column;
    align-items: stretch;
    max-width: 340px;
    margin-inline: auto;
    gap: 0.75rem;
  }

  .recipient-reaction-wrap > button,
  .recipient-reaction-wrap > a {
    width: 100%;
    min-width: 0;
  }
}

.recipient-reaction-wrap > button,
.recipient-reaction-wrap > a {
  min-height: 48px;
  min-width: 210px;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
  .gift-envelope-logo,
  .photo-skeleton,
  .showcase-card,
  .eq-bars i {
    animation: none !important;
  }
  .gift-intro-overlay,
  .envelope-flap,
  .envelope-inner-glow,
  .gift-envelope-logo,
  .step-progress-fill {
    transition: none !important;
  }
}

/* ===== Luxury Landing Page Hero (v44) ===== */
#section-hero {
  background:
    radial-gradient(circle at 15% 18%, rgba(255, 224, 234, 0.72) 0%, transparent 45%),
    radial-gradient(circle at 86% 24%, rgba(200, 155, 84, 0.16) 0%, transparent 42%),
    radial-gradient(circle at 74% 84%, rgba(230, 57, 70, 0.10) 0%, transparent 46%),
    linear-gradient(155deg, #fff9fa 0%, #fff2f5 52%, #fce8ee 100%);
  padding-top: max(2.25rem, env(safe-area-inset-top, 0px));
  padding-bottom: max(5.25rem, calc(4.25rem + env(safe-area-inset-bottom, 0px)));
  position: relative;
  overflow: hidden;
}

.hero-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(2rem, 5vw, 4.25rem);
  align-items: center;
}

.hero-copy {
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

#section-hero .hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.95rem 0.42rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid rgba(200, 155, 84, 0.36);
  box-shadow: 0 6px 20px rgba(143, 29, 58, 0.08);
  margin: 0 0 1.35rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: #8F1D3A;
}

#section-hero .hero-brand svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.hero-brand-sep {
  width: 1px;
  height: 14px;
  background: rgba(200, 155, 84, 0.45);
}

.hero-brand-tag {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: #7b4e5a;
  letter-spacing: 0.02em;
}

#section-hero .hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.45rem, 5vw, 4.25rem);
  line-height: 1.12;
  font-weight: 700;
  margin-bottom: 1.1rem;
  text-align: inherit;
}

#section-hero .hero-title .script-text {
  display: inline-block;
  margin-inline-end: 0.16em;
  background: linear-gradient(125deg, #8F1D3A 0%, #D93250 52%, #A62643 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#section-hero .hero-title .ampersand {
  color: #C89B54;
  -webkit-text-fill-color: #C89B54;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  margin-inline-end: 0.16em;
}

#section-hero .hero-subtitle {
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  line-height: 1.7;
  color: #5c3d46;
  max-width: 34rem;
  margin: 0 0 1.85rem;
  text-align: inherit;
}

.hero-cta-wrap {
  margin-bottom: 1.85rem;
}

.hero-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.95rem 2rem;
  font-size: 1.06rem;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(217, 50, 80, 0.28), inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

.hero-cta-btn .cta-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.25s ease;
}

.hero-cta-btn:hover .cta-arrow {
  transform: translateX(4px);
}

html[dir="rtl"] .hero-cta-btn .cta-arrow {
  transform: scaleX(-1);
}

html[dir="rtl"] .hero-cta-btn:hover .cta-arrow {
  transform: scaleX(-1) translateX(-4px);
}

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.25rem;
  align-items: center;
}

.hero-highlight-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #6b4852;
}

.hero-highlight-item svg {
  width: 18px;
  height: 18px;
  color: #C89B54;
  flex-shrink: 0;
}

/* Right column: Keepsake Showcase Preview Card */
.hero-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.4rem 0.75rem 1.75rem;
}

.showcase-card {
  width: min(370px, 100%);
  padding: 2rem 1.5rem 1.45rem;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(200, 155, 84, 0.38);
  box-shadow:
    0 24px 54px rgba(143, 29, 58, 0.14),
    inset 0 2px 6px rgba(255, 255, 255, 0.95);
  text-align: center;
  position: relative;
  animation: showcaseFloat 5.5s ease-in-out infinite;
}

@keyframes showcaseFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.showcase-crest {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  margin: 0 auto 0.75rem;
  background: #FFF2F5;
  border: 1px solid rgba(200, 155, 84, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
}

.showcase-crest svg {
  width: 34px;
  height: 34px;
}

.showcase-greeting {
  font-family: var(--font-script);
  font-size: 1.65rem;
  font-weight: 700;
  color: #8F1D3A;
  margin-bottom: 0.35rem;
}

.showcase-excerpt {
  font-size: 0.86rem;
  line-height: 1.55;
  color: #6c4c55;
  margin: 0 auto 1.1rem;
  max-width: 26ch;
}

.showcase-polaroids {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.05rem;
}

.polaroid-mini {
  width: 112px;
  padding: 7px 7px 10px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid rgba(200, 155, 84, 0.28);
  box-shadow: 0 8px 20px rgba(70, 20, 35, 0.12);
}

.polaroid-a { transform: rotate(-4.5deg); }
.polaroid-b { transform: rotate(4deg) translateY(3px); }

.polaroid-frame {
  height: 70px;
  border-radius: 6px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.polaroid-art-a {
  background: linear-gradient(135deg, #ffd4e2 0%, #f6a3be 55%, #e2749a 100%);
}

.polaroid-art-b {
  background: linear-gradient(135deg, #fde8cc 0%, #f5c994 52%, #d89b60 100%);
}

.polaroid-frame svg {
  width: 58px;
  height: 44px;
}

.polaroid-cap {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #5c3d46;
}

.showcase-music-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(143, 29, 58, 0.08);
  border: 1px solid rgba(143, 29, 58, 0.16);
  font-size: 0.78rem;
  font-weight: 600;
  color: #8F1D3A;
}

.eq-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 12px;
}

.eq-bars i {
  display: block;
  width: 2.5px;
  border-radius: 2px;
  background: #D93250;
  animation: eqPulse 0.9s ease-in-out infinite alternate;
}

.eq-bars i:nth-child(1) { height: 6px; animation-delay: 0s; }
.eq-bars i:nth-child(2) { height: 12px; animation-delay: 0.22s; }
.eq-bars i:nth-child(3) { height: 8px; animation-delay: 0.45s; }

@keyframes eqPulse {
  from { transform: scaleY(0.45); }
  to { transform: scaleY(1); }
}

.showcase-chip {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(200, 155, 84, 0.42);
  box-shadow: 0 8px 22px rgba(90, 20, 42, 0.12);
  font-size: 0.78rem;
  font-weight: 700;
  color: #7a233b;
}

.showcase-chip-occ {
  margin-bottom: -14px;
}

.showcase-chip-link {
  margin-top: -12px;
  font-family: monospace;
  font-size: 0.76rem;
}

.showcase-chip-link svg {
  width: 14px;
  height: 14px;
  color: #C89B54;
}

@media (max-width: 899px) {
  .hero-shell {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .hero-copy {
    align-items: center;
    text-align: center;
  }

  #section-hero .hero-title {
    font-size: clamp(2.15rem, 8.5vw, 3.1rem);
  }

  .hero-highlights {
    justify-content: center;
  }

  .hero-showcase {
    padding: 0.5rem 0 1.25rem;
  }
}

html[lang="ar"] .hero-subtitle,
html[lang="ar"] .showcase-excerpt {
  unicode-bidi: plaintext;
}

/* ===== Stationary Controls & Text-Only Language Direction (v45) ===== */
.lang-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  left: auto;
  bottom: auto;
  min-width: 68px;
  width: auto;
  height: 38px;
  padding: 0 0.85rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  direction: ltr;
}

.fixed-back-btn {
  top: 1rem;
  left: 1rem;
  right: auto;
  min-width: 92px;
  height: 38px;
  padding: 0 0.85rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  direction: ltr;
}

.music-controls {
  bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  left: auto;
  right: max(2rem, env(safe-area-inset-right, 0px));
}

.step-progress,
.step-progress-dots {
  direction: ltr;
}

@media (max-width: 540px) {
  .fixed-back-btn {
    top: max(0.65rem, env(safe-area-inset-top, 0px));
    left: 0.75rem;
    right: auto;
    min-width: 78px;
    height: 40px;
    padding: 0 0.75rem;
  }

  .lang-toggle {
    top: max(0.65rem, env(safe-area-inset-top, 0px));
    right: 0.75rem;
    left: auto;
    bottom: auto;
    min-width: 60px;
    height: 40px;
    padding: 0 0.7rem;
  }

  .step-progress {
    padding-left: 5.8rem;
    padding-right: 5.8rem;
    padding-inline-start: 5.8rem;
    padding-inline-end: 5.8rem;
  }
}

@media (max-width: 480px) {
  .music-controls {
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    left: auto;
    right: max(1rem, env(safe-area-inset-right, 0px));
  }
}

/* Text-only direction: Arabic prose/inputs read RTL naturally without flipping layout */
html[lang="ar"] .section-title,
html[lang="ar"] .section-subtitle,
html[lang="ar"] .hero-title,
html[lang="ar"] .hero-subtitle,
html[lang="ar"] .showcase-greeting,
html[lang="ar"] .showcase-excerpt,
html[lang="ar"] .form-group label,
html[lang="ar"] .form-group input[type="text"],
html[lang="ar"] .form-group textarea,
html[lang="ar"] .form-hint,
html[lang="ar"] .message-preview,
html[lang="ar"] .recipient-greeting,
html[lang="ar"] .recipient-message,
html[lang="ar"] .recipient-signature,
html[lang="ar"] .recipient-footer,
html[lang="ar"] .gallery-item-text,
html[lang="ar"] .gift-intro-to,
html[lang="ar"] .gift-intro-from,
html[lang="ar"] .cake-heading,
html[lang="ar"] .cake-sub,
html[lang="ar"] .wish-text,
html[lang="ar"] .track-stats-card,
html[lang="ar"] .track-times,
html[lang="ar"] .track-badge,
html[lang="ar"] .intro-lock-title,
html[lang="ar"] .intro-lock-hint,
html[lang="ar"] .intro-lock-err,
html[lang="ar"] .centerpiece-heading,
html[lang="ar"] .centerpiece-sub,
html[lang="ar"] .recipient-voice-heading,
html[lang="ar"] .recipient-gallery-heading,
html[lang="ar"] .recipient-gallery-sub,
html[lang="ar"] .recipient-details-card,
html[lang="ar"] .recipient-closing-text,
html[lang="ar"] .tinyurl-label,
html[lang="ar"] .tinyurl-status,
html[lang="ar"] .voice-rec-status,
html[lang="ar"] .reaction-sent-note,
html[lang="ar"] .theme-preview-text,
html[lang="ar"] .photo-privacy-copy,
html[lang="ar"] .photo-privacy-title,
html[lang="ar"] .photo-privacy-desc,
html[lang="ar"] .photo-privacy-pills,
html[lang="ar"] .date-preview-text,
html[lang="ar"] .music-toggle .toggle-label {
  direction: rtl;
  unicode-bidi: plaintext;
}

html[lang="ar"] .hero-copy {
  direction: rtl;
}

html[lang="ar"] .hero-title {
  direction: rtl;
  unicode-bidi: normal;
}

html[lang="en"] .section-title,
html[lang="en"] .section-subtitle,
html[lang="en"] .hero-title,
html[lang="en"] .hero-subtitle,
html[lang="en"] .showcase-greeting,
html[lang="en"] .showcase-excerpt,
html[lang="en"] .form-group label,
html[lang="en"] .form-group input[type="text"],
html[lang="en"] .form-group textarea,
html[lang="en"] .form-hint,
html[lang="en"] .message-preview,
html[lang="en"] .recipient-greeting,
html[lang="en"] .recipient-message,
html[lang="en"] .recipient-signature,
html[lang="en"] .recipient-footer,
html[lang="en"] .gallery-item-text,
html[lang="en"] .gift-intro-to,
html[lang="en"] .gift-intro-from,
html[lang="en"] .cake-heading,
html[lang="en"] .cake-sub,
html[lang="en"] .wish-text,
html[lang="en"] .track-stats-card,
html[lang="en"] .track-times,
html[lang="en"] .track-badge,
html[lang="en"] .intro-lock-title,
html[lang="en"] .intro-lock-hint,
html[lang="en"] .intro-lock-err,
html[lang="en"] .centerpiece-heading,
html[lang="en"] .centerpiece-sub,
html[lang="en"] .recipient-voice-heading,
html[lang="en"] .recipient-gallery-heading,
html[lang="en"] .recipient-gallery-sub,
html[lang="en"] .recipient-details-card,
html[lang="en"] .recipient-closing-text,
html[lang="en"] .tinyurl-label,
html[lang="en"] .tinyurl-status,
html[lang="en"] .voice-rec-status,
html[lang="en"] .reaction-sent-note,
html[lang="en"] .theme-preview-text {
  direction: ltr;
}

/* ===== 7 New Features UI & Frame Styles (v48) ===== */
.tone-group,
.frame-style-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (min-width: 600px) {
  .tone-group,
  .frame-style-group {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.tone-btn,
.frame-btn {
  min-height: 46px;
  padding: 0.6rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.15s ease;
}

#msg-tone-group {
  margin-bottom: 1.15rem;
}

.tone-btn.active,
.frame-btn.active {
  border-color: var(--btn-active-bg, var(--primary));
  background: var(--btn-active-bg, var(--primary));
  color: var(--btn-active-fg, #ffffff);
  font-weight: 700;
  box-shadow: 0 3px 10px var(--shadow);
}

/* Voice recorder control card */
.voice-recorder-box {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.voice-rec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.voice-rec-actions button {
  padding: 0.65rem 1.15rem;
  min-height: 44px;
  font-size: 0.92rem;
}

@media (max-width: 480px) {
  .voice-rec-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .voice-rec-actions button {
    width: 100%;
  }

  .cake-actions {
    flex-direction: column;
    align-items: stretch;
    max-width: 320px;
    margin-inline: auto;
    gap: 0.75rem;
  }

  .cake-actions > button {
    width: 100%;
  }
}

.voice-rec-status {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-light);
}

.voice-rec-status.recording {
  color: #c62828;
}

.voice-audio-preview {
  width: 100%;
  height: 40px;
}

/* Optional passcode + unlock date box */
.lock-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin: 0;
}

.lock-date-label {
  display: block;
  margin-top: 0.25rem;
  margin-bottom: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

html[lang="ar"] .lock-date-label {
  direction: rtl;
  text-align: right;
}

/* Photo frame presets on recipient gallery & creator preview */
.recipient-gallery.frame-rounded .recipient-gallery-item,
.recipient-gallery-grid.frame-rounded .recipient-gallery-item,
.preview-gallery-grid.frame-rounded .preview-photo-card {
  border-radius: 22px;
  padding: 0;
  background: transparent;
  box-shadow: 0 12px 30px var(--shadow-lg);
}

.recipient-gallery.frame-rounded .recipient-gallery-item img,
.recipient-gallery-grid.frame-rounded .recipient-gallery-item img,
.preview-gallery-grid.frame-rounded .preview-photo-card img {
  border-radius: 22px !important;
}

.recipient-gallery.frame-film .recipient-gallery-item,
.recipient-gallery-grid.frame-film .recipient-gallery-item,
.preview-gallery-grid.frame-film .preview-photo-card {
  background: #1b1719;
  color: #f6edf0;
  border-radius: 6px;
  padding: 14px 18px 18px;
  border-top: 5px dashed rgba(255, 255, 255, 0.35);
  border-bottom: 5px dashed rgba(255, 255, 255, 0.35);
}

.recipient-gallery.frame-film .recipient-gallery-item .gallery-item-text,
.recipient-gallery-grid.frame-film .recipient-gallery-item .gallery-item-text,
.preview-gallery-grid.frame-film .preview-photo-card .gallery-item-text {
  color: #f6edf0 !important;
}

.recipient-gallery.frame-scrapbook .recipient-gallery-item,
.recipient-gallery-grid.frame-scrapbook .recipient-gallery-item,
.preview-gallery-grid.frame-scrapbook .preview-photo-card {
  background: #fffdf7;
  padding: 10px 10px 16px;
  border-radius: 4px;
  border: 1px solid #eadfcd;
  box-shadow: 0 10px 26px rgba(60, 30, 20, 0.16);
}

.recipient-gallery.frame-scrapbook .recipient-gallery-item:nth-child(odd),
.recipient-gallery-grid.frame-scrapbook .recipient-gallery-item:nth-child(odd),
.preview-gallery-grid.frame-scrapbook .preview-photo-card:nth-child(odd) {
  transform: rotate(-1.6deg);
}

.recipient-gallery.frame-scrapbook .recipient-gallery-item:nth-child(even),
.recipient-gallery-grid.frame-scrapbook .recipient-gallery-item:nth-child(even),
.preview-gallery-grid.frame-scrapbook .preview-photo-card:nth-child(even) {
  transform: rotate(1.6deg);
}

/* Live Photo Frame Style Preview inside Step 3 */
.frame-live-preview {
  margin-top: 0.85rem;
  padding: 0.9rem 1rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--card-border);
  background: color-mix(in srgb, var(--card-bg) 88%, var(--primary) 12%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.frame-live-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.frame-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--primary-ink, var(--primary));
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
}

.frame-live-name {
  font-weight: 600;
  color: var(--text-light);
}

.frame-live-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 0.75rem 0.65rem;
  min-height: 200px;
}

.frame-live-card {
  position: relative;
  width: fit-content;
  max-width: min(100%, 320px);
  min-width: 210px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-radius 0.25s ease, padding 0.25s ease;
}

.frame-live-media {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
}

.frame-live-media img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 360px;
  display: block;
  object-fit: contain;
  margin: 0 auto;
}

.frame-live-sample {
  width: 240px;
  max-width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
}

.frame-live-sample svg {
  width: 100%;
  height: 100%;
  display: block;
}

.frame-live-caption {
  margin-top: 0.55rem;
  text-align: center;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-light);
  line-height: 1.35;
  background: transparent;
  border-top: none;
  padding: 0.2rem 0.25rem 0;
}

.frame-live-stage.frame-polaroid .frame-live-card {
  background: #ffffff;
  color: #3b2a2f;
  padding: 10px 10px 18px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 10px 26px rgba(35, 15, 22, 0.14);
}

.frame-live-stage.frame-polaroid .frame-live-media {
  border-radius: 3px;
}

.frame-live-stage.frame-polaroid .frame-live-caption {
  color: #5a434a;
}

.frame-live-stage.frame-film .frame-live-card {
  background: #1b1719;
  color: #f6edf0;
  border-radius: 6px;
  padding: 14px 16px 16px;
  border-top: 5px dashed rgba(255, 255, 255, 0.4);
  border-bottom: 5px dashed rgba(255, 255, 255, 0.4);
  box-shadow: 0 12px 28px rgba(15, 10, 12, 0.32);
}

.frame-live-stage.frame-film .frame-live-media {
  border-radius: 2px;
}

.frame-live-stage.frame-film .frame-live-caption {
  background: transparent;
  border-top: none;
  color: #f6edf0 !important;
  opacity: 1;
}

.frame-live-stage.frame-rounded .frame-live-card {
  background: transparent;
  padding: 0;
  border-radius: 22px;
}

.frame-live-stage.frame-rounded .frame-live-media {
  border-radius: 22px;
  box-shadow: 0 14px 30px var(--shadow-lg);
}

.frame-live-stage.frame-scrapbook .frame-live-card {
  background: #fffdf7;
  color: #4a3525;
  padding: 10px 10px 16px;
  border-radius: 4px;
  border: 1px solid #eadfcd;
  box-shadow: 0 10px 26px rgba(60, 30, 20, 0.16);
  transform: rotate(-1.8deg);
}

.frame-live-stage.frame-scrapbook .frame-live-card::before,
.recipient-gallery.frame-scrapbook .recipient-gallery-item::before,
.recipient-gallery-grid.frame-scrapbook .recipient-gallery-item::before,
.preview-gallery-grid.frame-scrapbook .preview-photo-card::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 58px;
  height: 18px;
  border-radius: 2px;
  background: rgba(235, 198, 152, 0.65);
  border: 1px solid rgba(205, 162, 112, 0.35);
  box-shadow: 0 2px 5px rgba(60, 30, 20, 0.1);
  pointer-events: none;
  z-index: 2;
}

.frame-live-stage.frame-scrapbook .frame-live-caption {
  color: #6b4e38;
}

/* Recipient Voice Note card & Modern Waveform Player */
.recipient-voice-section {
  min-height: auto;
  padding: 1.75rem var(--gutter);
}

.recipient-voice-card {
  max-width: 30rem;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.35rem 1.45rem;
  border-radius: 24px;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  box-shadow: 0 16px 38px var(--shadow);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.recipient-voice-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--gradient);
  opacity: 0.85;
}

.recipient-voice-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.72rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary-ink, var(--primary));
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.6rem;
}

.recipient-voice-badge svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.recipient-voice-heading {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 0.28rem;
}

.recipient-voice-sub {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 1.05rem;
  line-height: 1.45;
}

.voice-player {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 18px;
  background: color-mix(in srgb, var(--primary) 7%, var(--card-bg));
  border: 1px solid var(--card-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  width: 100%;
  text-align: left;
}

.voice-player-compact {
  padding: 0.6rem 0.75rem;
  border-radius: 14px;
}

.voice-play-btn {
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--gradient);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  flex-shrink: 0;
}

.voice-play-btn:hover {
  transform: scale(1.05);
}

.voice-play-btn:active {
  transform: scale(0.96);
}

.voice-play-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.voice-player.is-playing .voice-play-btn {
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 22%, transparent), 0 8px 20px var(--shadow);
}

.voice-wave-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.voice-wave-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  height: 34px;
  cursor: pointer;
  padding: 2px 0;
  touch-action: none;
}

.voice-wave-track:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 6px;
}

.voice-wave-bar {
  flex: 1;
  min-width: 3px;
  max-width: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 25%, var(--text-light) 18%);
  transition: background 0.14s ease, transform 0.18s ease;
}

.voice-wave-bar.is-played {
  background: var(--primary);
}

.voice-player.is-playing .voice-wave-bar.is-head {
  transform: scaleY(1.18);
}

.voice-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.voice-time {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.voice-speed-btn {
  padding: 0.15rem 0.52rem;
  min-height: 26px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.voice-speed-btn:hover {
  border-color: var(--primary);
}

@media (prefers-reduced-motion: reduce) {
  .voice-player.is-playing .voice-wave-bar.is-head,
  .voice-play-btn:hover,
  .frame-live-card {
    transform: none;
    transition: none;
  }
}

/* Recipient Viral CTA */
.recipient-viral-cta {
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--card-border);
  display: flex;
  justify-content: center;
}

.recipient-make-own-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  min-height: 44px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, var(--card-bg));
  border: 1px solid var(--card-border);
  color: var(--primary-ink, var(--primary));
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.recipient-make-own-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 18px var(--shadow);
  transform: translateY(-1px);
}

/* Sprint 2 Progressive Disclosure Drawers, Photo Toolbar & Share Hierarchy */
.photo-slot-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
}

.photo-move-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.photo-move-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.photo-link-toggle {
  background: transparent;
  border: none;
  padding: 0.25rem 0.15rem;
  color: var(--primary-ink, var(--primary));
  font-size: 0.82rem;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
  align-self: flex-start;
}

.photo-link-toggle:hover {
  text-decoration: underline;
}

.photo-url-wrap {
  width: 100%;
}

.optional-drawer,
.share-drawer {
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  overflow: hidden;
}

.optional-drawer[open],
.share-drawer[open] {
  overflow: visible;
}

.optional-drawer-inline {
  margin-top: 0.9rem;
}

.optional-drawer-inline .song-external-tools {
  padding: 1rem 1.1rem 1.1rem;
  border-top: 1px solid color-mix(in srgb, var(--card-border) 55%, transparent);
  border-bottom: none;
  gap: 0.8rem;
}

.optional-drawer-summary {
  padding: 1rem 1.15rem;
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.optional-drawer-summary::-webkit-details-marker {
  display: none;
}

.optional-drawer-summary::after {
  content: '+';
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-ink, var(--primary));
  flex-shrink: 0;
}

details[open] > .optional-drawer-summary::after {
  content: '−';
}

.optional-drawer-body {
  padding: 1.15rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  border-top: 1px solid color-mix(in srgb, var(--card-border) 55%, transparent);
}

.optional-drawer-body .form-hint {
  margin: 0;
}

.optional-drawer .voice-recorder-box,
.share-drawer .tinyurl-box {
  border: none;
  padding-inline: 0;
  background: transparent;
}

.optional-drawer .voice-recorder-box {
  padding: 0.25rem 0 0;
  margin: 0;
}

.share-drawer .tinyurl-box {
  padding: 1.1rem 1.15rem 1.2rem;
  margin: 0;
  border-top: 1px solid color-mix(in srgb, var(--card-border) 55%, transparent);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.share-drawer .tinyurl-label {
  margin-bottom: 0;
}

.share-drawer .tinyurl-actions {
  margin-top: 0;
  gap: 0.75rem;
}

.tinyurl-regen-row {
  display: flex;
  width: 100%;
  margin-top: 0.1rem;
}

.tinyurl-regen-btn {
  width: 100%;
}

.tinyurl-regen-btn.is-suggested {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--card-bg));
  color: var(--primary-ink, var(--primary));
}

.share-drawer .tinyurl-status {
  margin-top: 0;
}

.advanced-audio-drawer {
  margin-top: 0.5rem;
}

.advanced-audio-summary {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.25rem 0;
}

.share-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  width: 100%;
}

.share-primary-actions > * {
  flex: 1 1 180px;
}

.hero-cta-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.hero-demo-btn {
  min-height: 50px;
  padding: 0.8rem 1.3rem;
  font-size: 0.96rem;
  border-radius: var(--radius-full, 999px);
}

.share-privacy-note {
  margin: 0;
  padding: 0.25rem 0.5rem;
  font-size: 0.84rem;
  color: var(--text-light);
  text-align: center;
  line-height: 1.45;
}

.share-actions.share-secondary-actions {
  margin: 0.25rem auto 0;
  gap: 0.85rem;
}

/* Envelope Intro Passcode & Time Capsule Lock */
.intro-lock-box {
  position: relative;
  z-index: 1;
  width: 100%;
  box-sizing: border-box;
  margin: 1rem auto 1.25rem;
  padding: 1.15rem;
  border-radius: 18px;
  background: rgba(143, 29, 58, 0.05);
  border: 1.5px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

#intro-pass-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
}

.intro-lock-title,
#intro-pass-wrap .intro-lock-title {
  display: block;
  margin: 0;
  line-height: 1.5;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--primary-ink, var(--primary));
  text-align: center;
}

.intro-lock-hint,
#intro-pass-wrap .intro-lock-hint {
  display: inline-block;
  align-self: center;
  margin: 0 0 0.25rem;
  padding: 0.28rem 0.85rem;
  border-radius: 999px;
  background: rgba(143, 29, 58, 0.08);
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-light);
  text-align: center;
}

.intro-pass-input,
#intro-pass-wrap .intro-pass-input {
  width: 100%;
  min-height: 3.15rem;
  padding: 0.75rem 1rem;
  margin: 0.2rem 0 0.1rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--card-border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  text-align: center;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#intro-pass-wrap .intro-pass-input:hover {
  border-color: var(--primary);
}

#intro-pass-wrap .intro-pass-input:focus,
#intro-pass-wrap .intro-pass-input:focus-visible {
  outline: none;
  outline-offset: 0;
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary), 0 0 0 2px var(--shadow);
}

.intro-lock-err,
#intro-pass-wrap .intro-lock-err {
  display: block;
  margin: 0;
  line-height: 1.45;
  font-size: 0.85rem;
  font-weight: 600;
  color: #c62828;
  text-align: center;
}

#intro-pass-wrap .btn-primary {
  width: 100%;
  margin-top: 0.25rem;
}

/* Tracking Box on Share screen + Gift Status section */
.track-box {
  margin: 0;
  padding: 1.15rem 1.2rem;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  text-align: start;
}

.track-box-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.55rem;
}

html[lang="ar"] .track-box-label {
  direction: rtl;
  text-align: right;
}

.track-box .share-link-box {
  display: flex;
  width: 100%;
  margin-bottom: 0.7rem;
}

.track-box #track-link {
  width: 100%;
  flex: 1;
  min-width: 0;
  padding: 0.8rem 1rem;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
  direction: ltr;
  text-align: left;
  box-sizing: border-box;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.track-box #track-link:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--shadow);
}

.track-actions-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  width: 100%;
}

.track-actions-row button {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.track-stats-card {
  max-width: 30rem;
  width: 100%;
  margin: 1.5rem auto 0;
  padding: 1.75rem 1.35rem;
  border-radius: 22px;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  box-shadow: 0 14px 38px var(--shadow);
}

.track-badge {
  display: inline-block;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.track-badge.opened {
  background: rgba(37, 211, 102, 0.14);
  color: #167e3d;
}

.track-badge.waiting {
  background: rgba(200, 155, 84, 0.16);
  color: #9b6c16;
}

.track-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.track-metric {
  padding: 0.9rem;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--card-border);
}

.track-metric-val {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary-ink, var(--primary));
}

.track-metric-lbl {
  font-size: 0.82rem;
  color: var(--text-light);
}

.track-times {
  font-size: 0.86rem;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

/* Save keepsake image button */
.btn-save-card {
  min-height: 48px;
  min-width: 210px;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
}

/* Graduation cap celebration glow + Eid lantern swing */
.cp-eid {
  transform-origin: 50% 8%;
}

.centerpiece-visual.is-tapped .cp-eid-glow {
  opacity: 1;
  transform: scale(1.28);
}

.cp-eid-glow {
  opacity: 0.65;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.35s ease, transform 0.45s ease;
}

/* Keepsake preview dialog */
.keepsake-dialog {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(20, 8, 12, 0.84);
  backdrop-filter: blur(6px);
  padding: 1.25rem;
  box-sizing: border-box;
}

.keepsake-stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 42rem;
  max-height: 82vh;
  overflow-y: auto;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.48);
}

.keepsake-stage > img {
  display: block;
  width: 100%;
  height: auto;
}

.keepsake-html-card {
  padding: 2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  border: 4px double currentColor;
  border-radius: 14px;
}

.keepsake-html-crest {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.keepsake-html-occ {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.keepsake-html-art {
  width: 170px;
  max-width: 60%;
}

.keepsake-html-art svg {
  width: 100%;
  height: auto;
  display: block;
}

.keepsake-html-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  width: 100%;
}

.keepsake-html-photo {
  background: #ffffff;
  padding: 10px 10px 14px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.keepsake-html-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.keepsake-html-photo span {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.88rem;
  font-style: italic;
  color: #4a3a3f;
}

.keepsake-html-letter {
  width: 100%;
  padding: 1.5rem 1.25rem;
  border-radius: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.keepsake-bar {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  max-width: 42rem;
  padding-top: 0.9rem;
}

.keepsake-btn {
  flex: 1;
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.keepsake-bar .btn-secondary {
  background: rgba(255, 255, 255, 0.94);
  color: #2b1820;
  border-color: rgba(255, 255, 255, 0.78);
}

@media (max-width: 400px) {
  .fixed-back-btn {
    min-width: 72px;
    height: 38px;
    padding: 0 0.55rem;
    font-size: 0.82rem;
  }

  .step-progress {
    padding-left: 5.1rem;
    padding-right: 5.1rem;
    padding-inline-start: 5.1rem;
    padding-inline-end: 5.1rem;
  }

  .step-progress-dots {
    gap: 0.35rem;
  }

  .step-dot {
    width: 24px;
    height: 24px;
    font-size: 0.72rem;
  }

  .song-search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .song-search-row .btn-compact-sm {
    width: 100%;
    padding: 0.55rem 1rem;
  }

  .track-actions-row {
    grid-template-columns: 1fr;
  }

  .keepsake-bar {
    flex-direction: column;
  }
}

/* ===== Bulletproof Date & Time Pickers (v54) ===== */
.date-picker-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.date-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr) minmax(0, 1.15fr);
  gap: 0.6rem;
}

.date-time-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.date-select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0.65rem 0.75rem;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  background-color: var(--card-bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.date-select.is-empty {
  color: var(--text-light);
  font-weight: 500;
}

.date-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--shadow);
}

#years-together {
  font-variant-numeric: tabular-nums;
}

.date-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: var(--bg-alt);
  font-size: 0.88rem;
  line-height: 1.4;
}

.date-preview-row.is-warn {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
  color: #c62828;
}

[data-theme="deep"] .date-preview-row.is-warn,
[data-theme="dark"] .date-preview-row.is-warn {
  color: #fca5a5;
}

.date-preview-text {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.date-preview-row.is-warn .date-preview-text {
  color: inherit;
}

.date-clear-btn {
  flex-shrink: 0;
  min-height: 34px;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.date-clear-btn:hover {
  border-color: var(--primary);
  color: var(--primary-ink, var(--primary));
}

@media (max-width: 400px) {
  .date-picker-row {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.45fr) minmax(0, 1.05fr);
    gap: 0.4rem;
  }

  .date-select {
    padding: 0.55rem 0.45rem;
    font-size: 0.88rem;
  }
}

/* ===== Photo Privacy Reassurance Card ===== */
.photo-privacy-card {
  margin: 0.35rem 0 0.9rem;
  padding: 0.95rem 1.05rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: 0 4px 14px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.photo-privacy-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.photo-privacy-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  color: var(--primary-ink, var(--primary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.photo-privacy-icon svg {
  width: 19px;
  height: 19px;
}

.photo-privacy-copy {
  flex: 1;
  min-width: 0;
}

.photo-privacy-title {
  display: block;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.photo-privacy-desc {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-light);
  margin: 0;
}

.photo-privacy-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.photo-privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
}

/* ===== Tracking Card Action Buttons ===== */
#section-track .action-buttons {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

#section-track .action-buttons > button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

@media (max-width: 599px) {
  #section-track .action-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  #section-track .action-buttons > button {
    width: 100%;
  }
}

/* ===== Accessible Toast, Inline Validation & Modal Dialogs ===== */
.app-toast {
  position: fixed;
  top: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10050;
  max-width: min(92vw, 460px);
  padding: 0.78rem 1.25rem;
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text);
  border: 1.5px solid var(--card-border);
  box-shadow: 0 12px 34px rgba(24, 10, 14, 0.22);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: toastSlideIn 0.22s ease;
}

.app-toast.is-error {
  border-color: #c62828;
  background: #fff5f5;
  color: #9e1c1c;
}

.app-toast.is-ok {
  border-color: #1b7f44;
  background: #f2fbf5;
  color: #146334;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.field-invalid {
  border-color: #c62828 !important;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.16) !important;
  animation: fieldShake 0.32s ease;
}

@keyframes fieldShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.app-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(20, 8, 12, 0.56);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.app-modal-card {
  width: 100%;
  max-width: 28rem;
  padding: 1.5rem 1.45rem 1.35rem;
  border-radius: 20px;
  background: var(--card-bg);
  color: var(--text);
  border: 1.5px solid var(--card-border);
  box-shadow: 0 22px 55px rgba(15, 5, 8, 0.28);
  text-align: center;
}

.app-modal-msg {
  font-size: 0.98rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.app-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.app-modal-actions > button {
  flex: 1;
  min-height: 44px;
}

.app-modal-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--primary-ink, var(--primary));
  margin-bottom: 0.75rem;
}

.app-legal-card {
  max-width: 36rem;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  text-align: start;
}

.app-legal-card .app-modal-msg {
  overflow-y: auto;
  white-space: pre-line;
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.68;
  padding-inline-end: 0.35rem;
  margin-bottom: 1.1rem;
}

.legal-contact-intro {
  margin: 0 0 0.85rem;
}

.legal-contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.legal-contact-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 6%, var(--card-bg));
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--card-border));
}

.legal-contact-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.legal-contact-link {
  color: var(--primary-ink, var(--primary));
  font-weight: 600;
  text-decoration: none;
  word-break: break-all;
}

.legal-contact-link:hover {
  text-decoration: underline;
}

#section-hero.section {
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.75rem;
}

.site-footer {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding-top: 0.75rem;
  font-size: 0.86rem;
  color: var(--text-light);
}

.site-footer-link {
  border: none;
  background: transparent;
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.site-footer-link:hover {
  color: var(--primary-ink, var(--primary));
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.site-footer-sep {
  opacity: 0.45;
  user-select: none;
}

/* ===== Customer Comfort: Draft Resume Banner ===== */
.draft-resume-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 0.9rem;
  width: 100%;
  margin: 1rem 0 0.85rem;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--primary) 8%, var(--card-bg));
  border: 1.5px solid color-mix(in srgb, var(--primary) 26%, var(--card-border));
  box-shadow: 0 6px 20px var(--shadow);
}

.draft-resume-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.draft-resume-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Envelope Wax-Seal Chooser & Live Preview */
.seal-style-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.seal-style-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px 11px;
  border-radius: var(--radius-md);
  border: 2px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
  text-align: center;
}

.seal-btn-emblem {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.seal-btn-emblem svg {
  width: 100%;
  height: 100%;
  display: block;
}

.seal-btn-label {
  line-height: 1.25;
}

.seal-style-btn:hover {
  border-color: color-mix(in srgb, var(--primary) 65%, var(--card-border));
  transform: translateY(-2px);
}

.seal-style-btn:hover .seal-btn-emblem {
  transform: scale(1.06);
}

.seal-style-btn.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--card-bg));
  color: var(--primary-ink, var(--primary));
  box-shadow: 0 6px 18px var(--shadow);
}

.seal-live-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--card-border);
  background: color-mix(in srgb, var(--bg-alt) 55%, var(--card-bg));
}

.seal-live-envelope {
  position: relative;
  width: 108px;
  height: 70px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-alt) 45%, var(--card-bg)), var(--card-bg));
  border: 1.5px solid color-mix(in srgb, var(--accent) 45%, var(--card-border));
  box-shadow: 0 6px 16px var(--shadow);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.seal-live-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: color-mix(in srgb, var(--primary) 10%, var(--bg-alt));
  clip-path: polygon(0 0, 100% 0, 50% 96%);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.seal-live-trim {
  position: absolute;
  inset: 4px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  pointer-events: none;
}

.seal-live-seal {
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  margin-top: 8px;
}

.seal-live-seal svg {
  width: 100%;
  height: 100%;
  display: block;
}

.seal-live-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.seal-live-note {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
}

.seal-live-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.gift-envelope-logo[data-seal] {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  box-shadow: none;
}

@media (max-width: 600px) {
  .seal-style-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Hands-Free Memory Slideshow Trigger */
.gallery-slideshow-bar {
  display: flex;
  justify-content: center;
  margin: 0.35rem 0 1.25rem;
}

.btn-slideshow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  padding: 9px 18px;
  border-radius: 999px;
}

/* Recipient Thank-You Reply Note & Sender Tracking Replies */
.recipient-reply-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 460px;
  margin: 1rem auto 0.25rem;
}

.recipient-reply-input {
  flex: 1 1 240px;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(157, 35, 65, 0.25);
  background: rgba(255, 255, 255, 0.92);
  color: #2f1c22;
  font-size: 0.92rem;
}

.track-notes-wrap {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(157, 35, 65, 0.14);
  text-align: start;
}

.track-notes-heading {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--primary, #9d2341);
  margin-bottom: 0.65rem;
}

.track-notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.track-note-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(157, 35, 65, 0.05);
  border: 1px solid rgba(157, 35, 65, 0.12);
}

.track-note-text {
  font-size: 0.95rem;
  line-height: 1.45;
  word-break: break-word;
}

.track-note-time {
  font-size: 0.78rem;
  opacity: 0.72;
}

/* ===== Giftly Custom Dropdown Pickers (.gselect) ===== */
.gselect {
  position: relative;
  width: 100%;
  min-width: 0;
}

.gselect-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  pointer-events: none !important;
}

.gselect-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0.65rem 0.78rem;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  background-color: var(--card-bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  text-align: start;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}

.gselect-trigger:hover {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--card-border));
}

.gselect-trigger:focus-visible,
.gselect.is-open .gselect-trigger {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--shadow);
}

.gselect-trigger.is-empty {
  color: var(--text-light);
  font-weight: 500;
}

.gselect-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gselect-chevron {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--text-light);
  transition: transform 0.2s ease, color 0.2s ease;
}

.gselect-chevron svg {
  width: 16px;
  height: 16px;
}

.gselect.is-open .gselect-chevron {
  transform: rotate(180deg);
  color: var(--primary-ink, var(--primary));
}

.gselect-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  display: grid;
  gap: 5px;
  padding: 0.65rem;
  min-width: 100%;
  max-width: min(320px, calc(100vw - 24px));
  max-height: 248px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 16px;
  border: 1.5px solid color-mix(in srgb, var(--primary) 20%, var(--card-border));
  background: var(--card-bg);
  box-shadow: 0 18px 42px rgba(28, 12, 18, 0.22), 0 4px 12px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
  animation: gselectPop 0.16s ease-out;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--primary) 35%, transparent) transparent;
}

.gselect-menu[hidden] {
  display: none !important;
}

.gselect-menu.is-dropup {
  top: auto;
  bottom: calc(100% + 8px);
}

.gselect-menu::-webkit-scrollbar {
  width: 6px;
}

.gselect-menu::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 35%, transparent);
}

.gselect-menu.is-grid-days {
  width: max-content;
  min-width: min(272px, calc(100vw - 24px));
  grid-template-columns: repeat(7, minmax(32px, 1fr));
}

.gselect-menu.is-grid-months {
  width: max-content;
  min-width: min(276px, calc(100vw - 24px));
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gselect-menu.is-grid-years {
  width: max-content;
  min-width: min(240px, calc(100vw - 24px));
  grid-template-columns: repeat(3, minmax(64px, 1fr));
}

.gselect-menu.is-grid-time {
  width: max-content;
  min-width: min(260px, calc(100vw - 24px));
  grid-template-columns: repeat(4, minmax(52px, 1fr));
}

.gselect-menu.is-grid-list {
  grid-template-columns: 1fr;
}

.gselect-option {
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0.48rem 0.4rem;
  min-height: 36px;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease, transform 0.12s ease;
}

.gselect-option:hover,
.gselect-option:focus-visible {
  outline: none;
  background: color-mix(in srgb, var(--primary) 11%, transparent);
  border-color: color-mix(in srgb, var(--primary) 28%, transparent);
  color: var(--primary-ink, var(--primary));
}

.gselect-option.is-selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 32%, transparent);
}

.gselect-option:active {
  transform: scale(0.96);
}

@keyframes gselectPop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 420px) {
  .gselect-menu.is-grid-months {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
