/* 11/11 edit-clarity: actions on the picture and the chord row. Reuses the existing quiet text buttons, Geist/Mono and the accent. */

/* 3. The selected chord: the same low-opacity accent in the chord row and in the Whole flow picture */
#chords .chord[data-current=true]{background:color-mix(in srgb,var(--accent,#c37532) 9%,transparent)}
#chords .chord[data-current=true]:hover{background:color-mix(in srgb,var(--accent,#c37532) 13%,transparent)}
#chords .chord .chord-menu{display:none;font-size:10px;color:var(--accent,#c37532);margin-left:4px;vertical-align:middle;padding:2px 3px}
#chords .chord[data-current=true] .chord-menu{display:inline}

/* 5. Change a chord in place */
.progression{position:relative}
#chord-pop{position:absolute;z-index:30;width:max-content;max-width:min(440px,100%);background:#fff;border:1px solid #777;box-shadow:0 8px 30px #0002;padding:8px 10px 8px;font-size:12px}
#chord-pop[hidden]{display:none}
#chord-pop .cp-head{display:flex;align-items:center;gap:8px;margin-bottom:6px}
#cp-name{font:15px Geist,Arial,sans-serif;width:110px;border:0;border-bottom:1px solid #ccc;padding:3px 2px;background:#fff}
#cp-name:focus{outline:none;border-bottom-color:var(--accent,#c37532)}
#cp-notes{font:10px Mono;color:#888;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
#chord-pop .cp-head button{font-size:11px;padding:4px 6px}
#cp-close{font-size:15px!important;line-height:1}
#chord-pop .cp-chips{display:flex;flex-wrap:wrap;gap:3px;margin:4px 0}
#chord-pop .cp-chips button{font-size:11px;padding:4px 6px;min-width:28px;border:1px solid #e0e0e0}
#chord-pop .cp-chips button:hover{border-color:#9a9a96}
#chord-pop .cp-chips button[aria-pressed=true]{border-color:var(--accent,#c37532);color:var(--accent,#c37532)}
#chord-pop .cp-foot{display:flex;align-items:center;gap:8px;margin-top:6px;border-top:1px solid #eee;padding-top:5px}
#chord-pop .cp-voices{display:flex;align-items:center;gap:2px;color:#555}
#chord-pop .cp-voices button{padding:3px 8px;font-size:13px}
#chord-pop .cp-voices button:disabled,#chord-pop button:disabled{color:#bbb;cursor:default}
#cp-count{font:11px Mono;min-width:14px;text-align:center}
#cp-error{flex:1;color:#a33;font-size:11px;min-width:0}
#cp-more{font-size:11px;padding:4px 6px;margin-left:auto}

/* 4. Tool row with keyboard hints */
.curve-modes kbd{font:9px Mono;color:#9a9a96;margin-left:4px;letter-spacing:0}
.curve-modes button[aria-pressed=true] kbd{color:var(--accent,#c37532)}

/* 2 + 4. Snap settings live on the picture's lower edge (Transition view only) */
#snap-strip{position:absolute;left:88px;bottom:3px;display:flex;align-items:center;gap:12px;font-size:11px;color:#777;z-index:4;max-width:calc(100% - 100px);white-space:nowrap}
#snap-strip[hidden],#snap-key-field[hidden]{display:none}
#snap-strip .snap-label{font:10px Mono;color:#9a9a96;text-transform:uppercase;letter-spacing:.3px}
#snap-strip label{display:inline-flex;align-items:center;gap:5px}
#snap-strip select{font:11px Geist,Arial,sans-serif;border:0;border-bottom:1px solid #ddd;background:transparent;padding:2px 1px;color:#222;max-width:150px}
#snap-strip input[type=checkbox]{accent-color:#222;margin:0}
#auto-connect{font-size:11px;padding:3px 4px;color:var(--accent,#c37532)}

/* 6. Add / remove a voice */
#voice-add,#voice-remove{position:absolute;z-index:6;font:11px/1 Geist,Arial,sans-serif;padding:3px 6px;white-space:nowrap;background:#fff;border:1px solid #d3d3d3;color:#555;min-width:20px;min-height:20px}
#voice-add:hover,#voice-remove:hover{border-color:var(--accent,#c37532);color:var(--accent,#c37532)}
#voice-add[hidden],#voice-remove[hidden]{display:none}
#voice-add{transform:translate(-100%,0)}
body[data-look=c] #voice-add{transform:translate(-100%,-50%)}
#voice-remove{transform:translate(-50%,-50%);font-size:12px}

/* 1. Nearly silent part and its edge */
#quiet-tip{position:absolute;z-index:9;background:#fff;border:1px solid #333;padding:4px 7px;font-size:11px;white-space:nowrap;pointer-events:none;box-shadow:0 2px 0 #0001}
#quiet-tip[hidden]{display:none}
#score .quiet-edge,#score .quiet-hit{cursor:ew-resize}
#score .end-grip{cursor:grab}
#stage[data-direct=edge],#stage[data-direct=edge] *{cursor:ew-resize!important}
#stage[data-direct=regrip],#stage[data-direct=regrip] *{cursor:grabbing!important}
#stage[data-direct=remove],#stage[data-direct=remove] *{cursor:no-drop!important}

/* 4. The compact "More" panel */
#tools-dialog{max-width:620px}
#tools-dialog header{margin-bottom:10px}
#tools-dialog .more-row{display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px;padding:6px 0;border-bottom:1px solid #eee}
#tools-dialog .more-label{font-size:11px;color:#777;width:100%}
#tools-dialog .more-row label{margin:4px 0 4px 12px}
#tools-dialog #voice-picks{display:flex;flex-wrap:wrap;gap:2px}
#tools-dialog .group-actions{display:flex;flex-wrap:wrap;gap:2px}
#tools-dialog .more-note{margin:10px 0 0;font-size:11px}
/* 11/11 (owner): hover shows (score band colour now set on the band itself, product31.mjs tintFill) the chord a click would choose (pale); the chosen chord is stronger */
#chords .chord.is-hover{background:color-mix(in srgb,var(--accent,#c37532) 5%,transparent)}
#chords .chord:not([data-current=true]):hover{background:color-mix(in srgb,var(--accent,#c37532) 5%,transparent)}
/* 11/11 (owner: how is this used / Apply in the wrong place): a picked shape is on the curves at once, like every other
   edit (⌘Z undoes), so Apply and Cancel are gone. Versions are shown as pictures, not numbers. */
#preview-apply,#preview-cancel{display:none!important}
#pitch-variants div{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}
#pitch-variants button{display:flex;flex-direction:column;align-items:center;gap:1px;padding:3px 2px 2px;min-height:0}
#pitch-variants button svg{width:100%;height:24px}
#pitch-variants button small{font:9px Mono,monospace;color:#888}
#pitch-variants button[aria-pressed=true]{border-color:var(--accent,#c37532);background:color-mix(in srgb,var(--accent,#c37532) 8%,#fff)}
#pitch-variants button[aria-pressed=true] small{color:#1a1a1a}
/* 11/11 note drag: grab a note name (or a line where it holds its note) and move it up or down */
.note-grip{cursor:grab}
.note-grip circle{fill:#fff;stroke:var(--accent,#be7c38);stroke-width:1.4;transition:r .12s}
.note-grip:hover circle{r:5.5;fill:var(--accent,#be7c38)}
#stage[data-hover=note]{cursor:grab}
#stage[data-direct=note],#stage[data-direct=note] *{cursor:grabbing!important}
#note-tag{position:absolute;z-index:6;pointer-events:none;background:#1f1f1f;color:#fff;border-radius:6px;padding:3px 8px;font-size:12px;display:flex;gap:6px;align-items:baseline;white-space:nowrap}
#note-tag[hidden]{display:none}
#note-tag span{opacity:.65;font-size:11px}
/* 11/11: remove = small round × on the selected line */
#voice-remove{transform:translate(-50%,-50%)!important;width:20px;height:20px;min-width:0;min-height:0;padding:0;border-radius:50%;font:14px/18px Geist,Arial,sans-serif;text-align:center}
#voice-remove{border-color:var(--accent,#c37532)!important;color:var(--accent,#c37532)!important;font-weight:500}
/* 11/11 overlap sweep: "Start" covered the note name at the left edge; it now hangs to the right of its stem */
#voice-start{transform:translate(-8px,calc(-100% - 8px))!important}
#voice-start::after{left:8px!important}
body[data-look=c] #voice-add{transform:translate(0,-50%)!important}
#rec-open{display:inline-flex;align-items:center;gap:5px}
#rec-open .rec-dot{width:8px;height:8px;border-radius:50%;background:#d23c2a}
#sync.nudge{outline:2px solid var(--accent,#c37532);outline-offset:2px}
/* 11/12 chord row: every chord keeps its share of the time line; what does not fit is shortened or shown on hover */
#chords .chord{min-width:0;overflow:hidden}
#chords .chord strong{white-space:nowrap;overflow:hidden;display:block}
#chords .chord .squeezed{visibility:hidden}
#chords .chord:hover{overflow:visible;z-index:3;position:relative}
#chords .chord:hover .squeezed{visibility:visible}
#chords .chord.is-short:hover .chord-name,#chords .chord:hover .squeezed{background:#fff;padding-right:4px}
#shape-stack{font-size:11px;color:#555;margin:2px 0 6px}
#shape-stack[hidden]{display:none}
/* 11/12 Replace / Stack switch and the list of stacked shapes */
.stack-row{flex-wrap:wrap;row-gap:4px}
.stack-row .stack-list{display:flex;flex-wrap:wrap;align-items:center;gap:4px;font-size:11px;color:#333;flex-basis:100%}
.stack-row .stack-item{display:inline-flex;align-items:center;gap:2px;padding:1px 2px 1px 7px;border:1px solid #d6d2ca;border-radius:10px;background:#fff}
.stack-row .stack-item button{border:0;background:none;padding:0 4px;font-size:12px;line-height:1;color:#888;min-height:0}
.stack-row .stack-item button:hover{color:var(--accent,#c37532)}
.stack-row .stack-plus{color:#aaa}
.stack-row button[aria-pressed=true]{border-color:var(--accent,#c37532);color:#1a1a1a;background:color-mix(in srgb,var(--accent,#c37532) 9%,#fff)}
/* 11/12 Help off: explaining lines hidden, the space they take stays (nothing moves); notices still show */
#help-toggle{font:11px Geist,sans-serif;color:#666;background:none;border:1px solid #d6d2ca;border-radius:12px;padding:2px 9px;margin-right:8px}
#help-toggle[aria-pressed=true]{color:#1a1a1a;border-color:#999}
body[data-help=off] #edit-hint:not(.is-notice),body[data-help=off] .sound-s,body[data-help=off] #quiet-tip,body[data-help=off] #shape-stack{visibility:hidden}
/* 11/13: no symbol-only buttons; on narrower windows the header buttons sit a little closer instead */
@media(max-width:1300px){.instrument.product31 .top-right{gap:4px!important}#help-toggle{padding:2px 7px!important;margin-right:2px!important}}
@media(max-width:1000px){.instrument.product31 header.top{gap:8px!important}.instrument.product31 .language-switch{padding-left:6px}}
@media(max-width:1000px){.instrument.product31 .top-right button{padding-left:5px!important;padding-right:5px!important}}

/* Flow controls follow the line weights and calibrated scales used in Frond instruments. */
.product31 :is(#preset-open,#sound-pick,#project-open,#tools-open,#sound-open,#rec-open,#daw-info,#save-desktop),
dialog[id] :is(header>button[data-close],.dialog-actions>button,#record-midi-open,.import-midi-button,#play-mode) {
 border:1px solid #282828;
 border-radius:0;
 background:#fff;
 min-height:30px;
 box-shadow:none;
}
.product31 :is(#project-open,#save-desktop,#daw-info) { border-style:dashed }
.product31 #sound-pick { padding:6px 8px; align-items:center }
.product31 #preset-open { padding-inline:10px }
.product31 :is(#tools-open,#sound-open) { background:#f1f1ee;border-color:#f1f1ee }
.product31 :is(#undo,#redo) { border:1px solid #d8d8d4;border-radius:0 }
.product31 :is(#preset-open,#sound-pick,#project-open,#tools-open,#sound-open,#rec-open,#daw-info,#save-desktop,#undo,#redo):hover:not(:disabled),
dialog[id] button:hover:not(:disabled) { background:#efefec;border-color:#222 }
.product31 :is(#tools-open,#sound-open,#project-open):active { background:#deded9 }
.product31 .header-actions #animate {
 background:#fff;color:#181818;border:1px solid #d7d7d1;border-left:3px solid #222;border-radius:0;
}
.product31 .header-actions #animate[aria-pressed=true],
#sound-dialog #play-mode[aria-pressed=true] { background:#222;color:white;border-color:#222 }
.product31 #sync { border:0;border-radius:0;background:transparent }
.product31 .top-right button { line-height:1.15 }
.product31 .delivery #midi-drag { border-radius:0;border:1px dashed #333;background:#fff;color:#181818 }
.product31 .delivery #midi-format { border:0;border-bottom:1px solid #222;background:#fff;border-radius:0;padding:4px;max-width:185px }
.product31 #help-toggle { border-radius:0;border:0;border-bottom:1px solid #aaa }
.product31 #rec-open .rec-dot { border-radius:0;width:6px;height:6px }
.product31 .language-switch { flex:none;white-space:nowrap }
#tempo:not([readonly]) { cursor:ns-resize;touch-action:none;appearance:textfield;border-bottom:1px solid #222 }
#tempo::-webkit-inner-spin-button,#tempo::-webkit-outer-spin-button { appearance:none }
#pitch-panel .pitch-scroll { margin-top:5px;padding-right:4px }
#pitch-panel .library-tabs { gap:5px }
#pitch-panel .library-tabs button { border-radius:0;border:0;border-bottom:1px solid #d3d3ce;padding:8px 2px }
#pitch-panel .library-tabs [aria-pressed=true] { border-color:#222;background:#222;color:#fff }
#pitch-panel #preset-grid .recipe { border-radius:0;min-height:66px }
#pitch-panel #preset-grid .recipe[aria-pressed=true] { background:#f2f2ef;color:#181818;box-shadow:inset 0 -2px var(--accent) }
#pitch-panel #preset-grid .recipe[aria-pressed=true] path { stroke:var(--accent) }
#pitch-panel .scope-chips button { border-radius:0 }
#pitch-panel .recipe:focus-visible { outline-offset:-2px }
@media(max-width:1370px) {
 .instrument.product31 .top { gap:clamp(8px,1vw,15px)!important }
 .instrument.product31 :is(.wordmark,#midi-drop-zone,#sound-pick) { margin-right:0!important }
 .instrument.product31 #preset-open { margin-left:clamp(4px,1vw,12px)!important }
 .instrument.product31 #sound-pick .sound-v { max-width:clamp(78px,9vw,120px)!important }
}
@media(min-width:1371px) and (max-width:1460px) {
 .instrument.product31 #midi-drop-zone .zone-text { display:none!important }
}
#sound-dialog {
 width:min(940px,92vw);
 border:1px solid #222;border-radius:0;
 padding:26px 30px;
 box-shadow:0 12px 40px #0002;
}
#sound-dialog header { border-color:#222;margin-bottom:12px }
#sound-dialog header h2 { font-weight:400;letter-spacing:-.6px }
#sound-dialog :is(button,select) { border-radius:0;margin:0 }
#sound-dialog select { -webkit-appearance:none;appearance:none;border:0;border-bottom:1px solid #222;padding:5px 20px 5px 0 }
#sound-dialog .sound-controls {
 display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
 gap:24px;margin:20px 0 30px;
}
#sound-dialog .sound-control {
 display:flex;flex-direction:column;align-items:stretch;gap:10px;
 min-width:0;padding:0;
}
#sound-dialog .sound-control label { display:block;margin:0;font-size:12px;color:#555;min-height:18px }
#sound-dialog .sound-control output {
 font:400 clamp(32px,3.7vw,44px)/1 Geist,sans-serif;
 color:#181818;letter-spacing:-2px;
 white-space:nowrap;padding:2px 0 5px;
}
#sound-dialog .sound-control .parameter-unit { font:12px Mono,monospace;color:#888;letter-spacing:0;margin-left:7px }
#sound-dialog input[type=range] {
 appearance:none;display:block;width:100%;min-width:0;height:27px;
 margin:0;padding:0;border:0;background:transparent;cursor:ew-resize;
}
#sound-dialog input[type=range]::-webkit-slider-runnable-track {
 height:12px;
 border-bottom:1px solid #222;
 background:repeating-linear-gradient(to right,#222 0 1px,transparent 1px 5%) left bottom/100% 5px no-repeat,
 repeating-linear-gradient(to right,#222 0 1px,transparent 1px 25%) left bottom/100% 10px no-repeat;
}
#sound-dialog input[type=range]::-webkit-slider-thumb {
 appearance:none;width:10px;height:8px;margin-top:12px;
 border:0;border-radius:0;background:var(--accent);
 clip-path:polygon(50% 0,100% 100%,0 100%);
}
#sound-dialog input[type=range]::-webkit-slider-thumb:hover { background:#222 }
#sound-dialog .sound-control input:focus-visible { outline-offset:4px }
#sound-dialog .scale-ends { display:flex;justify-content:space-between;font:10px Mono,monospace;color:#777;margin-top:2px }
#sound-dialog #midi-panel .io-strip { padding-top:14px;border-color:#c9c9c3 }
#sound-dialog #midi-panel .io-source { margin:0 0 6px }
#sound-dialog #midi-route-status { margin:5px 0 0 }
#sound-dialog #midi-analysis-actions { display:flex;flex-wrap:wrap;gap:8px;margin-top:14px;padding-top:14px }
#sound-dialog .import-midi-button { border-style:dashed }
#sound-dialog #record-midi-open { border-left-width:3px }
#sound-dialog #record-midi-open::before { content:"";display:inline-block;width:5px;height:5px;background:#222;margin-right:7px;vertical-align:1px }
#sound-dialog .play-mode { display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;margin-top:15px }
#sound-dialog .play-mode label { margin:0 }
#sound-dialog .play-mode small { flex-basis:100%;font-size:11px;line-height:1.6;color:#777 }
#sound-dialog #play-glide { width:100px }
#sound-dialog .play-mode output { font:14px Mono,monospace;color:#222;min-width:58px }
#sound-dialog > p { margin:9px 0 0;font-size:11px }
@media(max-width:790px) {
 #sound-dialog { padding:18px }
 #sound-dialog .sound-controls { grid-template-columns:repeat(2,minmax(0,1fr));gap:20px }
}

/* Shared finish: quiet surfaces, measured values, and distinct action states. */
dialog[id] { border:1px solid #222;border-radius:0;box-sizing:border-box;max-width:calc(100vw - 36px);max-height:calc(100dvh - 36px);box-shadow:0 12px 40px #0002;overscroll-behavior:contain }
dialog[id]::backdrop { background:#17171738 }
dialog[id] header { border-bottom-color:#222;align-items:center }
dialog[id] header h2 { font-weight:400;letter-spacing:-.6px }
dialog[id] :is(button,input:not([type=checkbox]):not([type=range]),select) { border-radius:0 }
dialog[id] :is(header>button[data-close],#analysis-close) { padding:6px 12px;min-width:58px;flex-shrink:0;margin:0 }
dialog[id] :is(input[type=search],input[type=text],select) { border-color:#b6b6b0;background-color:#fff }
dialog[id] input[type=checkbox] { accent-color:var(--accent) }
.product31 :is(button,input,select):focus-visible,dialog[id] :is(button,input,select,summary):focus-visible { outline:2px solid var(--accent);outline-offset:3px }
.product31 button:disabled,dialog[id] button:disabled { cursor:default }
#pitch-panel .pitch-scroll,#progression-grid,dialog[id] { scrollbar-width:thin;scrollbar-color:#b7b7b0 transparent }
#pitch-panel .stack-row button { border-radius:0 }
#pitch-panel .stack-row .stack-item { border-radius:0;border-color:#ccc;padding:3px 3px 3px 7px }
#pitch-panel :is(.scope-chips,.stack-row) button[aria-pressed=true] { border-color:#222;background:#f2f2ef;box-shadow:inset 0 -2px var(--accent) }
.product31 .view-options button { min-height:30px;border-bottom:1px solid transparent }
.product31 .view-options button[aria-pressed=true] { text-decoration:none;border-bottom-color:#222 }
.product31 .ab [data-ab] { min-width:27px;min-height:28px;border-bottom:1px solid transparent }
.product31 .ab [aria-pressed=true] { border-bottom-color:var(--accent);color:#222 }
.product31 #midi-format { appearance:auto }
.product31 .delivery #scrub31 { appearance:none;background:transparent;height:24px;cursor:ew-resize }
.product31 .delivery #scrub31::-webkit-slider-runnable-track { height:6px;border-bottom:1px solid #999;background:repeating-linear-gradient(to right,#b9b9b3 0 1px,transparent 1px 5%) }
.product31 .delivery #scrub31::-webkit-slider-thumb { appearance:none;width:9px;height:12px;margin-top:-3px;border:0;border-radius:0;background:#222;clip-path:polygon(0 0,100% 0,100% 65%,50% 100%,0 65%) }

/* Progressions remain visual: neutral contours acquire the accent on selection. */
#progression-dialog { width:960px;padding:24px 28px 18px;gap:0 }
#progression-dialog header { margin-bottom:10px }
#progression-dialog .progression-filter { padding:2px 0 16px;gap:16px }
#progression-search { flex:1;min-width:180px;height:34px;border:0;border-bottom:1px solid #888;padding:7px 0 }
#progression-dialog .progression-filter label { margin:0;font-size:11px;color:#666 }
#progression-family { max-width:200px;height:34px }
#progression-grid { gap:0 22px;padding-right:6px;min-height:100px }
#progression-grid .progression-choice { grid-template-columns:minmax(0,1fr) 100px;gap:8px 14px;border:0;border-top:1px solid #d5d5cf;min-height:112px;padding:14px 9px;margin:0;border-radius:0;align-content:center;background:#fff }
#progression-grid .progression-choice:hover { background:#f7f7f4 }
#progression-grid .progression-choice[aria-pressed=true] { background:#f2f2ee;box-shadow:inset 2px 0 var(--accent);color:#181818 }
#progression-grid .progression-name strong { font-weight:500;font-size:14px;letter-spacing:-.2px }
#progression-grid .progression-name small { font:9px Mono,monospace;color:#777 }
#progression-grid .progression-choice>small { font:10px Mono,monospace;color:#888 }
#progression-grid .progression-chords { gap:4px 9px }
#progression-grid .progression-chords span { padding:0;background:none;font:11px Mono,monospace;color:#555 }
#progression-grid .progression-mini { width:100px;height:48px }
#progression-grid .progression-mini-svg path { stroke:#41413d;stroke-opacity:.8;stroke-width:1 }
#progression-grid .progression-choice[aria-pressed=true] path { stroke:var(--accent);stroke-opacity:1 }
#progression-dialog .progression-actions { padding:14px 0 0;margin-top:12px;border-top-color:#222;gap:8px }
#progression-dialog .progression-actions output { flex:1;min-width:160px;font:11px/1.5 Geist,sans-serif;color:#666 }
#progression-dialog .progression-actions button { margin:0;border:1px solid #222;min-height:32px;padding:7px 12px }
#progression-audition { border-left-width:3px!important }
#progression-dialog #progression-apply:not(:disabled),#chord-dialog .apply-chord { background:#222;color:#fff;border-radius:0 }
#progression-dialog #progression-apply:hover:not(:disabled),#chord-dialog .apply-chord:hover { background:#444 }

/* Chord editing uses the same numeric hierarchy as Tone. */
#chord-dialog { width:680px;padding:24px 28px }
#chord-dialog #chord-result { font-size:42px;letter-spacing:-1.3px }
#chord-dialog .eyebrow { color:#777;letter-spacing:.08em }
#chord-dialog .chord-choice-label { font-size:11px;color:#666;margin:14px 0 8px }
#chord-dialog :is(#chord-roots,#chord-qualities,#chord-lengths) { gap:5px }
#chord-dialog :is(#chord-roots,#chord-qualities,#chord-lengths) button { border-color:#d3d3ce;min-width:38px;min-height:32px }
#chord-dialog button[aria-pressed=true] { border-color:#222;color:#181818;box-shadow:inset 0 -2px var(--accent);background:#f2f2ef }
#chord-dialog #chord-pitches { font:11px Mono,monospace;color:#777;letter-spacing:.06em;padding:5px 0 }
#chord-dialog .chord-adjust { display:grid;grid-template-columns:1fr 2fr;gap:28px;padding-top:3px }
#chord-dialog .chord-stepper { gap:14px;min-height:44px }
#chord-dialog .chord-stepper output { font:400 28px Geist,sans-serif;letter-spacing:-.8px;min-width:34px }
#chord-dialog .chord-stepper button { font-size:18px;min-width:28px;padding:3px;border:0;border-bottom:1px solid #bbb }
#chord-dialog #chord-length { font-size:20px }
#chord-dialog #chord-advanced { border-top:1px solid #ddd;padding-top:6px }
#chord-dialog #chord-advanced .group-actions button { border:1px solid #ccc;padding:6px 9px;margin:0 }
#chord-dialog #remove-chord { color:#a33e2d;border-color:#c9a29b!important }
#chord-dialog .chord-apply { border-color:#222;padding-top:14px }
#chord-pop { border-color:#222;border-radius:0;box-shadow:0 8px 24px #0002 }
#chord-pop .cp-chips button { border-radius:0 }
#chord-pop .cp-chips button[aria-pressed=true] { color:#222;background:#f2f2ee;border-color:#222;box-shadow:inset 0 -2px var(--accent) }

/* Secondary tools use bounded rows instead of scattered text links. */
#tools-dialog,#project-dialog,#detail-dialog,#daw-dialog { width:760px }
#tools-dialog .more-row { padding:16px 0;gap:8px 10px }
#tools-dialog .more-label { flex-basis:100%;color:#777;font-size:11px;margin-bottom:4px }
#tools-dialog #voice-picks { margin:0;gap:5px }
#tools-dialog :is(.more-row>button,.group-actions>button,#voice-picks>button),#detail-dialog :is(.interpolations>button,#reset-transition,#harmonize,#capture) { border:1px solid #c8c8c2;padding:7px 10px;margin:0;min-height:30px }
#tools-dialog .group-actions { margin:0;gap:6px }
#tools-dialog #voice-picks [aria-pressed=true],#detail-dialog .interpolations [aria-pressed=true] { border-color:#222;color:#222;background:#f2f2ef;box-shadow:inset 0 -2px var(--accent) }
#project-dialog .dialog-actions { padding:0 0 20px;border-bottom:1px solid #ddd }
#project-dialog .dialog-actions>button { border-style:dashed;padding:9px 16px;margin:0 }
#project-dialog>label { display:flex;margin:18px 0 }
#project-dialog :is(#meter-num,#meter-den) { width:60px;font-size:22px;font-weight:400;padding:6px;border:0;border-bottom:1px solid #aaa }
#detail-dialog #detail-title { font-size:14px;color:#555 }
#detail-dialog .interpolations { display:flex;gap:6px;padding-bottom:16px;border-bottom:1px solid #ddd }
#detail-dialog>label { display:grid;grid-template-columns:130px minmax(110px,1fr) 65px;gap:22px;max-width:none;margin:18px 0 24px;color:#555;font-size:11px }
#detail-dialog input[type=range] { appearance:none;min-width:0;width:100%;height:24px;padding:0;background:transparent;border:0;cursor:ew-resize }
#detail-dialog input[type=range]::-webkit-slider-runnable-track { height:10px;border-bottom:1px solid #333;background:repeating-linear-gradient(to right,#666 0 1px,transparent 1px 10%) left bottom/100% 5px no-repeat }
#detail-dialog input[type=range]::-webkit-slider-thumb { appearance:none;width:10px;height:8px;margin-top:10px;border:0;border-radius:0;background:var(--accent);clip-path:polygon(50% 0,100% 100%,0 100%) }
#detail-dialog input:disabled { opacity:.3;cursor:default }
#detail-dialog output { width:auto;font:22px Geist,sans-serif;letter-spacing:-.7px;color:#222 }
#detail-dialog :is(#reset-transition,#harmonize,#capture) { margin:4px 4px 0 0;font-size:11px }
#daw-duration { display:block;border-top:1px solid #222;padding-top:16px;margin-top:24px;font-size:13px;color:#222 }

/* Recording stays immediately visible; its shape joins the rest of Flow. */
#analysis-dialog .motion-head { border-bottom-color:#222;padding-bottom:14px }
#analysis-dialog #analysis-close { border:1px solid #222 }
#analysis-dialog #analysis-file { border:1px dashed #666;padding:6px 10px;min-height:30px }
#analysis-dialog .ap-tracks button { border-radius:0;padding:5px 9px }
#analysis-dialog .ap-tracks button[aria-pressed=true] { box-shadow:inset 0 -2px var(--accent);background:#f2f2ef }
#analysis-dialog #record-start { border-radius:0!important;box-shadow:none;min-height:30px }
#analysis-dialog #record-start.is-recording { box-shadow:inset 3px 0 #751a12 }
#analysis-dialog #record-stop { border-radius:0;padding:6px 10px;min-height:30px }
#analysis-dialog .record-setup { flex-wrap:wrap;gap:10px 16px;padding:5px 0 10px }
#analysis-dialog .ap-use { border:1px solid #222;padding:9px 18px }
#analysis-dialog .ap-use:hover:not(:disabled) { color:#fff;background:#444 }
#analysis-dialog .ap-use:disabled { border-color:#ddd }
@media(max-width:790px) {
 #progression-dialog { padding:20px }
 #progression-grid { grid-template-columns:1fr }
 #detail-dialog>label { grid-template-columns:100px minmax(80px,1fr) 55px;gap:12px }
}
@media(prefers-reduced-motion:reduce) {
 #record-start.is-armed { animation:none }
}
/* Respect host-only visibility even when a control has a flex/grid display rule. */
dialog[id] [hidden] { display:none!important }
dialog[id] select {
 appearance:none;padding-right:28px;
 background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M2 2l4 4 4-4' fill='none' stroke='%23555' stroke-width='1.2'/%3E%3C/svg%3E");
 background-repeat:no-repeat;background-position:right 8px center;
}
#progression-dialog #progression-family { padding-right:30px }
#detail-dialog .parameter-unit { font:10px Mono,monospace;letter-spacing:0;color:#777;margin-left:5px }
#detail-dialog>label { grid-template-columns:130px minmax(110px,1fr) 95px }
@media(max-width:790px) { #detail-dialog>label { grid-template-columns:100px minmax(80px,1fr) 80px } }

/* Frond typography: light quantities, tracked mono captions, restrained text weight. */
@font-face { font-family:Geist;src:url('../assets/fonts/Geist-Light.ttf') format('truetype');font-weight:300;font-style:normal;font-display:swap }
html[lang=en] :is(.product31,dialog[id]) { font-synthesis:none }
html[lang=en] .product31 :is(#preset-open,#project-open,#tools-open,#sound-open,#rec-open,#save-desktop,#daw-info),
html[lang=en] #pitch-panel .library-tabs button,
html[lang=en] dialog[id] :is(header>button[data-close],.dialog-actions>button,.progression-actions>button,#analysis-close) {
 font-family:Mono,monospace;font-size:10px;font-weight:400;letter-spacing:.045em;text-transform:uppercase;
}
html[lang=en] #pitch-panel .library-tabs button { font-size:11px;letter-spacing:.08em }
html[lang=en] .product31 :is(.view-options button,#undo,#redo) { font-size:11px;font-weight:400 }
html[lang=en] :is(#sound-dialog .sound-control label,.chord-choice-label,#tools-dialog .more-label,.io-label) {
 font:10px/1.5 Mono,monospace;letter-spacing:.08em;text-transform:uppercase;color:#777;
}
html[lang=en] dialog[id] header h2 { font-weight:300;font-size:23px;letter-spacing:-.7px }
#sound-dialog .sound-control output { font-weight:300;font-variant-numeric:tabular-nums;letter-spacing:-1.6px }
html[lang=en] #chord-dialog #chord-result { font-size:42px;font-weight:300;letter-spacing:-1.2px }
#chord-dialog .chord-stepper output,#detail-dialog output { font-weight:300;font-variant-numeric:tabular-nums }
html[lang=en] #progression-grid .progression-name strong { font-weight:400 }
html[lang=en] #pitch-panel #preset-grid .recipe strong { font-weight:400;font-size:11px;letter-spacing:.01em }
html[lang=en] .product31 .chord strong { font-weight:500;letter-spacing:-.6px }
html[lang=en] .product31 #tempo { font-weight:300;font-variant-numeric:tabular-nums;letter-spacing:-.4px }
.product31 .language-switch [aria-pressed=true] { color:#222;border-bottom:1px solid #222 }
.product31 .language-switch [aria-pressed=false] { color:#999 }

/* Capability notice: shown on a non-MPE selection, reopenable beside Sound. */
#sound-compatibility{width:min(560px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;padding:24px;background:#fff;color:#222;border:1px solid #777}
#sound-compatibility .compatibility-source{font:12px Mono,monospace;letter-spacing:.04em;color:#666}
#sound-compatibility p{font-size:13px;line-height:1.65;margin:16px 0}
#sound-compatibility dl{margin:20px 0}
#sound-compatibility dl>div{padding:13px 0;border-top:1px solid #ddd}
#sound-compatibility dt{font:11px Mono,monospace;letter-spacing:.04em;margin-bottom:6px}
#sound-compatibility dd{margin:0;font-size:13px;line-height:1.55;color:#666}
#sound-compatibility .dialog-actions{display:flex;flex-wrap:wrap;gap:10px;justify-content:flex-end}
/* 11/16 (B33 restored): shapes list in pages of whole rows; the panel itself never scrolls */
#grid-pager{display:flex;align-items:center;gap:10px;justify-content:flex-end;font-size:11px;color:#666;margin:4px 0 2px}
#grid-pager[hidden]{display:none}
#grid-pager button{font:11px Geist,sans-serif;background:none;border:1px solid #d6d2ca;border-radius:12px;padding:2px 10px;color:#333}
#grid-pager button:hover:not(:disabled){border-color:#1a1a1a}
#grid-pager button:disabled{opacity:.35}
#preset-grid{overflow:hidden!important;-webkit-mask-image:none!important;mask-image:none!important}
#pitch-panel .pitch-scroll{overflow:hidden!important}
