/*
 * ANA Voice Postcard — iOS 27 inspired interface layer
 * Brand-preserving adaptation of Apple's hierarchy, harmony, materials,
 * concentric geometry, touch sizing and motion foundations for the web.
 */

@font-face {
  font-family: "Vazirmatn Local";
  src: url("fonts/vazirmatn-fa.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
  font-family: "Vazirmatn Local";
  src: url("fonts/vazirmatn-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215;
}

@font-face {
  font-family: "Estedad Local";
  src: url("fonts/estedad-fa.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
  font-family: "Estedad Local";
  src: url("fonts/estedad-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215;
}

@font-face {
  font-family: "Lalezar Local";
  src: url("fonts/lalezar-fa.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
  font-family: "Lalezar Local";
  src: url("fonts/lalezar-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215;
}

@font-face {
  font-family: "Noto Naskh Local";
  src: url("fonts/noto-naskh-fa.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
  font-family: "Noto Naskh Local";
  src: url("fonts/noto-naskh-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215;
}

:root {
  color-scheme: light;
  --font-ui: "Vazirmatn Local", -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
  --font-display: "Estedad Local", "Vazirmatn Local", sans-serif;
  --font-campaign: "Lalezar Local", "Estedad Local", sans-serif;
  --font-letter: "Noto Naskh Local", "Vazirmatn Local", serif;
  --ios-blue: #0a66c2;
  --ios-blue-pressed: #0753a1;
  --ios-label: #10233d;
  --ios-secondary-label: #52647b;
  --ios-tertiary-label: #77889c;
  --ios-separator: rgba(18, 59, 113, 0.13);
  --ios-content: rgba(255, 255, 255, 0.86);
  --ios-content-solid: #f9fcff;
  --ios-glass: rgba(246, 251, 255, 0.58);
  --ios-glass-strong: rgba(250, 253, 255, 0.76);
  --ios-blue-glass: rgba(22, 101, 182, 0.82);
  --ios-gold-glass: rgba(240, 180, 41, 0.88);
  --ios-hairline: 0.5px solid rgba(255, 255, 255, 0.7);
  --ios-inner-light: inset 0 1px 0 rgba(255, 255, 255, 0.72), inset 0 -1px 0 rgba(9, 51, 100, 0.08);
  --ios-shadow-float: 0 12px 36px rgba(6, 40, 80, 0.17), 0 2px 8px rgba(6, 40, 80, 0.09);
  --ios-shadow-control: 0 8px 22px rgba(6, 43, 86, 0.18), var(--ios-inner-light);
  --ios-radius-window: 42px;
  --ios-radius-card: 30px;
  --ios-radius-control: 18px;
  --ios-radius-small: 14px;
  --ios-spring: 420ms cubic-bezier(0.22, 1, 0.36, 1);
  --ios-press: 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --max-width: 500px;
}

html {
  background: #082d5a;
  overscroll-behavior-y: none;
}

body {
  min-height: 100svh;
  background:
    radial-gradient(circle at 82% -8%, rgba(143, 199, 232, 0.72) 0, transparent 32rem),
    radial-gradient(circle at -5% 92%, rgba(240, 180, 41, 0.32) 0, transparent 25rem),
    linear-gradient(155deg, #092f5f 0%, #1760a7 52%, #72b4dc 118%);
  color: var(--ios-label);
  font-family: var(--font-ui);
  line-height: 1.65;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
summary,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

:focus-visible {
  outline: 3px solid rgba(240, 180, 41, 0.92);
  outline-offset: 3px;
  border-radius: 14px;
}

.page {
  min-height: 100svh;
  padding: 0;
  background: transparent;
}

.page::before,
.page::after {
  display: none;
}

.shell {
  isolation: isolate;
  width: 100%;
  max-width: var(--max-width);
  min-height: 100svh;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 82% 4%, rgba(143, 199, 232, 0.32), transparent 18rem),
    linear-gradient(180deg, #eef7fe 0%, #f9fcff 45%, #edf6fc 100%);
  box-shadow: none;
}

.shell::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 260px;
  background:
    radial-gradient(circle at 82% 18%, rgba(240, 180, 41, 0.16), transparent 8rem),
    linear-gradient(180deg, rgba(143, 199, 232, 0.18), transparent);
  pointer-events: none;
}

/* Floating navigation/control layer */
.wizard-progress {
  position: relative;
  z-index: 20;
  gap: 5px;
  width: calc(100% - 32px);
  min-height: 34px;
  margin: max(12px, env(safe-area-inset-top)) 16px 0;
  padding: 14px 13px;
  border: var(--ios-hairline);
  border-radius: 999px;
  background: var(--ios-glass);
  box-shadow: var(--ios-shadow-control);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
}

.wizard-progress span {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(18, 59, 113, 0.13);
  box-shadow: inset 0 1px 1px rgba(3, 33, 68, 0.06);
}

.wizard-progress span.is-done {
  background: rgba(10, 102, 194, 0.72);
}

.wizard-progress span.is-active {
  background: linear-gradient(90deg, var(--ios-blue), #3f95d4 66%, var(--ana-gold));
  box-shadow: 0 0 10px rgba(10, 102, 194, 0.28);
}

/* Content layer */
.wizard-step {
  padding: 18px 20px max(22px, env(safe-area-inset-bottom));
  animation: ios-view-enter var(--ios-spring) both;
}

.wizard-step[data-step="1"] {
  padding-top: 14px;
}

.step-back {
  align-self: flex-start;
  min-width: 44px;
  min-height: 44px;
  margin: 0 0 7px;
  padding: 0 15px;
  border: var(--ios-hairline);
  border-radius: 999px;
  background: var(--ios-glass-strong);
  color: var(--ios-blue);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 5px 16px rgba(9, 53, 101, 0.1), var(--ios-inner-light);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
}

.step-back:active {
  transform: scale(0.95);
  background: rgba(232, 243, 252, 0.88);
}

.step-eyebrow {
  min-height: 28px;
  margin: 0 2px 10px;
  color: var(--ios-blue);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0;
}

.step-eyebrow span:last-child {
  min-width: 52px;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(18, 59, 113, 0.07);
  color: var(--ios-secondary-label);
  text-align: center;
}

.step-title {
  max-width: 390px;
  margin-top: 12px;
  color: var(--ios-label);
  font-size: clamp(26px, 7vw, 34px);
  font-weight: 800;
  line-height: 1.38;
  letter-spacing: -0.035em;
  font-family: var(--font-display);
}

.step-subtitle {
  max-width: 390px;
  margin-top: 7px;
  color: var(--ios-secondary-label);
  font-size: 16px;
  line-height: 1.8;
}

.hero-visual {
  aspect-ratio: 1.18 / 1;
  border: var(--ios-hairline);
  border-radius: var(--ios-radius-card);
  box-shadow: var(--ios-shadow-float);
  transform: translateZ(0);
}

.hero-visual::after {
  background:
    linear-gradient(0deg, rgba(4, 34, 70, 0.22), transparent 32%),
    linear-gradient(110deg, transparent 52%, rgba(143, 199, 232, 0.1));
}

.hero-visual img {
  object-position: 28% center;
}

.brand-badge,
.final-success-logo {
  width: 58px;
  height: 58px;
  padding: 6px;
  border: var(--ios-hairline);
  border-radius: 50%;
  background: rgba(250, 253, 255, 0.72);
  box-shadow: var(--ios-shadow-control);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
}

/* System-like controls */
.btn {
  min-height: 56px;
  padding: 13px 20px;
  border: var(--ios-hairline);
  border-radius: var(--ios-radius-control);
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.01em;
  box-shadow: var(--ios-shadow-control);
  transition: transform var(--ios-press), filter var(--ios-press), box-shadow var(--ios-press), opacity var(--ios-press);
}

.btn-primary {
  background: linear-gradient(180deg, rgba(35, 119, 201, 0.94), rgba(9, 82, 157, 0.96));
  color: #fff;
  box-shadow: 0 11px 25px rgba(5, 72, 143, 0.27), var(--ios-inner-light);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #2377c9, #09529d);
  filter: saturate(1.05);
}

.btn-secondary {
  background: rgba(215, 235, 249, 0.72);
  color: var(--ios-blue);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
}

.btn-outline,
.btn-ghost {
  border: var(--ios-hairline);
  background: var(--ios-glass-strong);
  color: var(--ios-blue);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
}

.btn:active:not(:disabled) {
  transform: scale(0.965);
  filter: brightness(0.96);
  box-shadow: 0 4px 12px rgba(6, 43, 86, 0.15), var(--ios-inner-light);
}

.btn:disabled {
  opacity: 0.42;
  box-shadow: none;
}

.btn-row {
  gap: 10px;
}

/* Form components */
#detailsForm {
  gap: 12px;
}

.field {
  margin-top: 14px;
}

.field label {
  margin: 0 4px 7px;
  color: var(--ios-secondary-label);
  font-size: 14px;
  font-weight: 650;
}

.field input[type="text"] {
  min-height: 58px;
  padding: 14px 17px;
  border: 1px solid var(--ios-separator);
  border-radius: var(--ios-radius-control);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ios-label);
  font-size: 17px;
  box-shadow: 0 4px 16px rgba(8, 48, 94, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  caret-color: var(--ios-blue);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.field input[type="text"]::placeholder {
  color: #91a0b0;
}

.field input[type="text"]:focus {
  border-color: rgba(10, 102, 194, 0.7);
  outline: none;
  box-shadow: 0 0 0 4px rgba(10, 102, 194, 0.12), 0 8px 20px rgba(8, 48, 94, 0.08);
}

.field input.has-error {
  border-color: rgba(192, 57, 43, 0.72);
  box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.09);
}

/* List, disclosure and card components */
.guide-list,
.music-choices {
  gap: 10px;
  margin-top: 18px;
}

.guide-item,
.music-choice,
.suggestions,
.recorder-diagnostics,
.inline-consent,
.playback-card,
.mix-preview-result,
.after-play {
  border: 1px solid var(--ios-separator);
  border-radius: var(--ios-radius-control);
  background: var(--ios-content);
  box-shadow: 0 5px 18px rgba(7, 45, 88, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.guide-item {
  min-height: 56px;
  padding: 13px 15px;
  color: var(--ios-label);
  font-size: 15px;
}

.guide-item .dot {
  width: 8px;
  height: 8px;
  background: var(--ios-blue);
  box-shadow: 0 0 0 5px rgba(10, 102, 194, 0.1);
}

.guide-item-featured {
  border-color: rgba(255, 255, 255, 0.4);
  background: linear-gradient(135deg, rgba(13, 67, 128, 0.96), rgba(34, 112, 184, 0.92));
  color: #fff;
  box-shadow: 0 10px 24px rgba(9, 65, 128, 0.2), var(--ios-inner-light);
}

.music-icon,
.music-choice-icon {
  border: var(--ios-hairline);
  background: var(--ios-gold-glass);
  color: var(--ana-blue-deep);
  box-shadow: 0 5px 13px rgba(137, 91, 0, 0.15), var(--ios-inner-light);
}

.suggestions,
.recorder-diagnostics {
  overflow: hidden;
}

.suggestions summary,
.recorder-diagnostics summary {
  min-height: 52px;
  padding: 13px 16px;
  color: var(--ios-blue);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.suggestions[open] summary,
.recorder-diagnostics[open] summary {
  border-bottom: 0.5px solid var(--ios-separator);
}

.suggestion-item {
  border-color: var(--ios-separator);
  color: var(--ios-secondary-label);
}

.recording-prompts {
  overflow: hidden;
  border: 1px solid var(--ios-separator);
  border-radius: var(--ios-radius-control);
  background: var(--ios-content);
  box-shadow: 0 5px 18px rgba(7, 45, 88, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.recording-prompts h3 {
  color: var(--ios-blue);
}

/* Recorder as a focused content surface */
.recorder {
  margin-top: 18px;
  padding: 24px 16px 16px;
  border: 1px solid var(--ios-separator);
  border-radius: var(--ios-radius-card);
  background:
    radial-gradient(circle at 50% 21%, rgba(143, 199, 232, 0.24), transparent 9rem),
    rgba(255, 255, 255, 0.76);
  box-shadow: 0 12px 34px rgba(7, 45, 88, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.recorder-ring {
  width: 188px;
  height: 188px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(244, 250, 254, 0.58);
  box-shadow: 0 14px 36px rgba(10, 64, 124, 0.14), inset 0 0 0 8px rgba(255, 255, 255, 0.38);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
}

.recorder-ring circle.ring-bg {
  stroke: rgba(18, 59, 113, 0.1);
}

.recorder-ring circle.ring-progress {
  stroke: var(--ana-gold);
  filter: drop-shadow(0 0 5px rgba(240, 180, 41, 0.42));
}

.mic-button {
  width: 92px;
  height: 92px;
  border: var(--ios-hairline);
  background: linear-gradient(160deg, rgba(41, 128, 209, 0.96), rgba(6, 70, 139, 0.97));
  box-shadow: 0 13px 29px rgba(6, 61, 122, 0.3), var(--ios-inner-light);
}

.mic-button:active {
  transform: scale(0.93);
}

.recorder-controls[hidden] {
  display: none !important;
}

.timer {
  color: var(--ios-label);
  font-size: 34px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.recorder-hint,
.rerecord-note {
  color: var(--ios-secondary-label);
  font-size: 14px;
}

.waveform,
.playback-card {
  border-color: var(--ios-separator);
  background: rgba(255, 255, 255, 0.68);
}

.playback-card {
  padding: 10px;
  border-radius: 24px;
}

.auto-mix-status {
  border-color: rgba(143, 199, 232, 0.45);
  border-radius: var(--ios-radius-control);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 5px 18px rgba(7, 45, 88, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.auto-mix-status.has-error {
  border-color: rgba(192, 57, 43, 0.2);
  background: rgba(255, 238, 236, 0.88);
}

.play-toggle {
  width: 50px;
  height: 50px;
  border: var(--ios-hairline);
  background: var(--ios-blue-glass);
  box-shadow: var(--ios-shadow-control);
}

.voice-file-button {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ios-blue);
  font-weight: 650;
}

.mix-note,
.mix-explainer,
.privacy-note {
  border-radius: var(--ios-radius-small);
}

.music-choice {
  min-height: 74px;
  padding: 11px 13px;
  text-align: right;
  transition: transform var(--ios-press), border-color var(--ios-press), background var(--ios-press), box-shadow var(--ios-press);
}

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

.music-choice:active {
  transform: scale(0.975);
}

.music-choice.is-selected {
  border-color: rgba(10, 102, 194, 0.48);
  background: linear-gradient(135deg, rgba(218, 239, 253, 0.86), rgba(255, 255, 255, 0.92));
  box-shadow: 0 8px 22px rgba(8, 66, 129, 0.12), inset 0 0 0 1px rgba(10, 102, 194, 0.08);
}

.music-choice-check {
  width: 25px;
  height: 25px;
  border-color: rgba(18, 59, 113, 0.22);
}

.music-choice.is-selected .music-choice-check {
  border-color: var(--ios-blue);
  background: var(--ios-blue);
  color: #fff;
}

.inline-consent {
  padding: 16px;
}

.inline-consent .checkbox-field {
  margin-top: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.inline-consent .checkbox-field input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--ios-blue);
}

.inline-consent .checkbox-field label {
  color: var(--ios-secondary-label);
  font-size: 14px;
  line-height: 1.75;
}

.alert {
  border: 1px solid rgba(192, 57, 43, 0.16);
  border-radius: var(--ios-radius-small);
  background: rgba(255, 238, 236, 0.88);
  box-shadow: 0 6px 18px rgba(98, 31, 23, 0.07);
}

/* Progress, loading and completion states */
.loading-view {
  padding-inline: 4px;
}

.loading-spinner {
  border-color: rgba(10, 102, 194, 0.14);
  border-top-color: var(--ios-blue);
}

.build-steps span {
  min-height: 36px;
  border-radius: 999px;
  background: rgba(18, 59, 113, 0.07);
  color: var(--ios-tertiary-label);
}

.build-steps span.is-active {
  background: rgba(240, 180, 41, 0.2);
  color: #725005;
}

.upload-progress {
  border-radius: 999px;
  background: rgba(18, 59, 113, 0.1);
}

.upload-progress-bar {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ios-blue), #51a1d8);
}

.final-success-step {
  padding-top: 14px;
}

.final-success-art {
  aspect-ratio: 1.16 / 1;
  border: var(--ios-hairline);
  border-radius: var(--ios-radius-card);
  box-shadow: var(--ios-shadow-float);
}

.final-success-copy {
  padding: 22px 8px 18px;
}

.final-success-copy h2 {
  color: var(--ios-label);
  font-size: clamp(30px, 8vw, 38px);
}

.final-success-copy p {
  color: var(--ios-secondary-label);
  font-size: 15px;
}

.final-success-check {
  border: var(--ios-hairline);
  background: var(--ios-gold-glass);
  box-shadow: var(--ios-shadow-control);
}

.final-link-actions {
  min-height: 44px;
  color: var(--ios-blue);
  font-size: 14px;
}

/* Recipient experience */
#recipientApp {
  background:
    radial-gradient(circle at 84% 2%, rgba(143, 199, 232, 0.32), transparent 18rem),
    linear-gradient(180deg, #edf7fd 0%, #f9fcff 58%, #edf5fb 100%);
}

.card-scene {
  padding: max(18px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background: transparent;
}

.postcard-frame-v3 {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--ios-radius-card);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--ios-shadow-float);
}

.postcard-frame-v3 .card-key-visual {
  aspect-ratio: 1.08 / 1;
  border-radius: calc(var(--ios-radius-card) - 1px);
}

.postcard-frame-v3 .card-key-visual::after {
  background: linear-gradient(0deg, rgba(4, 31, 63, 0.52), transparent 46%);
}

.postcard-frame-v3 .postcard-message {
  padding: 22px 21px 20px;
}

.postcard-frame-v3 .postcard-message h1 {
  color: var(--ios-label);
  font-size: clamp(30px, 8vw, 38px);
}

.postcard-note {
  color: var(--ios-secondary-label);
  font-size: 15px;
}

.postcard-frame-v3 .from-label {
  color: var(--ios-secondary-label);
  font-size: 13px;
}

.card-hero-play {
  width: 112px;
  height: 112px;
  border: var(--ios-hairline);
  background: rgba(243, 186, 52, 0.9);
  box-shadow: 0 0 0 9px rgba(255, 255, 255, 0.2), 0 15px 36px rgba(2, 27, 57, 0.36), var(--ios-inner-light);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
}

.card-play-hint {
  top: calc(50% + 75px);
  right: auto;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  text-shadow: none;
}

.card-scene .after-play {
  margin-top: 12px;
  padding: 14px;
  background: var(--ios-glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
}

.card-scene .after-play p {
  color: var(--ios-secondary-label);
  font-size: 14px;
}

.state-scene {
  padding: max(28px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
}

.state-icon {
  border: var(--ios-hairline);
  background: var(--ios-glass-strong);
  box-shadow: var(--ios-shadow-control);
}

.state-title {
  color: var(--ios-label);
}

.state-text {
  color: var(--ios-secondary-label);
}

/* Brand signature stays content-level, quiet and readable. */
.brand-wave {
  height: 28px;
  opacity: 0.72;
}

.brand-footer {
  min-height: calc(52px + env(safe-area-inset-bottom));
  padding: 8px 16px max(12px, env(safe-area-inset-bottom));
  color: var(--ios-tertiary-label);
  font-size: 13px;
}

.brand-footer img {
  height: 22px;
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .wizard-progress,
  .step-back,
  .brand-badge,
  .final-success-logo,
  .btn-secondary,
  .btn-outline,
  .btn-ghost,
  .recorder-ring,
  .card-hero-play,
  .card-scene .after-play {
    background-color: rgba(247, 251, 254, 0.96);
  }
}

@media (min-width: 560px) {
  .page {
    padding: 24px;
  }

  .shell {
    min-height: min(860px, calc(100svh - 48px));
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--ios-radius-window);
    box-shadow: 0 34px 90px rgba(2, 27, 57, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  }

  .wizard-progress {
    margin-top: 16px;
  }

  .wizard-step {
    padding-inline: 28px;
  }
}

@media (max-width: 359px) {
  .wizard-step,
  .card-scene,
  .state-scene {
    padding-inline: 16px;
  }

  .hero-visual {
    aspect-ratio: 1.28 / 1;
  }

  .step-title {
    font-size: 24px;
  }

  .recorder {
    padding-inline: 10px;
  }

  .recorder-ring {
    width: 164px;
    height: 164px;
  }

  .mic-button {
    width: 80px;
    height: 80px;
  }

  .btn-row {
    flex-direction: column;
  }

  .btn-row .btn {
    width: 100%;
  }
}

@media (prefers-contrast: more) {
  :root {
    --ios-secondary-label: #2e425d;
    --ios-separator: rgba(18, 59, 113, 0.34);
    --ios-glass: rgba(255, 255, 255, 0.9);
    --ios-glass-strong: rgba(255, 255, 255, 0.96);
  }

  .btn,
  .field input[type="text"],
  .guide-item,
  .music-choice {
    border-width: 1.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Final typography roles — kept at the end so legacy component sizes cannot override them. */
.step-title,
.final-success-copy h2,
.postcard-frame-v3 .postcard-message h1,
.state-title,
.recipient-title {
  font-family: var(--font-display);
}

.postcard-kicker,
.postcard-frame-v3 .postcard-kicker,
.final-success-copy .postcard-kicker {
  font-family: var(--font-campaign);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
}

.postcard-note,
.postcard-frame-v3 .from-label,
.arrival-copy .recipient-sub,
.final-success-copy p {
  font-family: var(--font-letter);
  font-size: 17px;
  line-height: 1.9;
}

@keyframes ios-view-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
