/* anything the app hides stays hidden, even when a class gives it display:flex (e.g. a .group) */
[hidden]{display:none !important}
:root{
  --bg:#E8EAF0; --surface:#F6F7FA; --ink:#1C1F2C; --muted:#5D6376; --line:#CDD1DC;
  --brass:#8E6A12; --good:#2E7A55; --bad:#B23F3A; --ivory:#FCFBF7; --ebony:#262833; --ghost:#D9B44A;
  --staff:rgba(28,31,44,.07);
  color-scheme:light;
  box-sizing:border-box;
  padding-top:env(safe-area-inset-top,0px);
  padding-bottom:env(safe-area-inset-bottom,0px);
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#151824; --surface:#1E2232; --ink:#ECE6D8; --muted:#9A9FB2; --line:#2F3447;
    --brass:#D6B04E; --good:#7DC69E; --bad:#E58078; --ivory:#E9E4D6; --ebony:#0E1018; --ghost:#D6B04E;
    --staff:rgba(236,230,216,.06);
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#151824; --surface:#1E2232; --ink:#ECE6D8; --muted:#9A9FB2; --line:#2F3447;
  --brass:#D6B04E; --good:#7DC69E; --bad:#E58078; --ivory:#E9E4D6; --ebony:#0E1018; --ghost:#D6B04E;
  --staff:rgba(236,230,216,.06);
  color-scheme:dark;
}
/* the whole app scales with the window: every size is in rem, and the root size
   follows the window (designed at 1366x650 with 15px text, so it always fits) */
html{scroll-padding-top:env(safe-area-inset-top,0px);font-size:clamp(12px,min(1.098vw,2.3vh),28px)}
@media (max-width:820px) and (min-height:521px),(max-width:820px) and (orientation:portrait){html{font-size:15px}}
*,*::before,*::after{box-sizing:inherit}
html{scrollbar-gutter:stable}   /* a scrollbar that comes and goes no longer shifts the page sideways */
body{margin:0;min-height:100vh;display:flex;flex-direction:column;background:var(--bg);color:var(--ink);font:400 1rem/1.5 "IBM Plex Sans",system-ui,-apple-system,"Segoe UI",sans-serif}
button{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--brass);outline-offset:2px}

.top{display:flex;justify-content:space-between;align-items:baseline;gap:1rem;flex-wrap:wrap;width:100%;max-width:78.7rem;margin:0 auto;padding:.5rem 1.25rem .1rem}
.brand{font-weight:700;font-size:1.25rem;letter-spacing:.01em}
.brand>span{font-family:"MuseJazz Text","Comic Sans MS",cursive;color:var(--brass);font-size:1.6rem;margin-right:.4rem;-webkit-text-stroke:.04em var(--brass)}
.brand .home{display:inline-block;margin-right:.7rem;color:var(--muted);text-decoration:none;font-weight:400;font-size:1.1rem}
.brand .home:hover{color:var(--ink)}
.status{display:flex;align-items:center;gap:.5rem;font-size:.85rem;color:var(--muted);max-width:100%}
.dot{width:.6rem;height:.6rem;border-radius:50%;background:var(--muted);flex:none}
.status.on .dot{background:var(--good)}
.status.off .dot{background:var(--bad)}

.wrap{flex:1;width:100%;max-width:78.7rem;margin:0 auto;padding:0 1.25rem .5rem;display:grid;grid-template-columns:minmax(0,1fr) 15.3rem;grid-template-rows:auto auto auto;align-content:start;gap:.6rem 1rem}
.controls{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:.45rem 1.5rem;padding:.35rem 0 .6rem;border-bottom:1px solid var(--line)}
.group{display:flex;flex-direction:row;align-items:center;gap:.5rem}
.glabel{font-size:.8rem;color:var(--muted);white-space:nowrap}
.seg{display:flex;border:1px solid var(--line);border-radius:.55rem;overflow:hidden;background:var(--surface)}
.seg button{border:0;background:transparent;padding:.28rem .65rem;cursor:pointer;font-size:.85rem;white-space:nowrap}
.seg button+button{border-left:1px solid var(--line)}
.seg button[aria-pressed="true"]{background:var(--ink);color:var(--bg)}
.chips{display:flex;flex-wrap:wrap;gap:.3rem}
.chip{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:.08rem .5rem;font-size:.85rem;cursor:pointer;min-width:2rem}
.chip[aria-pressed="true"]{border-color:var(--brass);color:var(--brass);font-weight:600}
.chip.link{border-style:dashed}
.group.dim{opacity:.4;pointer-events:none}
.controls .brk{flex-basis:100%;height:0}

.stage{position:relative;background:var(--surface);border-radius:.95rem;padding:.4rem 1.4rem .6rem;min-height:0;display:flex;flex-direction:column}
.head{display:flex;align-items:center;gap:1.5rem 2.5rem;flex-wrap:wrap;margin:.3rem 0 .4rem}
.staffbox{flex:1 1 16rem;max-width:20rem}
/* wide screens: chord next to the staff, hint and feedback to their right, so it all fits the window height */
@media (min-width:821px),(max-height:520px) and (orientation:landscape){
  .stage{display:grid;grid-template-columns:minmax(10.5rem,max-content) auto minmax(0,1fr);grid-template-rows:auto auto auto 1fr auto;column-gap:1.5rem}
  .prog{grid-column:1/-1}
  .head{display:contents}
  /* centred in the free space left of the staff: half the column gap across, and level with the middle of the staff lines */
  .chord{grid-column:1;grid-row:2/5;align-self:center;justify-self:center;position:relative;left:.75rem;top:.55rem}
  .staffbox{grid-column:2;grid-row:2/5;align-self:start;width:12.5rem;max-width:none}
  /* hint and result share one spot, centred on the staff lines (the padding skips the label above them).
     Playing a chord fades the hint out and the result in, in place; the next chord fades the hint back.
     contain:size = the text takes the staff's height but never adds to it,
     so nothing here can make the panel taller and push the keyboard down */
  .textcol{grid-column:3;grid-row:2/5;display:grid;align-items:center;align-self:stretch;contain:size;overflow:hidden;padding-top:1.62rem}
  .textcol>.hint,.textcol>.feedback{grid-area:1/1;min-width:0}
  .textcol .hint{font-size:1.1rem;line-height:1.45;color:var(--ink);transition:opacity .2s,visibility .2s}
  .textcol .htitle{display:block;font-size:1.6rem;font-weight:600;line-height:1.2;margin-bottom:.35rem}
  .textcol .hnote{display:block;margin-top:.5rem;font-style:italic;color:var(--muted)}
  .textcol .hnote b{color:var(--ink)}
  .textcol.playing .hint{opacity:0;visibility:hidden}
  .textcol .feedback{min-height:0;margin:0;max-width:none;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}
  .textcol .feedback:empty{display:none}
  .textcol.playing .feedback{animation:fadein .2s ease-out}
  .textcol .verdict{font-size:1.75rem;line-height:1.25;margin-bottom:.2rem}
  .textcol .verdict.bad{font-size:1.3rem}
  .textcol .vmeta{font-size:.85rem;color:var(--muted)}
  .textcol .tip{font-size:.95rem;margin-top:.2rem}
  .actions{grid-column:1/-1;grid-row:5}
}
/* label above the staff with room under it for high notes and the 8va sign, centred over the staff lines (the staff starts 7% in, after the brace) */
.stafflbl{font-size:.8rem;color:var(--muted);text-align:center;padding-left:7%;margin-bottom:.45rem}
#staff svg{display:block;width:100%;height:auto;overflow:visible}   /* very high or low notes draw past the edge instead of being cut off */
#staff .err{color:var(--muted);font-size:.85rem}
.prog{display:flex;align-items:baseline;gap:1.1rem;font-family:"MuseJazz Text","Comic Sans MS",cursive;font-size:1.3rem;color:var(--muted);min-height:1.8rem}
.prog .lbl{font-family:"IBM Plex Sans",system-ui,sans-serif;font-size:.85rem}
.prog .cur{color:var(--ink)}
.prog .done{color:var(--good)}
.chord{font-family:"MuseJazz Text","Comic Sans MS",cursive;font-size:4.75rem;line-height:1;margin:0;transition:color .2s;flex:none}
.chord .q{font-size:.55em;margin-left:.04em;vertical-align:.55em}
.acc{margin-left:.02em}
.chip{font-family:"MuseJazz Text","IBM Plex Sans",sans-serif;font-size:1rem}
.chip.link{font-family:"IBM Plex Sans",system-ui,sans-serif;font-size:.85rem}
.chord.flash{animation:flash .35s ease-out}
@keyframes flash{from{transform:translateY(6px);opacity:.35}to{transform:none;opacity:1}}
.hnote{font-style:italic}
.hint{color:var(--muted);max-width:70ch;font-size:.86rem;line-height:1.4}
.feedback{margin-top:.5rem;min-height:3.6rem;max-width:70ch}
.feedback .verdict{font-weight:600}
.feedback .verdict.good{color:var(--good)}
.feedback .verdict.bad{color:var(--bad)}
.feedback .tip{color:var(--brass);font-size:.9rem}
/* voice-leading traffic light */
.feedback .vl-great{color:var(--good)}
.feedback .vl-ok{color:var(--brass)}
.feedback .vl-jump{color:var(--bad)}
.vldot{display:inline-block;width:.6em;height:.6em;border-radius:50%;background:currentColor;margin-right:.4em;vertical-align:.05em}
.feedback .vl .qbtn{border-color:currentColor;color:inherit}
.chord.ok{color:var(--good)}
.qbtn{display:inline-flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;margin-left:.3rem;padding:0;border:1px solid var(--brass);border-radius:50%;background:transparent;color:var(--brass);font-size:.75rem;font-weight:600;line-height:1;cursor:pointer;vertical-align:.05em}
.pop{position:absolute;top:1rem;right:1rem;z-index:5;max-width:min(22.7rem,calc(100% - 2rem));background:var(--bg);color:var(--ink);border:1px solid var(--brass);border-radius:10px;padding:.75rem 2.1rem .8rem .95rem;font-size:.9rem;line-height:1.45;box-shadow:0 6px 24px rgba(0,0,0,.18);animation:popin .2s ease-out}
.pop[hidden]{display:none}
.pop b{color:var(--brass);font-weight:600}
.pop-x{position:absolute;top:.35rem;right:.4rem;border:0;background:transparent;color:var(--muted);cursor:pointer;font-size:.85rem;padding:.2rem .35rem}
@keyframes popin{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
.actions{margin-top:auto;padding-top:.3rem;display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}
.btn{border:1px solid var(--line);background:var(--bg);border-radius:.55rem;padding:.45rem .9rem;cursor:pointer}
.btn.primary{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.sound{display:flex;align-items:center;gap:.35rem;font-size:.9rem;color:var(--muted);margin-left:auto;cursor:pointer}

.stats{background:var(--surface);border-radius:.95rem;padding:.7rem 1.1rem;min-height:0;overflow:auto}
.stats h2{font-size:.95rem;margin:0 0 .2rem;font-weight:600}
.stat{display:flex;justify-content:space-between;align-items:baseline;padding:.15rem 0;border-bottom:1px solid var(--line)}
.stat b{font-size:1.1rem;font-weight:600;font-variant-numeric:tabular-nums}
.stat span{color:var(--muted);font-size:.85rem}
.speed{margin-top:.5rem;display:grid;grid-template-columns:repeat(2,minmax(0,max-content));column-gap:.7rem;font-size:.85rem;line-height:1.35}
.speed .empty{grid-column:1/-1}
.speed .empty[hidden]{display:none}
.slow h3,.slow li{color:var(--bad)}
.fast h3,.fast li{color:var(--good)}
.speed h3{font-size:.85rem;margin:0 0 .35rem;font-weight:600}
.speed ol{margin:0;padding-left:1.05rem}
.speed li{font-variant-numeric:tabular-nums;white-space:nowrap}
[dir=rtl] .speed ol{direction:ltr;text-align:left;padding-left:1.05rem}   /* chord symbol + seconds read left to right; with the RTL page the list was cut into "…Fm7" */
.speed .sym{font-family:"MuseJazz Text","Comic Sans MS",cursive;font-size:1.05rem}
.empty{color:var(--muted)}
.shead{display:flex;justify-content:space-between;align-items:center;margin-bottom:.2rem}
.shead h2{margin:0}
.reset{font-size:.78rem;padding:.15rem .6rem}

.kbwrap{grid-column:1/-1;overflow-x:auto;background:var(--surface);border-radius:.95rem;padding:.6rem}
.kb{position:relative;height:11.3rem;min-width:61rem;user-select:none;touch-action:manipulation}
.key{position:absolute;top:0;cursor:pointer;display:flex;align-items:flex-end;justify-content:center;font-size:.72rem;font-weight:600}
.key.w{height:100%;background:var(--ivory);border:1px solid rgba(0,0,0,.25);border-radius:0 0 6px 6px;padding-bottom:.45rem;color:#1C1F2C;z-index:1}
.key.b{height:62%;background:var(--ebony);border-radius:0 0 4px 4px;z-index:2;padding-bottom:.35rem;color:#fff;border:1px solid rgba(0,0,0,.5)}
.key .oct{position:absolute;bottom:.2rem;font-weight:400;font-size:.62rem;color:#8a8a8a}
.key.on.w{background:#C9CEDB}
.key.on.b{background:#5A6075}
.key.good.w{background:#9ED3B5}
.key.good.b{background:#2E7A55}
.key.bad.w{background:#EFA9A3}
.key.bad.b{background:#B23F3A}
.key.ghost.w{box-shadow:inset 0 -1.75rem 0 var(--ghost)}
.key.ghost.b{box-shadow:inset 0 -1.2rem 0 var(--ghost)}
.key .deg{position:relative;z-index:1;margin-bottom:.9rem}
.foot{grid-column:1/-1;color:var(--muted);font-size:.82rem;margin:0}

.chord,.prog span:not(.lbl),.speed .sym,.brand>span,.chip:not(.link),.chip[aria-pressed="true"]:not(.link){font-weight:400}
@media (max-width:820px) and (min-height:521px),(max-width:820px) and (orientation:portrait){
  .wrap{grid-template-columns:1fr}
  .stage{padding:1.1rem}
  .sound{margin-left:0}
}
@media (prefers-reduced-motion:reduce){.chord{transition:none}.chord.flash{animation:none}.pop{animation:none}}
.nowrap{white-space:nowrap}
/* chord types a level doesn't include yet: visible but locked */
.chip.locked{opacity:.35;cursor:not-allowed;border-style:dashed}
.seg button.locked{opacity:.35;cursor:not-allowed}
/* Guide switch next to the buttons: Off / Read / Learn */
.actions .guide{gap:.4rem}
.seg.small button{padding:.22rem .55rem;font-size:.8rem}
/* top right: MIDI status, with the speaker button under it */
/* the speaker sits on the MIDI status line, to its left, so nothing hangs down over the controls */
.topright{display:flex;align-items:baseline;gap:1rem;position:relative;top:.33rem}   /* status on the title's line */
.topright .speaker{order:-1;white-space:nowrap}
.speaker{display:inline-flex;align-items:center;gap:.3rem;border:0;background:transparent;padding:.05rem .2rem;cursor:pointer;color:var(--muted);font-size:.78rem}
.speaker:hover{color:var(--ink)}
.speaker svg{width:1.05rem;height:1.05rem;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.speaker .cone{fill:currentColor}
.speaker .waves{display:none}
.speaker.on{color:var(--ink)}
.speaker.on .waves{display:inline}
.speaker.on .cross{display:none}
/* Show me / Skip / Clear keys: same size as the Guide switch on the right */
.actions .btn{padding:.22rem .7rem;font-size:.8rem;border-radius:.45rem}
@keyframes fadein{from{opacity:0}to{opacity:1}}
@media (prefers-reduced-motion:reduce){.textcol .hint{transition:none}.textcol.playing .feedback{animation:none}}
/* Learn mode: the written notes in the same gold as on the staff and the keys */
.textcol .hnote .goldnotes{color:var(--brass);font-style:normal;font-weight:600}
/* Scales & Modes: the root big, the scale name beside it; a wider staff for the row of notes */
/* scales: the root big, the scale name under it, so long names like "Major pentatonic" stay narrow */
.chord .sname{display:block;font-size:.3em;line-height:1.1;margin-top:.1em;text-align:center}
body[data-module="scales"] .chord{text-align:center}
@media (min-width:821px),(max-height:520px) and (orientation:landscape){
  body[data-module="scales"] .staffbox{width:26rem}
}
/* Scales: the stats lists use the plain font, smaller, one line per entry */
body[data-module="scales"] .speed .sym{font-family:inherit;font-size:.82rem}
.speed li{overflow:hidden;text-overflow:ellipsis}
.speed>div{min-width:0}
body[data-module="scales"] .speed{column-gap:.35rem}
body[data-module="scales"] .speed ol{padding-left:.9rem}
body[data-module="scales"] .speed .sym{font-size:.8rem}
body[data-module="scales"] .speed li{font-size:.76rem}body[data-module="scales"] .speed .sym{font-size:inherit}
/* level badge next to the module name */
.brand .lvl{font-size:.55em;margin-left:.12em;vertical-align:.7em;line-height:0}
/* header stays one line: title (and level path) keep their size, the MIDI message shortens with … (full text on hover) */
.top{flex-wrap:nowrap}
.top .brand{flex:none;white-space:nowrap}
.top .topright{min-width:0;flex:0 1 auto}
.top .status{min-width:0}
#statusText{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
/* the speaker at the right end of the first controls row */
.controls .sound-group{margin-left:auto;align-self:center}
/* ☰ menu next to the module title */
.navmenu{position:relative;display:inline-block;margin-right:.55rem;vertical-align:-.12em}
.nav-btn{display:inline-flex;align-items:center;justify-content:center;width:1.9rem;height:1.9rem;border:1px solid var(--line);border-radius:.45rem;background:var(--surface);cursor:pointer;color:var(--ink);padding:0}
.nav-btn:hover,.nav-btn[aria-expanded="true"]{border-color:var(--brass);color:var(--brass)}
.nav-btn svg{width:1.1rem;height:1.1rem;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.nav-panel{position:absolute;top:calc(100% + .35rem);left:0;z-index:30;min-width:17rem;background:var(--surface);border:1px solid var(--line);border-radius:.7rem;padding:.4rem 0;box-shadow:0 10px 28px rgba(0,0,0,.16);font-size:.85rem;font-weight:400;line-height:1.35;white-space:nowrap}
.nav-panel a,.nav-panel .soon{display:block;padding:.32rem .9rem;color:var(--ink);text-decoration:none}
.nav-panel a:hover{background:var(--bg)}
.nav-main{color:var(--muted)!important}
.nav-head{margin:.45rem .9rem .15rem;padding-top:.45rem;border-top:1px solid var(--line);font-family:"MuseJazz Text","Comic Sans MS",cursive;color:var(--brass);font-size:1.05rem}
.nav-lv b{display:inline-block;width:1.8rem;font-weight:600;color:var(--muted)}
.nav-lv.cur{color:var(--brass);font-weight:600}
.nav-lv.cur b{color:var(--brass)}
.nav-panel .soon{color:var(--muted)}
.nav-panel .soon i{font-size:.75rem}
.nav-mod{padding-left:1.4rem!important}
.nav-ok{font-family:"IBM Plex Sans",system-ui,sans-serif;font-size:.8em;line-height:1;margin-left:.3em;vertical-align:baseline}
/* Practice as gold chips (Scales), to match the keys: the chosen one outlined in gold */
.seg.gold{border:0;background:transparent;gap:.3rem;overflow:visible}
.seg.gold button{border:1px solid var(--line)!important;border-radius:999px;padding:.08rem .6rem;font-family:"MuseJazz Text","IBM Plex Sans",sans-serif;font-size:.95rem;background:var(--surface);color:var(--muted)}
.seg.gold button[aria-pressed="true"]{background:var(--surface);color:var(--brass);border-color:var(--brass)!important}
.seg.gold button:hover{color:var(--brass)}
/* a row with a centred middle: the two side groups share the space equally */
.controls .group.side{flex:1 1 0;min-width:max-content;margin-left:0!important}   /* never narrower than its buttons */
.controls .group.side.end{justify-content:flex-end}
body.fulltrainer #qualChips .chip{font-size:.74rem;padding:.04rem .3rem;min-width:0}body.fulltrainer #qualChips{gap:.18rem}
/* switched-off chips look like the unselected Practice chips (L3): grey text, plain border; switched-on ones are gold */
.chip[aria-pressed="false"]{color:var(--muted);border-color:var(--line)}
.chip[aria-pressed="false"]:hover{color:var(--brass)}
@media (min-width:821px),(max-height:520px) and (orientation:landscape){body[data-module="scales"] .textcol .hint{line-height:1.38}body[data-module="scales"] .textcol .htitle{margin-bottom:.2rem}body[data-module="scales"] .textcol .hnote{margin-top:.3rem}}
/* light / dark switch in the header (js/theme.js) */
.theme-btn{display:inline-flex;align-items:center;justify-content:center;flex:none;width:1.9rem;height:1.9rem;border:1px solid var(--line);border-radius:.45rem;background:var(--surface);color:var(--ink);cursor:pointer;padding:0;position:absolute;right:1.25rem;top:.5rem}
.lang-sel{position:absolute;right:calc(1.25rem + 1.9rem + .45rem);top:.5rem;height:1.9rem;padding:0 .2rem 0 .35rem;border:1px solid var(--line);border-radius:.45rem;background:var(--surface);color:var(--ink);font:600 .78rem/1 inherit;font-family:inherit;letter-spacing:.04em;cursor:pointer}
.lang-sel:hover,.lang-sel:focus-visible{border-color:var(--brass);color:var(--brass)}
[dir=rtl] .lang-sel{direction:ltr}
.theme-btn:hover{border-color:var(--brass);color:var(--brass)}
.theme-btn svg{width:1.05rem;height:1.05rem;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.top.has-theme{position:relative;padding-right:3.7rem}   /* button 1.9rem + 1.25rem edge + .55rem gap, the same gap as between ☰ and the title */
.top.has-lang{padding-right:8.6rem}   /* the language box (about 3rem) + .45rem gap, left of the light/dark button */
[dir=rtl] .theme-btn{right:auto;left:1.25rem}
[dir=rtl] .lang-sel{right:auto;left:calc(1.25rem + 1.9rem + .45rem)}
[dir=rtl] .top.has-theme{padding-right:1.25rem;padding-left:3.7rem}
[dir=rtl] .top.has-lang{padding-right:1.25rem;padding-left:8.6rem}

/* JazzSync logo (2026-10-04): the triangle mark before the name in every header; the tagline on the main page */
:root{--logo-blue:#11B8F6;--logo-orange:#FA8E25}
[data-theme="dark"]{--logo-blue:#11B8F6;--logo-orange:#FA8E25}

.brand .logo{height:1.15em;width:auto;vertical-align:baseline;margin:-.3em .35em 0 0}
.brand .tagline{margin-left:.7em;font-size:.72em;font-weight:500;letter-spacing:.04em}
.brand .tagline i{font-style:normal}
.brand .tagline .t1{color:var(--logo-blue)}.brand .tagline .t2{color:var(--logo-orange)}.brand .tagline .t3{color:var(--ink)}

/* the module name sits on the bottom line of the ☰ button (teacher, 2026-10-04); font-independent */
.brand .navmenu{vertical-align:-.12em}   /* a small nudge: the gold jazz letters dip a little below the line */
.brand .nav-btn{display:inline-block;vertical-align:baseline;position:relative}   /* no in-flow content: its bottom edge sits on the text baseline, whatever the font */
.brand .nav-btn svg{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}

/* ☰ menu: links to the reading (JazzSync Piano Method) */
.nav-panel a.nav-read{color:var(--brass);font-weight:600}

/* The brand fonts of the logo (2026-10-05): the JazzSync wordmark in Outfit Bold (Jazz ink, Sync logo blue), the tagline in Inter Medium.
   Self-hosted (fonts/, SIL Open Font License in licenses/), so they also work offline and in the apps. */
@font-face{font-family:"Outfit";src:url(../fonts/outfit-700.woff2) format("woff2");font-weight:700;font-display:swap}
@font-face{font-family:"Inter Brand";src:url(../fonts/inter-500.woff2) format("woff2");font-weight:500;font-display:swap}
.brand .wm{font-family:"Outfit",sans-serif;font-weight:700;letter-spacing:-.005em}
.brand .wm i{font-style:normal;color:var(--logo-blue)}
.brand .tagline{font-family:"Inter Brand",sans-serif;font-weight:500;letter-spacing:.08em}
/* phones (2026-10-09): longer module names in other languages: the title may wrap and the MIDI message shows as its coloured dot only, so the page never gets wider than the screen */
@media (max-width:600px){.top .brand{flex:1 1 auto;min-width:0;white-space:normal}.top #statusText{display:none}}
html[lang=ja] .brand>span{-webkit-text-stroke:0;font-weight:700}@media (max-width:600px){html[lang=ja] .top .brand>span{font-size:1.2rem}}
/* right-to-left (Hebrew): chord progressions read left to right; the step buttons point the way the cards move */
[dir=rtl] .prog{direction:ltr}[dir=rtl] .prog .lbl{unicode-bidi:isolate;direction:rtl}
[dir=rtl] #backBtn .pb-ic svg,[dir=rtl] #nextBtn .pb-ic svg{transform:scaleX(-1)}
[dir=rtl] #chordName,[dir=rtl] .chordname,[dir=rtl] .chord{direction:ltr;unicode-bidi:isolate}
[dir=rtl] .nav-panel{left:auto;right:0}
.key .deg.arw,.tkb .key .deg.arw{font-size:1.25rem;font-weight:700;line-height:1}

[dir=rtl] .ic-chord,[dir=rtl] .ic-clef,[dir=rtl] .brand .bname,[dir=rtl] .brand .tagline{direction:ltr;unicode-bidi:isolate}   /* the logo words and the icons read left to right */
.top.has-lang .topright{overflow:hidden}.top.has-lang .topright .status{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}   /* a long MIDI message never runs under the language box */

/* ---------- phones (27 Oct 2026, the Android app) ----------
   Sideways: the whole lesson fits the short screen (the 12px minimum text size made the keyboard fall off the bottom);
   the "Click anywhere to turn on the sound" tag at the top of the card is hidden there (the ▶ pill says the same).
   Upright: lesson and practice pages ask to turn the phone sideways (js/theme.js adds the message to keyboard pages). */
@media (max-height:520px) and (orientation:landscape){
  /* the whole width of the phone is used (no empty side bands), the text is bigger and the keys a little shorter */
  html:has(body.kbpage){font-size:max(var(--phmin,9px),min(1.45vw,var(--phf,2.85vh)))!important}
  html:has(body.kbpage main.wrap){--phf:2.85vh}   /* practice pages: the settings and the numbers are in drawers now (30 Oct), so the same size as the lessons */
  html:has(body.kbpage .card.lining){--phf:2.6vh}   /* a play-along card with its chord chart */
  body.kbpage .top,body.kbpage .lesson,body.kbpage .wrap{max-width:none}
  body.kbpage .top{padding:.35rem .9rem .1rem}
  body.kbpage .lesson{padding:.35rem .9rem .5rem;gap:.5rem}
  body.kbpage .wrap{padding:0 .9rem .4rem}
  body.kbpage .tkb,body.kbpage .kb{height:8.2rem}
  body.kbpage .card{min-height:0;padding:.8rem 1.3rem .7rem}
  body.kbpage .rstrip{height:22px}body.kbpage .ruler{height:7px;bottom:3px}body.kbpage .ruler span{font-size:11px;bottom:7px;line-height:1.2}   /* a thin strip of fixed height: a ruler showing never moves the keys (2 Nov) */
  body.kbpage .kbwrap{padding:.45rem}
  body.kbpage .card-nav .nav-mid{zoom:.8}   /* Back / Play / Next a little smaller: room for the chord charts */
  body.kbpage .lang-sel{right:calc(.9rem + 1.9rem + .45rem);font-size:.78rem;font-weight:600;line-height:1}   /* the language box at its real size, so the MIDI message never runs under it */
  body.kbpage .top.has-lang{padding-right:7.6rem}
  [dir=rtl] body.kbpage .lang-sel{right:auto;left:calc(.9rem + 1.9rem + .45rem)}
  [dir=rtl] body.kbpage .top.has-lang{padding-right:.9rem;padding-left:7.6rem}
  .soundtip{display:none!important}
  body.kbpage #cardText{min-height:0!important;max-width:none;font-size:1.3rem}
  /* readable on a phone (Dima, 30 Oct: "the Questions are too small, Contents too"): a floor in px for every small text */
  body.kbpage .cp-open span,body.kbpage .lang-sel,body.kbpage #statusText{font-size:12.5px!important}
  body.kbpage .qnum,body.kbpage .quiz-mode,body.kbpage .quiz-mode button{font-size:13px!important}
  body.kbpage #quiz .choices button,body.kbpage #quiz>button,body.kbpage #quiz .opts button{font-size:15px}
  body.kbpage #quiz button:not(.show-ans){font-size:15px!important;min-height:34px}body.kbpage #quiz .quiz-mode button{font-size:13px!important;min-height:0}
  body.kbpage .show-ans{font-size:14px!important}
  body.kbpage .card-nav .pb-lb{font-size:15px}   /* the row is zoomed to 80%: 12px on the screen */
  body.kbpage .ap-switch,body.kbpage .ap-switch span{font-size:12.5px}
  body.kbpage .card-nav small,body.kbpage .card-nav span{font-size:max(12.5px,1em)}
  body.kbpage .card small,body.kbpage .lnctl,body.kbpage .lnmeta,body.kbpage .lcbtn,body.kbpage .bpmv{font-size:max(12px,1em)}
  body.kbpage #earMsg,body.kbpage #earGo,body.kbpage .earmsg{font-size:13.5px}
  body.kbpage #nav a,body.kbpage .nav-lv,body.kbpage .nav-mod,body.kbpage .nav-main,body.kbpage .nav-read{font-size:15px}body.kbpage .nav-head{font-size:16px}
  body.kbpage .card button:not(.cardpill):not(.ap-switch):not(.pbtn):not(.show-ans),body.kbpage .card select{font-size:max(13.5px,1em)!important}
  body.kbpage .ap-pill,body.kbpage .ap-pill span{font-size:13px}body.kbpage .oct{font-size:max(10px,1em)}
  body.kbpage #cpanel{font-size:15px}body.kbpage #cpanel .cp-pct,body.kbpage #cpanel small{font-size:13px}
  /* the practice trainers (js/phone-practice.js, 30 Oct): settings in a drawer from the left, the numbers in one from the right */
  body.kbpage main.wrap{grid-template-columns:minmax(0,1fr);gap:.4rem}
  body.kbpage main.wrap .controls{position:fixed;top:0;bottom:0;left:0;width:min(620px,74vw);z-index:61;background:var(--surface);flex-direction:column;flex-wrap:nowrap;align-items:stretch;gap:12px;padding:12px 16px 16px;overflow:auto;border:0;border-radius:0 18px 18px 0;box-shadow:0 0 30px rgba(0,0,0,.28);transform:translateX(-106%);transition:transform .22s;font-size:15px}
  body.kbpage.ph-set main.wrap .controls{transform:none}
  body.kbpage main.wrap .controls .group{flex-direction:column;align-items:flex-start;gap:7px;margin-left:0!important}
  body.kbpage main.wrap .controls .brk{display:none}
  body.kbpage main.wrap .controls .glabel{font-size:14px;font-weight:600}
  body.kbpage main.wrap .controls .chips,body.kbpage main.wrap .controls .seg{flex-wrap:wrap;gap:7px}
  body.kbpage main.wrap .controls button{font-size:15px!important;min-height:36px;padding:0 12px}
  body.kbpage main.wrap .controls .seg button{border-radius:10px}
  body.kbpage main.wrap .controls .speaker{width:auto;font-size:15px!important}
  body.kbpage main.wrap .stats{position:fixed;top:0;bottom:0;right:0;width:min(340px,42vw);z-index:61;border-radius:18px 0 0 18px;box-shadow:0 0 30px rgba(0,0,0,.28);transform:translateX(106%);transition:transform .22s;padding:12px 16px;font-size:16px}
  body.kbpage.ph-st main.wrap .stats{transform:none}
  body.kbpage main.wrap .stats h2{font-size:20px}body.kbpage main.wrap .stats .stat{font-size:16px;padding:8px 0}body.kbpage main.wrap .stats .stat b{font-size:20px}
  body.kbpage main.wrap .stats h3,body.kbpage main.wrap .stats .empty,body.kbpage main.wrap .stats .lbl{font-size:14px!important}
  body.kbpage main.wrap .stats button{font-size:14px!important;min-height:32px}
  body.kbpage .ph-sum{display:flex;align-items:center;gap:8px;overflow-x:auto;scrollbar-width:none;padding:0;white-space:nowrap}
  body.kbpage .ph-open,body.kbpage .ph-stats{height:34px;padding:0 14px;border:1px solid var(--brass);border-radius:999px;background:var(--surface);color:var(--brass);font-size:15px;font-weight:600;line-height:1;font-family:inherit;flex:none;cursor:pointer}
  body.kbpage .ph-stats{display:inline-flex;align-items:center;border-color:var(--line);color:var(--ink);margin-right:8px}
  body.kbpage .ph-chip{height:32px;padding:0 12px;border:1.5px solid var(--brass);color:var(--brass);border-radius:999px;display:inline-flex;align-items:center;font-size:14px;font-weight:600;flex:none;cursor:pointer}
  body.kbpage .ph-dh{display:flex;align-items:center;justify-content:space-between;position:sticky;top:-12px;background:var(--surface);padding:4px 0 6px;z-index:2}
  body.kbpage .ph-dh b{font-size:20px}
  body.kbpage .ph-x,body.kbpage .stats .ph-x{display:inline-grid;place-items:center;width:38px;height:38px;border:0;background:none;color:var(--muted);font-size:22px;cursor:pointer}
  body.kbpage.ph-set .ph-shade,body.kbpage.ph-st .ph-shade{display:block;position:fixed;inset:0;z-index:60;background:rgba(10,12,18,.42)}
  body.kbpage main.wrap .stage{font-size:15px;padding:.15rem 1rem .35rem}
  body.kbpage main.wrap .stafflbl{white-space:nowrap}body.kbpage main.wrap .stage .lbl{font-size:13px}
  body.kbpage main.wrap .kb{height:7.4rem}
  body.kbpage main.wrap .controls .sound-group{align-self:flex-start}
  body.kbpage main.wrap .controls .seg{border:0;background:none}body.kbpage main.wrap .controls .seg button{border:1px solid var(--line)}
  body.kbpage main.wrap .actions .btn,body.kbpage main.wrap .actions .seg button{font-size:15px!important;min-height:36px}
  body.kbpage main.wrap .actions .glabel,body.kbpage main.wrap .stafflbl{font-size:13px}
  body.kbpage main.wrap .hint,body.kbpage main.wrap .feedback{font-size:15px}
  body.kbpage .card-head{flex-wrap:nowrap}body.kbpage #cardTitle{min-width:0}body.kbpage .ap-switch{white-space:nowrap}body.kbpage .dots-wrap{flex-direction:row;gap:.8rem}   /* Auto-play beside the step dots, not under them: one row less */   /* card numbers, title and step dots stay on one line */   /* the room kept for the longest text of the level would push the keyboard off */
}
.rotate-hint{display:none}
@media (orientation:portrait) and (max-width:600px){
  html:has(body.kbpage),body.kbpage{overflow:hidden!important}
  body.kbpage .rotate-hint{display:flex;position:fixed;left:0;top:0;width:100vw;height:100vh;z-index:99999;flex-direction:column;align-items:center;justify-content:center;
    gap:14px;padding:32px 28px;text-align:center;background:var(--bg);color:var(--ink);font-size:16px;line-height:1.45}
  body.kbpage .rotate-hint svg{width:96px;height:96px;color:var(--brass)}
  body.kbpage .rotate-hint b{font-size:22px;font-weight:700}
  body.kbpage .rotate-hint p{margin:0;max-width:300px;color:var(--muted,var(--ink));opacity:.85}
  body.kbpage .rotate-hint a{margin-top:6px;color:var(--brass);font-weight:600;text-decoration:none;padding:10px 18px;border:1px solid var(--brass);border-radius:999px}
}

/* the phone parts of the practice trainers (js/phone-practice.js): hidden except on a phone held sideways (the phone block) */
.ph-sum,.ph-stats,.ph-dh,.ph-shade,.stats .ph-x{display:none}
/* very short phones held sideways (360px high and less): the practice trainers a little tighter so the keys stay on screen */
@media (max-height:380px) and (orientation:landscape){
  body.kbpage main.wrap .actions .btn,body.kbpage main.wrap .actions .seg button{min-height:31px}
  body.kbpage .ph-open,body.kbpage .ph-stats{height:30px}body.kbpage .ph-chip{height:28px}
  body.kbpage main.wrap .kb{height:6.6rem}
  body.kbpage main.wrap{gap:.25rem}
}
/* the practice trainers' button bar on top of the keys (2 Nov), phone held sideways: tighter, readable level links */
@media (max-height:520px) and (orientation:landscape){
 body.kbpage .kbbar{padding:0 .2rem .2rem!important;margin-bottom:.15rem!important;gap:.3rem .8rem!important}
 body.kbpage .kbbar .lvnav .lvlink{font-size:13px!important}body.kbpage .kbbar .lvnav .lvlink small{display:none}
 body.kbpage .kbbar .actions .btn{min-height:30px!important}
 body.kbpage main.wrap .kbwrap{padding-top:.3rem}
}
@media (max-height:380px) and (orientation:landscape){
 body.kbpage .kbbar .actions .btn,body.kbpage .kbbar .seg button{min-height:26px!important;padding-top:0!important;padding-bottom:0!important}
 body.kbpage main.wrap .kb{height:6.2rem}
}
/* lessons and practice never scroll as a page (the card fits or scrolls inside itself), so no scrollbar can appear for a moment
   while a page loads and push everything sideways ("the window jumps" between levels, Dima 2 Nov) */
html:has(body[data-module]:not([data-theory="review"])),html:has(body.kbpage:not([data-theory="review"])){overflow-y:hidden}
/* the practice trainers' bar on top of the keys (in the page itself since 2 Nov, so nothing jumps when the page opens): ← Previous level · buttons · Next level → */
.kbbar{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:.4rem 1.2rem;margin:0 0 .45rem;padding:.1rem .3rem .45rem;border-bottom:1px solid var(--line)}
.kbbar .lvnav{display:contents}.kbbar .lvlink.prev{grid-column:1;grid-row:1;justify-self:start;max-width:100%}.kbbar .lvlink.next{grid-column:3;grid-row:1;justify-self:end;max-width:100%;margin-left:0}
.kbbar .actions{grid-column:2;grid-row:1;margin:0!important;padding:0!important;flex-wrap:nowrap}.kbbar .actions .guide{margin-left:.8rem}
.kbbar .actions .btn{box-sizing:border-box;height:1.95rem;min-height:0;padding:0 .95rem;line-height:1;display:inline-flex;align-items:center}.kbbar .actions .seg{box-sizing:border-box;height:1.95rem}.kbbar .actions .seg button{height:100%;padding:0 .95rem;line-height:1}

/* one row of settings (js/app.js oneRow): the groups after the line break shrink together when they would wrap */
.controls .brk~.group{zoom:var(--crz,1)}
/* full Scales trainer: the long list of scales takes the rest of its row and wraps inside it, Direction stays at its right end */
body.fulltrainer .controls #qualGroup{flex:1 1 0;min-width:0}body.fulltrainer .controls #qualChips{flex-wrap:wrap}

/* the logo/wordmark link never shows the browser link blue or visited purple (4 Dec 2026, Dima) */
a.brand,a.brand:visited,a.logohome,a.logohome:visited{color:var(--ink);text-decoration:none}
