/* Palette, sidebar and toolbar follow Plio's warm paper / rose system. */
:root{font-family:"DM Sans","Segoe UI",system-ui,sans-serif;color:#39291f;background:#f6f0e6;--accent:#a84c13;--accent-dark:#873a0d;--muted:#77675d;--line:#e6dcd2;--sidebar-width:248px;--surface:#fffdf9;--ink:#39291f}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;min-height:100vh;background:radial-gradient(ellipse at 65% 0%,#fae8d4,transparent 40rem),#f6f0e6}
a{color:#874217;text-underline-offset:3px}
svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer}
button:disabled{cursor:default;opacity:.57}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,[tabindex="0"]:focus-visible{outline:3px solid #ae652d;outline-offset:3px}
h1,h2,h3,p{margin-top:0}
h1{margin:6px 0 9px;font-size:clamp(31px,4vw,42px);font-weight:650;line-height:1.12;letter-spacing:-1.35px}
h2{font-size:23px;letter-spacing:-.6px;font-weight:650;margin-bottom:10px}
h3{font-size:17px;font-weight:650;margin-bottom:7px}
p,li,td{line-height:1.55}
.skip{position:fixed;z-index:5;left:12px;top:12px;padding:10px;background:white;transform:translateY(-180%)}
.skip:focus{transform:none}
.sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar-width);padding:20px 18px;background:linear-gradient(160deg,#fff3e8,#f7e3e7);border-right:1px solid #ead9d2;color:#554039;overflow:auto;z-index:3}
.brand{display:flex;flex-direction:column;align-items:center;gap:0;padding:0 4px 9px;text-decoration:none}
.brand img{display:block;width:210px;max-width:100%;height:128px;object-fit:contain}
.brand span,.nav-label,.eyebrow{color:#895d46;font-size:11px;font-weight:650;letter-spacing:1.7px}
.brand span{font-size:10px;letter-spacing:1.85px}
.sidebar-rule{height:1px;background:#e4cfc9;margin:19px 8px}
.nav-label{margin:0 9px 10px}
.nav-item{display:flex;gap:10px;align-items:center;width:100%;min-height:44px;margin:3px 0;padding:9px 10px;border:0;background:transparent;text-align:left;border-radius:7px;color:#75574d;font-size:14px}
.nav-item:hover{background:#f4d9d8;color:#472d23}
.nav-item[aria-current="page"]{background:#edc5ce;color:#58323d;box-shadow:inset 3px 0 #c47c91;font-weight:650}
#nav-count{margin-left:auto;padding:2px 7px;background:#faedf0;border-radius:12px;font-size:12px}
.app-shell{margin-left:var(--sidebar-width);min-height:100vh;display:flex;flex-direction:column}
.topbar{min-height:68px;padding:0 34px;display:flex;gap:15px;align-items:center;justify-content:space-between;background:#fffcf7cf;border-bottom:1px solid var(--line)}
.breadcrumb,.header-actions{display:flex;align-items:center;gap:13px;flex-wrap:wrap;color:#786457;font-size:14px}
.breadcrumb{margin-right:auto}
.save-status{display:inline-flex;align-items:center;gap:8px;font-size:13px;white-space:nowrap}
.dot{display:inline-block;width:7px;height:7px;background:#8a7961;border-radius:50%}
.save-status.dirty .dot{background:#c57438}
.icon-button{display:inline-flex;align-items:center;justify-content:center;min-width:42px;min-height:42px;border:0;border-radius:7px;background:transparent}
.icon-button:hover{background:#f2dfcf}
.sidebar-toggle{display:none}
main{width:100%;max-width:1370px;margin:0 auto;flex:1;padding:28px 34px 48px}
.workspace-file-status,.notice{padding:12px 15px;margin:0 0 22px;border:1px solid #e8ded1;background:#fdf8f0;color:#705747;font-size:13px;border-radius:9px;line-height:1.52}
.workspace-file-status.dirty{background:#fff1d9;border-color:#ebd4b0;color:#715021}
.notice{background:#f8e7dc;border-color:#e6c7b4}
.page-heading{margin:0 0 24px}
.page-heading p,.muted{color:var(--muted)}
.page-heading p{margin:0;max-width:68ch}
.panel{background:var(--surface);border:1px solid #e7ddd2;border-radius:12px;padding:clamp(15px,3vw,27px);margin-bottom:16px;min-width:0}
.panel>p:last-child,.panel>ul:last-child{margin-bottom:0}
.grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(220px,.7fr);gap:16px;align-items:start}
.practice-setup{grid-template-columns:repeat(2,minmax(0,1fr))}
.exercise-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 12px;margin-top:16px}
.exercise-group{display:flex;min-width:0;flex-direction:column;gap:6px}
.exercise-group h3{margin:0 0 2px;font-size:14px;color:#684f3e}
.exercise-option{position:relative;display:block;cursor:pointer}
.exercise-option input{position:absolute;opacity:0;width:1px;height:1px;min-height:0;margin:0;padding:0}
.exercise-option span{display:flex;align-items:center;gap:8px;min-height:44px;padding:7px 9px;border:1px solid #ddcbb9;border-radius:7px;background:#fffaf3;color:#684f3e;font-size:14px;line-height:1.3}
.exercise-option span::before{content:"";box-sizing:border-box;width:12px;height:12px;flex:none;border:1px solid #9c7960;border-radius:50%;background:#fffdf9}
.exercise-option:hover span{background:#fbe8d4;border-color:#cea27d}
.exercise-option input:checked + span{border-color:#b57888;background:#f3dce0;color:#58323d;font-weight:650}
.exercise-option input:checked + span::before{border:4px solid #8f5366}
.exercise-option input:focus-visible + span{outline:3px solid #ae652d;outline-offset:2px}
.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;margin:15px 0}
.field{display:flex;flex-direction:column;gap:7px;min-width:0;color:#684f3e;font-size:14px;font-weight:550}
input,select{min-height:43px;max-width:100%;border:1px solid #decfc2;border-radius:7px;padding:8px 10px;background:#fffcf8}
select{width:100%}
.actions,.tabs,.choices{display:flex;gap:9px;flex-wrap:wrap;align-items:center}
.actions{margin-top:16px}
.button{display:inline-flex;gap:7px;align-items:center;justify-content:center;border:1px solid transparent;border-radius:7px;min-height:42px;padding:8px 13px;text-align:center;font-size:14px;text-decoration:none;font-weight:600}
.primary{color:#fffaf6;background:var(--accent);border-color:var(--accent)}
.primary:hover:not(:disabled){background:var(--accent-dark)}
.secondary{background:#fffaf3;color:#765135;border-color:#ddcbb9}
.secondary:hover:not(:disabled){background:#fbe8d4;border-color:#cea27d}
.quiet{background:transparent;color:#85522d}
.quiet:hover:not(:disabled){background:#f4e9df}
.tabs{margin-bottom:16px}
.tab[aria-pressed=true]{background:#f3dce0;border-color:#d0a1ad;color:#58323d}
.badge{display:inline-flex;align-items:center;border-radius:15px;padding:2px 9px;background:#f4e5d7;color:#765135;font-size:12px;font-weight:650}
.match-head,.result-head,.score-head{display:flex;flex-wrap:wrap;gap:11px;justify-content:space-between;align-items:center;margin-bottom:12px}
.progress{width:100%;margin:1px 0 17px;height:10px;accent-color:#b9652d}
.inline-tip{color:var(--muted);font-size:13px;margin:10px 0}
.feedback{padding:14px;margin-top:16px;border:1px solid #ead9c7;border-left:4px solid #aa632f;border-radius:7px;background:#fbf0e2}
.feedback.good{background:#eef4e8;border-color:#a0b18e;border-left-color:#6e965a}
.feedback.bad{background:#f9ebe8;border-color:#e0b8ae;border-left-color:#b39888}
.feedback p{margin:5px 0 0}
.error{min-height:1.25em;color:#8d412f;font-size:14px;margin:10px 0 0}
.answer-form{margin-top:13px}
.answer-form input{width:min(100%,500px)}
.board-scroll,.staff-scroll,.table-scroll{overflow-x:auto;overscroll-behavior-inline:contain}
.board{display:grid;width:max-content;min-width:100%;gap:4px;padding:11px 0}
.board-col,.board-note{display:grid;place-items:center;min-height:38px;text-align:center;border-radius:6px;font-size:13px}
.board-col{background:#f2e9e1;color:#705b4c;font-weight:650}
.board-note{border:1px solid #eadcd0;background:#f9f2eb;color:#47372b}
button.board-note:not(:disabled){min-height:42px}
.board-note.open{background:#f0e4d8;border-color:#dccaB8;font-weight:650}
.board-note.tonic{background:#dce9f2;border-color:#9ebcd1}
.board-note.scale,.board-note.hit{background:#e2ebdc;border-color:#afc6a5}
.board-note.miss{background:#f4e9d2;border-color:#d8c397}
.board-note.wrong{background:#f3dde1;border-color:#d0a1ad}
.board-note.chosen,.board-note.target{background:#edc5ce;border-color:#bf8191;color:#552e3a;font-weight:700}
.board-note[aria-pressed=true]{box-shadow:inset 0 0 0 1px #8f5366}
.board-note:disabled{opacity:1}
.staff{display:block;width:100%;min-width:320px;max-width:700px;height:auto;background:white;border-radius:7px;border:1px solid #e5d8cb;color:#35261f}
.staff line{stroke:#35261f;stroke-width:1.2;vector-effect:non-scaling-stroke}
.staff text{fill:#35261f;stroke:none;font:12px system-ui,sans-serif}
.staff text.hit{fill:#386337;font-weight:750}
.staff text.wrong{fill:#923f3d;font-weight:750}
.staff .half-note{fill:white;stroke:currentColor;stroke-width:2.4}
.staff .staff-flag{fill:currentColor;stroke:none}
.exercise-tutorial{margin:12px 0;padding:12px 14px;background:#faf3ea;border:1px solid var(--line);border-radius:8px}
.exercise-tutorial li+li{margin-top:7px}
.exercise-tutorial li{max-width:68ch}
.exercise-tutorial ul{margin-bottom:2px}
.meter{display:grid;gap:7px;padding:12px;border:1px solid #eadacc;margin-top:14px;border-radius:7px;background:#fdf7ee}
.meter label{font-size:13px;color:#715c4b}
.meter progress{width:100%;accent-color:#a84c13}
pre{background:#f3e9df;padding:10px;border-radius:7px;white-space:pre-wrap}
dl,ol,ul{padding-inline-start:22px}
table{border-collapse:collapse;width:100%;text-align:left;font-size:14px}
td,th{border-bottom:1px solid #eadfd3;padding:9px;vertical-align:top}
th{background:#faf2e8;color:#695142}
details{border-bottom:1px solid #ece3dc;padding:12px 0}
details:last-child{border:0}
summary{cursor:pointer;font-size:15px;color:#684b39;font-weight:650}
details p:first-of-type{margin-top:12px}
.site-footer{display:flex;justify-content:space-between;flex-wrap:wrap;gap:10px;padding:12px 34px 23px;color:#715a49;font-size:13px}
@media(max-width:1050px){:root{--sidebar-width:211px}.sidebar{padding:16px 12px}.topbar,main,.site-footer{padding-inline:22px}}
@media(max-width:1020px){.practice-setup{grid-template-columns:minmax(0,1fr);gap:0}}
@media(max-width:760px){:root{--sidebar-width:0px}.app-shell{margin-left:0}.sidebar-toggle{display:inline-flex}.sidebar{width:min(280px,88vw);transform:translateX(-115%);box-shadow:14px 0 42px #51392d32;visibility:hidden}.sidebar.open{transform:none;visibility:visible}.topbar{padding:0 13px;min-height:59px;gap:6px}.breadcrumb,.header-actions{gap:7px}main{padding:18px 14px 32px}.grid{grid-template-columns:minmax(0,1fr)}.site-footer{padding-inline:14px}}
@media(max-width:410px){.save-status{font-size:11px}.top-file{display:none}.fields{gap:9px}.field{font-size:13px}.panel{padding:14px}}
@media(prefers-reduced-motion:no-preference){.sidebar{transition:transform .18s ease}.nav-item,.button{transition:background-color .16s ease}}
