/* Classfern Music keyword pages, group P (music theory). Base copied from group O (itself from groups C and H) so the department looks like one set; group P's own rules are at the end. */
:root{--kw-panel:#e8f5f2;--kw-line:#b9ddd5;--kw-ink:inherit;--kw-tip:#e3f4ef;--kw-tip-line:#9fd3c6}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--kw-panel:#123a34;--kw-line:#24584f;--kw-tip:#10352f;--kw-tip-line:#2c6b60}}
:root[data-theme="dark"]{--kw-panel:#123a34;--kw-line:#24584f;--kw-tip:#10352f;--kw-tip-line:#2c6b60}
.kw-upd{font-size:.88rem;opacity:.85;margin:.2rem 0 1rem}
.kw-answer{font-size:1.08rem;max-width:72ch}
.kw-facts{background:var(--kw-panel);border:1px solid var(--kw-line);border-radius:12px;padding:.8rem 1.1rem;max-width:72ch}
.kw-facts h2{margin-top:.2rem}
.kw-facts ul{margin:.3rem 0 .2rem;padding-left:1.2rem}
.kw-row{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin:.5rem 0}
.kw-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.kw-tool{clear:both;border:1px solid var(--kw-line);border-radius:14px;padding:.8rem 1rem;margin:1rem 0;background:var(--kw-panel)}
.kw-tool h2{margin-top:.2rem}
.kw-kids{display:inline-flex;gap:.45rem;align-items:center;min-height:44px;font-weight:600}
.kw-kids input{width:22px;height:22px}
.kw-msg{min-height:1.2em}
table.kw-t{border-collapse:collapse;margin:.4rem 0 1rem;max-width:100%}
table.kw-t th,table.kw-t td{border:1px solid var(--kw-line);padding:.35rem .55rem;text-align:left;vertical-align:top}
table.kw-t caption{text-align:left;font-weight:600;padding:.2rem 0}
.kw-wide{overflow-x:auto;max-width:100%}
.kw-steps li{margin:.3rem 0}
.kw-how{font-size:.9rem;font-weight:600;display:inline-block;border:1px solid var(--kw-line);border-radius:999px;padding:.05rem .6rem;margin:.2rem 0}
/* kids' mode: bigger notes and colour note names (the letter or tab is always shown too) */
html.kw-kids-on .kw-tool .btn{min-height:56px;font-size:1.1rem}
html.kw-kids-on .n-C{color:#c62828}html.kw-kids-on .n-D{color:#e65100}html.kw-kids-on .n-E{color:#9a7b00}html.kw-kids-on .n-F{color:#2e7d32}
html.kw-kids-on .n-G{color:#00796b}html.kw-kids-on .n-A{color:#1565c0}html.kw-kids-on .n-B{color:#6a1b9a}
html[data-theme="dark"].kw-kids-on .n-C{color:#ff8a80}html[data-theme="dark"].kw-kids-on .n-D{color:#ffb74d}html[data-theme="dark"].kw-kids-on .n-E{color:#ffe066}html[data-theme="dark"].kw-kids-on .n-F{color:#81c784}html[data-theme="dark"].kw-kids-on .n-G{color:#4dd0c4}html[data-theme="dark"].kw-kids-on .n-A{color:#90caf9}html[data-theme="dark"].kw-kids-on .n-B{color:#ce93d8}
@media (prefers-color-scheme:dark){html:not([data-theme="light"]).kw-kids-on .n-C{color:#ff8a80}html:not([data-theme="light"]).kw-kids-on .n-D{color:#ffb74d}html:not([data-theme="light"]).kw-kids-on .n-E{color:#ffe066}html:not([data-theme="light"]).kw-kids-on .n-F{color:#81c784}html:not([data-theme="light"]).kw-kids-on .n-G{color:#4dd0c4}html:not([data-theme="light"]).kw-kids-on .n-A{color:#90caf9}html:not([data-theme="light"]).kw-kids-on .n-B{color:#ce93d8}}
/* staff illustrations (Mr Chopin and Miss Clara Schumann) */
.staff-art{margin:.4rem 0 1rem;max-width:260px}
.staff-art img{display:block;width:100%;height:auto;background:none;border:0}
.staff-art--right{float:right;margin-left:1.2rem}
.staff-art--left{float:left;margin-right:1.2rem}
.staff-tip{display:flex;gap:1rem;align-items:center;background:var(--kw-tip);border:1px solid var(--kw-tip-line);border-radius:16px;padding:.9rem 1.1rem .9rem 0;margin:1.6rem 0 1.2rem 0;max-width:72ch;clear:both}
.staff-tip picture{flex:0 0 auto;margin:-1.6rem 0 -.6rem -.6rem}
.staff-tip img{display:block;width:150px;max-width:150px;height:auto;border:0;background:none}
.staff-tip__who{font-weight:700;margin:0 0 .2rem}
.staff-tip div p{margin:.15rem 0}
.kw-clear{clear:both}
.kw-tool select,.kw-tool input[type=text]{min-height:44px;font:inherit;padding:.3rem .5rem;border-radius:8px;border:1px solid var(--kw-line);background:var(--bg,transparent);color:inherit;max-width:100%}
.kw-tool input[type=text]{width:100%;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.kw-tool label{font-weight:600}
.kw-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(8.5rem,1fr));gap:.45rem;margin:.5rem 0}
.kw-grid .btn{min-height:44px;width:100%;text-align:left}
.kw-grid .btn small{display:block;font-weight:400;opacity:.85}
html.kw-kids-on .kw-grid .btn{min-height:56px;font-size:1.1rem}
@media (max-width:600px){
.staff-art,.staff-art--right,.staff-art--left{float:none;margin:.6rem auto 1rem;max-width:180px}
.staff-tip{flex-direction:column;align-items:flex-start;padding:.8rem 1rem}
.staff-tip picture{margin:-1.8rem 0 0 0}
.staff-tip img{width:120px}
}
/* group O: staves, charts and tools */
.kw-pic{margin:.6rem 0 1rem;max-width:100%}
.kw-pic svg{display:block;max-width:100%;height:auto;color:inherit}
.kw-pic figcaption{font-size:.95rem;margin-top:.2rem}
.kw-sym svg{display:block;width:auto;height:46px;max-width:none}
table.kw-values-t td{vertical-align:middle}
.kw-nb{min-height:44px;min-width:44px}
.kw-inline{display:inline-flex;gap:.4rem;align-items:center;min-height:44px}
.kw-inline input{width:20px;height:20px}
.kw-tool input[type=range]{width:10rem;max-width:100%;min-height:44px}
.kw-ws-host{background:var(--bg,#fff);border:1px solid var(--kw-line);border-radius:10px;padding:.6rem .8rem;margin:.6rem 0}
.kw-ws-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:.6rem 1rem;padding-left:1.6rem;margin:.4rem 0 1rem}
.kw-ws-grid li{break-inside:avoid;text-align:center}
.kw-ws-grid li::marker{font-weight:700}
.kw-ws-grid svg{display:block;width:100%;max-width:150px;height:auto;margin:0 auto}
@media print{.kw-ws-grid{grid-template-columns:repeat(6,1fr)}}
.kw-ws-box{display:inline-block;width:34px;height:34px;border:1.5px solid currentColor;border-radius:6px}
.kw-ws-key summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-weight:600}
@media print{html.kw-printing body *{visibility:hidden!important}html.kw-printing .kw-print-me,html.kw-printing .kw-print-me *{visibility:visible!important}html.kw-printing .kw-print-me{position:absolute;left:0;top:0;width:100%;border:0;background:none}html.kw-printing .kw-print-me .kw-row,html.kw-printing .kw-print-me .privacy,html.kw-printing .kw-print-me .kw-now,html.kw-printing .kw-print-me .kw-how{display:none!important}.kw-ws-key[open] summary{display:none}}
@media print{.kw-tool .kw-row,.kw-grid,.kw-kids,.staff-art,.staff-tip picture,.cards,.kw-noprint{display:none!important}}

/* group P: theory charts and tools */
:root{--kw-hl:#bfe7dd;--kw-hl-line:#0a6b5c}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--kw-hl:#1f6b5e;--kw-hl-line:#8fe0cf}}
:root[data-theme="dark"]{--kw-hl:#1f6b5e;--kw-hl-line:#8fe0cf}
table.kw-sym-t td,table.kw-sym-t th{vertical-align:middle}
.kw-sym .lt-sign{height:40px;width:auto}
.kw-big{font:italic 700 1.6rem Georgia,serif}
.kw-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;white-space:nowrap}
.kw-pics{display:flex;flex-wrap:wrap;gap:.4rem 1.4rem;align-items:flex-end}
.kw-pics .kw-pic{margin:.3rem 0}
.kw-pic-s svg{max-width:150px}
.kw-gloss{display:grid;grid-template-columns:repeat(auto-fill,minmax(15rem,1fr));gap:.1rem 1.2rem;margin:.6rem 0}
.kw-gloss div{padding:.3rem 0;border-bottom:1px solid var(--kw-line)}
.kw-gloss dt{font-weight:700;font-style:italic}
.kw-gloss dd{margin:0}
.kw-tool form.kw-row input[type=text]{width:auto;flex:1 1 12rem}
.kw-ch{font-size:1.9rem;line-height:1;font-family:"Segoe UI Symbol","Noto Music","Noto Sans Symbols 2","Apple Symbols",serif}
.kw-bars{list-style:none;padding:0;margin:.6rem 0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.35rem}
.kw-bars li{border:1px solid var(--kw-line);border-radius:10px;padding:.45rem .5rem;text-align:center;background:var(--bg,transparent)}
.kw-bars li b{display:block;font-size:1.25rem}
.kw-bars li small{opacity:.85}
.kw-bars li.on{background:var(--kw-hl);border:2px solid var(--kw-hl-line);outline:2px solid var(--kw-hl-line)}
.kw-bars li.on b::before{content:"▶ ";font-size:.8em}
table.kw-12 td,table.kw-12 th{text-align:center;padding:.3rem .35rem;white-space:nowrap}
table.kw-12 td.kw-l{border-left:3px solid var(--kw-hl-line)}
.kw-ts-count{font:700 1.5rem ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;margin:.5rem 0;letter-spacing:.05em;overflow-wrap:anywhere}
.kw-ts-count .a0{opacity:.55;font-weight:400}
.kw-ts-count .a1{text-decoration:underline}
.kw-ts-count .a2{text-decoration:underline double}
.kw-ts-count span.on{background:var(--kw-hl);outline:2px solid var(--kw-hl-line);border-radius:6px;opacity:1}
.kw-tap-btn{min-width:9rem;min-height:72px;font-size:1.3rem;touch-action:manipulation}
.kw-tap-btn.hit{transform:scale(.96);outline:3px solid var(--kw-hl-line)}
.kw-res-box{font-weight:600;max-width:72ch;background:var(--bg,transparent);border:1px solid var(--kw-line);border-radius:10px;padding:.5rem .7rem}
.kw-ws-r{grid-template-columns:repeat(auto-fill,minmax(230px,1fr))}
.kw-ws-r svg{max-width:260px}
.kw-ws-line{display:block;border-bottom:1.5px solid currentColor;height:1.6rem;margin:.1rem .4rem 0}
.kw-ws-key ol{padding-left:1.6rem}
.kw-sol-row .btn{min-width:3.4rem}
.kw-ladder{max-width:100%;height:auto}
.kw-cof-wrap{display:grid;grid-template-columns:minmax(0,340px) minmax(0,1fr);gap:1rem;align-items:start}
.kw-cof-pic svg{width:100%;max-width:340px;height:auto}
.kw-circle .kw-seg{cursor:pointer}
.kw-circle .kw-seg path{fill:var(--bg,#fff);stroke:currentColor;stroke-width:1}
.kw-circle .kw-seg path.kw-in{fill:var(--kw-panel)}
.kw-circle .kw-seg.on path{fill:var(--kw-hl);stroke:var(--kw-hl-line);stroke-width:3}
.kw-circle .kw-seg.on text{font-weight:800;text-decoration:underline}
.kw-keys{display:grid;grid-template-columns:repeat(auto-fill,minmax(3.2rem,1fr));gap:.35rem;margin:.2rem 0 .6rem}
.kw-keys .btn[aria-pressed="true"]{outline:3px solid var(--kw-hl-line);font-weight:800}
.kw-keys .btn[aria-pressed="true"]::after{content:" ✓"}
.kw-key-out{border-top:1px solid var(--kw-line);margin-top:.4rem;padding-top:.2rem}
.kw-key-s svg,.kw-res-k svg,.kw-res-s svg{max-width:100%;height:auto;color:inherit}
.kw-res-k svg{max-width:420px}
.kw-res-s{overflow-x:auto}
table.kw-ks-t td,table.kw-ks-t th{vertical-align:middle}
table.kw-ks-t svg{display:block;color:inherit}
html.kw-kids-on .kw-bars li b{font-size:1.6rem}
html.kw-kids-on .kw-keys .btn,html.kw-kids-on .kw-sol-row .btn{min-height:56px;font-size:1.2rem}
@media (max-width:600px){table.kw-ks-t svg{width:64px;height:auto}table.kw-ks-t td:nth-child(2),table.kw-ks-t th:nth-child(2){display:none}.kw-cof-wrap{grid-template-columns:1fr}.kw-bars{grid-template-columns:repeat(2,minmax(0,1fr))}.kw-ts-count{font-size:1.2rem}}
@media print{.kw-gloss{grid-template-columns:repeat(3,1fr)}.kw-ws-r{grid-template-columns:repeat(2,1fr)}}
