:root{--ink:#263c35;--muted:#78857c;--paper:#f6f5ed;--line:#e4e8df;--green:#254e3e;--lime:#d9edaa;--yellow:#f5d96a;--serif:Georgia,serif;--sans:Arial,sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--sans);font-size:14px}.section-kicker,.library-meta{font-size:10px;font-weight:700;letter-spacing:.13em}main{max-width:1430px;margin:auto;padding:0 5.8vw}h1,h2,h3,p{margin:0}.workspace{display:grid;grid-template-columns:335px minmax(0,1fr);gap:20px;align-items:start}.panel{background:#fff;border:1px solid #e9ece4;border-radius:15px;box-shadow:0 9px 35px #4a5c3c08}.library{padding:27px 20px 15px}.panel-heading{display:flex;justify-content:space-between;align-items:end}.section-kicker{color:#93a292}.panel-heading h2,.practice h2{font:29px/1.1 var(--serif);letter-spacing:-.025em;margin-top:9px}.count{font:11px var(--sans);color:#809079;background:#edf2e7;padding:5px 8px;border-radius:20px;vertical-align:middle;margin-left:3px}.heading-mark{font-size:23px;color:#95aa8d}.search{height:42px;border:1px solid #e4e9e0;border-radius:8px;display:flex;align-items:center;padding:0 12px;margin:24px 0 14px;gap:9px}.search span{font-size:23px;color:#92a095}.search input{border:0;outline:0;width:100%;font:12px var(--sans);color:var(--ink)}.search input::placeholder{color:#a4b0a5}.filters{display:flex;flex-wrap:wrap;gap:6px}.filter{border:1px solid #e6ebe2;background:white;color:#87958a;border-radius:6px;font:600 10px var(--sans);padding:7px 9px;cursor:pointer}.filter.active{background:#e3eed4;color:#48674e;border-color:#e3eed4}.library-meta{display:flex;justify-content:space-between;color:#a5b0a4;margin:27px 3px 10px;font-size:9px}.pattern-list{max-height:492px;overflow:auto;padding-right:3px}.pattern-card{width:100%;text-align:left;border:0;border-radius:9px;background:transparent;display:flex;align-items:center;gap:12px;padding:12px 10px;color:var(--ink);cursor:pointer}.pattern-card:hover{background:#f7f9f3}.pattern-card.active{background:#edf4e5}.card-icon{width:36px;height:36px;display:grid;place-items:center;border-radius:7px;background:#f4f5ed;color:#799277;font-size:16px}.pattern-card.active .card-icon{background:#dcebc9}.card-copy{flex:1;min-width:0}.card-copy strong{display:block;font-size:12px}.card-copy small{display:block;font-size:10px;color:#96a397;margin-top:5px}.card-arrow{font-size:16px;color:#a1b19c}.empty{color:#87958a;padding:20px 8px;font-size:12px}.practice{padding:28px 30px}.practice-heading{display:flex;justify-content:space-between}.pattern-number{font:italic 32px var(--serif);color:#e2e9df}.badges{display:flex;gap:6px;margin:20px 0 28px}.badges span{background:#f0f4ea;color:#82937d;font-size:9px;letter-spacing:.08em;font-weight:700;padding:7px 9px;border-radius:5px}.badges span:first-child{background:#deedcc;color:#577a51}.score-top{display:flex;justify-content:space-between;align-items:center;border-top:1px solid #edf0e9;padding-top:22px}.score-icon{font-size:24px;color:#b9c9b4}.score-wrap{overflow-x:auto}.score{min-width:500px;margin:24px 0 14px;display:grid;grid-template-columns:50px repeat(var(--steps),1fr);grid-template-rows:repeat(6,32px) 27px 24px;position:relative}.string-name,.note-cell{position:relative;display:flex;align-items:center;justify-content:center}.string-name{justify-content:flex-start;color:#829086;font-size:10px;font-weight:700}.string-name small{font-size:9px;color:#b6c0b6;margin-left:5px}.note-cell::before{content:'';position:absolute;left:0;right:0;top:50%;height:1px;background:#d8e0d6}.note-cell:last-of-type::before{right:0}.note-cell.current{background:#f0f6e8}.note{z-index:1;display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:#eff4e9;color:#456a4b;font-weight:700;font-size:11px}.note-cell.current .note{background:#759a6b;color:white}.finger-cell,.beat-cell{text-align:center;font-size:11px;color:#6d846d;padding-top:5px}.finger-cell{font-weight:700}.finger-cell.current{color:#3c6741}.beat-cell{color:#b2bdb1;font-size:9px}.player{background:#f5f7f0;border-radius:10px;margin-top:25px;padding:18px;display:flex;align-items:center;gap:22px}.player-main{display:flex;align-items:center;gap:11px;min-width:165px}.play-button{border:0;background:var(--green);color:white;width:45px;height:45px;border-radius:50%;cursor:pointer;font-size:14px}.play-button:hover{background:#3a6650}.player-main strong{display:block;font-size:12px}.player-main small{display:block;color:#9aa99a;font-size:10px;margin-top:5px}.tempo{flex:1;min-width:110px}.tempo-label{display:flex;justify-content:space-between;align-items:center}.tempo-label label{font-size:9px;font-weight:700;letter-spacing:.12em;color:#95a497}.tempo-label strong{font-size:15px}.tempo-label small{font-size:9px;color:#9aaa9b}.tempo input{width:100%;height:4px;accent-color:#729365;cursor:pointer}.metronome{border:1px solid #dce5d8;background:white;color:#617b66;border-radius:7px;padding:10px;font:600 10px var(--sans);white-space:nowrap;cursor:pointer}.metronome span{font-size:15px}.metronome b{font-size:9px;color:#a9b6a8;margin-left:5px}.metronome[aria-pressed=true]{background:#dceccf}.tuning{border-top:1px solid #edf0e9;margin-top:28px;padding-top:24px}.tuning-head{display:flex;justify-content:space-between;gap:20px;align-items:end}.tuning-head h3{font:24px var(--serif);margin-top:8px}.select-wrap select,.string-select{border:1px solid #e0e8dd;border-radius:7px;background:#fff;color:#536e58;font:600 11px var(--sans);padding:10px;cursor:pointer}.strings{display:grid;grid-template-columns:repeat(6,1fr);gap:8px;margin-top:20px}.string-box{background:#f8faf5;border:1px solid #edf1e9;border-radius:8px;padding:10px 6px;text-align:center}.string-box label{display:block;font-size:9px;color:#a3b0a2;font-weight:700;margin-bottom:6px}.string-select{max-width:100%;padding:5px 3px;background:transparent;border:0;font-size:15px;color:#4e7053}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}button:focus-visible,select:focus-visible,input:focus-visible{outline:2px solid #789d68;outline-offset:3px}@media(max-width:900px){.workspace{grid-template-columns:280px minmax(0,1fr)}.practice{padding:24px 20px}.player{flex-wrap:wrap}.tempo{min-width:160px}}@media(max-width:680px){.workspace{display:flex;flex-direction:column}.panel{width:100%}.library{padding:22px 18px}.pattern-list{max-height:220px}.practice{padding:24px 17px}.score{min-width:480px}.player-main{min-width:150px}.strings{gap:4px}.string-box{padding:8px 1px}.string-select{font-size:12px}}
.pattern-row{display:flex;align-items:center;border-radius:9px}.pattern-row.active{background:#edf4e5}.pattern-row:hover{background:#f7f9f3}.pattern-row.active:hover{background:#edf4e5}.pattern-row .pattern-card{flex:1;min-width:0}.pattern-row.active .card-icon{background:#dcebc9}.favorite{flex:none;width:35px;height:38px;border:0;background:transparent;color:#a5b4a0;font-size:21px;cursor:pointer;border-radius:6px}.favorite:hover,.favorite.selected{color:#b69a39}.voice-control{display:flex;align-items:center;justify-content:space-between;gap:15px;border-top:1px solid #edf0e9;margin-top:24px;padding-top:20px}.voice-control select{min-width:135px}@media(max-width:680px){.voice-control select{min-width:110px}}
.chords{border-top:1px solid #edf0e9;margin-top:28px;padding-top:24px}.chords-head{display:flex;justify-content:space-between;align-items:center;gap:15px}.chords h3{font:24px var(--serif);margin-top:8px}.chord-toggle{white-space:nowrap;display:flex;align-items:center;gap:7px;color:#5f7b61;font-size:11px;font-weight:700;cursor:pointer}.chord-toggle input{accent-color:#648b60;width:16px;height:16px}.chord-cards{display:grid;grid-template-columns:1fr 1fr;gap:10px}.chord-card{border:1px solid #e5ebe1;background:#f8faf6;border-radius:9px;padding:13px;min-width:0}.chord-card.current-chord{border-color:#aac69a;background:#f0f6e9}.chord-card-head{display:flex;align-items:center;gap:7px}.chord-card-head>span,.shape-label{font-size:9px;letter-spacing:.1em;color:#91a290;font-weight:700;white-space:nowrap}.chord-name{min-width:0;width:100%;border:0;background:transparent;color:#42624a;font:600 12px var(--sans);padding:5px}.shape-label{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:9px 0}.shape-select{min-width:0;width:68%;border:1px solid #e0e8dd;border-radius:6px;background:white;color:#536e58;font:11px var(--sans);padding:6px}.chord-frets{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px}.muted-note{background:#f4f4f1;color:#a4aaa1}.voice-control{margin-top:24px}[hidden]{display:none!important}@media(max-width:680px){.chord-cards{grid-template-columns:1fr}.chords-head{align-items:flex-start}}
/* A wider, more compact practice area keeps two full pattern cycles readable. */

main{max-width:1800px;padding:0 max(3vw,20px)}



.workspace{grid-template-columns:290px minmax(0,1fr);gap:16px}
.practice{padding:24px 26px}.library{padding-top:24px}
.badges{margin:14px 0 18px}.score-top{padding-top:17px}.score{margin:15px 0 10px;grid-template-rows:repeat(6,29px) 25px 20px}
.score.two-chords{min-width:540px;grid-template-rows:30px repeat(6,29px) 25px 20px}
.score-chord-label{font-size:11px;font-weight:700;color:#839680;padding:6px 9px;border-left:2px solid #e2eadf;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.score-chord-label.current-chord{color:#456c4a;border-left-color:#7ca16e;background:#f3f8ee}
.chord-boundary{border-left:1px dashed #cbd9c6}
.player{margin-top:17px;padding:14px}.chords{margin-top:22px;padding-top:19px}.chord-card{padding:10px}
@media(max-width:900px){.workspace{grid-template-columns:250px minmax(0,1fr)}.practice{padding:21px 19px}}
@media(max-width:680px){.workspace{display:flex}.score.two-chords{min-width:540px}.practice{padding:20px 17px}}

.score.two-chords .finger-cell{font-size:10px;white-space:nowrap}
.score-chord-label{display:flex;align-items:center;gap:5px;padding:3px 6px;min-width:0}
.score-chord-label select{min-width:0;max-width:100%;border:1px solid #dce8d7;border-radius:5px;background:#fff;color:#426b49;font:600 11px var(--sans);padding:4px 5px;cursor:pointer}
.chord-frets{margin-top:10px}
.sequence-actions{display:flex;align-items:center;gap:10px}.sequence-actions>span{color:#98a89a;font-size:10px;white-space:nowrap}.sequence-actions button{border:1px solid #dce8d7;background:#f4f8f0;color:#4f7651;border-radius:7px;padding:7px 10px;font:700 15px var(--sans);cursor:pointer;white-space:nowrap}.sequence-actions button span{font-size:10px}.score-chord-label{gap:4px}.chord-pick{min-width:0;max-width:100%;border:1px solid #dce8d7;border-radius:5px;background:#fff;color:#426b49;font:600 11px var(--sans);padding:4px 7px;cursor:pointer;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.chord-pick::after{content:' ▾';color:#8ea58c}.remove-pattern{border:0;background:transparent;color:#a5b4a0;cursor:pointer;font-size:17px;line-height:1;padding:2px 4px}.chord-dialog{width:min(620px,calc(100vw - 30px));max-height:min(82vh,760px);border:1px solid #dfe8db;border-radius:15px;padding:24px;background:#fff;color:var(--ink);box-shadow:0 20px 65px #1e342d38}.chord-dialog::backdrop{background:#1c2e26a8}.dialog-head{display:flex;justify-content:space-between;gap:20px}.dialog-head h2{font:28px var(--serif);margin:7px 0}.dialog-head p{font-size:11px;color:#84958a;line-height:1.5}.dialog-close{align-self:start;border:0;background:#f2f6ef;color:#708773;border-radius:50%;width:32px;height:32px;font-size:20px;cursor:pointer}.dialog-search{display:flex;gap:10px;align-items:center;margin:18px 0 10px;border:1px solid #e1e9de;border-radius:8px;padding:0 11px;color:#8ba18e;font-size:20px}.dialog-search input{width:100%;height:39px;border:0;outline:0;font:12px var(--sans);color:var(--ink)}#dictionary-empty{padding:20px;color:#87958a;font-size:12px}@media(max-width:680px){.sequence-actions>span{display:none}.sequence-actions button span{font-size:9px}.chord-dialog{padding:18px}.dictionary-list{max-height:49vh}}

.chord-dialog{width:min(680px,calc(100vw - 30px));padding:20px}.dialog-head h2{font-size:25px;margin:5px 0}.dialog-search{margin:12px 0 7px}.dialog-search input{height:34px}.dictionary-air{border:1px solid #edf1eb;border-radius:6px;margin-bottom:8px}.dictionary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.dictionary-column{min-width:0;border:1px solid #edf1eb;border-radius:7px;overflow:hidden}.dictionary-column h3{margin:0;padding:7px 9px;background:#f5f8f2;color:#7e9480;font:700 10px var(--sans);letter-spacing:.08em;text-transform:uppercase}.dictionary-list{max-height:42vh;overflow:auto}.dictionary-item{display:flex;align-items:center;justify-content:space-between;gap:5px;width:100%;border:0;border-bottom:1px solid #edf1eb;padding:5px 8px;background:white;color:#416d4b;text-align:left;cursor:pointer;font:11px var(--sans)}.dictionary-item:hover,.dictionary-item:focus-visible{background:#edf5e8}.dictionary-item strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dictionary-item code{font:11px ui-monospace,SFMono-Regular,Menlo,monospace;color:#607d62;white-space:nowrap}.dictionary-air .dictionary-item{justify-content:flex-start;gap:16px}.dictionary-air code{letter-spacing:.02em}@media(max-width:480px){.chord-dialog{padding:14px}.dictionary-grid{gap:3px}.dictionary-column h3{padding:6px 4px}.dictionary-item{padding:5px 3px;gap:2px;font-size:10px}.dictionary-item code{font-size:9px;letter-spacing:-.05em}.dictionary-list{max-height:37vh}}
.saved-exercises{margin-top:18px;border:1px solid #e5ece1;border-radius:8px;background:#f8faf6}.saved-exercises summary{display:flex;justify-content:space-between;align-items:center;cursor:pointer;padding:11px 12px;color:#4d6f53;font-size:11px;font-weight:700;list-style:none}.saved-exercises summary::-webkit-details-marker{display:none}.saved-exercises summary b{display:inline-block;margin-left:4px;padding:3px 6px;border-radius:20px;background:#e3eede;color:#719070;font-size:9px}.saved-arrow{color:#9bad9a;font-size:16px}.saved-exercises[open] .saved-arrow{transform:rotate(180deg)}#exercise-list{padding:0 6px 6px}.exercise-empty{padding:6px 6px 10px;color:#96a597;font-size:10px;line-height:1.5}.exercise-row{display:flex;align-items:center;border-radius:6px}.exercise-row:hover{background:#edf4e9}.exercise-load{flex:1;min-width:0;text-align:left;border:0;background:transparent;padding:9px 6px;color:var(--ink);cursor:pointer}.exercise-load strong,.exercise-load small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.exercise-load strong{font-size:11px}.exercise-load small{color:#91a092;font-size:9px;margin-top:4px}.exercise-remove{border:0;background:transparent;color:#9baa9a;font-size:18px;padding:5px 9px;cursor:pointer}.practice-tools{display:flex;align-items:start;gap:15px}.save-exercise{border:1px solid #dce8d7;background:#f4f8f0;color:#4f7651;border-radius:7px;padding:9px 11px;font:700 11px var(--sans);white-space:nowrap;cursor:pointer}.save-exercise:hover{background:#e5f0dd}.exercise-status{color:#688b66;font-size:11px;min-height:0}.exercise-status:not(:empty){margin-top:12px}.exercise-dialog{width:min(440px,calc(100vw - 30px));border:1px solid #dfe8db;border-radius:15px;padding:22px;background:#fff;color:var(--ink);box-shadow:0 20px 65px #1e342d38}.exercise-dialog::backdrop{background:#1c2e26a8}.exercise-name-label{display:block;font-size:11px;font-weight:700;color:#6f8774;margin:22px 0 7px}#exercise-name{width:100%;border:1px solid #dce8d7;border-radius:7px;padding:11px;font:13px var(--sans);color:var(--ink)}.exercise-dialog-actions{display:flex;justify-content:flex-end;gap:8px}.exercise-dialog-actions button{border:1px solid #dce8d7;border-radius:7px;padding:9px 14px;background:white;color:#6c856f;font:700 11px var(--sans);cursor:pointer}.exercise-dialog-actions button[type=submit]{background:var(--green);color:white;border-color:var(--green)}#exercise-error:not(:empty){font-size:11px;color:#a94e44;margin-top:12px}@media(max-width:680px){.pattern-number{display:none}.save-exercise{padding:8px;font-size:10px}.practice-tools{gap:5px}}
.delete-exercise-actions{margin-top:22px}#confirm-delete-exercise{background:#a04d45;border-color:#a04d45;color:white}
.score.two-chords{grid-template-rows:30px repeat(6,29px) 25px 24px 20px}
.rhythm-label{font-size:9px;font-weight:700;color:#a0aea0;align-self:center}.rhythm-cell{text-align:center;font-family:Georgia,serif;font-size:17px;line-height:24px;color:#678668}.rhythm-cell.current{background:#f0f6e8;color:#315d3d}.rhythm-cell.rhythm-hold{font:11px/24px var(--sans);color:#bcc8b9}
/* Keep practice controls compact while leaving the score its full width. */
.player,.chords,.voice-control,.tuning{max-width:650px}
.chord-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.chord-card{padding:10px}.chord-frets{margin-top:7px}
.custom-card-actions{display:flex;justify-content:space-between;align-items:center;gap:6px;margin-top:9px}
.custom-card-actions span{font-size:9px;color:#8c9f8b}.custom-card-actions button,.custom-library-head button{border:1px solid #d5e5d1;border-radius:6px;background:#eaf3e5;color:#4c7352;padding:6px 8px;font:700 10px var(--sans);cursor:pointer}
.custom-card-actions button:hover,.custom-library-head button:hover{background:#dcebd4}.chord-name[readonly]{color:#42624a}
.custom-status{font-size:10px;color:#688b66;line-height:1.45}.custom-status:not(:empty){margin-top:9px}
.custom-library{border:1px solid #e2ebdc;background:#f9fbf7;border-radius:7px;padding:8px;margin-bottom:8px}.custom-library-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.custom-library-head strong{font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:#708d70}.custom-library-list{max-height:82px;overflow:auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;margin-top:5px}.custom-library-list:empty{display:none}.custom-library-list .dictionary-item{border:1px solid #edf1eb;border-radius:5px;padding:5px}.custom-empty{grid-column:1/-1;font-size:10px;color:#a0aea0}.custom-error:not(:empty){font-size:10px;color:#a94e44;margin-top:6px}.chord-dialog .dictionary-list{max-height:30vh}
@media(max-width:500px){.chord-cards{grid-template-columns:1fr}.custom-library-list{grid-template-columns:repeat(2,minmax(0,1fr))}.chord-dialog .dictionary-list{max-height:27vh}.player{gap:12px}}
/* Independent levels stay close to the guitar sound selector. */
.voice-control{display:block}
.voice-head{display:flex;align-items:center;justify-content:space-between;gap:15px}
.volume-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:16px}
.volume-control{display:block;min-width:0;color:#708a72;font-size:11px;font-weight:700}
.volume-control span{display:flex;justify-content:space-between;gap:8px}
.volume-control output{color:#91a191;font-size:10px}
.volume-control input{display:block;width:100%;height:5px;margin:10px 0 4px;accent-color:#729365;cursor:pointer}
@media(max-width:400px){.voice-head{align-items:flex-start}.volume-controls{gap:12px}}

/* Flechas de traste independientes para ajustes rápidos sin abrir menús. */
.fret-control{display:flex;flex-direction:column;align-items:stretch;text-align:center;min-width:0;color:#91a290}
.fret-string{font-size:9px;font-weight:700;margin-bottom:4px}
.fret-control button{height:24px;border:1px solid #dce7d8;background:#fff;color:#608367;font-size:10px;cursor:pointer}
.fret-control button:first-of-type{border-radius:6px 6px 0 0}
.fret-control button:last-of-type{border-radius:0 0 6px 6px}
.fret-control button:hover:not(:disabled){background:#dcebd4;color:#315a3d}
.fret-control button:disabled{color:#cad3c7;background:#f8faf6;cursor:default}
.fret-control output{display:grid;place-items:center;height:24px;background:#fff;border-left:1px solid #dce7d8;border-right:1px solid #dce7d8;color:#42624a;font-size:12px;font-weight:700}

.sixteenth-note{display:inline-block;width:14px;height:19px;fill:currentColor;vertical-align:middle}


main{padding-top:20px;padding-bottom:24px}
.exercise-dialog-actions{margin-top:18px}

/* Pattern variations and editor */
.pattern-controls{display:flex;align-items:center;gap:12px;margin:-12px 0 22px;flex-wrap:wrap}.pattern-controls label{font-size:11px;font-weight:700;color:#6f8774}.pattern-controls select,.pattern-controls button,.pattern-dialog select,.pattern-dialog input,.pattern-dialog button:not(.dialog-close){border:1px solid #dce8d7;border-radius:7px;background:#fff;color:#426b49;padding:8px;font:600 11px var(--sans)}.pattern-controls button,.pattern-dialog button{cursor:pointer}.pattern-dialog{width:min(680px,calc(100vw - 24px));max-height:90dvh;border:1px solid #dfe8db;border-radius:15px;padding:20px;background:#fff;color:var(--ink);box-shadow:0 20px 65px #1e342d38}.pattern-dialog::backdrop{background:#1c2e26a8}.pattern-name-label{display:flex;align-items:center;gap:10px;margin:16px 0;font-size:11px;font-weight:700}.pattern-name-label input{flex:1;min-width:0}.pattern-editor-rows{max-height:40dvh;overflow:auto;border:1px solid #edf1eb;border-radius:8px}.pattern-editor-step{display:flex;align-items:center;gap:10px;padding:8px;border-bottom:1px solid #edf1eb}.pattern-editor-step:last-child{border:0}.pattern-editor-step>strong{width:20px;color:#8ca08b}.pattern-editor-notes{flex:1;display:flex;flex-wrap:wrap;gap:6px}.pattern-editor-note{display:flex;gap:6px;align-items:center}.pattern-editor-note label,.insert-note label{font-size:10px;color:#708a72;font-weight:700;white-space:nowrap}.pattern-dialog select{padding:6px}.editor-duration{font-size:10px;color:#79917c;white-space:nowrap}.pattern-dialog [data-delete-step]{font-size:18px!important;padding:2px 8px!important}.insert-note{display:flex;align-items:end;flex-wrap:wrap;gap:8px;border:1px solid #e2ebdc;border-radius:8px;margin:14px 0 0;padding:10px}.insert-note legend{font-size:11px;font-weight:700;color:#708a72}.insert-note label{display:grid;gap:4px}.pattern-dialog #pattern-edit-error:not(:empty){margin-top:8px;color:#a94e44;font-size:11px}.pattern-dialog .exercise-dialog-actions button[type=submit]{background:var(--green);color:white;border-color:var(--green)}
/* Major and minor chords fit in six rows; only the larger Other group scrolls. */
.chord-dialog{max-height:94dvh}.dictionary-column:nth-child(-n+2) .dictionary-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));max-height:none;overflow:visible}.dictionary-column:nth-child(-n+2) .dictionary-item{min-width:0}.dictionary-column:nth-child(3) .dictionary-list{max-height:210px;overflow:auto}
@media(max-width:500px){.dictionary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dictionary-column:nth-child(3){grid-column:1/-1}.dictionary-column:nth-child(3) .dictionary-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));max-height:90px}.pattern-editor-step{gap:5px;flex-wrap:wrap}.pattern-editor-notes{min-width:190px}}

/* Interactive score: one column per step, one row per string. */
.pattern-dialog{width:min(850px,calc(100vw - 24px))}.editor-fingers{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.editor-fingers>span{font-size:9px;letter-spacing:.1em;color:#91a290;font-weight:700;margin-right:4px}.pattern-dialog .editor-fingers button{background:#f7faf4;padding:7px 10px}.editor-fingers button b{font:700 14px var(--serif);margin-right:4px}.pattern-dialog .editor-fingers button[aria-pressed=true]{background:#dcebcf;border-color:#bad2ad;color:#315b3d}.editor-hint{font-size:11px;line-height:1.45;color:#7d9180;margin:10px 0}.pattern-editor-rows{max-height:40dvh;overflow:auto;background:#fbfcf9}.editor-grid{display:grid;grid-template-columns:72px repeat(var(--editor-steps),44px);width:max-content;min-width:100%;align-items:stretch}.grid-label{position:sticky;left:0;z-index:2;display:flex;align-items:center;padding:0 8px;background:#f5f8f2;color:#839783;font-size:10px;font-weight:700;border-bottom:1px solid #eaf0e7}.grid-step,.grid-rhythm{height:31px;display:flex;align-items:center;justify-content:center;gap:3px;background:#f5f8f2;color:#819582;font-size:10px;border-bottom:1px solid #eaf0e7}.pattern-dialog .grid-step button{border:0;background:transparent;padding:0 3px;color:#a5b4a0;font-size:15px}.grid-cell{display:grid;place-items:center;height:37px;border-bottom:1px solid #e9efe7;border-right:1px solid #eef2eb;position:relative}.grid-cell::before{content:'';position:absolute;left:0;right:0;top:50%;height:1px;background:#dbe5d8}.pattern-dialog .grid-note{position:relative;z-index:1;width:27px;height:27px;padding:0;border:1px dashed #c7d8c2;border-radius:50%;background:#fff;color:#315b3d;font-size:12px}.pattern-dialog .grid-note:hover{border-style:solid;background:#edf5e8}.pattern-dialog .grid-note.has-note{border:1px solid #7fa270;background:#dcebcf;font-weight:700}.grid-rhythm{font:18px var(--serif);background:#fbfcf9}.pattern-dialog .insert-note legend{font-size:11px}
@media(max-width:500px){.pattern-dialog{padding:15px}.pattern-name-label{margin:10px 0}.editor-fingers{gap:4px}.pattern-dialog .editor-fingers button{padding:6px}.editor-hint{font-size:10px;margin:7px 0}.editor-grid{grid-template-columns:62px repeat(var(--editor-steps),40px)}.pattern-editor-rows{max-height:34dvh}.grid-cell{height:32px}}

/* Step length and new empty step are part of the grid. */
.pattern-dialog .grid-rhythm select{width:42px;max-width:100%;padding:3px 0;border:0;background:transparent;color:#678668;font:16px var(--serif);cursor:pointer}.grid-add{border-left:1px solid #e4ece0}.pattern-dialog .grid-add button{width:27px;height:27px;border:1px solid #cfe1c8;border-radius:50%;background:#eaf3e5;color:#4c7352;font:700 19px/1 var(--sans);padding:0}.grid-tail{background:#f9fbf7}.rhythm-cell.rhythm-rest{font:10px/24px var(--sans);color:#91a292}

.pattern-remove{flex:none;width:30px;height:38px;border:0;border-radius:6px;background:transparent;color:#a5b4a0;font-size:20px;cursor:pointer}.pattern-remove:hover{background:#f8e9e5;color:#a04d45}#confirm-delete-pattern{background:#a04d45;border-color:#a04d45;color:white}#delete-pattern-error:not(:empty){color:#a94e44;font-size:11px;margin-top:12px}

/* Column widths follow the duration of each note. */
.editor-grid{--eighth-width:44px;grid-template-columns:72px var(--editor-columns)}
.pattern-dialog .grid-rhythm select{appearance:none;-webkit-appearance:none;text-align:center;width:100%;padding:2px 0}
.pattern-dialog .grid-step button[data-delete-step]{padding:0 2px!important;line-height:1}
.pattern-dialog .grid-note{max-width:95%;max-height:95%}
@media(max-width:500px){.editor-grid{--eighth-width:40px;grid-template-columns:62px var(--editor-columns)}}

/* Practice workspace: use the available width without stretching controls. */
main{max-width:1600px;padding:clamp(14px,2vw,28px)}
.workspace{grid-template-columns:clamp(265px,23vw,315px) minmax(0,1fr);gap:clamp(14px,1.4vw,22px)}
.library{padding:24px 18px;min-width:0}
.library .panel-heading h2,.practice h2{margin-top:0}
.search{margin:18px 0 13px}
.library-meta{margin:18px 3px 9px}
.pattern-list{max-height:clamp(240px,calc(100vh - 420px),700px)}
.card-copy strong{font-size:13px}.card-copy small{font-size:11px;line-height:1.35}.pattern-card{padding:10px 8px}
.practice{padding:clamp(20px,2.2vw,32px);min-width:0}
.practice-heading{align-items:center;gap:16px}
.practice h2{font-size:clamp(27px,2.4vw,34px)}
.badges{flex-wrap:wrap;margin:14px 0 20px}
.pattern-controls{margin:-8px 0 20px}
.score-top{padding-top:16px}
.score{margin:15px 0 10px}
.player,.chords,.voice-control,.tuning{max-width:none}
.player{display:grid;grid-template-columns:auto minmax(180px,1fr) auto;gap:clamp(14px,2vw,28px);padding:16px 18px}
.player-main{min-width:160px}
.tempo{min-width:0}
.chords{margin-top:24px;padding-top:18px}
.chords-head h3,.tuning-head h3{font-size:22px;margin:0}
.chord-cards{margin-top:12px;grid-template-columns:repeat(auto-fit,minmax(min(290px,100%),1fr))}
.practice-settings{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(20px,3vw,40px);border-top:1px solid #edf0e9;margin-top:24px;padding-top:20px}
.practice-settings .tuning,.practice-settings .voice-control{border:0;margin:0;padding:0;min-width:0}
.practice-settings .tuning-head,.practice-settings .voice-head{min-height:34px;align-items:center}
.practice-settings .strings{margin-top:14px;gap:5px}
.practice-settings .string-box{padding:9px 2px}
.practice-settings .string-box label{font-size:9px}
.practice-settings .volume-controls{margin-top:17px}
.practice-settings .volume-control{font-size:12px}
@media(max-width:1100px){.workspace{grid-template-columns:250px minmax(0,1fr)}.practice-settings{grid-template-columns:1fr;gap:22px}.practice-settings .voice-control{border-top:1px solid #edf0e9;padding-top:19px}.practice-settings .strings{max-width:650px}}
@media(max-width:680px){
 main{padding:12px}
 .workspace{display:flex;gap:12px}
 .library{padding:16px}
 .library .panel-heading h2{font-size:25px}
 .saved-exercises{margin-top:12px}
 .search{margin:12px 0 10px}
 .filters{flex-wrap:nowrap;overflow-x:auto;padding-bottom:5px;scrollbar-width:thin}
 .filter{flex:none;white-space:nowrap}
 .library-meta{margin:10px 2px 5px}
 .pattern-list{max-height:158px}
 .pattern-card{padding:8px}
 .practice{padding:18px 15px}
 .practice-heading{align-items:flex-start}
 .practice h2{font-size:27px}
 .badges{margin:12px 0 18px}
 .pattern-controls{margin:-6px 0 16px}
 .score-wrap{margin-right:-4px}
 .player{grid-template-columns:minmax(0,1fr) auto;gap:14px;padding:14px}
 .player-main{min-width:0}
 .tempo{grid-column:1/-1;grid-row:2}
 .metronome{grid-column:2;grid-row:1}
 .practice-settings{margin-top:20px;padding-top:18px}
 .practice-settings .strings{gap:4px}
 .practice-settings .string-box label{font-size:8px}
 .practice-settings .string-select{font-size:13px}
}
@media(max-width:380px){.practice-heading{flex-wrap:wrap}.practice-settings .strings{grid-template-columns:repeat(3,minmax(0,1fr))}.practice-settings .string-box label{font-size:9px}}

.brand-label{display:block;margin-bottom:7px;color:#788e79;font-size:10px;font-weight:700;letter-spacing:.14em;text-transform:uppercase}

/* Appearance selector */
.theme-selector{display:flex;align-items:center;gap:4px;color:#78927d;font-size:17px}
.theme-selector select{border:1px solid #dce8d7;border-radius:7px;background:#f8faf5;color:#4b7054;padding:7px 6px;font:600 11px var(--sans);cursor:pointer}

/* Dark appearance: quiet green surfaces with clear text and states. */
:root[data-theme="dark"]{color-scheme:dark;--paper:#111a17;--ink:#e3ece2;--muted:#a8bba9;--line:#40544a;--green:#84b78a;--lime:#b6d8a6;--yellow:#d8c078;--dark-surface:#1c2924;--dark-raised:#25352d;--dark-border:#40544a;--dark-muted:#a8bba9;--dark-accent:#b6d8a6;--dark-ink:#e3ece2}
[data-theme="dark"] .panel,[data-theme="dark"] .exercise-dialog,[data-theme="dark"] .pattern-dialog,[data-theme="dark"] .chord-dialog{background:var(--dark-surface);border-color:#34473c;color:var(--dark-ink);box-shadow:0 12px 36px #0004}
[data-theme="dark"] .theme-selector,[data-theme="dark"] .brand-label,[data-theme="dark"] .heading-mark{color:var(--dark-accent)}
[data-theme="dark"] .theme-selector select,[data-theme="dark"] .select-wrap select,[data-theme="dark"] .pattern-controls select,[data-theme="dark"] .pattern-controls button,[data-theme="dark"] .pattern-dialog select,[data-theme="dark"] .pattern-dialog input,[data-theme="dark"] .pattern-dialog button:not(.dialog-close),[data-theme="dark"] #exercise-name{background:var(--dark-raised);border-color:var(--dark-border);color:var(--dark-ink)}
[data-theme="dark"] .count,[data-theme="dark"] .saved-exercises,[data-theme="dark"] .player,[data-theme="dark"] .string-box,[data-theme="dark"] .chord-card,[data-theme="dark"] .custom-library{background:var(--dark-raised);border-color:#344b3d}
[data-theme="dark"] .saved-exercises summary,[data-theme="dark"] .card-copy strong,[data-theme="dark"] .pattern-card,[data-theme="dark"] .player-main strong,[data-theme="dark"] .chord-name,[data-theme="dark"] .chord-name[readonly]{color:var(--dark-ink)}
[data-theme="dark"] .saved-exercises summary b,[data-theme="dark"] .card-icon,[data-theme="dark"] .badges span,[data-theme="dark"] .dialog-close{background:#304438;color:#bdd1bd}
[data-theme="dark"] .search,[data-theme="dark"] .dialog-search,[data-theme="dark"] .dictionary-column,[data-theme="dark"] .dictionary-air{border-color:var(--dark-border)}
[data-theme="dark"] .search input,[data-theme="dark"] .dialog-search input{background:transparent;color:var(--dark-ink)}
[data-theme="dark"] .search input::placeholder,[data-theme="dark"] .dialog-search input::placeholder{color:#9bad9f}
[data-theme="dark"] .filter,[data-theme="dark"] .save-exercise,[data-theme="dark"] .sequence-actions button,[data-theme="dark"] .metronome,[data-theme="dark"] .chord-pick,[data-theme="dark"] .exercise-dialog-actions button{background:#25352d;border-color:var(--dark-border);color:#d0dfcd}
[data-theme="dark"] .filter.active,[data-theme="dark"] .metronome[aria-pressed="true"],[data-theme="dark"] .pattern-row.active,[data-theme="dark"] .pattern-row.active:hover,[data-theme="dark"] .pattern-dialog .editor-fingers button[aria-pressed="true"]{background:#3a5542;border-color:#729679;color:#e5f1de}
[data-theme="dark"] .pattern-card:hover,[data-theme="dark"] .pattern-row:hover,[data-theme="dark"] .exercise-row:hover,[data-theme="dark"] .dictionary-item:hover,[data-theme="dark"] .dictionary-item:focus-visible{background:#304338}
[data-theme="dark"] .pattern-row.active .card-icon,[data-theme="dark"] .badges span:first-child{background:#46634b;color:#e0efda}
[data-theme="dark"] .favorite,[data-theme="dark"] .pattern-remove,[data-theme="dark"] .exercise-remove,[data-theme="dark"] .remove-pattern{color:#adc0a9}
[data-theme="dark"] .favorite.selected,[data-theme="dark"] .favorite:hover{color:#e5cd78}
[data-theme="dark"] .section-kicker,[data-theme="dark"] .library-meta,[data-theme="dark"] .card-copy small,[data-theme="dark"] .empty,[data-theme="dark"] .exercise-empty,[data-theme="dark"] .exercise-load small,[data-theme="dark"] .dialog-head p,[data-theme="dark"] .editor-hint,[data-theme="dark"] .custom-empty,[data-theme="dark"] .custom-card-actions span,[data-theme="dark"] .string-box label,[data-theme="dark"] .tempo-label label,[data-theme="dark"] .tempo-label small,[data-theme="dark"] .volume-control,[data-theme="dark"] .volume-control output,[data-theme="dark"] .sequence-actions>span,[data-theme="dark"] .chord-card-head>span{color:var(--dark-muted)}
[data-theme="dark"] .score-top,[data-theme="dark"] .chords,[data-theme="dark"] .practice-settings,[data-theme="dark"] .practice-settings .voice-control{border-color:#34473c}
[data-theme="dark"] .string-name,[data-theme="dark"] .string-name small,[data-theme="dark"] .finger-cell,[data-theme="dark"] .beat-cell,[data-theme="dark"] .rhythm-label,[data-theme="dark"] .rhythm-cell,[data-theme="dark"] .chord-toggle{color:#b3c8b3}
[data-theme="dark"] .note-cell::before,[data-theme="dark"] .grid-cell::before{background:#536e5b}
[data-theme="dark"] .note{background:#38543f;color:#e1f0d9}
[data-theme="dark"] .muted-note{background:#35403a;color:#b5c1b5}
[data-theme="dark"] .note-cell.current,[data-theme="dark"] .rhythm-cell.current,[data-theme="dark"] .score-chord-label.current-chord{background:#38503b;color:#e3f0dc}
[data-theme="dark"] .note-cell.current .note{background:#a7d09a;color:#13231a}
[data-theme="dark"] .score-chord-label,[data-theme="dark"] .chord-boundary{border-color:#617c62;color:#bbcfba}
[data-theme="dark"] .play-button{background:#a8d19b;color:#14271a}
[data-theme="dark"] .play-button:hover{background:#c0e0b4}
[data-theme="dark"] .string-select{background:transparent;color:var(--dark-ink)}
[data-theme="dark"] input[type="range"],[data-theme="dark"] .chord-toggle input{accent-color:#a8d19b}
[data-theme="dark"] .chord-card.current-chord{background:#304638;border-color:#7da783}
[data-theme="dark"] .fret-control button,[data-theme="dark"] .fret-control output{background:#1c2924;border-color:var(--dark-border);color:var(--dark-ink)}
[data-theme="dark"] .fret-control button:hover:not(:disabled){background:#3e5945}
[data-theme="dark"] .fret-control button:disabled{background:#222e27;color:#778b7b}
[data-theme="dark"] .custom-card-actions button,[data-theme="dark"] .custom-library-head button{background:#3a5542;border-color:#6e9375;color:#e4efdf}
[data-theme="dark"] .dictionary-column h3,[data-theme="dark"] .grid-label,[data-theme="dark"] .grid-step{background:#304438;color:#c2d7bf}
[data-theme="dark"] .dictionary-item{background:var(--dark-surface);border-color:#34473c;color:#dcebd8}
[data-theme="dark"] .dictionary-item code{color:#bbd2b7}
[data-theme="dark"] .custom-library-list .dictionary-item{border-color:#40544a}
[data-theme="dark"] .pattern-editor-rows,[data-theme="dark"] .grid-rhythm,[data-theme="dark"] .grid-tail{background:#1b2922;border-color:#40544a;color:#c6d9c2}
[data-theme="dark"] .grid-label,[data-theme="dark"] .grid-step,[data-theme="dark"] .grid-cell{border-color:#34473c}
[data-theme="dark"] .pattern-dialog .grid-note{background:#25352d;border-color:#718b74;color:#e4f1df}
[data-theme="dark"] .pattern-dialog .grid-note.has-note{background:#5c8562;border-color:#a9d39e;color:#fff}
[data-theme="dark"] .pattern-dialog .grid-note:hover{background:#486b4f}
[data-theme="dark"] .pattern-dialog .grid-rhythm select{background:transparent;color:#d7e9d2}
[data-theme="dark"] .pattern-dialog .grid-add button{background:#3a5542;border-color:#789d7e;color:#e5f1de}
[data-theme="dark"] .exercise-dialog-actions button[type="submit"],[data-theme="dark"] .pattern-dialog .exercise-dialog-actions button[type="submit"]{background:#a8d19b;border-color:#a8d19b;color:#14271a}
[data-theme="dark"] #confirm-delete-pattern,[data-theme="dark"] #confirm-delete-exercise{background:#a85c50;border-color:#c98273;color:#fff}
[data-theme="dark"] #exercise-error:not(:empty),[data-theme="dark"] #delete-pattern-error:not(:empty),[data-theme="dark"] .pattern-dialog #pattern-edit-error:not(:empty),[data-theme="dark"] .custom-error:not(:empty){color:#f0b3a6}
[data-theme="dark"] .custom-status,[data-theme="dark"] .exercise-status{color:#b6d8a6}
[data-theme="dark"] button:focus-visible,[data-theme="dark"] select:focus-visible,[data-theme="dark"] input:focus-visible{outline-color:#c3e5b5}
[data-theme="dark"] .custom-library-head strong,[data-theme="dark"] .editor-fingers>span,[data-theme="dark"] .fret-string{color:#b3c8b3}
[data-theme="dark"] .pattern-dialog .grid-step button[data-delete-step]{background:transparent;color:#c2d7bf}
