/* Music theory lessons. Piano keys keep real piano colours in both themes; everything else uses the site tokens. */
/* Music signs (𝄐 𝄋 𝄌 𝄆 𝄇 𝄪 𝄫 ♩) from a 4 KB Noto Music subset (SIL OFL), so phones without them show no boxes. */
@font-face{font-family:"Sowlea Music";src:url(/assets/noto-music-symbols.woff2) format("woff2");unicode-range:U+2669,U+1D106-1D107,U+1D10B-1D10C,U+1D110,U+1D12A-1D12B;font-display:swap}
.theory-page,.theory-page button,.theory-page select,.theory-page input{font-family:"Sowlea Music",Manrope,"Segoe UI",system-ui,-apple-system,"Noto Sans",sans-serif}
.tc-key text,.tc-minor text,.tc-count{font-family:"Sowlea Music",Manrope,system-ui,sans-serif}
.theory-page,.learn-page{--t-text-gold:#7d5a12;--t-white:#fdfcf8;--t-black:#24261f;--t-mark:#f3cf7a;--t-mark-b:#b98a2c;--t-play:#e9a23b;--t-ok:#2f7a4f;--t-no:#a8432e}
@media (prefers-color-scheme:dark){.theory-page,.learn-page{--t-text-gold:#f0c870;--t-white:#e9e6de;--t-black:#0d0f12;--t-mark:#f0c870;--t-mark-b:#c49536;--t-play:#f2a93f;--t-ok:#7fd3a0;--t-no:#ff9b85}}
.tstatus{min-height:0;margin:0;color:var(--muted);font-size:.9375rem}
.tstatus:empty{display:none}
.tnote,.ttry{color:var(--muted)}
.ttry{padding:12px 16px;border-inline-start:3px solid var(--t-mark);background:var(--panel);border-radius:0 12px 12px 0}
[dir=rtl] .ttry{border-radius:12px 0 0 12px}
.tcredit{margin-top:40px;font-size:.8125rem;color:var(--muted)}
.tfig{margin:20px 0 28px}
.tfig figcaption{margin-top:8px;font-size:.875rem;color:var(--muted)}
/* keyboard: always left-to-right, like a real piano */
.tkeys-scroll{overflow-x:auto;max-width:100%;direction:ltr;-webkit-overflow-scrolling:touch;padding-bottom:4px}
.tkeys{position:relative;direction:ltr;height:clamp(120px,30vw,170px);margin:12px 0;user-select:none;-webkit-user-select:none;touch-action:manipulation}
.tk{position:absolute;top:0;margin:0;padding:0 0 8px;border:1px solid #8f8d86;font:inherit;cursor:pointer;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:2px;line-height:1.1}
.tk-w{height:100%;background:var(--t-white);color:#2a2c27;border-radius:0 0 8px 8px;font-weight:700;font-size:clamp(.75rem,2.6vw,1rem);z-index:1}
.tk-w small{font-size:.65em;font-weight:500;opacity:.7}
.tk-b{height:60%;background:var(--t-black);color:#f4f2ec;border-color:#000;border-radius:0 0 6px 6px;z-index:2;font-size:clamp(.5rem,1.7vw,.75rem);padding-bottom:6px}
.tk-b span{display:block}
.tk.is-marked.tk-w{background:var(--t-mark)}
.tk.is-marked.tk-b{background:var(--t-mark-b)}
.tk.is-playing{background:var(--t-play)!important;color:#1d1a12}
.tk:focus-visible{outline:3px solid var(--accent);outline-offset:-3px;z-index:3}
.tbuttons{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0}
.tbig .tplay{font-size:1.0625rem;padding:12px 20px}
.tplay,.tchoice,.tchip{min-height:44px;padding:10px 16px;border:1px solid var(--line);border-radius:999px;background:var(--panel);color:var(--ink);font:inherit;font-weight:600;cursor:pointer;line-height:1.3;text-align:center}
.tplay::before{content:"▶";display:inline-block;margin-inline-end:8px;font-size:.75em}
[dir=rtl] .tplay::before{transform:scaleX(-1)}
.tplay:hover,.tchoice:hover,.tchip:hover{border-color:var(--ink)}
.tplay:focus-visible,.tchoice:focus-visible,.tchip:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.tc-key,.tc-minor{outline:none}
.tc-key:focus-visible circle{stroke:var(--accent);stroke-width:4}
.theory-page .lesson-article{min-width:0}
.ttable-wrap{position:relative;overflow-x:auto;max-width:100%;margin:16px 0 28px;-webkit-overflow-scrolling:touch}
.ttable{border-collapse:collapse;width:100%;min-width:min(100%,520px);font-variant-numeric:tabular-nums}
.ttable caption{text-align:start;font-weight:700;padding-bottom:8px}
.ttable th,.ttable td{padding:10px 8px;border-bottom:1px solid var(--line-soft);text-align:start;vertical-align:top}
.ttable thead th{font-size:.8125rem;color:var(--muted);font-weight:600}
.ttable .tplay{min-height:40px;padding:6px 12px;white-space:nowrap}
.tivs{list-style:none;padding:0;margin:16px 0 28px;display:grid;gap:12px;grid-template-columns:repeat(auto-fill,minmax(min(100%,250px),1fr))}
.tiv{padding:14px 16px;border:1px solid var(--line-soft);border-radius:16px;background:var(--panel);display:grid;gap:6px;align-content:start}
.tiv-head{display:flex;justify-content:space-between;gap:10px;align-items:baseline}
.tiv-head strong{font-size:1.0625rem}
.tiv-code{color:var(--muted);font-weight:600;font-size:.875rem;direction:ltr;unicode-bidi:isolate}
.tiv-facts{display:flex;flex-wrap:wrap;gap:4px 14px;margin:0;color:var(--muted);font-size:.875rem}
.tiv-feel{margin:0}
.tiv .tplay{justify-self:start;min-height:40px;padding:6px 14px}
.tworld td{white-space:nowrap}
.tworld th[scope=row]{min-width:7.5em}
.tsig{display:block;font-size:.875rem;color:var(--muted)}
.tnotes{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0;direction:ltr;justify-content:flex-start}
[dir=rtl] .tnotes{justify-content:flex-end}
.tnotes span{min-width:2.4em;padding:6px 8px;border:1px solid var(--line);border-radius:10px;text-align:center;font-weight:700;background:var(--panel)}
.tnotes span.is-acc{border-color:var(--t-mark-b)}
.tsteps{direction:ltr;unicode-bidi:isolate;letter-spacing:.06em;font-weight:600}
.tlabel{color:var(--muted);font-weight:600;letter-spacing:0}
.tscale-demo{display:grid;gap:18px;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));margin:16px 0 24px}
.tscale-demo>div{padding:16px;border:1px solid var(--line-soft);border-radius:16px;background:var(--panel)}
.tfinder{padding:18px;border:1px solid var(--line-soft);border-radius:20px;background:var(--panel);margin:16px 0 28px}
.tfinder-controls{display:flex;flex-wrap:wrap;gap:12px 18px}
.tfinder-controls label{display:grid;gap:6px;font-weight:600;font-size:.9375rem;flex:1 1 12rem}
.tfinder select,.tsearch input{min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:12px;background:var(--bg);color:var(--ink);font:inherit;width:100%}
.tfinder-out h3{margin:18px 0 4px}
.tabout{color:var(--muted);margin:6px 0}
.tkinds{display:grid;gap:12px;margin:12px 0 24px}
.tkinds div{padding-bottom:12px;border-bottom:1px solid var(--line-soft)}
.tkinds dt{font-weight:700}
.tkinds dd{margin:4px 0 0;color:var(--muted)}
/* circle of fifths */
.tcircle{display:grid;gap:20px;align-items:start;margin:16px 0 28px}
@media (min-width:760px){.tcircle{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr)}}
.tcircle svg{width:100%;max-width:440px;height:auto;justify-self:center;direction:ltr}
.tc-ring{fill:none;stroke:var(--line-soft);stroke-width:1.5}
.tc-key circle{fill:var(--panel);stroke:var(--line);stroke-width:1.5}
.tc-minor circle{fill:var(--wash);stroke:var(--line-soft)}
.tc-key text,.tc-minor text{fill:var(--ink);text-anchor:middle;font-weight:700;font-size:17px;pointer-events:none}
.tc-minor text{font-size:13px;font-weight:600}
.tc-key .tc-alt{font-size:12px;font-weight:600;fill:var(--muted)}
.tc-count{fill:var(--muted);text-anchor:middle;font-weight:600;font-size:11px}
.tc-minor .tc-alt{font-size:10px;fill:var(--muted)}
.tc-key,.tc-minor{cursor:pointer}
.tc-key.is-on circle{fill:var(--t-mark);stroke:var(--t-mark-b);stroke-width:2.5}
.tc-key.is-on text{fill:#2a2c27}
.tc-key.is-near circle,.tc-minor.is-near circle,.tc-minor.is-on circle{stroke:var(--t-mark-b);stroke-width:2.5}
.tcircle-info{padding:18px;border:1px solid var(--line-soft);border-radius:20px;background:var(--panel);min-height:8rem}
.tcircle-info h3{margin:0 0 8px}
.tcircle-info p{margin:6px 0}
/* terms */
.tsearch{display:grid;gap:6px;font-weight:600;margin:12px 0}
.tchips{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.tchip{min-height:40px;padding:6px 14px;font-size:.9375rem}
.tchip.is-on{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.tterm-count{color:var(--muted);font-size:.9375rem}
.tgroup h3{margin:28px 0 8px}
.tgroup dl{margin:0}
.tterm{display:grid;grid-template-columns:minmax(7.5rem,28%) minmax(0,1fr);gap:4px 16px;padding:12px 0;border-bottom:1px solid var(--line-soft)}
@media (max-width:480px){.tterm{grid-template-columns:1fr}}
.tterm dt{font-weight:700;font-style:italic;overflow-wrap:anywhere}
.tterm-extra{display:block;font-style:normal;font-weight:600;font-size:.8125rem;color:var(--muted)}
.tterm dd{margin:0}
.tterm-pic{display:block;margin-top:4px;color:var(--muted);font-size:.9375rem}
.tterm-pic::before{content:"✦ ";color:var(--t-mark-b)}
/* quiz */
.tquiz{padding:18px;border:1px solid var(--line-soft);border-radius:20px;background:var(--panel);margin:16px 0 28px}
.tquiz-q{font-size:1.25rem;font-weight:700;min-height:1.5em}
.tquiz-choices{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.tchoice{min-width:3.2em}
.tquiz-ok{color:var(--t-ok);font-weight:700}
.tquiz-no{color:var(--t-no);font-weight:700}
.tquiz .tk{cursor:default}
/* hub cards and art */
.tcards{display:grid;gap:14px;margin:20px 0}
.tcard{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 14px;padding:18px;border:1px solid var(--line-soft);border-radius:20px;background:var(--panel);color:inherit;text-decoration:none;align-items:start}
.tcard:hover{border-color:var(--ink)}
.tcard .tart{grid-row:span 3;width:88px;height:88px;border-radius:14px}
.tcard-n{font-size:.8125rem;font-weight:700;color:var(--muted)}
.tcard strong{font-size:1.125rem}
.tcard span:last-child{color:var(--muted)}
.thero{margin:0 0 20px}
.thero .tart{display:block;width:min(240px,56vw);height:auto;border-radius:24px}
.thero .tart-wide{width:min(560px,100%)}
.tcard .tart-wide{object-fit:cover}
.tnext{display:grid;gap:4px;margin:36px 0 12px;padding:18px;border:1px solid var(--line);border-radius:20px;color:inherit;text-decoration:none}
.tnext span{color:var(--muted);font-size:.875rem}
.tnext strong{font-size:1.125rem}
.tnext:hover{border-color:var(--ink)}
@media (prefers-reduced-motion:reduce){.tk,.tplay{transition:none}}
.tscs{list-style:none;padding:0;margin:16px 0 28px;display:grid;gap:10px}
.tsc{padding:12px 14px;border:1px solid var(--line-soft);border-radius:16px;background:var(--panel);display:grid;gap:8px}
.tsc-line{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 10px;align-items:center}
.tsc-name{font-weight:700;grid-column:1/-1}
.tsc-notes{display:flex;flex-wrap:wrap;gap:4px 8px;direction:ltr;font-variant-numeric:tabular-nums}
[dir=rtl] .tsc-notes{justify-content:flex-end}
.tsc-notes span{min-width:1.6em}
.tsc .tplay{min-height:40px;padding:6px 12px}
.ttable-wrap:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.msym{font-family:"Sowlea Music",serif;font-size:1.6em;line-height:0;vertical-align:-.12em;font-style:normal}
/* Music library portal (/<lang>/learn/): bookshelf + level paths. */
.learn{padding-block:8px 48px}
.learn-hero{display:grid;gap:24px;align-items:center;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);margin:8px 0 24px}
@media (max-width:760px){.learn-hero{grid-template-columns:1fr}.learn-art{order:-1;max-width:420px}}
.learn-hero h1{margin:0 0 8px;text-wrap:balance}
.learn-art{width:100%;height:auto;border-radius:24px;display:block}
.learn-search{display:grid;gap:6px;margin:16px 0 8px}
.learn-search label{font-weight:700}
.learn-search input{min-height:52px;padding:0 16px;border-radius:16px;border:1px solid var(--line);background:var(--panel);color:var(--ink);font:inherit;font-size:1.05rem;width:100%}
.learn-search input:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.learn-results{margin:8px 0 16px;padding:8px 14px;border:1px solid var(--line);border-radius:16px;background:var(--panel)}
.learn-results ul{list-style:none;margin:0;padding:0;display:grid;gap:2px;max-height:min(60vh,520px);overflow:auto}
.learn-results a{display:grid;gap:2px;padding:10px 6px;border-radius:10px;color:inherit;text-decoration:none}
.learn-results a:hover,.learn-results a:focus-visible{background:var(--wash)}
.learn-results small{color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.learn-count{margin:4px 0 6px;color:var(--muted);font-size:.9rem}
.learn-levels-title{font-size:1rem;margin:18px 0 8px}
.learn-levels{display:flex;flex-wrap:wrap;gap:8px}
.learn-levels a{min-height:44px;display:inline-flex;align-items:center;gap:8px;padding:8px 14px;border-radius:999px;border:1px solid var(--line);background:var(--panel);color:inherit;text-decoration:none;font-weight:650}
.learn-levels a:hover{border-color:var(--ink)}
.learn-today{display:grid;gap:4px;margin:0 0 28px;padding:16px 18px;border:2px dashed var(--t-mark-b);border-radius:20px}
.learn-today>span{font-size:.85rem;font-weight:700;color:var(--t-text-gold)}
.learn-today a{display:grid;gap:2px;color:inherit;text-decoration:none}
.learn-today strong{font-size:1.15rem}.learn-today small{color:var(--muted);font-size:.95rem}
.shelf-grid{display:grid;gap:14px;grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),1fr));margin:12px 0}
.shelf-card{display:grid;align-content:start;gap:8px;padding:12px;border:1px solid var(--line-soft);border-radius:20px;background:var(--panel)}
.shelf-main{display:grid;gap:4px;color:inherit;text-decoration:none}
.shelf-main img{display:block;width:100%;height:auto;aspect-ratio:16/10;object-fit:cover;object-position:center 40%;border-radius:14px;margin-bottom:6px}
.shelf-main strong{font-size:1.1rem}.shelf-main span{color:var(--muted);font-size:.92rem}
.shelf-main:hover strong{text-decoration:underline}
.shelf-card ul{list-style:none;margin:0;padding:8px 0 0;border-top:1px solid var(--line-soft);display:grid;gap:2px}
.shelf-card li a{display:block;padding:6px 2px;color:inherit;font-size:.92rem}
.learn-paths{margin-top:32px}
.lvl{padding:16px 18px;border:1px solid var(--line-soft);border-radius:20px;background:var(--panel);margin:12px 0;scroll-margin-top:16px}
.lvl h3{margin:0 0 4px}.lvl>p{margin:0 0 10px;color:var(--muted)}
.lvl ol{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.lvl li{display:grid;grid-template-columns:4.6em minmax(0,1fr);gap:8px;align-items:baseline}
.lvl li span{font-size:.8rem;font-weight:700;color:var(--t-text-gold)}
.lvl-go{display:inline-block;margin-top:10px;font-weight:700}
.lvl-more{font-size:.85rem;color:var(--muted);margin:8px 0 0}
