:root {
  color-scheme: light;
  --evergreen: #19462b;
  --evergreen-deep: #0e321d;
  --evergreen-light: #416c45;
  --paper: #faf0e4;
  --ink: #163b24;
  --muted: #536450;
  --line: #d9ccba;
  --soft: #e0e6d8;
  --gold: #e4b557;
  --gold-dark: #865217;
  --gold-soft: #f8dfaa;
  --candy: #c81123;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%239b8066' opacity='.065' filter='url(%23n)' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
  font-family: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 16px;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Three ways to listen, with a share action independent of any local track. */
.app-sharing { position: absolute; top: 32px; right: 26px; display: grid; justify-items: end; gap: 5px; max-width: 200px; }
.app-sharing .share-button { color: var(--ink); border-color: #d6c1a7; background: var(--grain), linear-gradient(135deg, #fff7e9, #efddc9); font-size: 16px; padding: 10px 16px; border-radius: 22px; }
.share-status { color: var(--evergreen-deep); font-size: 13px; }
.share-status:empty { display: none; }
.share-dialog { width: min(420px, calc(100% - 32px)); padding: 24px; color: var(--ink); border: 5px solid #fbf3e9; border-radius: 24px; background: var(--grain), var(--paper); box-shadow: 0 20px 70px #18312d59; }
.share-dialog::backdrop { background: #17302770; backdrop-filter: blur(3px); }
.share-dialog h2 { font-size: 23px; }
.share-dialog p { margin-top: 10px; font-size: 16px; }
.share-dialog input { display: block; width: 100%; min-height: 44px; margin-top: 16px; padding: 10px; color: var(--ink); background: #fffbf3; border: 1px solid #c6c7ac; border-radius: 10px; font-size: 16px; }
.share-dialog .dialog-actions { display: flex; justify-content: flex-end; margin-top: 18px; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  position: relative;
  isolation: isolate;
  color: var(--ink);
  background: #ebe7ef;
  line-height: 1.45;
}
.winter-scene {
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: max(850px, 75vw);
  pointer-events: none;
  background: url("./artwork/winter-scene.webp?v=12") top center / 100% auto no-repeat;
}
.winter-scene::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 15%;
  background: linear-gradient(transparent, #ebe7ef);
}
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button, input, summary { touch-action: manipulation; }
button { transition: background-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease; }
button:disabled { cursor: default; opacity: .46; }
button:not(:disabled):active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, summary:focus-visible, canvas:focus-visible, a:focus-visible {
  outline: 3px solid #8e421d;
  outline-offset: 4px;
}
h1, h2, h3, p { margin: 0; }
svg { flex-shrink: 0; }
button svg, .source-icon svg, .headphone-note svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { width: min(680px, calc(100% - 48px)); margin: 0 auto; padding: 11px 0 25px; }
.app-header { text-align: center; margin: 0 -40px 17px; }
.app-wordmark { display: block; width: min(100%, 435px); height: auto; margin-inline: auto; }
.tagline { margin-top: 5px; color: #153b25; font-family: Georgia, "Times New Roman", serif; font-size: clamp(21px, 2.1vw, 29px); font-style: italic; font-weight: 700; line-height: 1.25; letter-spacing: -.025em; text-shadow: 0 1px #ffffff38; }
.mode-tabs { display: flex; justify-content: center; gap: 15px; position: relative; z-index: 1; margin: 0 38px -1px; }
.mode-tab { display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 12px; min-height: 55px; padding: 10px 18px 13px; border: 1px solid #527959; border-bottom: 0; border-radius: 24px 23px 9px 9px; color: #f9efdc; background: var(--grain), linear-gradient(140deg, #829a78, #547d5b 70%, #547454); box-shadow: inset 0 2px 3px #e6f0d94d, 0 3px 6px #283b2426; font-size: 21px; font-weight: 500; white-space: nowrap; }
.mode-tab:hover { filter: brightness(1.04); }
.mode-tab[aria-selected="true"] { color: var(--ink); background: var(--grain), linear-gradient(145deg, #fff8ed, #f5e4d2); border-color: #d9c2a8; box-shadow: inset 0 2px 3px #fffaf4, 0 3px 5px #45332135; font-weight: 700; }
.mode-tab svg { width: 28px; height: 28px; }
.mode-panel { position: relative; padding: 28px 27px 25px; border: 7px solid #fbf3e9; border-bottom: 10px solid #ede0d1; border-radius: 35px 39px 34px 40px; background: var(--grain), linear-gradient(108deg, #faf1e6, #f6eade 65%, #f9eee3); box-shadow: inset 0 3px 7px #fffdf9, inset 0 -4px 8px #b69f8740, 0 5px 5px #6f625536, 0 16px 25px #57667c18; }
.mode-panel::before { content: ""; position: absolute; z-index: 2; top: -8px; left: 15px; right: 17px; height: 13px; border-radius: 50% 40% 35% 45%; background: var(--grain), linear-gradient(#fffdf9, #fbf3e9); box-shadow: 0 -2px 3px #fff9f2bd, 0 3px 4px #8d74570d; pointer-events: none; }
.source-card { display: grid; grid-template-columns: 57px minmax(0, 1fr); align-items: center; column-gap: 14px; row-gap: 16px; padding-bottom: 24px; }
.source-icon { display: grid; place-items: center; width: 57px; height: 57px; border: 1px solid #e8d7bc; border-radius: 16px; color: var(--evergreen); background: var(--grain), linear-gradient(135deg, #fff9eb, #f5e6cd); box-shadow: inset 0 2px 2px #fffdf3, 0 2px 3px #7a5a3730; }
.source-icon svg { width: 32px; height: 32px; }
.source-copy { min-width: 0; }
.source-copy h2 { font-size: 22px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.source-copy p { margin-top: 5px; color: #304a32; font-size: 16px; line-height: 1.4; }
.source-actions { display: flex; grid-column: 2; gap: 9px; }
.source-actions .button { min-width: 200px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 10px 16px; border: 1px solid #c7cdb9; border-radius: 15px; font-size: 16px; font-weight: 600; line-height: 1.3; white-space: nowrap; box-shadow: inset 0 2px 2px #ffffff9c, inset 0 -2px 2px #5b493314, 0 3px 4px #534c3628; }
.button-primary { background: var(--grain), linear-gradient(135deg, #4b7849, #275532 70%, #20482a); border-color: #577753; color: #fff5e5; box-shadow: inset 0 2px 2px #adc19469, inset 0 -2px 2px #142d1c3d, 0 3px 4px #34432b3b; }
.button-primary:hover:not(:disabled) { background-color: #355a32; filter: brightness(1.08); }
.button-secondary { background: var(--grain), linear-gradient(135deg, #e8ecde, #d2ddcf); color: var(--ink); border-color: #c9d0bf; }
.button-secondary:hover:not(:disabled) { filter: brightness(1.035); box-shadow: inset 0 2px 2px #fff, 0 4px 6px #534c362e; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.section-heading h3 { font-size: 21px; font-weight: 700; }
.text-actions { display: flex; gap: 17px; }
.text-button { min-height: 40px; border: 0; padding: 6px 0; background: transparent; color: #25422a; font-size: 16px; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.text-button:hover { color: #a5151b; }
.wave-surface { overflow: hidden; width: 100%; border: 1px solid #e4d5b9; border-bottom-color: #fff9ec; border-radius: 26px; background: var(--grain), linear-gradient(135deg, #f9e7c5, #fff1d5 60%, #f2debb); box-shadow: inset 0 3px 7px #81643d33, 0 1px 1px #fff; }
#waveCanvas { display: block; width: 100%; height: 137px; cursor: crosshair; touch-action: none; }
.timeline-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-top: 10px; min-height: 44px; }
.hint { color: #435640; font-size: 13px; max-width: 340px; }
.range-list { display: flex; justify-content: flex-end; flex-wrap: wrap; flex-shrink: 0; max-width: 48%; gap: 6px; color: var(--gold-dark); font-size: 14px; }
.range-list button, .range-list .range-chip, .range-list .range-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 5px 11px; border: 1px solid #e7c78e; border-radius: 12px; background: var(--grain), linear-gradient(#ffe7b7, #f1d297); color: #825217; box-shadow: inset 0 1px 2px #fff4d4, 0 2px 3px #805e2526; font-size: 14px; font-variant-numeric: tabular-nums; }
.range-list button:hover { background-color: #e7c384; }
.range-list:empty { display: none; }

.audition-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; padding-bottom: 21px; border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 #fff8ed; }
.transport { display: flex; align-items: center; gap: 7px; min-width: 0; }
.play-button { min-width: 108px; min-height: 53px; padding: 11px 18px; border-color: #ce4c40; background: var(--grain), linear-gradient(135deg, #e73832, #c5101b 75%); color: #fff7df; font-size: 21px; font-weight: 700; box-shadow: inset 0 2px 3px #ffb1a6a1, inset 0 -3px 3px #8a0e195c, 0 3px 4px #6b281c4f; text-shadow: 0 1px 1px #8e251e; }
.play-button:hover:not(:disabled) { filter: brightness(1.08); }
.play-button svg { display: none; }
.play-button::before { content: ""; display: block; flex-shrink: 0; width: 18px; height: 23px; background: currentColor; clip-path: polygon(5% 0, 100% 50%, 5% 100%); }
.play-button.is-playing::before { width: 16px; height: 20px; clip-path: none; background: linear-gradient(to right, currentColor 0 35%, transparent 35% 65%, currentColor 65% 100%); }
.skip-button { width: 36px; min-height: 44px; flex-shrink: 0; padding: 6px; border-radius: 12px; }
.skip-button svg { width: 19px; height: 19px; stroke: none; }
.time-readout { display: flex; align-items: center; gap: 5px; margin-left: 4px; font-size: 15px; font-variant-numeric: tabular-nums; color: #344b32; white-space: nowrap; }
#currentTime { color: var(--ink); font-weight: 600; }
.time-divider { color: #798269; }
.audition-switch { display: inline-flex; align-items: stretch; flex-shrink: 0; padding: 3px; border: 1px solid #c6ceba; border-radius: 17px; background: var(--grain), linear-gradient(135deg, #dbe3d4, #cbd8c9); box-shadow: inset 0 1px 3px #8a998630, 0 2px 3px #635d4328; }
.audition-switch button { min-height: 42px; padding: 7px 11px; border: 1px solid transparent; border-radius: 13px; background: transparent; color: #25452c; font-size: 16px; font-weight: 500; white-space: nowrap; }
.audition-switch button[aria-pressed="true"] { background: var(--grain), linear-gradient(135deg, #fffaee, #f4e6d4); border-color: #dfc9ad; color: var(--ink); box-shadow: inset 0 1px 2px #fff, 0 2px 3px #6d573632; font-weight: 700; }
.audition-switch button:hover { color: #0b2918; }
.audition-switch button span { color: var(--evergreen); margin-right: 1px; }

.amount-block { padding: 16px 0 0; }
.amount-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 9px; }
.amount-heading label { font-weight: 700; font-size: 22px; }
.amount-heading output { font-size: 24px; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.amount-slider { --fill: 55%; -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 10px; background: transparent; accent-color: var(--candy); cursor: pointer; }
.amount-slider::-webkit-slider-runnable-track {
  height: 11px;
  border: 1px solid #adba9e;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff59, transparent 45%, #62110b26) left / var(--fill) 100% no-repeat,
    repeating-linear-gradient(128deg, #fff9eb 0 7px, #d51b2c 7px 14px) left / var(--fill) 100% no-repeat,
    linear-gradient(#bacbb0, #8ea681);
  box-shadow: inset 0 1px 2px #4f592f30, 0 1px 1px #fff9ec;
}
.amount-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 30px; height: 30px; margin-top: -10px; border: 1px solid #ac1823; border-radius: 50%; background: radial-gradient(circle at 32% 23%, #ffbbb0 0, #f74d4d 16%, #da1828 44%, #a30b1b 80%, #8e0814); box-shadow: inset 0 1px 1px #ffbeb5, 0 3px 4px #64281c55; }
.amount-slider::-moz-range-track { height: 9px; border: 1px solid #adba9e; border-radius: 20px; background: linear-gradient(#bacbb0, #8ea681); box-shadow: inset 0 1px 2px #4f592f30, 0 1px 1px #fff9ec; }
.amount-slider::-moz-range-progress { height: 9px; border-radius: 20px; background: linear-gradient(180deg, #ffffff59, transparent 45%, #62110b26), repeating-linear-gradient(128deg, #fff9eb 0 7px, #d51b2c 7px 14px); }
.amount-slider::-moz-range-thumb { width: 28px; height: 28px; border: 1px solid #ac1823; border-radius: 50%; background: radial-gradient(circle at 32% 23%, #ffbbb0 0, #f74d4d 16%, #da1828 44%, #a30b1b 80%, #8e0814); box-shadow: inset 0 1px 1px #ffbeb5, 0 3px 4px #64281c55; }
.slider-endpoints { display: flex; justify-content: space-between; color: #344b32; font-size: 16px; }
.status-line { margin-top: 17px; padding: 11px 13px; color: #45502f; font-size: 14px; overflow-wrap: anywhere; border: 1px solid #e8cb93; border-radius: 13px; background: var(--grain), #f9e3b8; box-shadow: inset 0 1px 2px #fff4d2; }
.status-line:empty, .local-note:empty { display: none; }
.status-line.error, .status-line.is-error { color: #8b3022; border-color: #d7a593; background-color: #fae2d4; }
.save-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.keep-option { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; font-size: 14px; cursor: pointer; }
.keep-option input { width: 19px; height: 19px; margin: 0; accent-color: var(--evergreen); cursor: pointer; }
.save-row .button { font-size: 14px; min-height: 43px; padding: 10px 12px; }
.local-note { color: var(--muted); font-size: 14px; margin-top: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.local-note.is-error { color: #963c2f; }

details summary { cursor: pointer; width: fit-content; min-height: 33px; font-size: 16px; }
.timing-details { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); color: #294d2b; }
.timing-details summary::marker { color: var(--evergreen); }
.timing-content { display: flex; align-items: flex-end; gap: 20px; padding-top: 10px; padding-bottom: 4px; }
.tempo-field label { display: block; margin-bottom: 7px; font-size: 14px; color: var(--ink); }
.tempo-input-row { display: flex; align-items: center; gap: 9px; }
.tempo-input-row input { width: 85px; height: 44px; border: 1px solid #c4c7b0; border-radius: 10px; background: #fff9ed; padding: 8px 11px; box-shadow: inset 0 2px 3px #73644915; color: var(--ink); font-size: 16px; }
.timing-content p { padding-bottom: 9px; color: var(--muted); font-size: 14px; }
.playlist-section { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 15px; }
.playlist-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.playlist-heading h2 { font-size: 22px; font-weight: 700; letter-spacing: -.025em; }
#shufflePlaylist { font-size: 14px; }
#shufflePlaylist[aria-pressed="true"] { background: var(--grain), linear-gradient(#fbe6ba, #eed098); border-color: #d7b77d; color: #694612; }
.playlist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.playlist-item { display: flex; align-items: center; gap: 11px; padding: 11px; border: 1px solid #e1d2ba; border-radius: 16px; background: var(--grain), #fff6e9; box-shadow: inset 0 1px 2px #fffaf4, 0 2px 3px #66512e0c; }
.playlist-item[aria-current="true"] { border-color: #9cba94; background: var(--grain), #edf0df; box-shadow: inset 3px 0 0 #477644, inset 0 1px 2px #fff; }
.playlist-item.drag-over { border-color: var(--gold-dark); background-color: var(--gold-soft); }
.track-play { flex-shrink: 0; width: 43px; height: 43px; display: grid; place-items: center; padding: 0; border: 1px solid #c6ccac; border-radius: 50%; color: var(--evergreen); background: var(--grain), linear-gradient(#fff8e9, #e8e9d5); box-shadow: inset 0 1px 2px #fff, 0 2px 2px #594b2d20; }
.track-play svg { width: 18px; height: 18px; stroke: none; }
.track-copy { min-width: 0; flex: 1; }
.track-title { border: 0; background: transparent; padding: 0; text-align: left; color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.track-meta { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.track-actions { display: flex; align-items: center; gap: 1px; }
.track-actions button { background: transparent; border: 0; padding: 8px; min-height: 40px; color: #3d6035; font-size: 13px; border-radius: 8px; }
.track-actions button:hover:not(:disabled) { background: #dce5cf; }
.track-actions button[data-move] { min-width: 36px; font-size: 22px; line-height: 1; }
.track-actions .remove-track { color: #935143; }

.environment-heading { display: flex; flex-direction: column; align-items: stretch; gap: 21px; margin-bottom: 23px; }
.environment-heading h2 { font-family: Georgia, "Times New Roman", serif; font-size: 34px; font-style: italic; font-weight: 700; letter-spacing: -.04em; line-height: 1.2; }
.environment-heading p { margin-top: 9px; color: #455b3d; font-size: 16px; }
.environment-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.environment-actions .button { flex: 1; padding-left: 12px; padding-right: 12px; }
.pulse-surface { position: relative; border: 1px solid #e0d1b0; border-radius: 23px; overflow: hidden; background: var(--grain), linear-gradient(135deg, #f3e5c7, #fff2d8); box-shadow: inset 0 3px 7px #80643c29, 0 1px 1px #fff8eb; }
.pulse-caption { position: absolute; left: 17px; top: 13px; z-index: 1; color: #576443; font-size: 13px; font-weight: 600; pointer-events: none; }
#pulseCanvas { display: block; width: 100%; height: 220px; }
.environment-status { padding: 20px 0; border-bottom: 1px solid var(--line); min-height: 112px; }
.environment-status h3 { font-size: 18px; font-weight: 700; }
.environment-status p { font-size: 14px; color: var(--muted); margin-top: 6px; }
.environment-amount { padding-top: 21px; }
.headphone-note { display: flex; align-items: flex-start; gap: 11px; padding: 14px 16px; margin-top: 23px; border: 1px solid #d2d3b8; border-radius: 15px; background: var(--grain), #e7ead7; color: #415637; font-size: 14px; box-shadow: inset 0 1px 2px #fff9ea; }
.headphone-note svg { width: 21px; height: 21px; margin-top: 1px; }
.microphone-note { margin-top: 12px; font-size: 13px; color: var(--muted); }

.app-footer { position: relative; margin: 19px 16px 0; color: #415547; }
.about-details summary { width: fit-content; color: #35503a; font-size: 13px; min-height: 28px; }
.about-details summary::marker { color: #6d8367; }
.about-content { padding: 10px 13px; border: 1px solid #fff8ec; border-radius: 12px; background: #f9f0e6db; }
.about-content p { font-size: 13px; margin-bottom: 9px; }
.about-content p:last-child { margin-bottom: 0; }
.footer-terms { position: absolute; inset-block-start: 0; inset-inline-end: 0; min-height: 28px; font-size: 13px; }
.footer-terms, .terms-back { color: var(--evergreen); text-underline-offset: 3px; }
.footer-terms:hover, .terms-back:hover { color: #9d1c21; }
.footer-credit { margin-top: 17px; text-align: center; color: #48604c; font-size: 12px; }
.footer-credit a { color: inherit; text-decoration: none; }
.footer-credit a:hover { color: #9d1c21; text-decoration: underline; text-underline-offset: 3px; }

.terms-page { background: linear-gradient(#c7e0ef, #ebe7ef 440px); }
.terms-shell { width: min(720px, calc(100% - 32px)); margin-inline: auto; padding-block: clamp(24px, 5vw, 56px); }
.terms-back { display: inline-block; margin-bottom: 16px; padding-block: 5px; font-weight: 700; }
.terms-document { padding: clamp(20px, 5vw, 48px); border: 1px solid var(--line); border-radius: 24px; background: var(--grain), var(--paper); box-shadow: 0 10px 28px #57667c1e; line-height: 1.6; }
.terms-document h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(32px, 6vw, 48px); line-height: 1.1; }
.terms-updated { margin-top: 10px; color: var(--muted); font-size: 14px; }
.terms-document section { margin-top: 28px; }
.terms-document h2 { font-size: 20px; line-height: 1.25; }
.terms-document section p { margin-top: 10px; }

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

@media (min-width: 1800px) {
  .winter-scene { background-size: 1800px auto; height: 1350px; background-color: #bfd9e9; }
}

@media (max-width: 980px) {
  .winter-scene { height: max(520px, 75vw); }
  .app-shell { width: min(680px, calc(100% - 40px)); padding-top: 17px; }
  .app-header { min-height: 225px; margin: 0 0 15px; }
  .tagline { font-size: clamp(20px, 3.2vw, 26px); }
}

@media (max-width: 700px) {
  .audition-row { align-items: stretch; flex-direction: column; gap: 14px; }
  .transport { justify-content: center; }
  .audition-switch button { flex: 1; }
}

@media (max-width: 600px) {
  .winter-scene { height: calc(75vw + 55px); background-position: center 55px; background-color: #b7d8ee; }
  .winter-scene::before { content: ""; position: absolute; inset: 0 0 auto; height: 83px; background: url("./artwork/winter-scene.webp?v=12") center top / 800px auto no-repeat; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
  .winter-scene::after { height: 14%; }
  .app-shell { width: calc(100% - 24px); padding-top: 15px; }
  .app-header { min-height: clamp(240px, calc(48vw + 55px), 300px); margin-bottom: 9px; }
  .app-wordmark { width: min(100%, 320px); }
  .tagline { margin: 3px auto 0; max-width: 95%; font-size: clamp(16px, 3.9vw, 22px); }
  .mode-tabs { gap: 8px; margin: 0 15px -1px; }
  .mode-tab { min-height: 50px; padding: 10px 8px 12px; gap: 8px; border-radius: 18px 20px 7px 7px; font-size: 16px; }
  .mode-tab svg { width: 23px; height: 23px; }
  .mode-panel { padding: 22px 16px 20px; border-width: 5px; border-bottom-width: 8px; border-radius: 28px 31px 27px 32px; }
  .mode-panel::before { top: -6px; left: 11px; right: 12px; height: 10px; }
  .source-card { grid-template-columns: 47px minmax(0, 1fr); column-gap: 11px; row-gap: 15px; padding-bottom: 20px; }
  .source-icon { width: 47px; height: 52px; border-radius: 13px; }
  .source-icon svg { width: 28px; height: 28px; }
  .source-copy h2 { font-size: 18px; }
  .source-copy p { font-size: 14px; margin-top: 4px; }
  .source-actions { grid-column: 1 / -1; }
  .source-actions .button { width: 100%; min-width: 0; font-size: 17px; }
  .button { font-size: 14px; min-height: 44px; }
  .section-heading { gap: 9px; margin-bottom: 8px; }
  .section-heading h3 { font-size: 18px; }
  .text-actions { gap: 12px; }
  .text-button { font-size: 13px; min-height: 40px; }
  .wave-surface { border-radius: 20px; }
  #waveCanvas { height: 124px; }
  .timeline-meta { flex-direction: column; gap: 8px; min-height: 0; }
  .hint { font-size: 12px; max-width: none; }
  .range-list { max-width: 100%; justify-content: flex-start; }
  .range-list button { min-height: 35px; font-size: 13px; }
  .audition-row { align-items: stretch; flex-direction: column; gap: 14px; margin-top: 17px; padding-bottom: 19px; }
  .transport { display: grid; grid-template-columns: 38px minmax(90px, 1fr) 38px auto; gap: 7px; }
  .skip-button { width: 38px; min-height: 44px; }
  .play-button { min-width: 0; min-height: 50px; padding: 11px 13px; font-size: 20px; }
  .time-readout { font-size: 14px; gap: 4px; margin-left: 5px; }
  .audition-switch { align-self: stretch; }
  .audition-switch button { flex: 1; font-size: 16px; }
  .amount-block { padding-top: 15px; }
  .amount-heading { margin-bottom: 7px; }
  .amount-heading label { font-size: 20px; }
  .amount-heading output { font-size: 22px; }
  .slider-endpoints { font-size: 14px; }
  .save-row { align-items: stretch; gap: 8px; margin-top: 14px; }
  .save-row .button { width: 100%; }
  .keep-option { font-size: 14px; }
  .timing-details { margin-top: 16px; }
  .timing-content { align-items: flex-start; flex-direction: column; gap: 10px; }
  .timing-content p { padding-bottom: 0; }
  .playlist-section { margin-top: 14px; padding-top: 18px; }
  .playlist-heading { gap: 12px; }
  .playlist-heading h2 { font-size: 20px; line-height: 1.2; }
  .playlist-heading .button { padding: 9px 12px; }
  .playlist-item { flex-wrap: wrap; gap: 9px; }
  .track-copy { flex-basis: calc(100% - 53px); }
  .track-actions { width: 100%; justify-content: flex-end; border-top: 1px solid #dce0cc; padding-top: 4px; }
  .track-actions button { min-width: 40px; }
  .environment-heading { gap: 18px; margin-bottom: 20px; }
  .environment-heading h2 { font-size: 29px; }
  .environment-heading p { font-size: 15px; }
  .environment-actions { gap: 8px; }
  .environment-actions .button { padding: 10px 11px; }
  .environment-actions .button-primary { flex-basis: 100%; }
  #pulseCanvas { height: 185px; }
  .environment-status { min-height: 105px; padding: 18px 0; }
  .environment-status h3 { font-size: 17px; }
  .headphone-note { padding: 13px; margin-top: 20px; gap: 9px; }
  .app-footer { margin: 17px 13px 0; }
}

@media (max-width: 360px) {
  .mode-tab { font-size: 15px; gap: 6px; }
  .mode-panel { padding-right: 13px; padding-left: 13px; }
  .section-heading { flex-wrap: wrap; gap: 0; }
  .text-actions { width: 100%; justify-content: space-between; }
  .transport { grid-template-columns: 34px minmax(86px, 1fr) 34px auto; gap: 5px; }
  .skip-button { width: 34px; }
  .time-readout { font-size: 12px; margin-left: 0; gap: 3px; }
  .amount-heading label { font-size: 18px; }
  .amount-heading output { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Shared track-name editor, from the current song or any playlist row. */
.source-title-row { display: flex; align-items: flex-start; gap: 8px; }
.source-title-row h2 { flex: 1; min-width: 0; }
.rename-current { display: grid; place-items: center; flex-shrink: 0; width: 44px; min-height: 44px; margin-top: -5px; padding: 7px; border: 0; border-radius: 10px; background: transparent; color: #45613e; }
.rename-current svg { width: 20px; height: 20px; }
.rename-current:hover:not(:disabled) { background: #e5e8d6; }
.rename-dialog { width: min(430px, calc(100% - 32px)); max-height: calc(100svh - 32px); margin: auto; padding: 25px; border: 5px solid #fff7ec; border-radius: 25px; color: var(--ink); background: var(--grain), var(--paper); box-shadow: 0 10px 45px #18351e5c, inset 0 -3px 8px #b69f8733; }
.rename-dialog::backdrop { background: #18332673; backdrop-filter: blur(3px); }
.rename-dialog form { display: grid; gap: 18px; }
.rename-dialog h2 { font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-style: italic; }
.rename-field label { display: block; margin-bottom: 7px; font-size: 16px; font-weight: 600; }
.rename-field input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #b6bea5; border-radius: 11px; color: var(--ink); background: #fffbf3; box-shadow: inset 0 2px 3px #6a5e4420; font-size: 16px; }
.rename-field input[aria-invalid="true"] { border-color: #aa4133; }
.rename-error { color: #933a2c; font-size: 14px; }
.rename-error:empty { display: none; }
.rename-actions { display: flex; justify-content: flex-end; gap: 10px; }
.rename-actions .button { min-width: 100px; }

/* Keep the three mode tabs readable at every width. */
.mode-tabs { gap: 10px; margin-right: 20px; margin-left: 20px; }
.mode-tab { min-width: 0; gap: 8px; padding-right: 12px; padding-left: 12px; font-size: 18px; }
.mode-tab svg { width: 24px; height: 24px; }
@media (max-width: 1120px) {
  .app-sharing { position: static; justify-items: center; max-width: none; margin-top: 13px; }
  .app-sharing .share-button { min-height: 40px; padding: 8px 15px; font-size: 14px; }
  .share-button svg { width: 18px; height: 18px; }
}
@media (max-width: 600px) {
  .mode-tabs { gap: 6px; margin-right: 8px; margin-left: 8px; }
  .mode-tab { gap: 5px; padding-right: 6px; padding-left: 6px; font-size: 14px; }
  .mode-tab svg { width: 20px; height: 20px; }
}
@media (max-width: 420px) {
  .mode-tab svg { display: none; }
}
