body{margin:0;background:#faf7f0;color:#443b36;font-size:16px}main{max-width:900px;margin:auto;padding:20px 16px 160px}header img{width:min(80%,340px);height:auto}h1{font-size:1.4rem}h2{font-size:1.2rem}p{line-height:1.65}section{background:#fff;border:1px solid #e1d9d0;border-radius:18px;padding:18px;margin:18px 0;min-width:0}.fields{display:flex;flex-wrap:wrap;gap:12px;align-items:end}label{display:flex;flex-direction:column;gap:5px;max-width:100%}button,input,select,textarea{font:inherit;border:1px solid #a99bb8;border-radius:10px;padding:10px;min-height:48px;max-width:100%;box-sizing:border-box}button{cursor:pointer;background:#ede9f7;color:#44345d;margin:5px 0;white-space:normal}button:disabled{opacity:.45;cursor:default}input[type=number]{width:140px}input[type=checkbox]{width:22px;min-height:22px}textarea{width:100%;min-height:80px}.score{overflow:auto;max-width:100%}.score svg{display:block;width:640px;max-width:none;margin:8px 0}footer{position:fixed;z-index:5;bottom:0;left:0;right:0;display:flex;gap:12px;align-items:center;justify-content:center;background:#fff8ef;border-top:2px solid #afa0ca;padding:10px 16px}footer p{margin:0;flex:1;max-width:620px;overflow-wrap:anywhere}footer button{background:#754e59;color:white;font-weight:700;flex-shrink:0}pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;max-height:360px;overflow:auto}#beats{display:flex;gap:10px}#beats i{font-style:normal;border:2px solid #baaed4;border-radius:50%;width:44px;height:44px;text-align:center;line-height:40px}#beats i.active{background:#d8ccef;border:3px solid #5f427c}#candidate{min-height:2em;color:#704918}[hidden]{display:none!important}@media(max-width:400px){main{padding-inline:10px}section{padding:12px}footer{padding:8px}footer button{max-width:115px}}:focus-visible{outline:3px solid #77599b;outline-offset:3px}

header .bird-preview{display:block;width:144px;height:144px;object-fit:contain;margin:12px 0}
#capture-position{font-size:1.3rem;font-weight:700;padding:12px;border-radius:10px;background:#f0ebf8;min-height:1.6em}
button[aria-pressed=true]{border:2px solid #77599b;background:#ded5ef}
.capture-editor{padding:14px;background:#f7f4fb;border:1px solid #d9cfe5;border-radius:12px;margin:12px 0}
#capture-note{width:100%}#capture-edit-status{min-height:1.65em;color:#614478}#capture-score [data-note-id]{cursor:pointer}#capture-score [data-editor-selected=true]{outline:2px solid #77599b;outline-offset:3px}

#capture-blocks{display:flex;gap:8px;overflow:auto;padding:8px 0}#capture-blocks button{flex:0 0 auto;min-width:64px;border-top-color:#baa7d4}#capture-score .capture-note-draft{outline:2px dashed #b06018;outline-offset:5px}#capture-edit-confirm,#preview{background:#d9ebd5;border-color:#64865b}#capture-edit-details{margin:16px 0}#capture-edit-details summary{cursor:pointer;padding:10px}

.edit-toolbar{position:sticky;top:0;z-index:3;background:#fffaf2;border:1px solid #ded0ba;border-radius:10px;padding:6px;gap:6px}.edit-toolbar button{font-size:14px;padding:7px;min-height:44px;margin:0}

#capture-selection{margin:0 0 6px;font-weight:700;color:#503069;font-size:15px;line-height:1.5}
#capture-time-edit{margin-top:8px}
#capture-time-position{margin:0 0 8px;font-size:13px;line-height:1.4;font-weight:700}
.note-time-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.note-time-actions button{margin:0;min-height:44px;padding:6px;font-size:14px;background:#e6edf0}
.melody-app.learning-active #capture-time-edit{display:none}
@media(max-height:500px){.editor-focus:not(.melody-app) .edit-toolbar{position:static}}
.note-navigation,.note-actions{display:grid;gap:6px}.note-navigation{grid-template-columns:repeat(4,minmax(0,1fr))}.note-actions{grid-template-columns:repeat(3,minmax(0,1fr));margin-top:6px}
#capture-blocks{position:relative;scroll-behavior:auto}#capture-blocks button[aria-pressed=true]{background:#624383;color:white;box-shadow:0 0 0 2px #624383;outline-offset:2px}
#capture-score{height:280px;max-height:42svh;min-height:150px;border:1px solid #d9cfe5;border-radius:10px;overscroll-behavior:contain;scroll-behavior:auto;margin:6px 0}
#capture-score [data-editor-selected=true] ellipse{fill:#c34a16;stroke:#c34a16;stroke-width:3}
@media(max-height:480px){#capture-score{height:170px;min-height:120px}.edit-toolbar{position:static}}

#capture-blocks button{display:flex;flex-direction:column;align-items:center;gap:2px}#capture-blocks strong{font-size:21px;line-height:1.1}#capture-blocks span{font-size:12px}

@media(min-width:600px) and (max-height:480px){#capture-note-panel{display:grid;grid-template-columns:minmax(250px,1fr) minmax(0,1fr);gap:8px;align-items:start}#capture-note-panel .edit-toolbar{grid-column:1;grid-row:1}#capture-blocks{grid-column:1;grid-row:2;max-width:100%}#capture-score{grid-column:2;grid-row:1 / 3;height:230px;max-height:64svh}}

.note-actions{grid-template-columns:repeat(4,minmax(0,1fr))}#capture-edit-delete{background:#fff0e6;border-color:#b67850}
#capture-score.is-playing [data-editor-selected=true]{outline:none}
#capture-score.is-playing [data-editor-selected=true] ellipse{fill:inherit;stroke:none;stroke-width:0}
.note-playback-halo{display:none;fill:#ffd2e8;stroke:none;pointer-events:none}
[data-playing=note]>.note-playback-halo{display:block}
#capture-score [data-playing=note] ellipse{fill:#ff3b91!important;stroke:#ff3b91!important;stroke-width:3!important}
#capture-score [data-playing=note] line,#capture-score [data-playing=note] path{stroke:#ff3b91!important}
#capture-score [data-playing=note] text{fill:#ff3b91!important}
#capture-score svg[data-playing=bar]{background:#fff7e8}
#capture-blocks.is-playing button[aria-pressed=true]{background:#ede9f7;color:#44345d;box-shadow:none;border:1px solid #a99bb8}
#capture-blocks button[data-playing=note]{background:#ffe34d!important;color:#27221e!important;box-shadow:inset 0 0 0 3px #5b4312!important;font-weight:700;opacity:1}
.editor-focus #capture-score svg{width:100%;max-width:100%;height:auto}
#composer-panel{border:1px solid #d9cfe5;background:#faf8fd;border-radius:10px;padding:8px;margin:8px 0}
#composer-panel p{font-size:13px;margin:5px 0;line-height:1.4}
#composer-position{font-weight:bold}
.composer-values{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.composer-values label{font-size:13px}.composer-values input,.composer-values select{width:100%;min-height:44px;padding:6px}
#composer-keys{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:6px 0}
#composer-keys button{min-height:44px;margin:0;padding:5px}
#composer-beats{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:2px;margin:6px 0}
#composer-beats button{font-size:12px;padding:2px;min-height:44px}
.composer-replace{display:flex;flex-direction:row;align-items:center;font-size:13px}
.editor-focus.manual-composer #capture-note-panel{display:flex;flex-direction:column}
.manual-composer #capture-blocks{order:0}
.manual-composer #capture-score{order:1;height:180px;max-height:30svh}
.editor-focus.manual-composer .edit-toolbar{order:2;position:static}
.manual-composer #composer-panel{margin:6px 0;padding:6px}
.manual-composer #composer-position,.manual-composer #composer-candidate{margin:4px 0;font-size:13px}
.manual-composer #capture-selection{margin:3px 0}
.manual-composer .note-navigation button{min-height:36px;font-size:12px}
#image-settings{font-size:13px;border:1px solid #ddd3e6;border-radius:8px;padding:0 6px;margin:6px 0}
#image-settings select{width:100%;min-width:0;min-height:44px}
.composer-voice-hint{font-size:12px;margin:4px 0;color:#655570}
.manual-composer[data-composer-view="score"] #capture-blocks,.manual-composer[data-composer-view="blocks"] #capture-score{display:none}

/* Editing-first presentation; the technical layout remains available for comparison. */
.editor-focus main{max-width:1000px;padding:12px 12px 100px}
.editor-focus header h1{margin:0;font-size:19px;display:flex;gap:12px;align-items:baseline;flex-wrap:wrap}
.editor-focus header small{font-size:12px;font-weight:400;color:#746575}
.editor-focus header p{margin:5px 0 10px;font-size:13px}
.editor-focus summary{cursor:pointer;min-height:44px;box-sizing:border-box;padding:11px 6px;font-size:14px}
.editor-focus #editor-source,.editor-focus #technical-tools{border:1px solid #dfd6e5;border-radius:10px;padding:0 10px;background:#fff;margin:8px 0}
.editor-focus #edit-workspace{margin:8px 0;padding:12px;border-radius:14px;scroll-margin-top:8px}
.editor-focus .listen-settings{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin-bottom:10px}
.editor-focus .listen-settings label{font-size:12px;min-width:0;gap:3px}
.editor-focus .listen-settings label:has(#tempo),.editor-focus .listen-settings label:has(#count-volume){grid-column:span 2}
.editor-focus .listen-settings label:has(#instrument){grid-column:span 4}
.editor-focus .listen-settings label:has(#play-count-style){grid-column:span 3}
.editor-focus .listen-settings input,.editor-focus .listen-settings select{width:100%;min-width:0;font-size:14px;min-height:40px;padding:7px}
.editor-focus .listen-settings label:has(#play-count){display:flex;align-items:center;justify-content:center;gap:6px}
.editor-focus .listen-settings #play-count{width:22px;min-height:22px}
.editor-focus .editor-voice{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:6px}
.editor-focus .editor-voice label{font-size:13px;display:flex;flex-direction:row;align-items:center}
.editor-focus .editor-voice #mic{font-size:12px;min-height:36px;margin:0;padding:6px}
.editor-focus #edit-voice-status{font-size:12px;margin:0;flex:1;min-width:120px;line-height:1.4}
.editor-focus .quick-transpose{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:6px 0}
.editor-focus .quick-transpose button{font-size:13px;min-height:40px;margin:0;padding:7px}
.editor-focus .edit-toolbar{background:#f7f3fb;border-color:#d9cfe5;position:sticky;top:0;padding:7px}
.editor-focus .note-actions,.editor-focus .listen-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:6px}
.editor-focus #capture-edit-status{font-size:12px;line-height:1.4;margin:5px 0 0;min-height:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.editor-focus #capture-blocks{gap:6px;padding:6px 2px}
.editor-focus #capture-blocks button{min-width:52px;padding:5px 8px;margin:0}
.editor-focus #capture-score{height:210px;min-height:150px;max-height:32svh;margin:0}
.editor-focus #editor-more{margin:8px 0;border-top:1px solid #e4dce9}
.editor-focus #editor-more p{font-size:13px}
.editor-focus .editor-finish{gap:6px}
.editor-focus .editor-finish button{font-size:12px;min-height:40px;margin:0;padding:7px}
.editor-focus #copy-status:empty{display:none}
.editor-focus #source-hint{font-size:13px;margin:4px 0}
.editor-focus .source-actions{display:flex;gap:8px;flex-wrap:wrap}
.editor-focus #capture-position{font-size:15px;margin:8px 0;padding:8px}
.editor-focus #technical-tools section{margin:8px 0;padding:10px}
.editor-focus footer{padding:7px 12px;font-size:13px}
.editor-focus footer button{min-height:42px;margin:0}
@media(min-width:700px){
 .editor-focus .listen-settings{grid-template-columns:80px minmax(150px,2fr) minmax(140px,2fr) 90px 70px}
 .editor-focus .listen-settings label:has(input),.editor-focus .listen-settings label:has(select){grid-column:auto}
 .editor-focus #capture-score{height:270px;max-height:42svh}
 .editor-focus .editor-voice{float:right;max-width:52%}
 .editor-focus .quick-transpose{max-width:46%;margin-bottom:10px}
 .editor-focus #capture-note-panel{clear:both}
}
@media(min-width:600px) and (max-height:480px){
 .editor-focus #capture-note-panel{display:grid;grid-template-columns:minmax(240px,1fr) minmax(0,1fr)}
 .editor-focus .edit-toolbar{position:static}
 .editor-focus #capture-score{height:260px;max-height:72svh;grid-column:2;grid-row:1 / 3}
}
