/* Solfaboard — one stylesheet for every page. No inline styles anywhere (CSP: style-src 'self'). */
@font-face {
  font-family: "Noto Music";
  src: url("fonts/NotoMusic-subset.woff2?v=8baf404dd3") format("woff2");
  font-display: swap;
  unicode-range: U+266D-266F, U+1D100-1D1FF;
}
:root {
  --bar: #1d2030; --bar2: #2a2e42; --line: #33374a; --fg: #f4f1ea; --acc: #f0a830;
  --ink: #1d2030; --muted: #5b6072; --paper: #faf8f3; --link: #1c5fb0;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --music: "Noto Music", "Apple Symbols", "Segoe UI Symbol", serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); }
a { color: var(--link); }
img, svg { display: inline-block; vertical-align: middle; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }

/* ---------- site header ---------- */
.site { display: flex; align-items: center; gap: 16px; padding: 0 14px; height: 44px; background: var(--bar); color: var(--fg); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--fg); text-decoration: none; font-weight: 700; letter-spacing: .01em; }
nav.main { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; }
nav.main a { color: #c9cbd6; text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: 14px; white-space: nowrap; }
nav.main a:hover { background: var(--bar2); color: var(--fg); }
nav.main a[aria-current="page"] { color: var(--fg); background: var(--bar2); }

/* ---------- board page ---------- */
.app { height: 100vh; height: 100svh; min-height: 520px; display: flex; flex-direction: column; background: var(--bar); }
/* Toolbar: row 1 = what you put on the board, row 2 = how it looks and sounds (design: docs/design/toolbar-proposed.dc.html).
   One «on» look per kind: current tool = filled amber; toggles = amber icon; size = cream fill; colour = ring. */
#bar { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; background: var(--bar); color: var(--fg); border-top: 1px solid var(--line); }
#bar .row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.grp { display: flex; flex: none; gap: 4px; align-items: center; }
#bar .dot { flex: none; width: 5px; height: 5px; border-radius: 50%; background: #4a4f68; }
#bar .hair { flex: none; width: 1px; height: 22px; background: #3a3f55; margin: 0 4px; }
#bar button, .menu button, .view button, .view select {
  font: 14px/1 var(--sans); color: var(--fg); background: var(--bar2); border: 0; border-radius: 9px;
  min-width: 36px; height: 36px; padding: 0 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
#bar button:hover, .menu button:hover, .view button:hover { background: #363b54; }
#bar button:disabled, #bar button[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
#bar button[aria-busy="true"] { opacity: .6; cursor: progress; }
#bar button svg { width: 20px; height: 20px; flex: none; }
#bar .r1 button[aria-pressed="true"] { background: var(--acc); color: var(--bar); }
#bar .sym, .menu .sym { font-family: var(--music); line-height: 1; }
#bar .r1 .sym { font-size: 20px; }
#bar .notes .sym { min-width: 32px; padding: 0; font-size: 18px; }
#bar .notes [data-tool^="a"].sym { min-width: 30px; font-size: 17px; }
#bar .notes [data-tool="ax"].sym, #bar .notes [data-tool="abb"].sym { font-size: 16px; }
#bar .wide { padding: 0 12px; }
#bar .wide svg { width: 22px; }
#bar .tnum { font-weight: 700; font-size: 13px; letter-spacing: .02em; }
#bar .caret::after { content: "\25BE"; font-size: 11px; opacity: .8; }
/* row 2: 32 px */
#bar .r2 button { height: 32px; min-width: 32px; font-size: 13px; padding: 0 10px; color: #b9b6c6; }
#bar .r2 .actions button { color: var(--fg); }
#bar .r2 button[aria-pressed="true"] { color: var(--acc); }
#bar .r2 .tg .ic { font-weight: 700; }
#bar .pill { background: var(--bar2); border-radius: 9px; height: 32px; padding: 3px; gap: 2px; }
#bar .sizes button { height: 26px; min-width: 30px; padding: 0; border-radius: 7px; background: transparent; color: #b9b6c6; }
#bar .sizes button[aria-pressed="true"] { background: var(--fg); color: var(--bar); font-weight: 600; }
#bar .cols { padding: 0 9px; gap: 7px; }
#bar .cols .sw { min-width: 16px; width: 16px; height: 16px; padding: 0; border-radius: 50%; }
#bar .cols .sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bar2), 0 0 0 4px var(--fg); color: inherit; }
#bar .segp { display: inline-flex; gap: 1px; }
#bar .segp > button:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
#bar .segp > button:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
#bar .r2 .spacer { flex: 1 1 0; min-width: 0; height: 32px; position: relative; overflow: hidden; }
.c0 { background: #111111 !important; } .c1 { background: #e03131 !important; } .c2 { background: #1971c2 !important; }
.c3 { background: #2f9e44 !important; } .c4 { background: #f08c00 !important; } .c5 { background: #9c36b5 !important; }
.menu.bars-menu > button svg { width: 20px; height: 20px; }
#sound .on-only, #sound .off-only { display: none; }
#sound[aria-pressed="true"] .on-only, #sound[aria-pressed="false"] .off-only { display: inline; }
#play .stop, #play[aria-pressed="true"] .go { display: none; }
#play[aria-pressed="true"] .stop { display: inline; }
#board { position: relative; flex: 1 1 auto; min-height: 300px; overflow: hidden; background: #e7e5de; }
#cv { position: absolute; left: 0; top: 0; display: block; }
#scroller { position: absolute; inset: 0; overflow: auto; touch-action: none; cursor: crosshair; }
#sizer { width: 1px; height: 1px; }
#txt {
  position: absolute; z-index: 3; margin: 0; padding: 0; border: 0; outline: 2px dashed var(--acc); outline-offset: 3px;
  background: rgba(255, 255, 255, .92); font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-weight: 600;
  line-height: 1.2; resize: none; overflow: hidden; field-sizing: content; min-width: 4ch;
}
#txt.caps { text-transform: uppercase; }
#toast { pointer-events: none; position: absolute; left: 50%; top: auto; bottom: 78px; transform: translateX(-50%); z-index: 4; background: var(--bar); color: var(--fg);
  padding: 8px 14px; border-radius: 8px; font-size: 14px; box-shadow: 0 4px 18px rgba(0, 0, 0, .25); max-width: calc(100% - 32px); }
.view { position: absolute; right: 22px; bottom: 22px; z-index: 2; display: flex; gap: 3px; padding: 4px; border-radius: 10px;
  background: rgba(29, 32, 48, .88); box-shadow: 0 2px 10px rgba(0, 0, 0, .2); }
.view button, .view select { height: 30px; min-width: 30px; font-size: 15px; }
.view #zreset { min-width: 54px; font-size: 13px; }
.menu { position: fixed; z-index: 20; background: var(--bar); color: var(--fg); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); display: flex; flex-direction: column; gap: 4px; max-width: calc(100vw - 16px); }
.menu > button { justify-content: flex-start; width: 100%; padding: 0 10px; height: 38px; }
.menu .mh { margin: 4px 2px 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #aeb2c2; }
.menu .grid { display: grid; grid-template-columns: repeat(8, 38px); gap: 4px; }
.menu .grid button { min-width: 0; padding: 0; font-size: 13px; }
.menu .row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.menu input { width: 52px; height: 34px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 15px var(--sans); text-align: center; }
.menu .tsym { font-family: var(--music); font-size: 20px; }
@media (max-width: 760px) {
  #bar .row { gap: 6px 10px; }
  .grp { flex-wrap: wrap; max-width: 100%; }   /* a group wider than the screen wraps inside itself */
  #bar .dot, #bar .r2 .spacer { display: none; }
  .view { right: 14px; bottom: 14px; }
}

/* ---------- tooltip ---------- */
#tip { position: fixed; z-index: 50; max-width: 300px; padding: 8px 11px; border-radius: 8px; background: #fffdf7; color: var(--ink);
  border: 1px solid #d9d4c5; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); font-size: 13.5px; line-height: 1.4; pointer-events: none; }
#tip strong { display: block; font-size: 14px; margin-bottom: 2px; }
@media (prefers-reduced-motion: no-preference) { #tip { animation: tipin .08s ease-out; } @keyframes tipin { from { opacity: 0; transform: translateY(-2px); } } }

/* ---------- landing / prose ---------- */
.landing, .prose { max-width: 760px; margin: 0 auto; padding: 36px 20px 24px; }
.landing h1, .prose h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.2; margin: 0 0 14px; }
.landing h2, .prose h2 { font-size: 20px; margin: 28px 0 8px; }
.landing .lead { font-size: 18px; color: #2c3040; }
.landing ul, .prose ul { padding-left: 22px; }
.landing li, .prose li { margin: 6px 0; }
.landing ol { padding-left: 22px; }
.cta { display: inline-block; margin-top: 6px; padding: 10px 16px; border-radius: 8px; background: var(--bar); color: var(--fg); text-decoration: none; font-weight: 600; }
.small { font-size: 14px; color: var(--muted); }
.ad-slot { max-width: 760px; margin: 8px auto 0; padding: 0 20px; min-height: 0; }
.ad-slot::before { content: "Advertisement"; display: block; font-size: 11px; color: #8a8f9e; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.ad-slot ins.adsbygoogle { display: block; }
.ad-slot ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

/* ---------- footer & feedback ---------- */
.foot { border-top: 1px solid #e3dfd3; margin-top: 32px; padding: 20px; color: var(--muted); font-size: 14px; }
.foot .in { max-width: 760px; margin: 0 auto; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0 6px; }
.linkish { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; font: inherit; cursor: pointer; }
.fb summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.fb form { margin-top: 10px; display: grid; gap: 8px; max-width: 520px; }
.fb fieldset { border: 0; padding: 0; margin: 0; display: flex; gap: 16px; }
.fb textarea { width: 100%; font: 15px/1.4 var(--sans); padding: 8px; border: 1px solid #cfc9b8; border-radius: 8px; background: #fff; color: var(--ink); }
.fb button[type="submit"] { justify-self: start; padding: 8px 16px; border-radius: 8px; border: 0; background: var(--bar); color: var(--fg); font: 600 14px var(--sans); cursor: pointer; }
.fb button[disabled] { opacity: .5; cursor: not-allowed; }
.fb #fb-status { margin: 0; min-height: 1.4em; color: var(--ink); }

/* ---------- live keyboard page ---------- */
.kbd { height: calc(100vh - 44px); height: calc(100svh - 44px); min-height: 420px; display: flex; flex-direction: column;
  background: radial-gradient(ellipse at 50% 120%, #1f1840 0%, #0e0f1a 60%); color: var(--fg); overflow: hidden; }
.kbd-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 24px; color: #9a9fb3; font-size: 15px; }
.kbd-top button { background: #232641; color: var(--fg); border: 0; border-radius: 999px; padding: 8px 16px; font: 14px var(--sans); cursor: pointer; }
.kbd #stage { position: relative; flex: 1; }
.kbd #fx { position: absolute; inset: 0; width: 100%; height: 100%; }
.kbd #names { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 36px; flex-wrap: wrap; padding: 0 24px; pointer-events: none; }
.nm { font-size: min(13vw, 140px); font-weight: 800; line-height: 1; letter-spacing: -.02em; animation: pop .18s ease-out; }
.nm small { display: block; font-size: 26%; font-weight: 600; opacity: .65; text-align: center; margin-top: 10px; letter-spacing: .05em; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.kbd #keys { position: relative; height: 34vh; min-height: 200px; margin: 0 18px 18px; }
.w, .b { position: absolute; top: 0; border-radius: 0 0 10px 10px; transition: background .05s; }
.w { height: 100%; background: linear-gradient(#fbf9f4, #e9e4d8); border: 1px solid #1a1b26; }
.b { height: 62%; background: linear-gradient(#2b2d3a, #0b0c12); z-index: 2; border: 1px solid #000; border-radius: 0 0 7px 7px; }
.w.on, .b.on { background: var(--c); transform: translateY(2px); }
.w.held { background: color-mix(in srgb, var(--c) 45%, #fff); }
.b.held { background: color-mix(in srgb, var(--c) 45%, #000); }
.lbl { position: absolute; bottom: 12px; width: 100%; text-align: center; font-size: clamp(12px, 1.8vw, 24px); font-weight: 700; color: #8f8aa0; pointer-events: none; }
.lbl.c { color: #3a3550; }
@media (prefers-reduced-motion: reduce) { .nm { animation: none; } .w, .b { transition: none; } }

/* ---------- language menu (header) ---------- */
.langs { position: relative; }
.langs summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 6px; color: #c9cbd6; font-size: 13px; font-weight: 600; }
.langs summary::-webkit-details-marker { display: none; }
.langs summary:hover, .langs[open] summary { background: var(--bar2); color: var(--fg); }
.langs-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--bar); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px; display: grid; min-width: 160px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.langs-list a { color: #dfe1ea; text-decoration: none; padding: 7px 10px; border-radius: 6px; font-size: 14px; }
.langs-list a:hover { background: var(--bar2); }
.langs-list a[aria-current="true"] { color: var(--acc); }
@media (max-width: 560px) { nav.main a { padding: 6px 6px; font-size: 13px; } .brand span, .site .brand { font-size: 15px; } }

/* ---------- home page extras ---------- */
.landing .tagline { font-size: 19px; font-weight: 600; color: #2c3040; margin: 0 0 10px; }
.faq h3 { font-size: 17px; margin: 18px 0 4px; }
.faq p { margin: 0; }

/* ---------- live keyboard: playable keys ---------- */
.kbd #keys { touch-action: none; cursor: pointer; }

/* ---------- lessons ---------- */
.lessons .lx-hero { display: flex; gap: 28px; align-items: center; margin-bottom: 8px; }
.lessons .lx-photo { width: 220px; height: 220px; object-fit: cover; border-radius: 50%; flex: none; box-shadow: 0 6px 24px rgba(0, 0, 0, .15); }
.lessons .lx-hero h1 { margin-bottom: 8px; }
.lessons .offer { margin: 24px 0 8px; padding: 18px 20px; border-radius: 14px; background: #fff7e6; border: 1px solid #f3d9a4; }
.lessons .offer h2 { margin: 0 0 6px; }
.lessons .cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 8px; }
.lessons .cta.alt { background: #fff; color: var(--ink); border: 1px solid #cfc9b8; }
.lessons .price { margin: 0; font-size: 15px; color: #4a4f61; }
.ct { display: grid; gap: 6px; max-width: 520px; margin-top: 10px; }
.ct label { font-weight: 600; font-size: 15px; margin-top: 6px; }
.ct fieldset label { font-weight: 400; margin: 0; }
.ct input[type="text"], .ct input[type="email"], .ct select, .ct textarea {
  font: 16px/1.4 var(--sans); padding: 9px 10px; border: 1px solid #cfc9b8; border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
.ct fieldset { border: 0; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ct legend { font-weight: 600; font-size: 15px; padding: 0; margin-bottom: 4px; width: 100%; }
.ct button[type="submit"] { justify-self: start; margin-top: 8px; padding: 10px 18px; border-radius: 8px; border: 0; background: var(--bar); color: var(--fg); font: 600 15px var(--sans); cursor: pointer; }
.ct button[disabled] { opacity: .5; cursor: not-allowed; }
#ct-status { min-height: 1.4em; margin: 4px 0 0; font-weight: 600; }
@media (max-width: 600px) { .lessons .lx-hero { flex-direction: column; align-items: flex-start; } .lessons .lx-photo { width: 160px; height: 160px; } }

/* ---------- song form dialog ---------- */
.sf { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--bar); color: var(--fg); max-width: min(720px, calc(100vw - 24px)); width: 100%; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.sf::backdrop { background: rgba(10, 12, 20, .45); }
.sf-in { padding: 18px 20px; display: grid; gap: 10px; }
.sf h2 { margin: 0; font-size: 19px; }
.sf-row { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.sf label { display: grid; gap: 4px; font-size: 13px; color: #c9cbd6; }
.sf select, .sf input { font: 15px var(--sans); height: 34px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 0 8px; }
.sf #sf-per { width: 70px; }
.sf .mh { margin: 4px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #aeb2c2; }
.sf-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 40vh; overflow: auto; }
.chip { display: flex; align-items: center; gap: 3px; background: var(--bar2); border-radius: 9px; padding: 4px; }
.chip input[type="text"] { width: 108px; height: 30px; }
.chip input[type="number"] { width: 56px; height: 30px; }
.chip button, .sf-add button, .sf-btns button { font: 14px var(--sans); color: var(--fg); background: #363b54; border: 0; border-radius: 6px; min-width: 28px; height: 30px; cursor: pointer; }
.chip button:disabled { opacity: .35; cursor: default; }
.sf-add { display: flex; gap: 6px; }
.sf-add input { width: 200px; }
.sf-add button { padding: 0 12px; height: 34px; }
.sf-note { margin: 0; font-size: 13px; color: #aeb2c2; }
.sf-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.sf-btns button { padding: 0 16px; height: 36px; }
.sf-btns .primary { background: var(--acc); color: #1d2030; font-weight: 700; }
.sf-btns .primary:disabled { opacity: .5; }

/* ---------- live keyboard: spelling, chords, key ---------- */
.kbd .nm .alt { font-size: 45%; font-weight: 700; opacity: .75; margin-left: .25em; vertical-align: middle; }
.kbd .chord { text-align: center; line-height: 1; animation: pop .18s ease-out; }
.kbd .chord .sym { font-size: min(15vw, 160px); font-weight: 800; letter-spacing: -.02em; }
.kbd .chord .tones { margin-top: 14px; font-size: clamp(18px, 3vw, 34px); font-weight: 700; opacity: .85; }
.kbd .chord .chalt { margin-top: 10px; font-size: clamp(14px, 1.8vw, 20px); font-weight: 600; color: #c9cbd6; }
#keyinfo { position: absolute; left: 0; right: 0; top: 6px; margin: 0; text-align: center; font-size: 15px; font-weight: 600; color: #9a9fb3; pointer-events: none; min-height: 1.2em; }
@media (prefers-reduced-motion: reduce) { .kbd .chord { animation: none; } }

/* ---------- clear dialog and actionable toast ---------- */
.sf.clr { max-width: min(460px, calc(100vw - 24px)); }
.sf.clr .sf-note { font-size: 15px; color: #dfe1ea; }
.sf.clr .sf-btns { flex-wrap: wrap; }
#toast button { pointer-events: auto; margin-left: 8px; font: 600 14px var(--sans); color: var(--bar); background: var(--acc); border: 0; border-radius: 6px; padding: 4px 10px; cursor: pointer; }

/* ---------- board name (header) and the boards sidebar ---------- */
.site .bname { min-width: 0; width: 220px; max-width: 32vw; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--fg); font: 600 14px var(--sans); text-overflow: ellipsis; }
.site .bname::placeholder { color: #9a9fb3; }
.site .bname:hover { border-color: var(--line); }
.site .bname:focus { background: var(--bar2); border-color: var(--acc); outline: none; }
.boards { position: absolute; left: 0; top: 0; bottom: 0; z-index: 5; display: flex; pointer-events: none; }
.boards .btog { pointer-events: auto; cursor: pointer; }
.boards .btog:hover { opacity: 1; }
.boards .bpanel { display: none; }
.boards.open { pointer-events: auto; }
.boards.open .btog { order: 2; }
.boards.open .bpanel { display: flex; flex-direction: column; gap: 6px; width: min(300px, calc(100vw - 40px)); padding: 12px; background: var(--bar); color: var(--fg); box-shadow: 6px 0 24px rgba(0, 0, 0, .25); overflow: auto; }

.bpanel .mh { margin: 0 2px 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #aeb2c2; }
.bpanel button { font: 14px var(--sans); color: var(--fg); background: var(--bar2); border: 0; border-radius: 9px; cursor: pointer; }
.bpanel .bnew { height: 34px; text-align: left; padding: 0 12px; }
.bpanel .brow { display: flex; gap: 3px; align-items: center; }
.bpanel .bgo { flex: 1; min-width: 0; height: 34px; padding: 0 10px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: transparent; }
.bpanel .brow.on .bgo { background: #3a3420; color: var(--acc); font-weight: 600; }
.bpanel .bact { width: 28px; height: 28px; background: transparent; color: #b9b6c6; }
.bpanel .bact:hover, .bpanel .bgo:hover { background: #363b54; }
.bpanel .bact:disabled { opacity: .3; cursor: default; }
.bpanel .bren { flex: 1; min-width: 0; height: 32px; border-radius: 8px; border: 1px solid var(--acc); padding: 0 8px; font: 14px var(--sans); }
@media (max-width: 560px) { .site .bname { width: 120px; } }

/* ---------- radio menu ---------- */
#bar #radio [data-label="radio"] { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radio-menu { width: 300px; max-height: calc(100vh - 96px); display: flex; flex-direction: column; }
.radio-menu .rlist { overflow-y: auto; min-height: 0; flex: 1 1 auto; margin: 0 -4px; padding: 0 4px; overscroll-behavior: contain; }
.radio-menu .rgrp { margin: 0 0 4px; }
.radio-menu .rgrp > .rst { display: flex; width: 100%; margin: 0 0 2px; }
.radio-menu .rgh { margin: 6px 2px 2px; font-size: 11px; font-weight: 600; letter-spacing: .05em; color: #8f94a8; }
.radio-menu .rgh::first-letter { text-transform: uppercase; }
.radio-menu .rst .rnp { font-size: 12px; color: var(--fg); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radio-menu .rst .rnp::before { content: "\266A  "; color: var(--acc); }
.radio-menu .rstatus { overflow-wrap: anywhere; }
.radio-menu .rcredit { margin: 0 2px; font-size: 12px; color: #aeb2c2; }
.radio-menu .rsub { margin: 6px 2px 4px; font-size: 12px; color: #aeb2c2; }
.radio-menu .amb { display: flex; flex-wrap: wrap; gap: 4px; }
.radio-menu .amb .ach { height: 30px; padding: 0 10px; border-radius: 15px; font-size: 12.5px; width: auto; }
.radio-menu .amb .ach.on { background: #2f4a3c; color: #d8f5e4; box-shadow: inset 0 0 0 1px #4fbf86; }
.radio-menu .amb .ach.last::after { content: " \21BA"; color: #8f94a8; }
.radio-menu .avol { margin-top: 6px; }
.radio-menu .rcredit:empty { display: none; }
.radio-menu .rcredit a { color: var(--acc); }
.radio-menu .rst { flex-direction: column; align-items: flex-start; justify-content: center; height: auto; min-height: 44px; padding: 6px 10px; gap: 2px; }
.radio-menu .rst .rn { font-weight: 600; font-size: 14px; }
.radio-menu .rst .rg { font-size: 12px; color: #aeb2c2; }
.radio-menu .rst.on { background: #3a3420; }
.radio-menu .rst.on .rn { color: var(--acc); }
.radio-menu .rvol { display: flex; align-items: center; gap: 8px; margin: 4px 2px; }
.radio-menu .rvol input { flex: 1; accent-color: var(--acc); width: auto; height: auto; background: transparent; border: 0; }
.radio-menu .rstatus { margin: 0 2px; min-height: 1.3em; font-size: 13px; color: var(--fg); }
.radio-menu .roff { height: 32px; }
.radio-menu .rnote { margin: 2px; font-size: 11.5px; color: #8f94a8; line-height: 1.35; }

/* ---------- the cat corner (toolbar row 2) ---------- */
/* the cat corner sits in the top bar between the board name and the page links (cat.js moves it there) */
.catslot { flex: 1 1 240px; min-width: 0; height: 44px; position: relative; overflow: hidden; }
#bar .catslot { display: none; }
@media (max-width: 899px) { .catslot { flex: 0 0 64px; } }
@media (max-width: 600px) { .catslot { display: none; } }
@media (min-width: 601px) { .site .catslot ~ nav.main { flex-shrink: 0; } }
.cat .catx { border: 0; }
.radio-menu > :not(.rlist) { flex-shrink: 0; }
.cat { position: absolute; inset: 0; display: flex; align-items: center; gap: 10px; padding: 0 28px 0 4px; color: #c9cbd6; }
.cat .defs { position: absolute; }
.cat .stage { position: relative; flex: 1; height: 44px; min-width: 0; }
.cat .sc { position: absolute; top: 4px; height: 36px; width: auto; display: none; overflow: visible; }
.cat .catline { display: none; margin: 0; flex: 1; min-width: 0; font-size: 14.5px; font-style: italic; white-space: nowrap; overflow: hidden; text-align: center;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); }
.cat .catline .lt { padding: 0 14px; }
.cat .catline .lt { display: inline-block; white-space: nowrap; will-change: transform; }
.cat .catline.scroll { text-align: left; }
.cat .catline.wrap { white-space: normal; font-size: 13px; line-height: 16px; -webkit-mask-image: none; mask-image: none; }
.cat .catline.wrap .lt { white-space: normal; display: inline; }
.cat .catline.tick { animation: catslide .6s ease-out both; }
.cat[data-mode="still"] .catline.tick { animation: none; }
.cat[data-mode="line"] .stage { display: none; } .cat[data-mode="line"] .catline { display: block; }
.cat[data-mode="walk"] .walk { display: block; animation: catwalk 10s ease-in-out both; }
.cat .sway { animation: catsway 1.8s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
.cat .tilt { animation: cattilt 3s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 90%; }
.cat[data-mode="listen"] .listen { display: block; left: 26%; }
.cat[data-mode="hop"] .hop { display: block; left: 10%; }
.cat[data-mode="peek"] .peek { display: block; left: 36%; }
.cat .hopper { animation: cathop 9s ease-in-out both; }
.cat .peeker { animation: catpeek 4.5s ease-in-out infinite; }
.cat .f3 { animation-delay: 2.2s; }
.cat[data-mode="nap"] .nap { display: block; left: 34%; }
.cat[data-mode="still"] .nap { display: block; left: 0; }
.cat[data-mode="still"] .catline { display: block; animation: none; }
.cat[data-mode="still"] .stage { flex: 0 0 70px; }
.cat.both .stage { flex: 0 0 132px; }
.cat.both.tight .stage { flex: 0 0 64px; }
.cat.both .catline { display: block; }
.cat.both.tight .nap { left: 0; }
@media (max-width: 1299px) { .site .bname { width: 170px; } }
.cat .bob { animation: catbob 2.4s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 30% 90%; }
.cat .fly { animation: catfly 3.2s ease-in-out infinite; opacity: 0; }
.cat .f2 { animation-delay: 1.6s; }
.cat .pop { opacity: 0; animation: catpop 9s ease-in-out both; }
.cat .p2 { animation-name: catpop2; } .cat .p3 { animation-name: catpop3; }
.cat .z { fill: #c9cbd6; font: italic 700 9px var(--sans); animation: catz 3s ease-in-out infinite; opacity: 0; }
.cat .z2 { animation-delay: 1.5s; }
.cat .catx { position: absolute; right: 2px; top: 12px; width: 20px; height: 20px; min-width: 0; padding: 0; border-radius: 50%; font-size: 14px; line-height: 1; background: transparent; color: #8f94a8; }
.cat .catx:hover { background: var(--bar2); color: var(--fg); }
.cat.paused * { animation-play-state: paused !important; }
@keyframes catwalk { from { left: 0; } to { left: calc(100% - 26px); } }
@keyframes cathop { 0%, 6% { transform: translate(0, 0); } 10% { transform: translate(13px, -7px); } 14%, 42% { transform: translate(26px, 0); } 46% { transform: translate(39px, -7px); } 50%, 78% { transform: translate(52px, 0); } 82% { transform: translate(65px, -7px); } 86%, 100% { transform: translate(78px, 0); } }
@keyframes catpeek { 0%, 12% { transform: translateY(16px); } 38%, 70% { transform: translateY(0); } 92%, 100% { transform: translateY(16px); } }
@keyframes catsway { from { transform: rotate(-3deg) translateY(0); } to { transform: rotate(3deg) translateY(-1px); } }
@keyframes cattilt { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
@keyframes catbob { from { transform: translateY(0) rotate(-1.5deg); } to { transform: translateY(-1px) rotate(1.5deg); } }
@keyframes catfly { 0% { opacity: 0; transform: translate(0, 4px); } 35% { opacity: .95; } 100% { opacity: 0; transform: translate(5px, -9px); } }
@keyframes catpop { 0%, 13% { opacity: 0; } 18%, 100% { opacity: 1; } }
@keyframes catpop2 { 0%, 49% { opacity: 0; } 54%, 100% { opacity: 1; } }
@keyframes catpop3 { 0%, 85% { opacity: 0; } 90%, 100% { opacity: 1; } }
@keyframes catz { 0% { opacity: 0; transform: translate(0, 2px); } 40% { opacity: .9; } 100% { opacity: 0; transform: translate(4px, -6px); } }
@keyframes catslide { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cat * { animation: none !important; } }

/* ---------- tiny musical fireworks over a toolbar button (clipped to the toolbar) ---------- */
.fwlayer { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 60; }
.fwlayer .fw { position: absolute; font-weight: 700; font-family: var(--music), var(--sans); line-height: 1; transform: translate(-50%, -50%); opacity: 0;
  text-shadow: 0 0 1px rgba(0, 0, 0, .55), 0 1px 3px rgba(0, 0, 0, .35); will-change: transform, opacity; }
@media (prefers-reduced-motion: reduce) { .fwlayer { display: none; } }

/* keep a person's name together; balance the heading's lines */
.keep { white-space: nowrap; }
.lessons h1 { text-wrap: balance; }

/* toolbar music glyphs: centred on their ink box by assets/glyphfit.js */
#bar button.sym.fitted { position: relative; overflow: hidden; }
#bar button.sym .gl .bl { display: inline-block; width: 0; height: 0; vertical-align: baseline; }
#bar button.sym .gl { position: absolute; left: 0; top: 0; line-height: 1; white-space: nowrap; font-family: var(--music); pointer-events: none; }

/* ---------- radio mini-player (floats on pages without the board toolbar; persists across pages) ---------- */
.mini { position: fixed; z-index: 40; display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 8px; max-width: calc(100vw - 24px);
  background: var(--bar); color: var(--fg); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  font: 600 13px var(--sans); cursor: grab; touch-action: none; transition: top .2s, bottom .2s, left .2s, right .2s; }
.mini[data-corner="br"] { right: 16px; bottom: 16px; } .mini[data-corner="bl"] { left: 16px; bottom: 16px; }
.mini[data-corner="tr"] { right: 16px; top: 16px; } .mini[data-corner="tl"] { left: 16px; top: 16px; }
.mini.lift[data-corner="br"], .mini.lift[data-corner="bl"] { bottom: auto; top: 16px; }
.mini.dragging { cursor: grabbing; transition: none; opacity: .9; }
.mini .mcat { width: 26px; height: 26px; margin-top: -16px; flex: none; }
.mini.playing .mcat { animation: minibob .55s ease-in-out infinite alternate; }
.mini .mtxt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.mini .mname { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .mnp { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: #aeb2c2; }
.mini button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--bar2); color: var(--fg); cursor: pointer; font: 12px var(--sans); flex: none; }
.mini button:hover { background: #363b54; }
.mini .mvol { width: 70px; accent-color: var(--acc); }
@keyframes minibob { from { transform: translateY(0); } to { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .mini.playing .mcat { animation: none; } .mini { transition: none; } }
@media (max-width: 480px) { .mini .mvol { display: none; } .mini .mname, .mini .mnp { max-width: 120px; } }
.radio-menu .rst.last .rn::after { content: " \21BA"; color: #8f94a8; font-weight: 400; }

/* templates menu: one icon column, every icon centred in a 28 × 28 box, labels on one line and one x */
.menu.tpl-menu > button { gap: 10px; height: 40px; padding: 0 12px 0 8px; }
.menu .ti { position: relative; flex: none; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.menu .ti[data-g] { font-family: var(--music); }
.menu .ti .gl { position: absolute; left: 0; top: 0; line-height: 1; white-space: nowrap; font-family: var(--music); }
.menu .ti .gl .bl { display: inline-block; width: 0; height: 0; vertical-align: baseline; }
.menu .ti svg { width: 22px; height: 22px; }
/* boards sidebar handle: an obvious tab with an icon; its label slides out on hover or focus */
.boards .btog { position: relative; width: 26px; height: 92px; margin-top: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: var(--bar); color: var(--fg); border: 1px solid var(--acc); border-left: 0; border-radius: 0 10px 10px 0; opacity: 1; box-shadow: 2px 2px 10px rgba(0, 0, 0, .2); }
.boards .btog svg { width: 16px; height: 16px; }
.boards .btog .bchev { font-size: 10px; color: var(--acc); }
.boards .btog .blabel { position: absolute; left: 30px; top: 50%; transform: translateY(-50%); padding: 4px 9px; border-radius: 7px; background: var(--bar); color: var(--fg);
  font: 600 12px var(--sans); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; }
.boards .btog:hover .blabel, .boards .btog:focus-visible .blabel { opacity: 1; }
.boards.open .btog .blabel { display: none; }
.boards.open .btog .bchev { transform: rotate(180deg); }
/* ---------- score header (editable in place, scrolls and zooms with the board) ---------- */
.hdr { position: absolute; left: 0; top: 0; height: 110px; transform-origin: 0 0; z-index: 2; pointer-events: none; }
.hdr input { pointer-events: auto; border: 1px dashed transparent; border-radius: 6px; background: transparent; color: #111; padding: 2px 6px; font-family: var(--sans); }
.hdr input:hover { border-color: #cfc9b8; } .hdr input:focus { border-color: var(--acc); background: rgba(255, 255, 255, .9); outline: none; }
.hdr input::placeholder { color: #b9b4a5; }
.hdr .h-title { position: absolute; left: 20%; width: 60%; top: 18px; text-align: center; font: 700 30px var(--sans); }
.hdr .h-tempo { position: absolute; left: 34px; top: 70px; width: 260px; font: italic 700 16px var(--sans); }
.hdr .h-credits { position: absolute; right: 34px; top: 18px; display: grid; gap: 2px; justify-items: end; }
.hdr .h-credits label { pointer-events: auto; font: 500 14px var(--sans); color: #111; display: flex; align-items: center; gap: 4px; }
.hdr .h-credits input { width: 190px; font: 500 14px var(--sans); text-align: right; }
@supports (field-sizing: content) { .hdr .h-credits input { field-sizing: content; width: auto; min-width: 80px; max-width: 280px; } }

/* compact row 2: Export is one split button, Instrument and Title are icons (names in tooltips and menus) */
#bar .export .expc { min-width: 0; width: 24px; padding: 0; }
#bar .export .expc svg { width: 14px; height: 14px; }
#instb #inst-l, #hdrb [data-label] { display: none; }
#radio [data-label="radio"] { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#exp-menu > button { justify-content: space-between; gap: 18px; min-width: 190px; }
#exp-menu > button .small { color: #aeb2c2; font-size: 12px; }
/* 1100–1299 px: keep the toolbar to two rows, icons only (each button keeps its name in the tooltip) */
@media (min-width: 761px) and (max-width: 1299px) {
  #bar .row { gap: 6px 7px; }
  #bar [data-label="staff"], #bar [data-label="tpl"], #bar [data-label="sound"], #bar [data-label="names"], #bar [data-label="wand_short"],
  #bar #radio [data-label="radio"], #bar [data-label="cat"], #bar #exp-l { display: none; }
  #bar .r1 button { min-width: 32px; padding: 0 6px; }
  #bar .notes .sym { min-width: 30px; }
  #bar .notes [data-tool^="a"].sym { min-width: 28px; }
  #bar .r2 button { padding: 0 8px; }
  #bar .cols { gap: 5px; padding: 0 7px; }
}

/* the Library drawer (assets/library.js) */
.lib { position: fixed; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 30; background: #fbfaf6; color: var(--ink, #1c1533);
  border-left: 1px solid #e3ded2; box-shadow: -8px 0 24px rgba(0, 0, 0, .12); display: flex; flex-direction: column; }
.lib[hidden] { display: none; }
.lib-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #e9e4d8; }
.lib-top h2 { margin: 0; font-size: 17px; flex: 1; }
.lib-top button { border: 0; background: transparent; cursor: pointer; font: 600 14px var(--sans); color: #5b5470; padding: 6px 8px; border-radius: 8px; }
.lib-top button:hover { background: #efebe1; }
.lib-x { font-size: 20px !important; line-height: 1; }
.lib-body { overflow-y: auto; padding: 10px 12px 18px; flex: 1; overscroll-behavior: contain; }
.lib-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; align-items: center; }
.lib-levels .small { margin-right: 4px; color: #6b6480; }
.lib-chip { border: 1px solid #ddd6c6; background: #fff; border-radius: 14px; padding: 4px 10px; font: 12.5px var(--sans); cursor: pointer; color: #3b3450; }
.lib-chip.on { background: #1c1533; color: #fff; border-color: #1c1533; }
.lib-list { display: grid; gap: 8px; }
.lib-card { text-align: left; border: 1px solid #e6e0d2; background: #fff; border-radius: 10px; padding: 9px 11px; cursor: pointer; display: grid; gap: 2px; font: 13px var(--sans); color: #1c1533; }
.lib-card:hover { border-color: #b9a2ff; box-shadow: 0 2px 8px rgba(138, 99, 255, .12); }
.lib-ct { font-weight: 700; font-size: 14px; }
.lib-cm { color: #6b6480; font-size: 12px; margin: 0; }
.lib-cb { color: #3b3450; font-size: 12.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-note { color: #7a7390; font-size: 12px; margin-top: 12px; }
.lib-detail h3 { margin: 4px 0 2px; font-size: 18px; }
.lib-detail p { font-size: 13.5px; line-height: 1.45; }
.lib-go { border: 0; background: #8A63FF; color: #fff; border-radius: 9px; padding: 9px 14px; font: 600 14px var(--sans); cursor: pointer; margin: 4px 0 10px; }
.lib-go:hover { background: #7652f0; } .lib-go:disabled { opacity: .6; }
.lib-follow { background: #1c1533; }
.lib-rec { border-top: 1px solid #e9e4d8; padding-top: 10px; margin-top: 6px; }
.lib-h4 { font-weight: 700; margin: 0 0 6px; }
.lib-rec audio { width: 100%; }
.lib-attr { font-size: 12px !important; color: #6b6480; }
.lib-attr a { color: #5b3fd6; }
.lib-svg svg { width: 100%; height: auto; display: block; background: #fff; border: 1px solid #ece7db; border-radius: 8px; }
.lib-svg .sym { transition: fill .08s; }
.lib-svg .sym.on, .lib-svg .sym.on * { fill: #e8590c; stroke: #e8590c; }

#inst-menu > button[aria-pressed="true"] { background: #3a3420; color: var(--acc); }
#inst-menu > button[aria-pressed="true"]::after { content: "✓"; margin-left: auto; font-weight: 700; }
#inst-menu > button { justify-content: space-between; gap: 14px; min-width: 150px; }
.aud-menu { gap: 8px; min-width: 210px; }
.aud-menu .aud-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #c9cbd6; }
.aud-menu select { flex: 1; height: 32px; border-radius: 7px; border: 1px solid var(--line); background: var(--bar2); color: var(--fg); font: 14px var(--sans); padding: 0 6px; }
.aud-menu #aud-go { background: var(--acc); color: var(--bar); font-weight: 600; }

/* the board name is as wide as its text (boards.js sets the width) up to ~40% of the bar; the cat ticker gives way first */
.site .bname { flex: 0 0 auto; max-width: 40vw; }
@media (max-width: 1299px) { .site .bname { max-width: 34vw; } }
@media (max-width: 899px) { .site .bname { flex: 0 1 auto; } }
@media (max-width: 560px) { .site .bname { max-width: 36vw; min-width: 104px; } }
.bpanel .bgo { height: auto; min-height: 34px; padding: 5px 10px; white-space: normal; line-height: 1.25; }
.bpanel .bgo .bgt { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

/* tempo control next to Play */
#bar .tempo { display: inline-flex; align-items: center; gap: 1px; background: var(--bar2); border-radius: 9px; height: 32px; padding: 0 2px; }
#bar .tempo .tq-b { min-width: 22px; width: 22px; padding: 0; background: transparent; font-size: 15px; }
#bar .tempo .tq { display: inline-flex; align-items: center; gap: 1px; font: 600 13px var(--sans); color: var(--fg); cursor: ns-resize; padding: 0 2px; }
#bar .tempo .tq span { font-family: var(--music), var(--sans); font-size: 15px; }
#bar .tempo input { width: 30px; height: 24px; border: 0; border-radius: 5px; background: transparent; color: var(--fg); font: 600 13px var(--sans); text-align: center; padding: 0; }
#bar .tempo input:focus { background: #fff; color: var(--ink, #111); outline: none; }
#bar .tempo .tq-x { min-width: 30px; padding: 0 5px; background: transparent; font-size: 12px; }
#bar .tempo .tq-x[aria-pressed="true"] { color: var(--acc); }
#bar .tempo .tq-x { min-width: 40px; }
.lib-detail .lib-tempo { font-size: 12.5px; color: #6b6480; margin: -4px 0 10px; }
@media (min-width: 1500px) { #instb #inst-l { display: inline; } }

/* «Original notation» on a board transcribed from another writing system (Library) */
.orig { position: absolute; left: 40px; bottom: 22px; z-index: 3; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: calc(100% - 300px); }
.orig[hidden] { display: none; }
.orig > button { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--bar); color: var(--fg); font: 600 13px var(--sans); box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.orig > button svg { width: 16px; height: 16px; flex: none; }
.orig > button[aria-expanded="true"] { color: var(--acc); }
.orig figure { position: relative; margin: 0; width: min(620px, calc(100vw - 90px)); max-height: 56vh; overflow: auto; background: #fff; border: 1px solid #d9d4c7; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.orig figure[hidden] { display: none; }
.orig figure img { display: block; width: 100%; height: auto; }
.orig .orig-x { position: absolute; right: 6px; top: 6px; width: 28px; height: 28px; border: 0; border-radius: 7px; background: rgba(30, 33, 48, .8); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
@media (max-width: 760px) { .orig { left: 14px; bottom: 64px; max-width: calc(100% - 28px); } .orig figure { width: calc(100vw - 28px); } }
.lib-card .lib-thumb { display: block; width: 100%; height: 64px; object-fit: cover; object-position: left top; margin: 6px 0 2px; background: #fff; border: 1px solid #ece7db; border-radius: 6px; }
