/* LoopToSong app: the wizard shell and its five steps. Tokens and fonts come from
   /assets/site.css; this file only adds app components (SPEC.md §3, artifact AppScreen). */

body.app-body { background-attachment: fixed; }

.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 980px; margin: 0 auto; }

/* ---------- header ---------- */
.app-head { position: sticky; top: 0; z-index: 20; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 12px; background: rgba(34, 35, 34, 0.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.app-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.app-head .brand { font-size: 16px; }
.head-end { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.proj-chip[hidden] { display: none; }
.proj-chip { min-width: 0; }
.proj-chip [data-ref=chipText] { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chip-name { color: var(--text); }
@media (max-width: 480px) { .chip-meta { display: none; } }
.acct-btn { position: relative; height: 32px; padding: 0 12px; border-radius: 4px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.acct-btn::before { content: ""; position: absolute; inset: -7px 0; } /* a 44 px tall hit area, the button stays 32 px */
.acct-btn:hover { border-color: var(--t500); }
.acct-btn:focus-visible { outline: 2px solid var(--t300); outline-offset: 2px; }
.more-opts { color: var(--muted); font-size: 14px; }
.more-opts summary { cursor: pointer; padding: 12px 0; margin: -6px 0; width: max-content; } /* 45 px tall to tap, same spacing as before */
.more-opts[open] summary { margin-bottom: 2px; }
.proj-chip { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; border-radius: 4px; background: var(--panel); border: 1px solid var(--line); font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--muted); white-space: nowrap; }
.stepbar { display: flex; flex-direction: column; gap: 8px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.segs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; width: 100%; }
.segs span { height: 4px; border-radius: 2px; background: var(--line); }
.segs span.done { background: var(--t700); }
.segs span.cur { background: var(--t500); box-shadow: var(--glow-sm); }
.stepbar-row { display: flex; align-items: baseline; justify-content: space-between; width: 100%; gap: 10px; }
.stepbar-row .now { display: flex; align-items: baseline; gap: 10px; }
.stepbar-row .no { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--muted); }
.stepbar-row .name { font-family: Archivo, sans-serif; font-stretch: 100%; font-size: 20px; font-weight: 800; }
.stepbar-row .all { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--accent); }

/* ---------- main + footer ---------- */
.app-main { flex: 1 1 auto; display: flex; flex-direction: column; gap: 18px; padding: 20px 16px 24px; }
.app-foot { position: sticky; bottom: 0; z-index: 20; display: flex; gap: 10px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: rgba(30, 31, 30, 0.95); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.btn-back { flex: none; width: 56px; height: 56px; padding: 0; border-radius: 4px; border: 1px solid var(--border); background: transparent; color: var(--text); }
.btn-back[disabled] { opacity: 0.35; cursor: default; }
.btn-next { flex: 1 1 auto; height: 56px; border-radius: 4px; font-size: 17px; }
/* a blocked Next looks blocked: no teal, a dashed edge, and its label says what is missing */
.btn-next[disabled], .btn-next[aria-disabled="true"] { background: var(--panel); color: var(--muted); border: 1px dashed var(--border); cursor: default; box-shadow: none; font-stretch: 100%; font-weight: 700; }

h1.step-title { font-size: clamp(26px, 4vw, 34px); line-height: 1.12; }
.step-lead { margin: -6px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; max-width: 40em; }
.label { font-family: Archivo, sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 0.07em; color: var(--muted); text-transform: uppercase; }
.field { display: flex; flex-direction: column; gap: 8px; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* ---------- controls ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip-btn[aria-pressed="true"] { background: var(--sel); color: var(--on-teal); border-color: transparent; box-shadow: var(--sel-shadow); }
.seg-ctl { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 4px; background: var(--panel); border: 1px solid var(--line); }
.seg-ctl button { min-height: 44px; padding: 0 8px; border-radius: 4px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.seg-ctl button[aria-pressed="true"] { background: var(--key); color: var(--text); box-shadow: var(--key-shadow); }
.key-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.key-btn { min-height: 44px; border-radius: 4px; border: 1px solid var(--line); background: var(--key); color: var(--text); font-family: Archivo, sans-serif; font-stretch: 100%; font-size: 15px; font-weight: 800; box-shadow: var(--key-shadow); cursor: pointer; }
.key-btn[aria-pressed="true"] { background: var(--sel); color: var(--on-teal); border-color: transparent; box-shadow: var(--sel-shadow); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 4px; border: 1px solid var(--line); background: var(--key); color: var(--text); font: inherit; font-size: 20px; cursor: pointer; box-shadow: var(--key-shadow); }
.ghost-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 4px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; }
.ghost-btn.small { min-height: 44px; padding: 0 12px; font-size: 13px; }
.fill-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 4px; border: 0; background: var(--fill); color: var(--on-teal); box-shadow: var(--fill-shadow); font-family: Archivo, sans-serif; font-stretch: 100%; font-size: 16px; font-weight: 800; cursor: pointer; text-decoration: none; }
button:disabled, .fill-btn[aria-disabled="true"] { cursor: default; }

/* LCD panel (dark on every theme) */
.lcd { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 6px; background: var(--screen); color: #F4F3EC; box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5); }
.lcd-row { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-family: "JetBrains Mono", monospace; font-size: 11px; }
.lcd-row .dim { color: var(--t300); }

/* ---------- loop step ---------- */
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 220px; padding: 28px 16px; border-radius: 6px; border: 2px dashed var(--border); background: var(--panel); text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.drop:hover, .drop.over { border-color: var(--t500); background: rgba(244, 243, 236, 0.06); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop strong { font-family: Archivo, sans-serif; font-stretch: 100%; font-size: 22px; }
.drop .hint { max-width: 26em; }
.or-row { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.or-row::before, .or-row::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.wave { width: 100%; height: 64px; display: block; }
.loop-head { display: flex; align-items: center; gap: 12px; }
.loop-head .meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.loop-head .meta b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-round { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 50px; height: 50px; border-radius: 25px; border: 0; background: var(--fill); box-shadow: var(--fill-shadow); cursor: pointer; }
.play-round svg { fill: var(--on-teal); }
.bpm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 12px 16px; border-radius: 4px; background: var(--screen); color: #F4F3EC; }
.bpm-row input { width: 4.2ch; padding: 0; border: 0; background: transparent; color: inherit; font-family: "JetBrains Mono", monospace; font-size: 32px; font-weight: 700; }
.bpm-row input:focus { outline: none; }
.bpm-row .icon-btn { background: rgba(255, 255, 255, 0.08); border-color: transparent; color: #F4F3EC; box-shadow: none; }
.suggest { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 4px; border: 1px solid var(--t700); background: rgba(244, 243, 236, 0.06); font-size: 13px; }
.notice { padding: 12px 14px; border-radius: 4px; border: 1px solid var(--line); background: var(--panel); font-size: 14px; line-height: 1.5; }
.notice.error { border-color: #F06A3B; }

/* ---------- song step ---------- */
.timeline { position: relative; display: flex; flex-direction: column; gap: 6px; padding-top: 4px; cursor: pointer; touch-action: pan-y; user-select: none; -webkit-user-select: none; border-radius: 4px; }
.timeline:focus-within { outline: 2px solid var(--t300); outline-offset: 4px; }
.energy-svg { display: block; width: 100%; height: 76px; pointer-events: none; }
.lane { display: flex; gap: 2px; height: 26px; pointer-events: none; }
.lane span { min-width: 2px; display: flex; align-items: center; padding-left: 4px; border-radius: 5px; overflow: hidden; white-space: nowrap; font-family: "JetBrains Mono", monospace; font-size: 9px; font-weight: 700; color: rgba(34, 35, 34, 0.85); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3); transition: filter 0.2s, box-shadow 0.2s; }
.lane span.lt { color: #F4F3EC; }
.lane .loop { background: var(--sel); }
.lane span.on { filter: brightness(1.3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 12px rgba(244, 243, 236, 0.7); }
.timeline .playhead { position: absolute; top: 0; bottom: 0; }
.emeter { flex: none; width: 44px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.emeter i { display: block; height: 100%; border-radius: 3px; }
.app-main.enter .lane span { animation: l2s-grow 0.5s cubic-bezier(0.2, 0.9, 0.25, 1) backwards; animation-delay: calc(0.15s + var(--i) * 0.04s); transform-origin: left; }
@keyframes l2s-grow { from { transform: scaleX(0.2); opacity: 0; } to { transform: none; opacity: 1; } }
.app-main.enter .energy-svg .eline { stroke-dasharray: 3000; animation: l2s-draw-line 1.2s 0.2s ease-out backwards; }
@keyframes l2s-draw-line { from { stroke-dashoffset: 3000; } to { stroke-dashoffset: 0; } }
.dir-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dir-tab { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border-radius: 4px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.dir-tab b { font-family: Archivo, sans-serif; font-stretch: 100%; font-size: 15px; }
.dir-tab span { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--muted); }
.dir-tab[aria-pressed="true"] { border-color: var(--t500); box-shadow: 0 0 0 1px var(--t500), 0 0 22px rgba(244, 243, 236, 0.14); }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #FFFFFF; box-shadow: 0 0 8px rgba(255, 255, 255, 0.7); pointer-events: none; left: 0; display: none; }
.transport { display: flex; align-items: center; gap: 10px; }
.transport .now-playing { flex: 1 1 auto; min-width: 0; font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--t300); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.why { font-size: 14px; color: var(--muted); line-height: 1.5; }

.sec-list { display: flex; flex-direction: column; border-radius: 4px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.sec-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; width: 100%; }
.sec-row:first-child { border-top: 0; }
.sec-row.is-loop { background: rgba(244, 243, 236, 0.07); box-shadow: inset 3px 0 0 var(--t500); }
.sec-row.playing { background: rgba(244, 243, 236, 0.14); }
.sec-row .no { width: 20px; font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--muted); }
.sec-row .nm { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; overflow: hidden; white-space: nowrap; }
.sec-row .nm .tag { flex: none; }
.sec-row .bars { flex: none; font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--muted); white-space: nowrap; }
.tag { padding: 2px 6px; border-radius: 5px; background: var(--sel); color: var(--on-teal); font-family: "JetBrains Mono", monospace; font-size: 10px; font-weight: 700; white-space: nowrap; }
.tag.line { background: transparent; border: 1px solid var(--accent); color: var(--accent); }
.editor { display: flex; flex-direction: column; gap: 12px; padding: 14px 12px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, 0.12); }
.editor-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper output { min-width: 3.2ch; text-align: center; font-family: "JetBrains Mono", monospace; font-size: 15px; font-weight: 700; }
.editor select { min-height: 44px; padding: 0 10px; border-radius: 4px; border: 1px solid var(--line); background: var(--key); color: var(--text); font: inherit; font-size: 14px; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.checks { display: flex; flex-direction: column; gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 4px; border: 1px solid var(--line); background: var(--panel); }
.check.warn { border-color: var(--t600); background: rgba(244, 243, 236, 0.06); }
.check .k { flex: none; font-family: "JetBrains Mono", monospace; font-size: 11px; font-weight: 700; color: var(--accent); padding-top: 2px; }
.check .body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.45; }
.check .body p { margin: 0; }
.ok-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.ok-line::before { content: "✓"; color: var(--accent); font-weight: 800; }

/* ---------- ingredients ---------- */
.grid-scroll { overflow-x: auto; border-radius: 4px; border: 1px solid var(--line); background: var(--panel); -webkit-overflow-scrolling: touch; }
.ing-grid { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.ing-grid th, .ing-grid td { padding: 0; border-bottom: 1px solid var(--line); }
.ing-grid tr:last-child td, .ing-grid tr:last-child th { border-bottom: 0; }
.ing-grid th.rowh { position: sticky; left: 0; z-index: 2; min-width: 84px; padding: 0 10px; background: var(--panel); text-align: left; font-size: 13px; font-weight: 600; border-right: 1px solid var(--line); }
.ing-grid thead th { padding: 8px 4px; font-family: "JetBrains Mono", monospace; font-size: 10px; font-weight: 500; color: var(--muted); white-space: nowrap; text-align: center; }
.ing-grid thead th button { padding: 4px 6px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.ing-grid thead th.sel button { background: var(--key); color: var(--text); }
.ing-grid thead th.loopcol button { color: var(--accent); }
.cell { display: flex; align-items: center; justify-content: center; width: 48px; height: 44px; margin: 3px; border-radius: 4px; border: 1px solid transparent; font-family: "JetBrains Mono", monospace; font-size: 13px; font-weight: 700; cursor: pointer; background: transparent; color: var(--muted); }
.cell.in { background: var(--t700); color: #0A0A0A; }
.cell.vary { background: transparent; border-color: var(--t500); color: var(--accent); }
.cell.out { color: var(--muted); }
.cell.playing { outline: 2px solid #FFFFFF; }
.ing-grid td.trans { text-align: center; font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .cell { width: 26px; height: 22px; margin: 0; cursor: default; font-size: 11px; }
.plan-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); }
.plan-card h2 { font-size: 20px; }
.plan-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.plan-card li { display: flex; gap: 10px; font-size: 14px; line-height: 1.45; }
.plan-card li b.st { flex: none; width: 46px; font-family: "JetBrains Mono", monospace; font-size: 11px; padding-top: 2px; }
.plan-card li b.st.in { color: var(--accent); }
.plan-card li b.st.out { color: var(--muted); }
.plan-card li b.st.vary, .plan-card li b.st.new { color: var(--t300); }
.trans-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-card .var-list li { display: list-item; margin-left: 18px; list-style: disc; color: var(--text); }
.plan-card .var-list li::marker { color: var(--t300); }

/* ---------- chords ---------- */
.chord-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chord-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 8px 0 14px; border-radius: 4px; background: var(--key); border: 1px solid var(--line); box-shadow: var(--key-shadow); font-family: Archivo, sans-serif; font-stretch: 100%; font-size: 18px; font-weight: 800; }
.chord-chip small { font-family: "JetBrains Mono", monospace; font-size: 10px; font-weight: 500; color: var(--muted); }
.chord-chip button { width: 44px; height: 44px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.prog { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 12px; border-radius: 4px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.prog[aria-pressed="true"] { border-color: var(--t500); box-shadow: 0 0 0 1px var(--t500); }
.prog b { flex: 1 1 auto; font-family: Archivo, sans-serif; font-stretch: 100%; font-size: 16px; }
.prog span { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--muted); }
.sec-chords { display: flex; flex-direction: column; border-radius: 4px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.sec-chords div { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-top: 1px solid var(--line); font-size: 14px; }
.sec-chords div:first-child { border-top: 0; }
.sec-chords span.n { width: 110px; font-weight: 600; }
.sec-chords span.c { flex: 1 1 auto; font-family: Archivo, sans-serif; font-stretch: 100%; font-weight: 700; }

/* ---------- export ---------- */
.files { display: flex; flex-direction: column; border-radius: 4px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.file { display: flex; align-items: center; gap: 12px; padding: 14px 12px; border-top: 1px solid var(--line); }
.file:first-child { border-top: 0; }
.file .meta { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.file .meta b { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.file .meta span { font-size: 12px; color: var(--muted); }
.dl { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 4px; border: 0; background: var(--fill); color: var(--on-teal); box-shadow: var(--fill-shadow); font-size: 20px; font-weight: 800; cursor: pointer; }
.dl.locked { background: transparent; border: 1px solid var(--line); color: var(--muted); box-shadow: none; }
.pro-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 6px; background: var(--panel); border: 1px solid var(--t600); box-shadow: 0 0 28px rgba(244, 243, 236, 0.16); }
.pro-card h2 { font-size: 20px; }
.pro-card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.guide-img { width: 100%; height: auto; border-radius: 4px; border: 1px solid var(--line); }

/* ---------- steps sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(5, 6, 8, 0.6); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 620px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; padding: 10px 16px calc(22px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: #2C2D2C; border-top: 1px solid var(--line); box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.35); max-height: 88vh; overflow-y: auto; }
.sheet .grab { align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin-bottom: 8px; }
.sheet h2 { font-size: 20px; margin-bottom: 6px; }
.step-item { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 12px; border-radius: 4px; border: 1px solid transparent; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; width: 100%; }
.step-item.cur { border-color: var(--t700); background: rgba(244, 243, 236, 0.08); }
.step-item .dot { flex: none; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 14px; border: 1px solid var(--border); color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 12px; font-weight: 700; }
.step-item.done .dot { background: var(--t700); border-color: transparent; color: #0A0A0A; }
.step-item.cur .dot { background: var(--fill); border-color: transparent; color: #0A0A0A; box-shadow: var(--glow-sm); }
.step-item .tx { flex: 1 1 auto; display: flex; flex-direction: column; gap: 1px; }
.step-item .tx b { font-size: 15px; font-weight: 600; }
.step-item .tx span { font-size: 12px; color: var(--muted); }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 60; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 4px; background: #ECEDE8; color: #222322; font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 420px) {
  .sec-row .bars .from { display: none; }
}

@media (min-width: 760px) {
  .app-main { padding: 28px 24px 32px; gap: 22px; }
  .app-head, .app-foot { padding-left: 24px; padding-right: 24px; }
  .btn-next { flex: 0 1 360px; margin-left: auto; }
  .split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; align-items: start; }
}

/* focus on the hidden file inputs shows on their visible wrapper */
.drop:focus-within, label.ghost-btn:focus-within { outline: 2px solid var(--t500); outline-offset: 3px; }

/* tempo cheat sheet + finishing checklist (export step) */
.tempo-table { border-collapse: collapse; width: 100%; font-family: "JetBrains Mono", monospace; font-size: 13px; }
.tempo-table th, .tempo-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.tempo-table thead th { color: var(--muted); font-size: 11px; font-weight: 500; }
.tempo-table th[scope=row] { text-align: left; color: var(--accent); }
.tempo-table tr:last-child td, .tempo-table tr:last-child th { border-bottom: 0; }
.check-ul { margin: 0 0 12px; padding-left: 20px; color: var(--muted); line-height: 1.6; }

/* ==========================================================================
   Visual pass: motion, depth and instrument-style readouts
   ========================================================================== */

/* a faint studio grid behind everything */
body.app-body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px); background-size: 32px 32px; -webkit-mask-image: radial-gradient(900px 600px at 50% 0%, #000 0%, transparent 75%); mask-image: radial-gradient(900px 600px at 50% 0%, #000 0%, transparent 75%); }

/* the step slides in when it opens (not on every edit) */
@keyframes l2s-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.app-main.enter > * { animation: l2s-rise 0.5s cubic-bezier(0.2, 0.75, 0.2, 1) backwards; }
.app-main.enter > :nth-child(2) { animation-delay: 0.05s; }
.app-main.enter > :nth-child(3) { animation-delay: 0.1s; }
.app-main.enter > :nth-child(4) { animation-delay: 0.15s; }
.app-main.enter > :nth-child(5) { animation-delay: 0.2s; }
.app-main.enter > :nth-child(6) { animation-delay: 0.25s; }
.app-main.enter > :nth-child(n+7) { animation-delay: 0.3s; }

/* step bar: the current segment carries a moving light */
@keyframes l2s-sweep { from { background-position: 200% 0; } to { background-position: -100% 0; } }
.segs span { transition: background 0.3s; }
.segs span.cur { background: linear-gradient(90deg, var(--t600) 0%, var(--t300) 50%, var(--t600) 100%); background-size: 200% 100%; animation: l2s-sweep 2.4s linear infinite; }

/* keys feel physical */
.chip-btn, .seg-ctl button, .key-btn, .icon-btn, .ghost-btn, .fill-btn, .play-round, .dl, .cell, .dir-tab, .prog, .btn-next, .btn-back { transition: transform 0.08s, box-shadow 0.2s, background-color 0.2s, border-color 0.2s, color 0.2s; }
.chip-btn:active, .seg-ctl button:active, .key-btn:active, .icon-btn:active, .ghost-btn:active, .fill-btn:active, .play-round:active, .dl:active, .cell:active, .dir-tab:active, .prog:active, .btn-next:active { transform: translateY(1px) scale(0.97); }
@media (hover: hover) {
  .chip-btn:hover, .ghost-btn:hover, .dir-tab:hover, .prog:hover, .key-btn:hover { border-color: var(--t700); }
  .fill-btn:hover, .play-round:hover, .dl:not(.locked):hover, .btn-next:not([disabled]):not([aria-disabled="true"]):hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 26px rgba(244, 243, 236, 0.5); }
}
.play-round { position: relative; }
.play-round::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid rgba(244, 243, 236, 0.35); pointer-events: none; }

/* panels get depth */
.plan-card, .sec-list, .files, .grid-scroll, .sec-chords, .pro-card { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 30px rgba(0, 0, 0, 0.18); }
.lcd { position: relative; overflow: hidden; border: 1px solid rgba(244, 243, 236, 0.18); box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.35), 0 14px 36px rgba(0, 0, 0, 0.3); }
.lcd::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px); }

/* ---------- loop step ---------- */
.drop { overflow: hidden; }
.drop::before { content: ""; position: absolute; inset: -40%; background: radial-gradient(closest-side, rgba(244, 243, 236, 0.16), transparent 70%); animation: l2s-breathe 4s ease-in-out infinite; pointer-events: none; }
@keyframes l2s-breathe { 0%, 100% { opacity: 0.45; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.05); } }
.drop > * { position: relative; }
.drop > input { position: absolute; }
.eq { display: flex; align-items: flex-end; gap: 4px; height: 44px; }
.eq i { width: 6px; height: 100%; border-radius: 3px; background: linear-gradient(180deg, var(--t300), var(--t700)); box-shadow: 0 0 10px rgba(244, 243, 236, 0.45); transform-origin: bottom; animation: l2s-eq 1.1s ease-in-out infinite; }
.eq i:nth-child(1) { animation-delay: -0.9s; } .eq i:nth-child(2) { animation-delay: -0.3s; } .eq i:nth-child(3) { animation-delay: -0.6s; }
.eq i:nth-child(4) { animation-delay: -0.1s; } .eq i:nth-child(5) { animation-delay: -0.75s; } .eq i:nth-child(6) { animation-delay: -0.45s; }
.eq i:nth-child(7) { animation-delay: -0.2s; } .eq i:nth-child(8) { animation-delay: -0.95s; } .eq i:nth-child(9) { animation-delay: -0.55s; }
@keyframes l2s-eq { 0%, 100% { transform: scaleY(0.2); } 50% { transform: scaleY(1); } }
.drop.over .eq i { animation-duration: 0.45s; }

.wave-lcd { position: relative; height: 76px; padding: 6px 0; border-radius: 4px; background: var(--screen); border: 1px solid rgba(244, 243, 236, 0.18); box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.55); overflow: hidden; }
.wave-lcd::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(90deg, rgba(236, 237, 232, 0.22) 1px, transparent 1px); background-size: calc(100% / var(--bars)) 100%; }
.wave-lcd .wave { height: 64px; position: relative; filter: drop-shadow(0 0 6px rgba(244, 243, 236, 0.45)); }

.beat-led { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #3A3C3A; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6); }
.beat-led.on { animation: l2s-beat var(--beat) steps(1, end) infinite; }
@keyframes l2s-beat { 0% { background: var(--t300); box-shadow: 0 0 12px var(--t500), 0 0 3px #fff; } 30%, 100% { background: #3A3C3A; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6); } }
.bpm-row input { text-shadow: 0 0 14px rgba(244, 243, 236, 0.55); }

/* ---------- song step ---------- */
.energy-svg .eline { filter: drop-shadow(0 0 3px rgba(236, 237, 232, 0.9)); }
.app-main.enter .energy-svg { animation: l2s-fade 0.5s 0.1s backwards; }
@keyframes l2s-fade { from { opacity: 0; } to { opacity: 1; } }
.playhead { width: 2px; background: #FFFFFF; box-shadow: 0 0 10px #fff, 0 0 18px var(--t500); }
.transport .now-playing::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #3A3C3A; vertical-align: 1px; }
.transport.live .now-playing::before { background: var(--t300); box-shadow: 0 0 8px var(--t500); animation: l2s-pulse 1s ease-in-out infinite; }
@keyframes l2s-pulse { 50% { opacity: 0.35; } }
.sec-row { transition: background 0.2s; }
.sec-row.playing { box-shadow: inset 3px 0 0 var(--t300); }
.check.warn { box-shadow: inset 3px 0 0 var(--t500); }

/* ---------- ingredients: cells are pads ---------- */
.cell.in { background: linear-gradient(160deg, var(--t500), var(--t700)); color: var(--on-teal); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 12px rgba(244, 243, 236, 0.28); }
.cell.vary { background: rgba(244, 243, 236, 0.08); box-shadow: inset 0 0 10px rgba(244, 243, 236, 0.12); }
.cell.out { background: rgba(0, 0, 0, 0.16); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35); }
.legend .cell.in, .legend .cell.vary, .legend .cell.out { box-shadow: none; }
.ing-grid thead th.sel button { background: var(--sel); color: var(--on-teal); box-shadow: var(--sel-shadow); }

/* ---------- chords: piano roll ---------- */
.roll-wrap { position: relative; height: 128px; border-radius: 4px; background: rgba(0, 0, 0, 0.22); overflow: hidden; }
.roll { display: block; width: 100%; height: 100%; }
.roll rect:not([fill]) { fill: var(--t600); filter: drop-shadow(0 0 3px rgba(244, 243, 236, 0.6)); }
.roll rect.root { fill: var(--t300); }
.app-main.enter .roll { animation: l2s-fade 0.7s 0.2s both; }
.roll-names { display: flex; gap: 2px; }
.roll-names span { flex-basis: 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 2px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); overflow: hidden; }
.roll-names b { font-family: Archivo, sans-serif; font-stretch: 100%; font-size: 15px; font-weight: 800; color: #F4F3EC; }
.roll-names small { font-family: "JetBrains Mono", monospace; font-size: 10px; color: var(--t300); }
.chord-chip { background: linear-gradient(180deg, #3A3D44, var(--key)); }

/* ---------- export ---------- */
.hero-lcd .stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.hero-lcd .stats div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 4px; background: rgba(0, 0, 0, 0.22); }
.hero-lcd dt { font-family: "JetBrains Mono", monospace; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--t300); }
.hero-lcd dd { margin: 0; font-family: "JetBrains Mono", monospace; font-size: 22px; font-weight: 700; color: #ECEDE8; text-shadow: 0 0 14px rgba(244, 243, 236, 0.6); white-space: nowrap; }
.hero-lcd .guide-img { position: relative; border-color: rgba(244, 243, 236, 0.25); animation: l2s-fade 0.6s both; }
.app-main.enter .hero-lcd dd { animation: l2s-flicker 0.9s 0.25s both; }
@keyframes l2s-flicker { 0% { opacity: 0; } 20% { opacity: 1; } 30% { opacity: 0.3; } 45%, 100% { opacity: 1; } }
.ficon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 4px; background: var(--screen); color: var(--t300); border: 1px solid rgba(244, 243, 236, 0.2); }
.ficon.pro { color: var(--t400); box-shadow: 0 0 14px rgba(244, 243, 236, 0.2); }
.dl { position: relative; }
.dl.ping::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid var(--t300); animation: l2s-ping 0.7s ease-out forwards; pointer-events: none; }
@keyframes l2s-ping { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.6); } }
.pro-card { background: radial-gradient(420px 180px at 100% 0%, rgba(244, 243, 236, 0.14), transparent 70%), var(--panel); }
a.plan-card { transition: border-color 0.2s, transform 0.15s; }
@media (hover: hover) { a.plan-card:hover { border-color: var(--t600); transform: translateY(-2px); } }
@media (max-width: 420px) {
  .hero-lcd .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* calm by request */
@media (prefers-reduced-motion: reduce) {
  .app-main.enter > *, .app-main.enter .lane span, .app-main.enter .energy-svg, .app-main.enter .energy-svg .eline, .app-main.enter .roll, .app-main.enter .hero-lcd dd, .hero-lcd .guide-img { animation: none; }
  .segs span.cur, .drop::before, .eq i, .beat-led.on, .transport.live .now-playing::before, .dl.ping::after { animation: none; }
  .eq i { transform: scaleY(0.6); }
  .beat-led.on { background: var(--t300); }
  .chip-btn:active, .seg-ctl button:active, .key-btn:active, .icon-btn:active, .ghost-btn:active, .fill-btn:active, .play-round:active, .dl:active, .cell:active, .dir-tab:active, .prog:active, .btn-next:active { transform: none; }
}

/* one-tap demo offer (/app/?demo=1) */
.demo-sheet { align-items: stretch; gap: 14px; padding-top: 24px; text-align: left; }
.demo-sheet .eq { align-self: flex-start; height: 34px; }
.demo-sheet h2 { font-size: 24px; margin: 0; }
.demo-sheet .fill-btn { min-height: 56px; font-size: 18px; }

/* export: build-it-in-your-DAW checklist, share, kept projects */
.share-btn { align-self: flex-start; position: relative; z-index: 1; }
.build-list { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; border-radius: 4px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.build-list li { border-top: 1px solid var(--line); }
.build-list li:first-child { border-top: 0; }
.build-list label { display: flex; gap: 12px; align-items: flex-start; padding: 12px; cursor: pointer; }
.build-list input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--t500); }
.build-list .txt { display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.45; }
.build-list .txt b { font-weight: 600; }
.build-list li.sec .txt b { font-family: "JetBrains Mono", monospace; font-size: 13px; color: var(--accent); }
.build-list input:checked + .txt { opacity: 0.5; }
.build-list input:checked + .txt b { text-decoration: line-through; }
.var-details { padding: 0 12px 12px 46px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.var-details summary { cursor: pointer; color: var(--t300); font-family: "JetBrains Mono", monospace; font-size: 12px; }
.var-details ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.chips-line { display: flex; flex-wrap: wrap; gap: 4px; }
.st-chip { padding: 2px 7px; border-radius: 6px; font-family: "JetBrains Mono", monospace; font-size: 11px; font-weight: 700; border: 1px solid var(--line); color: var(--muted); }
.st-chip.in { background: linear-gradient(160deg, var(--t500), var(--t700)); color: var(--on-teal); border-color: transparent; }
.st-chip.vary { border-color: var(--t500); color: var(--accent); }
.st-chip.new { border-style: dashed; border-color: var(--t300); color: var(--t300); }
.lib { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.lib h3 { margin: 0; }
.lib-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.lib-list li { display: flex; align-items: center; gap: 6px; }
.lib-list .nm { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.lib-list .nm b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-list .nm span { font-size: 12px; color: var(--muted); }
.lib > .ghost-btn { align-self: flex-start; }
.lib-list li { flex-wrap: wrap; }
.lib-list li.now .nm b { color: var(--accent); }
.lib-now { font-style: normal; color: var(--accent); font-weight: 700; }
.lib-rename { gap: 6px; }
.lib-rename input { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--screen); color: var(--text); font: inherit; font-size: 15px; }
.lib-rename input:focus-visible { outline: 2px solid var(--t300); outline-offset: 2px; }
.lib-count a { color: var(--t300); }

/* stems */
.drop.small { min-height: 120px; padding: 18px 14px; }
.drop.small strong { font-size: 17px; }
.stem-slots { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.stem-slots li { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 4px 8px 4px 12px; border-top: 1px solid var(--line); }
.stem-slots li:first-child { border-top: 0; }
.stem-slots b { flex: none; width: 64px; font-size: 14px; }
.stem-slots .fname { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--muted); }
.stems-card .fill-btn { align-self: flex-start; }

.stem-dl { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.stem-dl .locked { opacity: 0.6; }
.main-dl { align-items: flex-start; background: rgba(244, 243, 236, 0.06); }
.main-dl .var-details { padding: 2px 0 0; }
.parts-note { margin: 0; padding: 12px; font-size: 12px; color: var(--muted); }

/* reference track overlay (song step) */
.energy-svg .refline { filter: drop-shadow(0 0 2px rgba(240, 106, 59, 0.6)); }
.ref-legend { display: flex; align-items: center; gap: 8px; margin: 0; font-family: "JetBrains Mono", monospace; font-size: 11px; color: #F2875C; }
.ref-legend span { flex: none; width: 18px; border-top: 2px dashed #F2875C; }
.ref-box { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }

/* free account: My account (the sign-in sheet has assets/auth.css) */
.acct-sheet { max-width: 520px; gap: 0; }
.acct-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.acct-top h2 { margin: 0; }
.acct-close { flex: none; background: transparent; border-color: var(--border); box-shadow: none; }
.acct-row { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.acct-row:nth-last-child(2) { border-bottom: 0; }
.acct-email { font-size: 16px; overflow-wrap: anywhere; }
.acct-plan { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; }
.acct-row .hint a { color: var(--t300); }
.acct-sheet .auth-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text); cursor: pointer; }
.acct-sheet .auth-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--t500); }
.acct-danger { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 8px; padding: 12px; border-radius: 4px; border: 1px solid rgba(242, 135, 92, 0.3); background: rgba(242, 135, 92, 0.05); }
.acct-danger .label { color: #F2875C; }
.danger-btn { border-color: rgba(242, 135, 92, 0.55); color: #F2875C; }
.danger-btn.armed { border-color: transparent; background: #D9582B; color: #fff; }
.app .pro-tag { display: inline-block; padding: 1px 6px; border-radius: 6px; background: transparent; border: 1px solid var(--t700); color: var(--t300); font-family: "JetBrains Mono", monospace; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; line-height: 1.5; vertical-align: 1px; }
.app .acct-btn .pro-tag { margin-left: 4px; }
.link-btn { padding: 0; border: 0; background: none; color: var(--t300); font: inherit; text-decoration: underline; cursor: pointer; }
.link-btn:focus-visible { outline: 2px solid var(--t300); outline-offset: 2px; }

/* ==========================================================================
   Design pass 2: bright teal only for what you act on, amber for variation,
   warnings and markers; calmer panels; readable numbers
   ========================================================================== */
:root { --amber: #F06A3B; --amber-dim: rgba(240, 106, 59, 0.14); --amber-line: rgba(240, 106, 59, 0.55); }
body.app-body { font-variant-numeric: tabular-nums; }

/* panels: less glow and scan lines, so the content leads */
.lcd { box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.45), 0 10px 26px rgba(0, 0, 0, 0.22); border-color: rgba(244, 243, 236, 0.14); }
.lcd::after { background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px); }
.energy-svg .eline { filter: drop-shadow(0 0 2px rgba(236, 237, 232, 0.55)); }
.dir-tab[aria-pressed="true"] { box-shadow: 0 0 0 1px var(--t500); }
.plan-card, .sec-list, .files, .grid-scroll, .sec-chords, .pro-card { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03); }
.pro-card { box-shadow: 0 0 0 1px rgba(244, 243, 236, 0.25); }

/* directions: say what each one is */
.dir-tab { gap: 4px; }
.dir-tab small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.dir-tab[aria-pressed="true"] small { color: var(--text); }

/* section lane: data in quiet teal; only the playing section lights up; a bar ruler */
.lane { position: relative; }
.lane::before { content: ""; position: absolute; left: 0; right: 0; top: -7px; height: 5px; pointer-events: none; background-image: linear-gradient(90deg, rgba(236, 237, 232, 0.35) 1px, transparent 1px); background-size: var(--ruler, 5%) 100%; }
.lane span { box-shadow: none; }
.lane span.tiny { font-size: 0; padding: 0; }
.marks span { display: flex; flex-direction: column; gap: 1px; }
.marks span b { font-weight: 500; font-size: 10px; color: var(--t300); opacity: 0.8; }
.marks span:last-child { align-items: flex-end; }
.marks span:not(:first-child):not(:last-child) { align-items: center; }

/* what the preview does */
.mode-badge { align-self: flex-start; margin: 0; padding: 6px 10px; border-radius: 4px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.18); color: var(--muted); font-size: 13px; line-height: 1.4; }
.mode-badge.stems { border-color: var(--t700); color: var(--text); }
.mode-badge.in-lcd { background: rgba(0, 0, 0, 0.22); border-color: rgba(244, 243, 236, 0.18); color: #F4F3EC; font-size: 12px; }

/* ingredient states: solid IN, amber VARY, an empty well for OUT */
.cell { font-size: 11px; letter-spacing: 0.02em; }
.cell.in { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.cell.vary { border-color: var(--amber-line); color: var(--amber); background: var(--amber-dim); box-shadow: none; }
.cell.out { color: #6C7079; }
.cell.playing { outline: 2px solid #FFFFFF; box-shadow: 0 0 12px rgba(244, 243, 236, 0.6); }
.legend .cell { width: 44px; }
.st-chip.vary { border-color: var(--amber-line); color: var(--amber); }
.plan-card li b.st.vary { color: var(--amber); }

/* warnings are amber, tips stay calm */
.check.warn { border-color: var(--amber-line); background: var(--amber-dim); box-shadow: inset 3px 0 0 var(--amber); }
.check.warn .k { color: var(--amber); }

/* readable readouts: sentences wrap, labels are a touch larger on phones */
.transport .now-playing { white-space: normal; overflow: visible; line-height: 1.4; }
@media (max-width: 520px) {
  .label { font-size: 11.5px; }
  .lane { height: 30px; }
  .lane span { font-size: 9.5px; padding-left: 3px; }
  .app-main { gap: 16px; }
  .dir-tab small { font-size: 11.5px; }
}

/* condensed chords */
.sec-chords div.all { background: rgba(244, 243, 236, 0.06); }
.sec-chords div.all .n { color: var(--accent); }

/* export guide: tap to enlarge */
.guide-zoom { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 4px; }
.guide-zoom:focus-visible { outline: 2px solid var(--t300); outline-offset: 3px; }
.zoom-tag { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 4px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 18px; }
.zoom-box { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; gap: 10px; padding: 12px; background: rgba(5, 6, 8, 0.92); }
.zoom-box > button { align-self: flex-end; background: var(--panel); }
.zoom-scroll { flex: 1 1 auto; overflow: auto; -webkit-overflow-scrolling: touch; border-radius: 4px; }
.zoom-scroll img { display: block; width: max(100%, 1400px); max-width: none; height: auto; }
.guide-zoom:has(img[hidden]) { display: none; }

/* ==========================================================================
   Design pass 3: amber only warns; VARY is a calm outline; new parts and
   transitions are dashed; fewer effects; section card; undo
   ========================================================================== */
.lcd::after { display: none; }
.wave-lcd .wave { filter: none; }
.cell.vary { border-color: rgba(236, 237, 232, 0.6); color: #F4F3EC; background: transparent; }
.cell.new { border: 1px dashed var(--t600); color: var(--accent); background: transparent; font-size: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.legend .cell.vary { border-color: rgba(236, 237, 232, 0.6); }
.st-chip.vary { border-color: rgba(236, 237, 232, 0.6); color: #F4F3EC; }
.plan-card li b.st.vary { color: #F4F3EC; }

/* the section you are on, readable at any width */
.sec-now { display: flex; align-items: center; gap: 8px; }
.sec-now span { flex: 1 1 auto; min-width: 0; text-align: center; font-family: "JetBrains Mono", monospace; font-size: 13px; color: #F4F3EC; }
.sec-now .icon-btn { flex: none; background: rgba(255, 255, 255, 0.07); border-color: transparent; color: #F4F3EC; box-shadow: none; }
.transport { flex-wrap: wrap; }
.hear-drop { margin-left: auto; background: rgba(0, 0, 0, 0.2); color: #F4F3EC; border-color: rgba(244, 243, 236, 0.35); }

/* secondary tools fold away */
.refine { border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }
.refine > summary { min-height: 48px; display: flex; align-items: center; padding: 0 14px; cursor: pointer; font-weight: 600; list-style: none; }
.refine > summary::-webkit-details-marker { display: none; }
.refine > summary::after { content: "▾"; margin-left: auto; color: var(--muted); }
.refine[open] > summary::after { content: "▴"; }
.refine > :not(summary) { margin: 0 14px 14px; }

/* per-section IN / VARY / OUT in the plan card */
.plan-card li.ing-row { align-items: center; }
.seg-ctl.mini { flex: none; display: inline-grid; grid-auto-columns: 52px; padding: 3px; gap: 3px; }
.seg-ctl.mini button { min-height: 36px; font-family: "JetBrains Mono", monospace; font-size: 11px; }
.seg-ctl.mini button[aria-pressed="true"] { background: var(--sel); color: var(--on-teal); }
@media (max-width: 520px) {
  .plan-card li.ing-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .seg-ctl.mini { grid-auto-columns: 64px; }
  .seg-ctl.mini button { min-height: 44px; }
}

/* export summary */
.export-summary { margin: 0; position: relative; z-index: 1; font-size: 14px; line-height: 1.5; color: #F4F3EC; }

/* undo next to back */
.btn-undo { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 56px; padding: 0 14px; border-radius: 4px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-undo[disabled] { opacity: 0.3; cursor: default; }
@media (max-width: 420px) { .btn-undo span { display: none; } .btn-undo { width: 56px; padding: 0; } }
.cell.new { display: block; line-height: 42px; padding: 0 4px; text-align: center; }
/* a long label ("Confirm the timing first") wraps to two lines instead of pushing the page wider than a 320 px phone */
@media (max-width: 420px) { .btn-next { min-width: 0; font-size: 15px; line-height: 1.15; white-space: normal; text-wrap: balance; padding: 0 10px; } }

/* ==========================================================================
   Second colour: amber. Teal = actions, playback, peaks, your loop.
   Amber = build-ups, things to make, labels, the current step, warnings.
   ========================================================================== */
.label { color: var(--amber); opacity: 0.9; }
.segs span.done { background: var(--t700); }
.segs span.cur { background: linear-gradient(90deg, var(--amber-2) 0%, #F7A27F 50%, var(--amber-2) 100%); background-size: 200% 100%; box-shadow: 0 0 8px rgba(240, 106, 59, 0.6); }
.stepbar-row .no { color: var(--amber); }
.proj-chip .led { background: var(--amber); box-shadow: 0 0 6px rgba(240, 106, 59, 0.8); }

/* the song lane */
.lane span.build { background: var(--amber-fill); color: #141007; }
.lane span.cut { background: #323432; color: var(--muted); }

/* tags: your loop stays teal, new parts and peaks get amber */
.tag.line { border-color: var(--amber); color: var(--amber); }
.dir-tab[aria-pressed="true"] small { color: var(--amber); }
.hear-drop { border-color: var(--amber-line); color: var(--amber); }
.mode-badge.in-lcd { border-color: rgba(240, 106, 59, 0.35); }

/* ingredients: things to make and transitions are amber */
.cell.new { border-color: var(--amber-line); color: var(--amber); background: var(--amber-soft); }
.st-chip.new { border-color: var(--amber); color: var(--amber); }
.plan-card li b.st.new { color: var(--amber); }
.ing-grid thead th.sel button { background: var(--amber-fill); color: #141007; box-shadow: none; }

/* chords: the root of each chord in amber */
.roll rect.root { fill: var(--amber); }
.roll-names small { color: var(--amber); }

/* export and Pro */
.ficon.pro { color: var(--amber); border-color: var(--amber-line); box-shadow: none; }
.file .tag.line { border-color: var(--amber); color: var(--amber); }
.build-list li.sec .txt b { color: var(--amber); }
.hero-lcd dt { color: var(--amber); }
.pro-card { border-color: var(--amber-line); background: radial-gradient(420px 180px at 100% 0%, rgba(240, 106, 59, 0.12), transparent 70%), var(--panel); box-shadow: none; }
.pro-card .fill-btn { background: var(--amber-fill); color: #141007; box-shadow: 0 0 18px rgba(240, 106, 59, 0.28); }

/* the reference line moves to lilac so it never reads as amber data */
.energy-svg .refline { stroke: #C9B8FF; filter: none; }
.ref-legend { color: #C9B8FF; }
.ref-legend span { border-top-color: #C9B8FF; }

/* neutral display panels: borders and inner text without the teal cast */
.lcd, .wave-lcd { border-color: rgba(255, 255, 255, 0.08); }
.lcd { color: #EDEFF2; }
.lcd-row .dim, .marks span b { color: #A9AFB8; }
.mode-badge.in-lcd { color: #D7DADF; background: rgba(0, 0, 0, 0.25); }
.sec-now span { color: #EDEFF2; }
.lane span.lt { color: #E6E8EB; }
.hero-lcd dd { text-shadow: none; }
.wave-lcd::before { background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px); }

/* splitting one loop into parts on this device */
.split-box { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 4px; border: 1px solid var(--amber-line); background: var(--amber-soft); }
.split-bar { display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.split-bar i { display: block; height: 100%; width: 0; background: var(--amber-fill); transition: width 0.3s ease; }
.split-done { color: var(--t300); }

/* a loaded loop takes a new file dropped on it */
.loop-card { transition: outline-color 0.15s ease; outline: 2px dashed transparent; outline-offset: 4px; }
.loop-card.over { outline-color: var(--t500); background: rgba(244, 243, 236, 0.06); }

/* loop timing: a suggested estimate (amber, dashed) vs a confirmed one (solid teal, ✓) */
.timing-box.unconfirmed { border: 1px dashed var(--amber-line); background: var(--amber-dim); }
.chip-btn.suggested { border: 1.5px dashed var(--amber); color: var(--text); background: transparent; }
.chip-btn.suggested .tag { padding: 1px 6px; border-radius: 6px; background: var(--amber-dim); color: var(--amber); font-family: "JetBrains Mono", monospace; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.confirm-yes { min-height: 44px; border-color: var(--t700); color: var(--text); font-weight: 700; }
.timing-box.flash { animation: l2s-flash 0.45s ease-in-out 3; }
@keyframes l2s-flash { 50% { box-shadow: 0 0 0 4px var(--amber-line), 0 0 22px rgba(240, 106, 59, 0.45); } }
@media (prefers-reduced-motion: reduce) {
  .timing-box.flash { animation: none; box-shadow: 0 0 0 3px var(--amber-line); }
}

/* brief 37: the Song step's Transitions toggle, and the parts ZIP button */
.trans-toggle { align-self: flex-start; min-width: 200px; }
.stem-dl .zip-btn { min-height: 44px; padding: 0 16px; font-size: 14px; }
.stem-dl .zip-btn:disabled { opacity: 0.75; }

/* ==========================================================================
   Calm pass (2026-11-05, from the approved sample 83d7b2d): one orange per
   screen, the step's main action (Next; Play on the Song step until the song
   has played; the parts ZIP on Download). Labels, tags, build sections, the
   current step and the play buttons go sage or muted; warnings go sand.
   ========================================================================== */
:root { --sand: #E2C27D; --sand-dim: rgba(226, 194, 125, 0.12); --sand-line: rgba(226, 194, 125, 0.55); }
body.app-body :focus-visible { outline: 2px solid var(--t300); outline-offset: 3px; }
body.app-body::before { display: none; }

/* one label style: 600, 12px, 0.06em, muted */
.label { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); opacity: 1; }
label.label { display: block; }

/* header and step bar: where you are, in sage */
.segs span.done { background: var(--t800); }
.segs span.cur { background: var(--t300); box-shadow: none; animation: none; }
.stepbar-row .no { font-size: 12px; color: var(--muted); }
.proj-chip .led { background: var(--t500); box-shadow: none; }
.step-item.cur .dot { background: var(--t400); color: var(--on-teal); box-shadow: none; }
.btn-undo[hidden], .btn-back[hidden], .btn-next[hidden] { display: none; }

/* play buttons are sage; on the Song step, Play is the main action until the song has played,
   and Next waits in outline */
.play-round { background: var(--sel); box-shadow: var(--sel-shadow); }
.play-round::after { border-color: rgba(244, 243, 236, 0.25); }
.app[data-step=song]:not(.heard) .play-round[data-act=play] { background: var(--fill); box-shadow: var(--fill-shadow); }
.app[data-step=song]:not(.heard) .btn-next:not([aria-disabled="true"]) { background: transparent; color: var(--t400); box-shadow: inset 0 0 0 1.5px var(--t400); }

/* song step */
.lane span.build { background: #D6AD62; color: #1E1F1E; }
.tag.line, .file .tag.line { border-color: var(--border); color: var(--muted); }
.dir-tab[aria-pressed="true"] small { color: var(--text); }
.hear-drop { border-color: rgba(244, 243, 236, 0.35); color: #F4F3EC; }
.mode-badge.in-lcd { border-color: rgba(244, 243, 236, 0.18); }
.check .k { color: var(--muted); }
.check.warn { border-color: var(--sand-line); background: var(--sand-dim); box-shadow: inset 3px 0 0 var(--sand); }
.check.warn .k { color: var(--sand); }
.transport { gap: 12px; }
.lcd .transport { padding: 2px 0; }
.refine .sec-list { box-shadow: none; }
.refine > summary { gap: 8px; }
.switch-row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; }
.switch-row .sw { flex: none; position: relative; width: 44px; height: 26px; border-radius: 13px; background: var(--key); border: 1px solid var(--border); transition: background-color 0.2s; }
.switch-row .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform 0.2s, background-color 0.2s; }
.switch-row[aria-checked="true"] .sw { background: var(--t700); border-color: transparent; }
.switch-row[aria-checked="true"] .sw::after { transform: translateX(18px); background: var(--on-teal); }

/* warnings and estimates are sand, not orange */
.timing-box.unconfirmed { border: 1px dashed var(--sand-line); background: var(--sand-dim); }
.chip-btn.suggested { border-color: var(--sand); }
.chip-btn.suggested .tag { background: var(--sand-dim); color: var(--sand); }
@keyframes l2s-flash { 50% { box-shadow: 0 0 0 4px var(--sand-line); } }
@media (prefers-reduced-motion: reduce) { .timing-box.flash { box-shadow: 0 0 0 3px var(--sand-line); } }
.split-box { border-color: var(--line); background: var(--panel); }
.split-bar i { background: var(--t400); }

/* loop step: the loop, then a two-line summary with Change */
.loop-foot { display: flex; align-items: center; gap: 12px; }
.loop-foot .hint { flex: 1 1 auto; min-width: 0; }
.metro-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 4px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.metro-btn[aria-pressed="true"] { background: var(--sel); color: var(--on-teal); border-color: transparent; }
.set-sum { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.set-sum-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.set-sum-tx b { font-size: 15px; }
.set-sum-tx span { font-size: 14px; color: var(--muted); line-height: 1.4; }
.set-sum .ghost-btn { flex: none; }
.set-edit { display: flex; flex-direction: column; gap: 18px; }
.tap-btn { align-self: flex-start; }
.role-list { display: flex; flex-wrap: wrap; gap: 6px; }
.genre-select { min-height: 44px; max-width: 100%; padding: 0 12px; border-radius: 4px; border: 1px solid var(--border); background: var(--key); color: var(--text); font: inherit; font-size: 15px; }
.bars-ctl button { padding: 0 2px; }
@media (max-width: 360px) { .bars-ctl button { font-size: 12px; } }

/* ingredients: the grid edits; the card below explains */
.ing-grid thead th.sel button { background: var(--sel); color: var(--on-teal); box-shadow: none; }
.plan-card li b.st.new, .st-chip.new { color: var(--t300); }
.st-chip.new { border-color: var(--t300); }
.plan-card .sub { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.sub-h { margin: 0; font-family: Archivo, sans-serif; font-stretch: 100%; font-size: 15px; font-weight: 700; color: var(--text); }
.mini-fold > summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--t300); font-size: 14px; font-weight: 600; }
.mini-fold[open] > summary { margin-bottom: 4px; }
.plan-card .new-list li { align-items: center; }

/* download: one main button, the rest folded */
.main-dl { display: flex; flex-direction: column; align-items: stretch; gap: 8px; background: none; }
.main-dl .zip-btn { min-height: 56px; padding: 0 22px; font-size: 17px; }
.zip-btn .pro-lock-icon { margin: 0 10px 0 0; width: 14px; height: 14px; }
.pro-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0; font-size: 14px; color: var(--muted); }
.pro-line .pro-lock-icon { margin: 0 2px 0 0; color: var(--t400); }
.pro-line a { color: var(--t300); font-weight: 600; text-underline-offset: 3px; }
.guide-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.lock-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.lock-tag .pro-lock-icon { margin: 0; color: var(--t400); }
.dl { background: transparent; border: 1px solid var(--border); color: var(--text); box-shadow: none; }
.dl.locked { border-color: var(--line); color: var(--muted); }
.stem-dl .locked { opacity: 1; color: var(--muted); border-color: var(--line); }
.stem-dl .pro-lock-icon { margin: 0 6px 0 0; color: var(--t400); }
.refine .files { box-shadow: none; }
.refine .build-list { margin-top: 0; }
.build-list li.sec .txt b { color: var(--t300); }
.ficon.pro { color: var(--t400); border-color: rgba(244, 243, 236, 0.2); }
@media (min-width: 760px) { .main-dl { align-items: flex-start; } .main-dl .zip-btn { padding: 0 32px; } }
.transport .now-playing { flex: 1 1 160px; }
.plan-card li.ing-row { flex-direction: row; align-items: flex-start; gap: 10px; }

/* ==========================================================================
   Site system pass (2026-11-10, Codex review 36): the app follows the approved
   tool pages. A cream title band per step, flat dark working panels (no slats,
   no glows), orange marks the active state, section colours carry the music,
   one sage surface at most (the empty upload zone).
   ========================================================================== */
body.app-body { --screen: #1F201F; --orange-sm: #F28A62; background: #2A2B2A; background-image: none; }

/* the dark bars run the full width, opaque, so the cream band never shows at their sides */
.app-head { background: #222322; box-shadow: 0 0 0 100vmax #222322; clip-path: inset(0 -100vmax); backdrop-filter: none; -webkit-backdrop-filter: none; }
.app-foot { background: #1E1F1E; box-shadow: 0 0 0 100vmax #1E1F1E; clip-path: inset(0 -100vmax); backdrop-filter: none; -webkit-backdrop-filter: none; }

/* cream title band: the step's title and one line under it */
.step-band {
  display: flex; flex-direction: column; gap: 8px;
  margin: -20px 0 4px; padding: 22px 0 22px;
  --text: #1F201F; --muted: #4A4A45;
  color: #1F201F; background: #F2EEE3; box-shadow: 0 0 0 100vmax #F2EEE3; clip-path: inset(0 -100vmax);
}
.step-band h1.step-title { margin: 0; color: #1F201F; }
.step-band .step-lead { margin: 0; color: #4A4A45; }
@media (min-width: 760px) { .step-band { margin-top: -28px; padding: 34px 0 30px; gap: 10px; } }
.app-main.enter > .step-band { animation: none; }

/* step progress: the current step is orange, done steps quiet */
.segs span.done { background: #6D736E; }
.segs span.cur { background: var(--orange); box-shadow: none; animation: none; }
.step-item.cur { border-color: rgba(240, 106, 59, 0.6); background: transparent; }
.step-item.cur .dot { background: var(--orange); color: #1F201F; box-shadow: none; }
.step-item.done .dot { background: #6D736E; color: #F4F3EC; }
.proj-chip .led { background: var(--orange); }

/* flat dark panels: one quiet hairline, soft depth, no slats or glows */
.lcd, .wave-lcd { background: #1F201F; border: 1px solid rgba(255, 255, 255, 0.09); box-shadow: 0 16px 34px -26px rgba(0, 0, 0, 0.8); }
.lcd::after, .wave-lcd::after { display: none; }
.ficon { background: #1F201F; border-color: rgba(255, 255, 255, 0.09); }
.wave-lcd .wave, .energy-svg .eline, .roll rect:not([fill]) { filter: none; }
.bpm-row { background: #1F201F; }
.bpm-row input { text-shadow: none; }
.playhead { background: #F4F3EC; box-shadow: none; }
.play-round { background: #F4F3EC; box-shadow: none; }
.play-round::after { display: none; }
.transport.live .now-playing::before { background: var(--orange); box-shadow: none; }
@media (hover: hover) {
  .fill-btn:hover, .play-round:hover, .dl:not(.locked):hover, .btn-next:not([disabled]):not([aria-disabled="true"]):hover { box-shadow: none; filter: brightness(1.06); }
}
.plan-card, .sec-list, .files, .grid-scroll, .sec-chords, .pro-card, .refine { box-shadow: none; }
.pro-card { background: var(--panel); border-color: var(--line); box-shadow: inset 0 3px 0 var(--orange); }
.pro-card .fill-btn { box-shadow: none; }

/* the one sage surface: the empty upload zone, where you start */
.drop:not(.small) { background: #F4F3EC; border: 2px dashed rgba(31, 32, 31, 0.4); color: #1F201F; --muted: #3A3C3A; }
.drop:not(.small) .hint { color: #3A3C3A; }
.drop:not(.small):hover, .drop:not(.small).over { background: #F4F3EC; border-color: #1F201F; }
.drop::before { display: none; }
.drop:not(.small) .eq i { background: #1F201F; box-shadow: none; }
.drop.small .eq i, .demo-sheet .eq i { background: #F4F3EC; box-shadow: none; }

/* selected = orange: the chosen version, pressed keys and chips, the picked column */
.dir-tab { background: var(--panel); }
.dir-tab[aria-pressed="true"] { border-color: var(--orange); box-shadow: inset 0 3px 0 var(--orange); }
.dir-tab[aria-pressed="true"] small { color: var(--text); }
.dir-tab[aria-pressed="true"] span { color: var(--orange-sm); }
.app .chip-btn[aria-pressed="true"], .app .key-btn[aria-pressed="true"], .app .seg-ctl button[aria-pressed="true"], .app .seg-ctl.mini button[aria-pressed="true"], .app .metro-btn[aria-pressed="true"] {
  background: #2A2B2A; color: #F4F3EC; border: 1.5px solid var(--orange); box-shadow: none;
}
.prog[aria-pressed="true"] { border-color: var(--orange); box-shadow: inset 0 3px 0 var(--orange); }
.switch-row[aria-checked="true"] .sw { background: var(--orange); }
.switch-row[aria-checked="true"] .sw::after { background: #1F201F; }

/* Listen: section colours stay; your loop gets an off-white edge, the playing section a white ring */
.lane span { color: #1F201F; filter: none; }
.lane .loop { box-shadow: inset 0 0 0 2px #F4F3EC; }
.lane span.on { filter: none; box-shadow: inset 0 0 0 2px #FFFFFF, 0 0 0 1px #FFFFFF; }
.sec-row.is-loop { background: transparent; box-shadow: inset 3px 0 0 #F4F3EC; }
.sec-row.playing { background: rgba(255, 255, 255, 0.06); box-shadow: inset 3px 0 0 var(--orange); }
.app .tag { background: transparent; border: 1px solid rgba(244, 243, 236, 0.6); color: #F4F3EC; }

/* What plays where: part status is neutral (IN filled, VARY outlined, OUT recessed);
   the column heads carry their section colour; the picked column is underlined orange */
.cell.in { background: #C9CCC5; color: #1F201F; box-shadow: none; }
.cell.vary { background: transparent; border-color: rgba(244, 243, 236, 0.6); color: #F4F3EC; box-shadow: none; }
.cell.out { background: rgba(0, 0, 0, 0.22); border-color: transparent; color: #8D918C; box-shadow: none; }
.cell.playing { outline: 2px solid var(--orange); outline-offset: 1px; box-shadow: none; }
.st-chip.in { background: #C9CCC5; color: #1F201F; }
.ing-grid thead th[style] { box-shadow: inset 0 3px 0 var(--sc); }
.ing-grid thead th button { color: var(--muted); }
.ing-grid thead th.loopcol button { color: var(--text); }
.ing-grid thead th.sel button { background: transparent; color: #F4F3EC; box-shadow: inset 0 -3px 0 var(--orange); border-radius: 0; }
.app[data-step=ingredients] .app-main > .plan-card { box-shadow: inset 0 3px 0 var(--orange); }
.app[data-step=ingredients] .app-main > .plan-card > .label:first-child { color: var(--orange-sm); }
.plan-card li b.st.in { color: #F4F3EC; }
/* a soft right edge while more sections wait off-screen */
.grid-more { margin: -8px 0 0; text-align: right; font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--muted); }
.grid-more[hidden] { display: none; }

/* Download: the guide sits on a flat dark panel; "Enlarge" is written out; the last step's bar does not stick */
.hero-lcd .guide-img { border-color: rgba(255, 255, 255, 0.12); }
.zoom-tag { width: auto; gap: 6px; padding: 0 12px; font-size: 14px; font-weight: 600; background: rgba(31, 32, 31, 0.86); border: 1px solid rgba(255, 255, 255, 0.18); }
.zoom-tag span { font-size: 13px; }
/* the last step has no Next: Undo and Back sit at the end of the page, not in a bar */
.app[data-step=export] .app-foot { position: static; background: transparent; box-shadow: none; border-top: 0; padding-top: 4px; }
/* the section list shows each section's colour, as on the timeline */
.sec-row .nm::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 2px; background: var(--sc, #6D736E); }

/* the app is a tool: dark from top to bottom like the tool pages (Roland 2026-11-11); the step title area is set
   apart by a hairline, not by a cream band */
.step-band {
  --text: #ECEDE8; --muted: #C9CCC5;
  color: #ECEDE8; background: transparent; box-shadow: none; clip-path: none;
  border-bottom: 1px solid rgba(244, 243, 236, 0.12); margin-bottom: 18px;
}
.step-band h1.step-title { color: #F4F3EC; }
.step-band .step-lead { color: #C9CCC5; }

/* =====================================================================
   Ported from the Hungarian build (Loopból dal, 2026-11-13): the section picker for long files,
   the song editor's Order row and two-tap Delete, the grid legend and the picked column.
   Colours stay 60-30-10 (assets/palette.css): charcoal, deep charcoal, orange for the selection.
   ===================================================================== */

/* ---- pick the loop out of a longer file (app/ui/trim.js), in the loop card's waveform language ---- */
.trim-card:focus, body.app-body .trim-card:focus-visible { outline: none; }
.trim-card .loop-head .chip-btn { flex: none; }
.trim-lane { height: 110px; padding: 0; touch-action: pan-y; cursor: pointer; user-select: none; -webkit-user-select: none; }
.trim-lane::before { display: none; }
.trim-lane .wave { position: absolute; left: 0; top: 7px; width: 100%; height: 96px; }
.trim-shade { position: absolute; top: 0; bottom: 0; background: rgba(20, 21, 20, 0.72); pointer-events: none; }
.trim-sel { position: absolute; top: 0; bottom: 0; box-sizing: border-box; border-top: 2px solid #F06A3B; border-bottom: 2px solid #F06A3B; background-color: rgba(240, 106, 59, 0.12); cursor: grab; touch-action: none; }
.trim-sel.held { cursor: grabbing; background-color: rgba(240, 106, 59, 0.2); }
.trim-sel.bars { background-image: linear-gradient(90deg, rgba(244, 243, 236, 0.38) 1px, transparent 1px); background-size: var(--trim-bar) 100%; background-repeat: repeat-x; }
.trim-handle { position: absolute; top: 0; bottom: 0; z-index: 2; width: 44px; margin-left: -22px; cursor: ew-resize; touch-action: none; }
.trim-handle::before { content: ""; position: absolute; left: 21px; top: 0; bottom: 0; width: 2px; background: #F06A3B; }
.trim-handle::after { content: ""; position: absolute; left: 16px; top: 50%; width: 12px; height: 32px; margin-top: -16px; border-radius: 4px; background: #F06A3B; box-shadow: 0 0 0 2px #141514; }
.trim-handle:focus, body.app-body .trim-handle:focus-visible { outline: none; }
.trim-handle:focus-visible::after { box-shadow: 0 0 0 2px #141514, 0 0 0 4px #F4F3EC; }
.trim-lane .playhead { z-index: 1; }
.trim-readout { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; line-height: 1.5; color: var(--text); }
.trim-card .chip-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.trim-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---- room between controls that sit side by side ---- */
.chips, .role-list, .editor-actions { gap: 8px; }

/* ---- Edit sections: the open row and its editor belong together; Order on its own row; Delete apart ---- */
.sec-row::after { content: ""; flex: none; width: 7px; height: 7px; margin: 0 4px 3px 6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.2s; }
.sec-row[aria-expanded="true"] { background: rgba(244, 243, 236, 0.05); box-shadow: inset 3px 0 0 #F06A3B; }
.sec-row[aria-expanded="true"]::after { transform: rotate(-135deg); margin-bottom: -3px; border-color: #F4F3EC; }
.sec-row[aria-expanded="true"] + .editor { box-shadow: inset 3px 0 0 #F06A3B; padding-left: 15px; }
.order-btns { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.order-pos { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--muted); margin-right: 4px; }
.editor-actions { padding-top: 14px; border-top: 1px solid var(--line); }
.editor-actions .del-btn { margin-left: auto; }
.editor-actions .del-btn[data-sure="1"] { background: #F06A3B; border-color: #F06A3B; color: #1B1C1B; font-weight: 700; }

/* ---- What plays where: a legend in the grid's own cell shapes, and the picked column all the way down ---- */
.ing-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin: 0 0 12px; font-size: 13px; color: var(--t600); }
.ing-legend > span { display: inline-flex; align-items: center; gap: 8px; }
.ing-legend .cell { width: auto; min-width: 48px; height: 26px; margin: 0; padding: 0 8px; font-size: 10px; cursor: default; }
.ing-grid td.sel, .ing-grid thead th.sel { background: rgba(240, 106, 59, 0.08); }
.ing-grid thead th button { min-height: 44px; min-width: 44px; }
/* the picker's tempo field is empty until typed: a dashed line shows where to type, orange when focused */
.trim-card .bpm-row input { width: 5.6ch; min-height: 44px; border-bottom: 1px dashed rgba(244, 243, 236, 0.4); }
.trim-card .bpm-row input:focus-visible { border-bottom: 2px solid #F06A3B; }

/* ---- more from the Hungarian build's UI pass ---- */
/* disabled controls look disabled: faded, a dashed edge on chips, a no-entry cursor (Move up on the first section,
   Delete with two sections left, the element chips after a split) */
.app :is(.chip-btn, .ghost-btn, .icon-btn, .seg-ctl button):disabled { opacity: 0.42; cursor: not-allowed; box-shadow: none; }
.app .chip-btn:disabled:not([aria-pressed="true"]) { border-style: dashed; }
.app .chip-btn:disabled[aria-pressed="true"] { opacity: 0.62; }
/* the tempo field fits a decimal (113.9) */
.bpm-row input { width: 5.6ch; }
/* small folds ("Add something new here", "Change the transition") read as buttons, with a chevron */
.app .mini-fold > summary { gap: 10px; padding: 0 14px; border: 1px solid var(--border); border-radius: 4px; color: var(--text); font-size: 13px; list-style: none; }
.app .mini-fold > summary::-webkit-details-marker { display: none; }
.app .mini-fold > summary::before { content: ""; width: 7px; height: 7px; margin-top: -3px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform 0.2s; }
.app .mini-fold[open] > summary { margin-bottom: 12px; }
.app .mini-fold[open] > summary::before { transform: rotate(-135deg); margin-top: 3px; }
.trans-pick, .stem-dl { gap: 8px; }

/* Export without Pro: what the locked parts download holds, with an 8-bar listen per part */
.pro-peek { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; padding: 12px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.peek-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.peek-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.peek-list .mono { font-family: "JetBrains Mono", monospace; font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.peek-list [aria-pressed="true"] { border-color: var(--sel); color: var(--sel); }
