/* One viewport, one creation step. Long text scrolls within the active card. */
html, body { height: 100%; overflow: hidden; }
body { height: 100dvh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 80% 0%, #26311b55, transparent 50%), var(--bg); }
header { width: min(100%, 1060px); flex: 0 0 60px; padding: 10px 24px; }
.brand { font-size: 24px; }
main { width: min(100%, 1000px); flex: 1; min-height: 0; margin: 0 auto; padding: 0 24px 18px; display: flex; flex-direction: column; }
.intro { flex: 0 0 112px; padding: 16px 10px; gap: 20px; }
.intro .eyebrow { font-size: 9px; margin-bottom: 6px; }
h1 { font-size: 40px; letter-spacing: -1.8px; line-height: 1.1; margin: 0; }
.subtitle { font-size: 12px; margin-top: 6px; }
.subtitle br { display: none; }
.record { width: 86px; height: 86px; margin: 0 8px 0 0; box-shadow: 5px 8px 15px #0005; }
.record-label { width: 40px; height: 40px; }
.record-label span, .record-label small { display: none; }
.record-label b { font-size: 23px; }
#studio { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tape-navigation { flex: none; margin-bottom: 10px; }
.tape-caption { display: none; }
.tape-tabs { padding: 5px; border-radius: 15px; background: #171d18; }
.tape-tabs button { min-height: 60px; font-size: 17px; padding: 8px 16px; }
.tape-tabs small { font-size: 10px; }
.tape-hint { font-size: 10px; margin: 5px 0 0; }
.tape-body { flex: 1; min-height: 0; }
.tape-side { height: 100%; min-height: 0; display: flex; flex-direction: column; }
.creation-steps { display: flex; align-items: center; gap: 12px; flex: none; padding: 0 12px 10px; }
.creation-steps button { min-height: 44px; padding: 6px 10px; background: transparent; color: var(--muted); font-size: 13px; }
.creation-steps button span { font-size: 10px; margin-right: 6px; opacity: .7; }
.creation-steps button[aria-current=step] { color: var(--lime); background: #d3f5820c; }
.creation-steps button:disabled { cursor: default; opacity: .4; }
.step-line { flex: 1; height: 1px; background: var(--line); }
#tape-body:not([data-step=record]) #voice-stage,
#tape-body:not([data-step=transcript]) #request-review,
#tape-body:not([data-step=lyrics]) #review { display: none; }
#voice-stage, #request-review, #review { flex: 1; min-height: 0; margin: 0; border-radius: 20px; background: linear-gradient(135deg, #20271e, #171d19 65%); box-shadow: 0 16px 40px #0002; }
#voice-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 22px; overflow: auto; }
.voice-wave { display: flex; gap: 5px; height: 42px; align-items: center; margin-bottom: 18px; }
.voice-wave i { background: var(--lime); opacity: .6; width: 4px; border-radius: 4px; height: 12px; }
.voice-wave i:nth-child(2n) { height: 26px; }.voice-wave i:nth-child(3n) { height: 38px; }
.voice-card .eyebrow { margin-bottom: 8px; }
.voice-card h2 { font-size: 30px; }
.voice-hint { margin: 6px 0 24px; font-size: 15px; }
.voice-button { min-height: 80px; padding: 18px 32px; box-shadow: 0 8px 32px #b0df6520; }
.voice-time { min-height: 24px; margin-top: 10px; font-size: 18px; }
#request-review, #review { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.stage-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #65744e transparent; padding: 22px 26px 16px; }
.stage-scroll .eyebrow { margin-bottom: 10px; }
.transcript-label, .review-card h2 { font-size: 25px; margin-bottom: 12px; }
#transcript { height: clamp(100px, 20dvh, 190px); resize: vertical; max-height: 40dvh; font-size: 16px; }
.review-card .hint { margin-bottom: 12px; font-size: 12px; }
#understood { color: var(--muted); font-size: 14px; margin: 8px 0 14px; }
.review-card #song-lyrics { max-height: none; overflow: visible; margin-bottom: 16px; font-size: 17px; line-height: 1.8; }
.stage-actions { display: flex; flex: none; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); background: #1a211a; }
.stage-actions .wide { min-height: 60px; font-size: 19px; }
.stage-actions > .secondary { width: 60px; flex-shrink: 0; font-size: 25px; }
.style-question { padding: 16px; margin: 14px 0 0; }
.style-question h3 { font-size: 18px; }
.style-question p { font-size: 14px; }
.style-options { gap: 8px; margin-bottom: 14px; }
.style-options button { font-size: 14px; }
.detected-style { font-size: 14px; margin-bottom: 0; }
.status { flex: none; margin: 8px 0 0; padding: 10px 14px; font-size: 12px; max-height: 100px; overflow: auto; }
.listen-now { min-height: 44px; margin-top: 8px; font-size: 15px; }
#side-listen .library { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 10px 0 0; }
.library-heading { margin-bottom: 12px; flex: none; padding: 0 10px; }
.library-heading .eyebrow { display: none; }
.library h2 { font-size: 23px; }
#songs { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 4px 8px; scrollbar-width: thin; scrollbar-color: #65744e transparent; }
footer { display: none; }
@media (max-width: 760px) {
  header { flex-basis: 52px; padding: 7px 18px; }
  main { padding: 0 12px max(10px, env(safe-area-inset-bottom)); }
  .intro { flex-basis: 82px; padding: 10px 6px; }
  .intro .eyebrow, .subtitle { display: none; }
  h1 { font-size: clamp(26px, 7.5vw, 36px); letter-spacing: -1.3px; }
  .record { width: 54px; height: 54px; margin: 0; flex-shrink: 0; }
  .record-label { width: 26px; height: 26px; }.record-label b { font-size: 17px; }
  .tape-tabs button { font-size: 15px; min-height: 58px; padding: 7px 10px; }
  .side-letter { width: 26px; height: 29px; font-size: 17px; }
  .creation-steps { gap: 4px; padding: 0 3px 6px; }
  .creation-steps button { padding: 6px 8px; font-size: 12px; }
  .creation-steps button span { margin-right: 3px; }
  #voice-stage { padding: 18px; }.voice-card h2 { font-size: 25px; }
  .voice-hint { font-size: 14px; margin-bottom: 20px; }
  .voice-wave { margin-bottom: 12px; }
  .voice-button { min-height: 80px; font-size: 21px; }
  .stage-scroll { padding: 18px 18px 12px; }
  .stage-actions { padding: 12px; gap: 8px; }
  .stage-actions .wide { min-height: 60px; font-size: 18px; }
  .stage-actions > .secondary { width: 50px; }
  .transcript-label, .review-card h2 { font-size: 23px; }
  .style-options button { flex-basis: 45%; }
}
@media (max-height: 620px) {
  .intro { display: none; }
  .tape-navigation { margin-top: 8px; }
  .voice-wave, .voice-card .eyebrow { display: none; }
  .voice-card h2 { font-size: 22px; }
  .voice-hint { margin-bottom: 12px; }
  .status { max-height: 60px; }
}
.voice-entry { display: flex; align-items: center; gap: 12px; width: min(100%, 450px); }
.voice-entry .voice-button { flex: 1; min-width: 0; width: auto; }
.keyboard-button { display: grid; place-items: center; flex: 0 0 52px; width: 52px; height: 52px; padding: 0; border: 1px solid #414b3b; background: transparent; color: var(--muted); border-radius: 14px; font-size: 27px; font-weight: 400; }
.keyboard-button:hover { color: var(--lime); border-color: var(--lime); background: #d3f58209; }
@media (max-width: 760px) { .voice-entry { gap: 8px; }.voice-entry .voice-button { padding: 16px; gap: 10px; font-size: 19px; }.voice-entry .voice-button #record-icon { font-size: 24px; }.keyboard-button { flex-basis: 48px; width: 48px; height: 52px; } }
/* A single input and a single scrolling surface per step. */
.tape-hint, .intro .eyebrow, .intro .subtitle { display: none; }
.intro { flex-basis: 88px; }
.tape-navigation { margin-bottom: 14px; }
#request-review .stage-scroll { display: flex; flex-direction: column; overflow: hidden; gap: 14px; padding: 22px; }
#request-review .transcript-label { flex: none; margin: 0; font-size: 23px; }
#transcript { flex: 1; min-height: 60px; height: auto; max-height: none; resize: none; margin: 0; padding: 18px; border-color: #3c4934; font-size: 17px; line-height: 1.7; scrollbar-width: thin; scrollbar-color: #65744e transparent; }
#review .stage-scroll { display: flex; flex-direction: column; overflow: hidden; padding: 22px; }
#review h2 { flex: none; margin: 0 0 8px; }
#understood { flex: none; margin: 0 0 12px; font-size: 13px; max-height: 3.2em; overflow: auto; }
#review #song-lyrics { flex: 1; min-height: 0; overflow-y: auto; max-height: none; margin: 0; padding: 16px; background: #121713; border: 1px solid var(--line); border-radius: 12px; scrollbar-width: thin; scrollbar-color: #65744e transparent; }
.stage-actions #back-request { width: auto; font-size: 15px; min-width: 110px; }
#status { border: none; background: transparent; padding: 7px 4px; margin-top: 4px; font-size: 12px; }
@media(max-width:760px){.intro{flex-basis:64px}.tape-navigation{margin-bottom:10px}#request-review .stage-scroll,#review .stage-scroll{padding:16px}#transcript{padding:14px;font-size:16px}#request-review .transcript-label{font-size:21px}.stage-actions #back-request{min-width:96px;padding:10px;font-size:14px}}
#understood { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-height: none; }
#research-sources { flex: none; margin-bottom: 10px; }
.source-links { font-size: 12px; color: var(--muted); }
.source-links summary { cursor: pointer; padding: 8px 0; }
.source-links[open] { max-height: 100px; overflow-y: auto; }
.source-links a { display: block; color: var(--lime); padding: 4px 0; overflow-wrap: anywhere; }

.admin-entry{margin-left:auto;color:var(--muted);opacity:.35;text-decoration:none;font-size:20px;width:44px;height:44px;display:grid;place-items:center;border-radius:50%;flex-shrink:0}.admin-entry:hover,.admin-entry:focus-visible{opacity:1;color:var(--lime)}header .header-note{margin-left:12px}
.collection-cost{font-size:12px;color:var(--muted);margin:3px 0 0}.tape-side .song .song-cost{font-size:12px;color:var(--lime);margin:14px 0 0}

/* The keyboard opens a compact form; voice remains the first screen. */
#tape-body:not([data-step=form]) #request-form { display: none; }
#request-form { flex: 1; min-height: 0; margin: 0; padding: 0; overflow: hidden; display: flex; flex-direction: column; border-radius: 20px; background: linear-gradient(135deg, #20271e, #171d19 65%); }
.form-fields { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; scrollbar-color: #65744e transparent; }
.form-fields h2 { margin: 0 0 2px; font-size: 23px; }
.request-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-fields label { margin-bottom: 5px; font-size: 13px; }
.form-fields label span { color: var(--muted); font-size: 11px; }
.form-fields input, .form-fields textarea, .form-fields select { margin: 0; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #3c4934; border-radius: 9px; background: #121713; color: var(--text); font: inherit; font-size: 16px; }
.form-fields select:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.request-theme-field { flex: 1; min-height: 100px; display: flex; flex-direction: column; }
.form-fields textarea { flex: 1; min-height: 74px; resize: none; line-height: 1.5; }
@media(max-width:760px) { .form-fields { padding: 16px; gap: 10px; }.request-form-grid { gap: 10px; }.form-fields h2 { font-size: 21px; } }
@media(max-width:380px) { .request-form-grid { grid-template-columns: 1fr; } }
/* Clear reading on a phone, in the preview and the saved song. */
#review #song-lyrics, .tape-side .song .song-lyrics pre {
  color: #f5f7f0; font-family: system-ui, sans-serif; font-size: 19px; font-weight: 450;
  line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere;
}
.form-fields label { color: #f0f2e9; font-size: 15px; font-weight: 600; }
.form-fields label span { color: #bec7b7; font-size: 13px; font-weight: 400; }
.form-fields input::placeholder, .form-fields textarea::placeholder { color: #a6b09e; opacity: 1; }
@media(max-width:760px) {
  .form-fields input, .form-fields textarea, .form-fields select, #transcript { font-size: 18px; line-height: 1.55; }
  .form-fields input, .form-fields select { min-height: 52px; }
  #review #song-lyrics, .tape-side .song .song-lyrics pre { font-size: 20px; line-height: 1.85; }
}

.voice-card .voice-hint {
  color: #eef3e5; font-size: 20px; font-weight: 500; line-height: 1.6;
  max-width: 540px; margin: 14px 0 28px; text-wrap: pretty;
}
.voice-card .voice-hint strong { color: var(--lime); font-weight: 750; }
@media(max-width:760px) { .voice-card .voice-hint { font-size: 19px; margin: 12px 0 24px; } }
@media(max-height:620px) { .voice-card .voice-hint { margin: 8px 0 16px; } }
