/* Tonalius — the app: a browser of 2048 scales and chords in the look of pro audio software (CLAUDE.md, "The web app").
   Full page — the app is the viewport, panels scroll inside it; no pop-up, offcanvas allowed; desktop, tablet, phone. */
:root {   /* the colours and fonts are css/tokens.css, shared with the documentation (about/) */
  --bar-h: 58px;
  --strip-h: 40px;
  --keys-h: clamp(120px, 20dvh, 200px);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.35 var(--ui);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.app {
  height: 100dvh;
  display: grid;
  position: relative;   /* the grips below are placed on the panels' grid areas */
  grid-template:
    "bar bar bar" var(--bar-h)
    "strip strip strip" var(--strip-h)
    "filt list detail" 1fr
    "keys keys keys" var(--keys-h) / var(--filt-w, 270px) minmax(0, 1fr) var(--det-w, minmax(380px, 470px));
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ——— bar ——— */
.bar {
  grid-area: bar;
  display: flex; align-items: center; gap: 12px;
  padding: 0 12px;
  background: linear-gradient(var(--bar-a), var(--bar-b));
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--hi);
  min-width: 0;
}
.title { margin: 0; font-size: inherit; flex: none; display: flex; }   /* the page's h1: the logo, named for screen readers */
.brand { display: flex; flex-direction: column; line-height: 1.05; flex: none; color: inherit; text-decoration: none; }
/* the logo (his of 2026-10-03, "usiamolo al posto del titolo e sottotitolo"; Tonalius's since 2026-10-06, scripts/build/logo.py):
   img/logo.svg as a mask, so it takes the text's colour */
.logo { display: block; height: 28px;   /* 36, then 32 ("riducilo un pochino…"), then 28 ("riduci ancora un po") */ aspect-ratio: 1920 / 442; background: var(--text);
  -webkit-mask: url(../img/logo.svg) center / contain no-repeat; mask: url(../img/logo.svg) center / contain no-repeat; }
.brand:hover .logo { background: var(--strong); }
.search {
  flex: 1 1 260px; min-width: 120px;
  display: flex; align-items: center;
  height: 38px;
  padding: 3px;
  border-radius: 8px;
  background: var(--search-frame);
  box-shadow: 0 1px 0 var(--hi);
}
.search input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; border-radius: 5px 0 0 5px;
  padding: 0 12px;
  background: linear-gradient(var(--field-a), var(--field-b));
  color: var(--field-ink);
  font: 500 17px var(--lcd-font);
  letter-spacing: .02em;
  outline: none;
}
.search input::placeholder { color: var(--field-dim); }
.search input:focus { box-shadow: inset 0 0 0 1px rgba(124, 196, 255, .5); }
.count-lcd {
  display: flex; align-items: center; height: 100%;
  padding: 0 12px;
  border-radius: 0 5px 5px 0;
  background: linear-gradient(var(--field-a), var(--field-b));
  border-left: 1px solid var(--field-edge);
  color: var(--count-ink);
  font: 600 18px var(--lcd-font);
  text-shadow: 0 0 8px var(--count-glow);
  min-width: 58px; justify-content: center;
}
.transport, .tools { display: flex; align-items: center; gap: 6px; flex: none; }
.tools { gap: 8px; }
.tbtn {
  width: 34px; height: 30px;
  border: 1px solid var(--line); border-radius: 6px;
  background: linear-gradient(var(--btn-a), var(--btn-b));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 1px 1px rgba(0, 0, 0, .4);
}
.tbtn:active { background: linear-gradient(var(--btn-press-a), var(--btn-press-b)); }
.tbtn.play { width: 46px; font-size: 15px; }
.tbtn.play.lit { background: linear-gradient(#5ee274, #23a53b); color: #04230b; }
.tbtn.lit { background: linear-gradient(var(--accent), var(--accent-2)); color: #ffffff; }
.tbtn.info { display: inline-grid; place-items: center; color: var(--text); text-decoration: none; }   /* the documentation, about/ */
.tbtn.info svg, .kb-btn.info-alt svg { width: 16px; height: 16px; }
.kb-btn.info-alt { display: none; place-items: center; text-decoration: none; color: inherit; }
.tbtn.fs { display: inline-grid; place-items: center; color: var(--text); }   /* full screen, where the browser allows it */
.tbtn.fs[hidden] { display: none; }
.tbtn.fs svg { width: 16px; height: 16px; }
.tbtn.rs { display: inline-grid; place-items: center; color: var(--text); }   /* the settings back to the start */
.tbtn.rs svg, .kb-btn.reset-alt svg { width: 16px; height: 16px; }
.kb-btn.reset-alt { display: none; place-items: center; color: inherit; }
.tbtn.th, .kb-btn.theme-alt { display: inline-grid; place-items: center; color: var(--text); }   /* Dark / Light */
.kb-btn.theme-alt { display: none; color: inherit; }
.tbtn.th svg, .kb-btn.theme-alt svg { width: 16px; height: 16px; }
.ico-moon, :root[data-theme="light"] .ico-sun { display: none; }
:root[data-theme="light"] .ico-moon { display: block; }
.tbtn.fs .ico-out, .tbtn.fs.lit .ico-in { display: none; }
.tbtn.fs.lit .ico-out { display: block; }
.filt-toggle { display: none; }
.seg.lang-alt { display: none; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; box-shadow: 0 1px 1px rgba(0, 0, 0, .4); flex: none; }
.seg button { border: 0; padding: 6px 10px; background: linear-gradient(var(--seg-a), var(--seg-b)); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.lit { background: linear-gradient(var(--accent), var(--accent-2)); color: #ffffff; text-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.seg.small button { padding: 5px 8px; font-size: 11px; }
.knob-wrap { display: flex; align-items: center; gap: 6px; color: var(--dim); }
.knob-wrap small { white-space: nowrap; }
.knob {
  --a: 0deg;
  position: relative; display: inline-block; flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, var(--knob-a), var(--knob-b) 55%, var(--knob-c) 100%);
  box-shadow: 0 2px 3px rgba(0, 0, 0, .6), inset 0 1px 1px rgba(255, 255, 255, .35);
  cursor: ns-resize; touch-action: none;
}
.knob::after {
  content: ""; position: absolute; left: 50%; top: 3px;
  width: 2px; height: 34%; margin-left: -1px;
  background: var(--knob-mark); border-radius: 1px;
  transform-origin: 50% 12px;
  transform: rotate(var(--a));
}
.knob:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.dark-select { height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: linear-gradient(var(--ctl-a), var(--ctl-b)); }
.led-btn {
  height: 30px; padding: 0 10px 0 22px; position: relative;
  border: 1px solid var(--line); border-radius: 6px;
  background: linear-gradient(var(--ctl-a), var(--ctl-b)); font-size: 12px;
}
.led-btn::before {
  content: ""; position: absolute; left: 8px; top: 50%;
  width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%;
  background: #4a2a10; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .6);
}
.led-btn.lit::before { background: var(--led); box-shadow: 0 0 8px var(--led); }
.led-btn.off { opacity: .45; }

/* ——— the key strip: the twelve keys, for everything ——— */
.strip {
  grid-area: strip;
  display: flex; align-items: center; gap: 12px;
  padding: 0 12px;
  background: linear-gradient(var(--strip-a), var(--strip-b));
  border-bottom: 1px solid var(--line);
}
.keyset { display: flex; gap: 3px; flex: none; }
body.keys-up { --strip-h: 0px; }   /* the keys up in the bar (main.js placeKeys): no strip */
body.keys-up .strip { display: none; }
.keyset button {
  min-width: 38px; height: 28px; padding: 0 6px;
  border: 1px solid #000000; border-radius: 4px;
  font: 600 14px var(--lcd-font);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.keyset .kw { background: linear-gradient(#f6f6f7, #d1d4d9); color: #1d2127; }
.keyset .kb { background: linear-gradient(#323946, #101216); color: #dadce0; }
.keyset .lit { background: linear-gradient(#ffd892, var(--led) 60%, var(--led-2)); color: #3b2000; box-shadow: 0 0 10px rgba(255, 170, 50, .55); }

/* ——— filters ——— */
.filters {
  grid-area: filt;
  container-type: inline-size;   /* the LED grids below read the panel's width */
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;   /* the map stays, the rest scrolls (.f-rest) */
  background: var(--panel);
  border-right: 1px solid var(--line);
  box-shadow: inset -1px 0 0 var(--hi);
}
.f-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: linear-gradient(var(--fhead-a), var(--fhead-b)); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.f-sec { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 var(--hi); }
/* the map's height set by its grip (his "una maniglia anche sotto la mappa in modo da modificare l'altezza della parte
   inferiore"): the map fits the height it is given, the filters below scroll on their own */
.f-map-sec { flex: none; height: var(--map-h, auto); max-height: 50%; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }   /* not dragged: half its panel at most */
.f-map-sec .world { flex: 1; min-height: 0; }
.f-map-sec .world svg { height: 100%; }
.f-rest { flex: 1; min-height: 0; overflow: auto; }
.f-sec h2 { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.f-hint { margin: -4px 0 8px; color: var(--dim); font-size: 11px; }
.led-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
/* a panel widened by its grip gives the number of notes and the twelve notes one row each (his "ad una certa larghezza
   divetano 12 colonne, così stanno su una riga sola"): from 460 px inside the panel (a scrollbar that takes room counts out),
   a cell then about 33 px, "A#" still at ease */
@container (min-width: 460px) { .led-grid { grid-template-columns: repeat(12, 1fr); } }
.chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: flex-start; }   /* side by side, wrapping as the panel allows (his "si comportano inline-block") */
/* Origin: a subregion and its traditions one block, the blocks side by side and wrapping as the panel allows — a wide panel
   holds a continent on a line or two (his "organizzare i bottoni di filtro in modo che si riducano le righe", "Gruppi
   affiancati"); a block wider than the panel wraps inside itself; more room between blocks than inside one */
#f-trad { column-gap: 14px; row-gap: 6px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 4px; max-width: 100%; }
.chips h3.macro { width: 100%; margin: 6px 0 0; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }   /* M49's macro-region */
.chips h3.macro:first-child { margin-top: 0; }
.chip {
  --c: #9aa;
  padding: 4px 9px 4px 20px; position: relative;
  border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(var(--chip-a), var(--chip-b));
  font-size: 12px; text-align: left;
}
.led-grid .chip { padding: 5px 0; text-align: center; border-radius: 5px; }
.chip::before {
  content: ""; position: absolute; left: 8px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%;
  background: color-mix(in srgb, var(--c) 35%, var(--chip-base)); opacity: .9;
}
.led-grid .chip::before { display: none; }
.chip.lit { background: linear-gradient(color-mix(in srgb, var(--c) 45%, var(--chip-lit-top)), color-mix(in srgb, var(--c) 25%, var(--chip-base))); color: var(--chip-lit-ink); border-color: color-mix(in srgb, var(--c) 60%, var(--chip-lit-edge)); }
.chip.lit::before { background: var(--c); box-shadow: 0 0 6px var(--c); }
.led-grid .chip.lit { background: linear-gradient(#ffd892, var(--led) 60%, var(--led-2)); color: #3b2000; border-color: #b06a12; }
.world, .mini-map { border-radius: 6px; padding: 6px; background: radial-gradient(ellipse at 50% 40%, var(--map-a), var(--map-b) 75%); box-shadow: inset 0 1px 4px var(--edge), 0 1px 0 var(--hi); }
.world svg { width: 100%; height: auto; display: block; }
.world .rest, .mini-map .rest { fill: var(--map-rest); }
.world [data-region] { opacity: .62; }
.world [data-region].lit { opacity: 1; }
.world [data-region], .mini-map [data-region] { cursor: pointer; transition: filter .15s, opacity .15s; }
.world [data-region]:hover { filter: brightness(1.3); }
.world [data-region].lit, .mini-map [data-region].lit { filter: brightness(1.45) drop-shadow(0 0 3px rgba(255, 255, 255, .35)); }
.mini-map [data-region]:not(.lit) { opacity: .35; }

/* ——— list ——— */
.browser { grid-area: list; display: flex; flex-direction: column; min-height: 0; background: var(--browser); position: relative; }
/* ID, Notes, Qt. and Symbol as wide as their widest cell (--w-*, measured by main.js), Name taking the rest, then the play button */
.list-head, .row { --play-w: 40px; display: grid; grid-template-columns: var(--w-id, auto) var(--w-notes, auto) var(--w-qt, auto) var(--w-sym, auto) minmax(0, 1fr) var(--play-w); align-items: center; gap: 8px; padding: 0 12px; }
.list-head > span { white-space: nowrap; overflow: hidden; }
/* one column, on a phone or in a list too narrow for Symbol (main.js folds it): the name a set is shown by */
.one-col > .list-head, .one-col .row { grid-template-columns: var(--w-id, auto) var(--w-notes, auto) var(--w-qt, auto) minmax(0, 1fr) var(--play-w); }
.one-col > .list-head > span:nth-child(4) { display: none; }
.measure { position: absolute; left: 0; top: 0; height: 0; overflow: hidden; visibility: hidden; pointer-events: none; display: grid; grid-template-columns: repeat(5, max-content); }
.measure > div { display: contents; }   /* the header's words and the longest cells, as grid items */
.list-head { height: 28px; flex: none; color: var(--dim); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; background: linear-gradient(var(--lhead-a), var(--lhead-b)); border-bottom: 1px solid var(--line); }
.list { --row-h: 38px; flex: 1; overflow: auto; outline: none; overflow-anchor: none; }   /* a row's height, read by main.js's window; the window drawn again keeps its place */
.list:empty { display: none; }
/* the first visit, while the dataset arrives (his "ok facciamolo"): written by the page, gone at the first list; a LED that
   breathes, still where motion is reduced */
.loading { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; padding: 24px;
  color: var(--dim); font: 500 14px/1.4 var(--lcd-font); letter-spacing: .08em; text-transform: uppercase; text-align: center; }
.loading i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--led); box-shadow: 0 0 8px var(--led);
  animation: breathe 1s ease-in-out infinite alternate; }
.loading.failed i { background: #ff5a4f; box-shadow: 0 0 8px #ff5a4f; animation: none; }
@keyframes breathe { from { opacity: .25; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .loading i { animation: none; } }
.row { height: var(--row-h); content-visibility: auto; contain-intrinsic-size: auto var(--row-h); border-bottom: 1px solid var(--row-line); box-shadow: 0 1px 0 var(--row-hi); cursor: pointer; }
.row.odd { background: var(--row-alt); }   /* by the row's place in the list: the window starts anywhere */
.row:hover { background: var(--row-hover); }
.row.sel { background: linear-gradient(#3d9b45, #2c7d34); color: #ffffff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
.c-id { font: 500 15px var(--lcd-font); color: var(--dim); white-space: nowrap; }
.row.sel .c-id { color: #d9ffd9; }
.c-notes { font: 500 15px var(--lcd-font); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-qt { font: 500 15px var(--lcd-font); text-align: center; color: var(--dim); white-space: nowrap; }
.c-sym { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-sym em { font-style: normal; color: var(--dim); font-size: 11px; margin-left: 6px; }   /* the symbol's other spellings, counted */
.row.sel .c-sym em { color: #d9ffd9; }
.row.sel .c-qt { color: #ffffff; }
.c-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.c-name .lbl { overflow: hidden; text-overflow: ellipsis; }
.c-name em { font-style: normal; color: var(--dim); font-size: 11px; }
.c-name .alt, .c-sym .alt { color: var(--dim); }   /* the other names and spellings that fit, after the main one */
.row.sel .c-name .alt, .row.sel .c-sym .alt { color: #d9ffd9; }
.row.sel .c-name em, .row.sel .dimmed { color: #d9ffd9; }   /* a dimmed name on the green was 1.1–1.6:1, now as the row's ID */
.dots { display: inline-flex; gap: 3px; margin-left: auto; padding-left: 6px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 4px var(--c); }
.dimmed { color: var(--dim); }
.row-play { display: grid; place-items: center; cursor: pointer; width: 30px; height: 24px; border: 1px solid var(--line); border-radius: 5px; background: linear-gradient(var(--ctl-a), var(--ctl-b)); font-size: 10px; }
.row.sel .row-play { background: linear-gradient(#e9ffe9, #b8eab8); color: #164d1c; }
.empty { padding: 30px; color: var(--dim); text-align: center; }
sup { font-size: .68em; line-height: 0; }
abbr.approx { text-decoration: none; color: var(--led-ink); cursor: help; }

/* ——— detail ——— */
.detail { grid-area: detail; display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--panel); border-left: 1px solid var(--line); }
.d-rest { flex: 1; min-height: 0; overflow: auto; padding: 12px; }   /* the set scrolls, its map stays at the foot (.d-map-sec) */
.d-map-sec { flex: none; height: var(--dmap-h, auto); max-height: 50%; display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: 8px 12px 12px; }
.d-map-sec .mini-map { flex: 1; min-height: 0; }
.d-map-sec .mini-map svg { height: 100%; }
.plugin { border-radius: 7px; overflow: hidden; border: 1px solid var(--edge); box-shadow: 0 14px 30px var(--plugin-shadow); }
.p-title { height: 22px; line-height: 22px; text-align: center; font-size: 12px; color: var(--ptitle-ink); background: linear-gradient(var(--ptitle-a), var(--ptitle-b)); border-bottom: 1px solid var(--edge); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 10px; }
.p-head { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: linear-gradient(var(--phead-a), var(--phead-b)); border-bottom: 1px solid var(--edge); }
.preset { flex: 1; min-width: 0; padding: 4px 10px; border-radius: 5px; background: var(--preset); box-shadow: inset 0 1px 2px var(--preset-in), 0 1px 0 var(--hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.pre-id { color: var(--dim); margin-right: 6px; font-family: var(--lcd-font); }
.p-btn.wide { width: auto; padding: 0 7px; font: 600 11px var(--lcd-font); letter-spacing: .04em; }
.p-btn { width: 28px; height: 24px; border: 1px solid var(--edge); border-radius: 4px; background: linear-gradient(var(--seg-a), var(--seg-b)); font-size: 10px; }
.p-body { padding: 12px; background: var(--brushed), linear-gradient(var(--pbody-a), var(--pbody-b)); color: var(--pbody-ink); }

.lcd { display: flex; gap: 1px; height: 46px; padding: 3px; margin-bottom: 12px; border-radius: 7px; background: var(--lcd-frame); box-shadow: 0 1px 0 var(--pbody-hi); }
.lcd .cell { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 0 6px; background: linear-gradient(var(--lcd-top), var(--lcd)); border-radius: 3px; color: var(--lcd-ink); min-width: 0; }
.lcd b { font: 500 19px/1 var(--lcd-font); text-shadow: 0 0 8px var(--lcd-glow); }
.lcd small { font: 500 9px/1.3 var(--lcd-font); letter-spacing: .14em; text-transform: uppercase; color: var(--lcd-dim); }
.lcd .bit { flex: 2 1 auto; }
.lcd .bit b { letter-spacing: .06em; }
.lcd .bit i { font-style: normal; color: var(--lcd-off); text-shadow: none; }
.lcd .bit i.on { color: var(--lcd-ink); text-shadow: 0 0 8px var(--lcd-glow-on); }

.bits { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin-bottom: 12px; }
.bit-led { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0 4px; border: 1px solid #697892; border-radius: 5px; background: linear-gradient(#f3f4f6, #cacdd3); box-shadow: 0 1px 2px rgba(0, 0, 0, .35), inset 0 1px 0 #ffffff; color: #2b313b; min-width: 0; }
.bit-led b { font: 600 14px/1 var(--lcd-font); }
.bit-led small { font: 500 10px/1 var(--lcd-font); color: #64728a; }
.bit-led .lamp { width: 8px; height: 8px; border-radius: 50%; background: #6b4a2a; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6); }
.bit-led.on { background: linear-gradient(#ffd892, var(--led) 60%, var(--led-2)); border-color: #b06a12; box-shadow: 0 0 10px rgba(255, 170, 50, .55), inset 0 1px 0 rgba(255, 255, 255, .6); }
.bit-led.on small { color: #6a3b00; }
.bit-led.on .lamp { background: #fff6d8; box-shadow: 0 0 6px #fff1b0; }
.bit-led.fixed { cursor: default; }

.inset { background: var(--inset); border-radius: 6px; padding: 8px 8px 20px; box-shadow: inset 0 2px 8px var(--inset-shade), 0 1px 0 var(--pbody-hi); }
.view-tabs { display: flex; gap: 2px; margin: -2px 0 8px; }
.view-tabs button { flex: 1; padding: 4px 6px; border: 1px solid var(--vtab-edge); border-radius: 4px; background: linear-gradient(var(--vtab-a), var(--vtab-b)); color: var(--vtab-ink); font-size: 11px; }
.view-tabs button.lit { background: linear-gradient(#ffd892, var(--led) 60%, var(--led-2)); color: #3b2000; border-color: #b06a12; }
.view[hidden] { display: none; }
/* the views on, side by side as the panel allows — one column, two, four (his "una sequenza tip 1-1-1-1 2-2 4 in base alla
   larghezza del pannello"): --cols written by main.js */
.views { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); gap: 14px 16px; align-items: center; }
.svg-view { min-height: 110px; display: flex; justify-content: safe center; overflow-x: auto; }   /* safe: a wide neck scrolls from its nut, not cut on the left */
.svg-view svg { display: block; max-width: 100%; height: auto; }
#v-circle svg { width: 230px; }
#v-staff svg { width: 100%; max-height: 150px; }
#v-guitar svg { width: 100%; min-width: 520px; }
.c-ring { fill: none; stroke: var(--ring); stroke-width: 1.5; }
.c-poly { fill: rgba(124, 196, 255, .18); stroke: var(--set); stroke-width: 1.6; stroke-linejoin: round; }
.c-dot { fill: var(--pc-dot); }
.c-dot.on { fill: var(--set); filter: drop-shadow(0 0 4px rgba(124, 196, 255, .7)); }
.c-dot.on.tonic { fill: var(--led); filter: drop-shadow(0 0 5px rgba(255, 180, 60, .8)); }
.c-lab { fill: var(--pc-lab); font: 600 12px var(--lcd-font); text-anchor: middle; dominant-baseline: middle; }
.c-lab.on { fill: var(--lcd-ink); }
.s-line { stroke: var(--staff); stroke-width: 1; }
.s-clef { fill: var(--staff-ink); font: 52px "Bravura", "Noto Music", "Apple Symbols", "Segoe UI Symbol", serif; }
.s-acc { fill: var(--staff-ink); font: 15px "Apple Symbols", "Noto Music", "Segoe UI Symbol", serif; }
.s-note { fill: none; stroke: var(--staff-note); stroke-width: 2.2; }
.s-note.tonic { stroke: var(--led); }
.g-board { fill: #3a2716; }
.g-fret { stroke: #b8b2a6; stroke-width: 1.5; }
.g-fret.nut { stroke: #efe9dc; stroke-width: 4; }
.g-string { stroke: #d9d2c3; }
.g-mark { fill: #6d5338; }
.g-dot { fill: var(--set); stroke: #0b2238; stroke-width: 1; }
.g-dot.tonic { fill: var(--led); stroke: #4a2a00; }
.g-lab { fill: #0c1a2a; font: 600 9px var(--lcd-font); text-anchor: middle; }
.g-num { fill: var(--fret-num); font: 500 10px var(--lcd-font); text-anchor: middle; }
.inset-label { display: flex; justify-content: space-between; gap: 10px; color: var(--inset-gold); font-size: 11px; margin-bottom: 6px; }
.inset-label .hint { color: var(--inset-hint); text-align: right; }
.wood, .tonic-keys, .ivory-keys { --whites: 14; position: relative; user-select: none; -webkit-user-select: none; touch-action: none; }
.wood > div, .tonic-keys > div, .ivory-keys > div { position: absolute; top: 0; }
.white { left: calc(100% / var(--whites) * var(--x)); width: calc(100% / var(--whites)); height: 100%; }
.black { left: calc(100% / var(--whites) * var(--x) - 100% / var(--whites) * .3); width: calc(100% / var(--whites) * .6); height: 62%; z-index: 2; }
.wood { height: 110px; cursor: pointer; }
.wk.white { background: repeating-linear-gradient(176deg, rgba(90, 45, 10, .18) 0 2px, transparent 2px 7px), linear-gradient(#dc9446, #b8742b 70%, #9d5f1e); border: 1px solid #5d3510; border-radius: 0 0 4px 4px; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .18); }
.wk.black { background: linear-gradient(#4c2e12, #1e1006); border: 1px solid #120802; border-radius: 0 0 3px 3px; }
.wk.on.white { background: linear-gradient(rgba(124, 196, 255, .6), rgba(124, 196, 255, .38)), repeating-linear-gradient(176deg, rgba(90, 45, 10, .18) 0 2px, transparent 2px 7px), linear-gradient(#dc9446, #b8742b); }
.wk.on.black { background: linear-gradient(#5aa8ea, #2a6db1); }
.wk.on::after { content: ""; position: absolute; left: 50%; bottom: 12%; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: #eaf6ff; box-shadow: 0 0 6px #bfe3ff; }
.wk.tonic::after { background: var(--led); box-shadow: 0 0 8px var(--led); width: 9px; height: 9px; margin-left: -4.5px; }
.wk.sounding { filter: brightness(1.4) saturate(1.3); }
.oct { position: absolute; bottom: -16px; left: 2px; font-size: 10px; color: var(--inset-num); }

.names-panel { padding: 6px 2px 20px; }
.it-names { margin: 10px 0 0; padding: 6px 10px; border-left: 3px solid var(--accent); background: rgba(180, 108, 255, .08); font-size: 14px; }
.it-names span { color: var(--dim); font-size: 11px; margin-right: 4px; text-transform: uppercase; letter-spacing: .06em; }
.syms .sym { display: inline-flex; flex-direction: column; }
.syms .sym.derived { color: var(--dim); cursor: help; }   /* built by the grammar, no source's: shown here only */
.names-panel h3 { margin: 16px 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.names-panel .count { color: var(--dim); font-weight: 400; margin-left: 4px; }
.props { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 10px 0 0; }
.props dt { color: var(--dim); }
.props dd { margin: 0; }
.syms { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 16px; }
.none { color: var(--dim); font-style: italic; }
.region { border-left: 3px solid var(--c); padding: 2px 0 2px 10px; margin: 8px 0; }
.region h4 { margin: 0 0 4px; color: var(--c); font-size: 12px; letter-spacing: .04em; }
:root[data-theme="light"] .region h4 { color: color-mix(in srgb, var(--c) 38%, var(--text)); }   /* a pale zone's colour readable on light:
   at 50 % eleven zones fell under 4.5:1 (the Caucasus 3.41), found by the general check of 2026-10-04; at 38 % the lowest is 4.77 */
.trad h5 { margin: 6px 0 2px; font-size: 12px; font-weight: 600; }
.trad h5 small { color: var(--dim); font-weight: 400; margin-left: 4px; }
.trad ul { margin: 0; padding: 0; list-style: none; }
/* a tradition's names on one line, comma-separated, wrapping (his "no metterei tutto su righe diverse, in modo da diminuire
   l'altezza"); still a list for a screen reader */
.trad li { display: inline; }
.trad li:not(:last-child)::after { content: ", "; }
.rels { display: flex; flex-direction: column; gap: 10px; }
.rel-row h5 { margin: 0 0 4px; font-size: 12px; color: var(--rel-h5); font-weight: 600; }
.rel-row > div { display: flex; flex-wrap: wrap; gap: 4px; }
.rel {
  padding: 3px 8px; border-radius: 5px; text-align: left; font-size: 12px; line-height: 1.5;
  border: 1px solid var(--line); background: linear-gradient(var(--rel-a), var(--rel-b)); color: var(--text);
}
.rel:hover { background: linear-gradient(var(--rel-hover-a), var(--rel-hover-b)); }
.rel b { color: var(--led-ink); font-weight: 600; margin-right: 3px; }
.rel em { font-style: normal; color: var(--dim); font-size: 10px; margin-left: 3px; }
.mini-map { opacity: .95; }
.mini-map svg { width: 100%; height: auto; display: block; }

/* ——— the keyboard to play ——— */
.keys { grid-area: keys; display: flex; flex-direction: column; min-height: 0; background: linear-gradient(var(--keys-a), var(--keys-b)); border-top: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--hi); padding: 6px 10px 8px; }
.keys-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--dim); font-size: 12px; }
.keys-bar output { min-width: 22px; text-align: center; color: var(--text); }
.kb-btn { height: 26px; min-width: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: linear-gradient(var(--ctl-a), var(--ctl-b)); font-size: 11px; }
.kb-btn.wide { margin-left: 8px; }
.kb-btn.lit { background: linear-gradient(var(--accent), var(--accent-2)); color: #ffffff; }
.detected { margin-left: 10px; padding: 3px 10px; border-radius: 5px; background: linear-gradient(var(--lcd-top), var(--lcd)); color: var(--lcd-ink); font: 500 14px var(--lcd-font); box-shadow: inset 0 1px 3px var(--inset-shade); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.detected b { color: var(--count-ink); font-weight: 600; }
.detected span { color: var(--lcd-dim); }
.detected[hidden] { display: none; }
.audio-hint { margin-left: 10px; padding: 3px 10px; border-radius: 5px; background: linear-gradient(#ffd892, var(--led) 60%, var(--led-2)); color: #3b2000; font-weight: 600; animation: blink 1.2s ease-in-out infinite alternate; }
.audio-hint[hidden], .led-btn[hidden] { display: none; }
@keyframes blink { from { box-shadow: 0 0 0 rgba(255, 170, 50, 0); } to { box-shadow: 0 0 12px rgba(255, 170, 50, .8); } }
.kb-help { margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ivory { flex: 1; min-height: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.ivory-keys { height: 100%; width: max(100%, 832px); }   /* the piano's 52 white keys, 16 px at least: a phone scrolls */
.ik.white { background: linear-gradient(#fdfdfd, #e8eaed 85%, #d4d7dc); border: 1px solid #181c22; border-radius: 0 0 6px 6px; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .08); }
.ik.black { background: linear-gradient(#323946, #0b0c0e 70%, #181c22); border: 1px solid #000000; border-radius: 0 0 4px 4px; box-shadow: inset 0 -5px 0 rgba(255, 255, 255, .08), 0 3px 4px rgba(0, 0, 0, .5); }
.ik.hit.white { background: linear-gradient(#d9c2ff, #b98bff); }
.ik.hit.black { background: linear-gradient(var(--accent), var(--accent-2)); }
.ik .oct { bottom: 5px; left: 3px; color: #939aa7; font-size: 9px; }
.ik.win.white { background: linear-gradient(#ffffff, #f0e9ff 80%, #ddd0f5); box-shadow: inset 0 3px 0 var(--accent), inset 0 -6px 0 rgba(0, 0, 0, .08); }
.ik.win.black { box-shadow: inset 0 3px 0 var(--accent), 0 3px 4px rgba(0, 0, 0, .5); }
.ik .cap { position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; font: 600 10px var(--lcd-font); color: #8a63d2; pointer-events: none; }
.ik.black .cap { bottom: 8px; color: #c8b2ff; }
.ik.win.hit.white { background: linear-gradient(#d9c2ff, #b98bff); }   /* a key pressed lights over the window's tint */
.ik.win.hit.black { background: linear-gradient(var(--accent), var(--accent-2)); }
.ik.hit.white .cap { color: #3b1675; }
.ik.hit.black .cap { color: #fff; }
.ik .oct { white-space: nowrap; }
.tabs { display: none; }

/* ——— the panels' widths (his "una maniglietta o simile che tenendo sciacciato e muovendomi posso modificare la larghezza"):
   a grip on the filters' edge and one on the set's, on a desktop; and the keyboard's height by a grip on its top edge (his
   "anche il pannello in basso … in questo caso verticalmente"); --filt-w, --det-w, --keys-h written by main.js once dragged ——— */
.gutter {
  position: absolute; top: 0; bottom: 0; z-index: 5; width: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: col-resize; touch-action: none; outline: none;
}
.gutter[data-pane="filt"] { grid-area: filt; right: -5px; }
.gutter[data-pane="det"] { grid-area: detail; left: -5px; }
.gutter[data-pane="keys"] { grid-area: keys; top: -5px; bottom: auto; left: 0; right: 0; width: auto; height: 10px; cursor: row-resize; }
.gutter[data-pane="map"], .gutter[data-pane="dmap"] { position: relative; flex: none; width: auto; height: 10px; margin: -5px 0; cursor: row-resize; }
.gutter::before { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; background: transparent; transition: background .15s; }
.gutter[data-pane="keys"]::before, .gutter[data-pane="map"]::before, .gutter[data-pane="dmap"]::before { top: 4px; bottom: auto; left: 0; right: 0; width: auto; height: 2px; }
.gutter i {
  --groove: rgba(0, 0, 0, .5); --face-1: var(--grip-a); --face-2: var(--grip-b);
  position: relative; width: 6px; height: 38px; border-radius: 3px; border: 1px solid var(--grip-edge);
  background: repeating-linear-gradient(transparent 0 4px, var(--groove) 4px 5px) 0 3px / 100% calc(100% - 6px) no-repeat, linear-gradient(90deg, var(--face-1), var(--face-2));
  box-shadow: 0 1px 3px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .14);
  transition: box-shadow .15s;
}
.gutter[data-pane="keys"] i, .gutter[data-pane="map"] i, .gutter[data-pane="dmap"] i { width: 38px; height: 6px; background: repeating-linear-gradient(90deg, transparent 0 4px, var(--groove) 4px 5px) 3px 0 / calc(100% - 6px) 100% no-repeat, linear-gradient(var(--face-1), var(--face-2)); }
.gutter:hover::before, .gutter:focus-visible::before { background: rgba(255, 255, 255, .1); }
.gutter:hover i, .gutter:focus-visible i { --face-1: var(--grip-hover-a); --face-2: var(--grip-hover-b); }
.gutter.drag::before { background: rgba(255, 181, 62, .45); }
.gutter.drag i { --groove: rgba(80, 40, 0, .45); --face-1: #ffd892; --face-2: var(--led-2); box-shadow: 0 0 10px rgba(255, 170, 50, .55); }
body.resizing { cursor: col-resize; user-select: none; -webkit-user-select: none; }
body.resizing.rows { cursor: row-resize; }

/* ——— tablet: the filters slide in from the left (offcanvas) ——— */
@media (max-width: 1199px) {
  .app { grid-template: "bar bar" var(--bar-h) "strip strip" var(--strip-h) "list detail" 1fr "keys keys" var(--keys-h) / minmax(0, 1fr) minmax(340px, min(420px, 48%)); }   /* an upright tablet leaves the list half */
  .filt-toggle { display: inline-block; flex: none; }   /* not squeezed by the search (25 px at 700) */
  .gutter { display: none; }   /* the panels' widths are app.css's below a desktop */
  .filters {
    position: fixed; z-index: 20; left: 0; bottom: 0;
    top: calc(var(--bar-h) + var(--strip-h) + env(safe-area-inset-top));
    width: min(320px, 88vw);
    transform: translateX(-102%); transition: transform .22s ease;
    box-shadow: 12px 0 30px rgba(0, 0, 0, .5);
  }
  body.filt-open .filters { transform: none; }
  .knob-wrap small { display: none; }
  .logo { height: 24px; }
  .bar { gap: 8px; }   /* Dark / Light added a button: the bar's gaps tighter below a desktop */
  .tools { gap: 4px; }
  /* the language, Dark / Light, the reset and info in the filters' head, as on a phone: in the bar they left the search 53 px
     at 1000 (and the bar overflowing), found in the general check of 2026-10-03 — below 1000 px only, until then */
  .bar .lang, .bar #theme, .bar #reset-all, .bar .tbtn.info { display: none; }
  .seg.lang-alt { display: inline-flex; }
  .kb-btn.info-alt, .kb-btn.reset-alt, .kb-btn.theme-alt { display: inline-grid; }
}
@media (max-width: 999px) {   /* a tablet upright */
  .logo { height: 20px; }   /* Tonalius's logo, 1920 × 442, is wider than 2048's: at 24 px it left the search 134 px at 820 */
  .row .dots { display: none; }   /* the origin's dots gave way to the name (nine of them left "Ha… +11"): the set's map shows them */
}
@media (max-width: 899px) {
  .transport .seg button { padding: 6px 7px; font-size: 12px; }
  #voice { display: none; }
}
@media (max-width: 759px) {   /* below an iPad mini the tempo knob goes, as on a phone, and the search has the room (his "La manopola
  del tempo", 2026-10-04: the search was 58 px at 700) */
  .knob-wrap { display: none; }
}

/* ——— phone: one pane at a time (list or set), tabs; the bar in two rows: the search, then the transport ———
   no keyboard to play, no Detect, no MIDI (question 90, his "Via tutte e due"; 91, "Tutte e due"): the list takes the room */
@media (max-width: 699px) {
  :root { --bar-h: 92px; --strip-h: 38px; }
  .app { grid-template: "bar" var(--bar-h) "strip" var(--strip-h) "tabs" 36px "pane" 1fr / 100%; }
  .keys, .bar .tools { display: none; }
  .bar { display: grid; grid-template: "tog search search" 38px "tr tr title" 34px / auto 1fr auto; gap: 6px; padding: 6px 8px; align-content: center; }
  .filt-toggle { grid-area: tog; height: 38px; }
  .knob-wrap, #voice, .bar .lang { display: none; }
  /* the logo on a phone too (his "il logo si deve vedere anche su phone", 2026-10-06): after the transport, in its free room */
  .title { grid-area: title; align-self: center; }
  .logo { height: 24px; }
  .search { grid-area: search; height: 38px; }
  .search input { font-size: 16px; }
  .count-lcd { min-width: 48px; padding: 0 8px; }
  .transport { grid-area: tr; gap: 4px; }
  .tools { grid-area: tools; gap: 4px; }
  .tbtn.play { width: 40px; }
  .seg button { padding: 6px 8px; font-size: 12px; }
  .led-btn { padding: 0 8px 0 19px; font-size: 11px; }
  .led-btn::before { left: 7px; }
  .seg.lang-alt { display: inline-flex; }
  .kb-btn.info-alt, .kb-btn.reset-alt, .kb-btn.theme-alt { display: inline-grid; }
  .strip { padding: 0 6px; }
  .keyset { gap: 2px; width: 100%; }
  .keyset button { min-width: 0; flex: 1; padding: 0; font-size: 12px; }
  .tabs { grid-area: tabs; display: flex; background: var(--tabs-bg); border-bottom: 1px solid var(--line); }
  .tabs button { flex: 1; border: 0; background: transparent; color: var(--dim); font-weight: 600; border-bottom: 2px solid transparent; }
  .tabs button.lit { color: var(--tabs-lit); border-bottom-color: var(--accent); }
  .browser, .detail { grid-area: pane; border: 0; }
  .detail { display: block; overflow: auto; }   /* a phone scrolls the set to its map, as before: no room to keep it */
  .d-rest { overflow: visible; padding-bottom: 0; }
  body[data-pane="list"] .detail, body[data-pane="detail"] .browser { display: none; }
  .list-head, .row { --play-w: 32px; gap: 6px; padding: 0 8px; }   /* one column (.one-col), always */
  .browser > .list-head > span:nth-child(4) { display: none; }   /* no Symbol column on a phone, before the list comes too */
  .c-notes { font-size: 13px; }
  .lcd b { font-size: 16px; }
  .lcd .bit b { font-size: 12px; letter-spacing: .01em; }
  .bit-led b { font-size: 12px; }
  .bit-led small { font-size: 9px; }
  .inset-label .hint, .kb-help { display: none; }
}
@media (max-width: 359px) {   /* a small phone: the logo a little lower, or Italian's Scala went under it at 320 */
  .logo { height: 20px; }
}
