:root {
  color-scheme: light;
  --bg: #eef9fb;
  --surface: rgba(255, 255, 255, 0.63);
  --surface-strong: rgba(255, 255, 255, 0.82);
  --ink: #242c31;
  --muted: #66757a;
  --coral: #ec6d76;
  --coral-dark: #d65363;
  --sea: #91cdda;
  --sand: #f4dfbc;
  --line: rgba(36, 44, 49, 0.14);
  --shadow: 0 24px 70px rgba(44, 58, 62, 0.18);
  --soft-shadow: 0 18px 54px rgba(44, 58, 62, 0.12);
  --radius-card: 8px;
  --font-ui: "Avenir Next", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
  --event-cover-image: image-set(url("/assets/just-married-cover.webp") type("image/webp"), url("/assets/just-married-cover.png") type("image/png"));
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  letter-spacing: 0;
}

body.modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(238, 249, 251, 0.45), rgba(255, 255, 255, 0.78) 52%, rgba(246, 229, 203, 0.58)),
    var(--event-cover-image);
  background-position: center;
  background-size: cover;
}

.ambient::before {
  content: "";
  position: absolute;
  inset: -42px;
  background: inherit;
  filter: blur(28px) saturate(1.05);
  transform: scale(1.08);
  opacity: 0.74;
}

.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 73% 22%, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 35%),
    linear-gradient(90deg, rgba(238, 249, 251, 0.58), rgba(255, 255, 255, 0.88) 47%, rgba(255, 255, 255, 0.62));
}

.stage {
  min-height: 100svh;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: clamp(28px, 5svh, 56px) 36px;
}

.player {
  width: min(100%, 1250px);
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(360px, 0.96fr) minmax(390px, 1fr);
  align-items: start;
  gap: clamp(34px, 4vw, 52px);
}

.cover-frame {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  background: var(--sand);
  isolation: isolate;
  animation: none;
  transition: none;
}

.cover-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  animation: none;
  transition: none;
}

.cover-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: inherit;
  pointer-events: none;
}

.cover-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  mix-blend-mode: screen;
  opacity: 0.64;
  pointer-events: none;
  animation: none;
  transition: none;
}

.track-copy,
.waveform-wrap,
.timeline,
.transport,
.secondary-controls {
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
}

.player.track-transition-out .track-copy,
.player.track-transition-out .waveform-wrap,
.player.track-transition-out .timeline,
.player.track-transition-out .transport,
.player.track-transition-out .secondary-controls {
  opacity: 0.26;
  filter: blur(2px);
  transform: translateY(5px) scale(0.995);
}

.player.track-transition-in .track-copy,
.player.track-transition-in .waveform-wrap,
.player.track-transition-in .timeline,
.player.track-transition-in .transport,
.player.track-transition-in .secondary-controls {
  animation: track-enter 260ms ease both;
}

@keyframes track-enter {
  from {
    opacity: 0.44;
    filter: blur(2px);
    transform: translateY(6px) scale(0.995);
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

.controls-panel {
  position: relative;
  min-width: 0;
  padding: 36px 0;
}

.controls-panel::before {
  content: "";
  position: absolute;
  right: -9%;
  top: -18%;
  width: min(44vw, 550px);
  aspect-ratio: 1.72;
  border: 11px double rgba(255, 255, 255, 0.48);
  border-bottom-color: transparent;
  border-left-color: rgba(255, 255, 255, 0.2);
  border-radius: 50% 50% 0 0;
  transform: rotate(5deg);
  pointer-events: none;
}

.track-copy h1 {
  margin: 0;
  max-width: 780px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(3.05rem, 4vw, 4.35rem);
  font-weight: 400;
  line-height: 1.02;
  overflow-wrap: break-word;
}

.track-copy p {
  margin: 16px 0 0;
  color: var(--coral);
  font-size: 1.35rem;
  font-weight: 500;
}

.event-collection {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.waveform-wrap {
  width: min(100%, 720px);
  max-width: 100%;
  height: 86px;
  margin-top: 42px;
  overflow: hidden;
}

#waveform {
  display: block;
  width: 100%;
  height: 100%;
}

.timeline {
  width: min(100%, 720px);
  max-width: 100%;
  display: grid;
  grid-template-columns: 58px minmax(180px, 1fr) 58px;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  color: var(--ink);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.timeline span:last-child {
  text-align: right;
}

.scrubber,
.volume {
  position: relative;
  display: block;
  height: 28px;
}

.scrubber input,
.volume input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.scrubber-track,
.volume-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(36, 44, 49, 0.18);
  overflow: visible;
}

#seekFill,
#volumeFill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: inherit;
  background: var(--coral);
}

#seekFill::after,
#volumeFill::after {
  content: "";
  position: absolute;
  right: -9px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--coral);
  box-shadow: 0 4px 14px rgba(36, 44, 49, 0.18);
}

.transport {
  width: min(100%, 560px);
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 46px;
  margin-top: 28px;
}

.secondary-controls {
  width: min(100%, 520px);
  max-width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(150px, 300px) 42px;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 28px;
}

.track-list {
  width: min(100%, 720px);
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  margin-top: 22px;
  padding: 3px 2px 7px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-padding-inline: 14px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}

.track-list::-webkit-scrollbar {
  display: none;
}

.track-option {
  min-height: 46px;
  border: 1px solid rgba(36, 44, 49, 0.11);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 5px 8px 5px 5px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.54);
  box-shadow: 0 8px 22px rgba(44, 58, 62, 0.06);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.track-option img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(44, 58, 62, 0.12);
}

.track-option span {
  color: currentColor;
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.track-option.active {
  border-color: rgba(236, 109, 118, 0.34);
  color: var(--coral-dark);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 12px 28px rgba(214, 83, 99, 0.1);
}

.track-option:hover,
.track-option:focus-visible {
  border-color: rgba(236, 109, 118, 0.48);
  background: rgba(255, 255, 255, 0.8);
}

.memory-cta {
  width: min(100%, 560px);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid rgba(36, 44, 49, 0.09);
}

.memory-button {
  min-height: 44px;
  border: 1px solid rgba(236, 109, 118, 0.34);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  color: var(--coral-dark);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--soft-shadow);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.memory-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.memory-button span {
  color: currentColor;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1;
}

.memory-button:hover,
.memory-button:focus-visible {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(236, 109, 118, 0.6);
  box-shadow: 0 18px 38px rgba(44, 58, 62, 0.14);
  transform: translateY(-1px);
}

.icon-button,
.play-button {
  border: 0;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease, transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.icon-button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

.icon-button.small {
  width: 42px;
  height: 42px;
}

.play-button {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(180deg, #ee7d84, var(--coral-dark));
  box-shadow: 0 18px 36px rgba(214, 83, 99, 0.36);
}

.icon-button svg,
.play-button svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.icon-button svg path,
.play-button svg path {
  vector-effect: non-scaling-stroke;
}

.play-button svg {
  width: 34px;
  height: 34px;
}

.play-button #playIcon path,
.transport .icon-button path {
  fill: currentColor;
  stroke: none;
}

#volumeIcon path {
  fill: none;
  stroke: currentColor;
}

.icon-button:hover,
.icon-button:focus-visible {
  color: var(--coral-dark);
  background: rgba(255, 255, 255, 0.5);
}

.play-button:hover,
.play-button:focus-visible {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 22px 42px rgba(214, 83, 99, 0.42);
}

.icon-button:active,
.play-button:active {
  transform: scale(0.97);
}

.icon-button:focus-visible,
.play-button:focus-visible,
.memory-button:focus-visible,
.track-option:focus-visible,
.modal-close:focus-visible,
.ghost-button:focus-visible,
.submit-button:focus-visible,
input:focus-visible + .scrubber-track,
input:focus-visible + .volume-track {
  outline: 3px solid rgba(145, 205, 218, 0.82);
  outline-offset: 4px;
}

.volume {
  width: 100%;
}

.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;
}

.memory-modal[hidden] {
  display: none;
}

.memory-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(238, 249, 251, 0.64);
  backdrop-filter: blur(16px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 590px);
  max-height: min(760px, calc(100svh - 44px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius-card);
  padding: 34px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 80px rgba(44, 58, 62, 0.22);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: rgba(238, 249, 251, 0.68);
  cursor: pointer;
}

.modal-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.2;
}

.modal-copy {
  padding-right: 44px;
}

.modal-copy h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 2.45rem;
  font-weight: 400;
  line-height: 1.04;
}

.modal-copy p {
  margin: 12px 0 0;
  color: var(--coral);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.memory-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 28px;
}

.memory-form label {
  position: relative;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.memory-form label.wide,
.form-status,
.form-actions {
  grid-column: 1 / -1;
}

.memory-form input,
.memory-form textarea {
  width: 100%;
  border: 1px solid rgba(36, 44, 49, 0.14);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  font-size: 1rem;
  line-height: 1.3;
}

.memory-form input::placeholder,
.memory-form textarea::placeholder {
  color: rgba(102, 117, 122, 0.66);
}

.memory-form textarea {
  resize: vertical;
  min-height: 110px;
}

.character-count {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: rgba(102, 117, 122, 0.7);
  font-size: 0.74rem;
  font-weight: 700;
}

.upload-zone {
  position: relative;
  min-height: 112px;
  border: 1.5px dashed rgba(236, 109, 118, 0.38);
  border-radius: 8px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 18px 14px;
  color: var(--coral-dark);
  background: rgba(255, 248, 246, 0.74);
  cursor: pointer;
  text-align: center;
}

.upload-zone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-zone svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.upload-zone strong,
.upload-zone em {
  display: block;
  line-height: 1.25;
}

.upload-zone strong {
  font-size: 0.9rem;
}

.upload-zone em {
  color: rgba(102, 117, 122, 0.86);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 600;
}

.memory-form input:focus,
.memory-form textarea:focus,
.upload-zone:focus-within {
  border-color: rgba(236, 109, 118, 0.72);
  outline: 3px solid rgba(236, 109, 118, 0.16);
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
}

.form-status.success {
  color: #3d7e69;
}

.form-status.error {
  color: #a63845;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.note-only-button,
.ghost-button,
.submit-button {
  min-height: 44px;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.note-only-button {
  margin-right: auto;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--coral-dark);
  background: transparent;
  padding-inline: 2px 10px;
}

.note-only-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.ghost-button {
  border: 1px solid rgba(36, 44, 49, 0.14);
  color: var(--ink);
  background: transparent;
}

.submit-button {
  border: 1px solid rgba(236, 109, 118, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: linear-gradient(180deg, #ee7d84, var(--coral-dark));
  box-shadow: 0 14px 28px rgba(214, 83, 99, 0.25);
}

.submit-button::before {
  content: "";
  width: 17px;
  height: 17px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12.1 21.35 10.55 19.94C5.4 15.27 2 12.18 2 8.4 2 5.31 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.08A6 6 0 0 1 16.5 3C19.58 3 22 5.31 22 8.4c0 3.78-3.4 6.87-8.55 11.54z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12.1 21.35 10.55 19.94C5.4 15.27 2 12.18 2 8.4 2 5.31 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.08A6 6 0 0 1 16.5 3C19.58 3 22 5.31 22 8.4c0 3.78-3.4 6.87-8.55 11.54z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.submit-button:disabled,
.ghost-button:disabled,
.note-only-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.memory-toast[hidden] {
  display: none;
}

.memory-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 35;
  width: min(360px, calc(100vw - 32px));
  min-height: 72px;
  border: 1px solid rgba(88, 184, 132, 0.34);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 50px rgba(44, 58, 62, 0.18);
  backdrop-filter: blur(16px);
}

.toast-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #37a86d;
  background: rgba(88, 184, 132, 0.12);
}

.toast-icon svg,
.memory-toast button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.3;
}

.memory-toast > span:last-of-type {
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.32;
}

.memory-toast button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.memory-toast button:hover,
.memory-toast button:focus-visible {
  color: var(--ink);
  background: rgba(238, 249, 251, 0.78);
}

.memory-heart {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 45;
  width: var(--heart-size, 16px);
  height: var(--heart-size, 16px);
  pointer-events: none;
  opacity: 0;
  border-radius: 2px;
  background: linear-gradient(180deg, #f1969d, var(--coral-dark));
  filter: drop-shadow(0 7px 12px rgba(214, 83, 99, 0.22));
  transform: translate(-50%, -50%) rotate(45deg) scale(0.4);
  animation: memory-heart-burst 1800ms cubic-bezier(0.18, 0.72, 0.2, 1) var(--heart-delay, 0ms) forwards;
}

.memory-heart::before,
.memory-heart::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
}

.memory-heart::before {
  left: -50%;
}

.memory-heart::after {
  top: -50%;
}

@keyframes memory-heart-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(45deg) scale(0.4);
  }

  12% {
    opacity: 1;
  }

  82% {
    opacity: 0.82;
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--heart-x)), calc(-50% + var(--heart-y))) rotate(calc(45deg + var(--heart-rotate))) scale(0.86);
  }
}

@media (prefers-reduced-motion: reduce) {
  .track-copy,
  .waveform-wrap,
  .timeline,
  .transport,
  .secondary-controls,
  .track-option,
  .memory-button,
  .icon-button,
  .play-button {
    transition: none;
    animation: none;
  }

  .memory-heart {
    display: none;
  }
}

@media (max-height: 780px) and (min-width: 861px) {
  .stage {
    padding-block: 24px;
  }

  .controls-panel {
    padding: 6px 0;
  }

  .track-copy h1 {
    font-size: clamp(2.8rem, 3.5vw, 3.65rem);
  }

  .track-copy p {
    margin-top: 10px;
    font-size: 1.12rem;
  }

  .event-collection {
    font-size: 0.86rem;
  }

  .waveform-wrap {
    height: 58px;
    margin-top: 22px;
  }

  .timeline {
    margin-top: 10px;
    font-size: 0.96rem;
  }

  .transport {
    gap: 32px;
    margin-top: 16px;
  }

  .play-button {
    width: 68px;
    height: 68px;
  }

  .secondary-controls {
    margin-top: 16px;
  }

  .track-list {
    margin-top: 13px;
  }

  .memory-cta {
    margin-top: 16px;
    padding-top: 14px;
  }
}

@media (max-width: 1120px) {
  .stage {
    padding: 32px 28px;
  }

  .player {
    max-width: 1000px;
    grid-template-columns: minmax(360px, 0.92fr) minmax(360px, 1fr);
    gap: 28px;
  }

  .controls-panel {
    padding: 18px 0;
  }

  .controls-panel::before {
    right: -18%;
    top: -12%;
    opacity: 0.58;
  }

  .track-copy h1 {
    font-size: 3.15rem;
  }

  .track-copy p {
    font-size: 1.15rem;
  }

  .event-collection {
    font-size: 0.88rem;
  }

  .waveform-wrap {
    height: 66px;
    margin-top: 24px;
  }

  .transport {
    gap: 30px;
    margin-top: 20px;
  }

  .play-button {
    width: 70px;
    height: 70px;
  }

  .secondary-controls {
    margin-top: 18px;
  }

  .track-list {
    margin-top: 16px;
  }

  .memory-cta {
    width: 100%;
    margin-top: 22px;
    padding-top: 18px;
  }
}

@media (max-width: 860px) {
  .stage {
    padding: 34px 22px;
    place-items: start center;
  }

  .player {
    max-width: 640px;
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .controls-panel {
    width: 100%;
    min-width: 0;
    padding: 0;
  }

  .track-copy h1 {
    font-size: 3.45rem;
  }

  .waveform-wrap {
    height: 86px;
    margin-top: 28px;
  }
}

@media (max-width: 560px) {
  .stage {
    min-height: 100svh;
    padding: 14px 18px 126px;
  }

  .player {
    gap: 24px;
  }

  .cover-frame {
    width: min(100%, 322px);
    margin-inline: auto;
  }

  .track-copy h1 {
    font-size: 2.22rem;
    line-height: 1.02;
  }

  .track-copy p {
    margin-top: 10px;
  }

  .waveform-wrap {
    height: 58px;
    margin-top: 20px;
  }

  .timeline {
    grid-template-columns: 44px minmax(120px, 1fr) 44px;
    gap: 10px;
    font-size: 0.9rem;
  }

  .transport {
    gap: 32px;
    margin-top: 20px;
  }

  .play-button {
    width: 70px;
    height: 70px;
  }

  .secondary-controls {
    grid-template-columns: 38px minmax(120px, 1fr) 38px;
    gap: 12px;
    margin-top: 18px;
  }

  .track-list {
    width: 100%;
    justify-content: flex-start;
    margin-top: 16px;
    margin-bottom: 82px;
    padding-inline: 0;
    scroll-padding-inline: 18px;
    mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
  }

  .track-option {
    min-height: 44px;
    gap: 8px;
    padding: 5px 10px 5px 5px;
  }

  .track-option img {
    width: 32px;
    height: 32px;
  }

  .track-option span {
    font-size: 0.78rem;
  }

  .icon-button {
    width: 42px;
    height: 42px;
  }

  .memory-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 12;
    width: auto;
    margin-top: 0;
    padding: 0 18px;
    border: 0;
    pointer-events: none;
  }

  .memory-button {
    min-height: 56px;
    padding-inline: 26px;
    justify-content: center;
    white-space: nowrap;
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 42px rgba(44, 58, 62, 0.2);
    backdrop-filter: blur(16px);
  }

  .memory-button span {
    font-size: 0.96rem;
  }

  .memory-modal {
    align-items: end;
    padding: 0;
  }

  .modal-card {
    width: 100%;
    max-height: min(92svh, 760px);
    border-radius: 8px 8px 0 0;
    padding: 28px 20px calc(18px + env(safe-area-inset-bottom));
  }

  .modal-card::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 50%;
    width: 48px;
    height: 4px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(36, 44, 49, 0.22);
  }

  .modal-copy {
    padding-right: 38px;
  }

  .modal-copy h2 {
    font-size: 1.58rem;
    text-align: center;
  }

  .modal-copy p {
    text-align: center;
    font-size: 0.9rem;
  }

  .memory-form {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 18px;
  }

  .memory-form input,
  .memory-form textarea {
    font-size: 0.95rem;
    padding: 11px 12px;
  }

  .memory-form textarea {
    min-height: 78px;
  }

  .upload-zone {
    min-height: 86px;
    padding: 12px;
  }

  .upload-zone svg {
    width: 28px;
    height: 28px;
  }

  .form-actions {
    position: sticky;
    bottom: calc(-18px - env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 10px;
    margin: 0 -20px;
    padding: 12px 20px calc(14px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 -16px 34px rgba(44, 58, 62, 0.08);
  }

  .note-only-button {
    grid-column: 1 / -1;
    min-height: 36px;
    justify-self: start;
  }

  .submit-button {
    width: 100%;
  }

  .ghost-button {
    width: 100%;
  }

  .memory-toast {
    left: 16px;
    right: 16px;
    bottom: calc(102px + env(safe-area-inset-bottom));
    width: auto;
    min-height: 66px;
  }

  body.modal-open .memory-toast {
    top: 12px;
    bottom: auto;
  }
}

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