/* Jammer — stage gear, not a web page. Anodised panel, amber readouts,
   silkscreen labels, lamps that actually light. Built thumb-first. */

:root {
  --bg:        #0a0b0d;
  --panel:     #14161a;
  --panel-2:   #1a1d23;
  --raise:     #232831;
  --line:      #2c313b;
  --line-soft: #21252c;
  --ink:       #ece9e3;
  --muted:     #8b9099;
  --amber:     #ffb020;
  --amber-ink: #2a1a00;
  --green:     #37d9a0;
  --red:       #ff4b4b;
  --drums:     #ffb020;
  --bass:      #ff8a3d;
  --keys:      #5ec8ff;
  --me:        #37d9a0;
  --ivory:     #e9e5da;
  --ivory-edge:#a9a496;
  --ebony:     #0e1013;
  --shadow:    0 1px 0 rgba(255,255,255,.045), 0 2px 10px rgba(0,0,0,.5);
  --inset:     inset 0 1px 0 rgba(255,255,255,.06), inset 0 -2px 6px rgba(0,0,0,.45);
  --radius:    12px;
  --f-ui:      "Archivo", ui-sans-serif, system-ui, sans-serif;
  --f-read:    "Martian Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg:        #ded8ca;
  --panel:     #f2eee3;
  --panel-2:   #e9e4d6;
  --raise:     #faf7ef;
  --line:      #c6bfac;
  --line-soft: #d6cfbe;
  --ink:       #1b1813;
  --muted:     #6d6657;
  --amber:     #a35c00;
  --amber-ink: #fff6e4;
  --green:     #0d7a53;
  --red:       #c42b2b;
  --drums:     #a35c00;
  --bass:      #a8521a;
  --keys:      #1d6a9c;
  --me:        #0d7a53;
  --ivory:     #fdfbf5;
  --ivory-edge:#b7b0a0;
  --ebony:     #2a2722;
  --shadow:    0 1px 0 rgba(255,255,255,.7), 0 2px 8px rgba(80,70,50,.18);
  --inset:     inset 0 1px 0 rgba(255,255,255,.7), inset 0 -2px 6px rgba(120,105,75,.18);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { background: var(--bg); color: var(--ink); }

body {
  margin: 0;
  font-family: var(--f-ui);
  font-size: 15px;
  line-height: 1.5;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) calc(env(safe-area-inset-bottom) + 28px) env(safe-area-inset-left);
  /* Fine grain so the panels read as metal rather than flat fills. */
  background-image: radial-gradient(ellipse at 50% -10%, rgba(255,176,32,.07), transparent 60%);
  background-attachment: fixed;
  -webkit-text-size-adjust: 100%;
}

h1, h2 { margin: 0; font-weight: 700; line-height: 1.15; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.label {
  font-size: 10px;
  font-variation-settings: "wdth" 118;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.muted { color: var(--muted); }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(var(--panel-2), var(--panel));
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.brand { display: flex; flex-direction: column; line-height: 1.05; }
.wordmark {
  font-size: 21px; font-weight: 800; letter-spacing: -.02em;
  font-variation-settings: "wdth" 112;
  color: var(--amber);
}
.tagline { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.song-title {
  flex: 1; min-width: 140px;
  font-size: 15px; font-weight: 600; text-align: center;
  color: var(--ink); overflow-wrap: anywhere;
}
.topbar-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.pill {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.pill.on { border-color: var(--green); color: var(--green); }

/* ---------- mode tabs ---------- */
.mode-tabs {
  display: flex; gap: 8px; padding: 10px 16px 0;
  overflow-x: auto; scrollbar-width: none;
}
.mode-tabs::-webkit-scrollbar { display: none; }
.mode-tab {
  display: flex; flex-direction: column; gap: 1px; text-align: left;
  padding: 8px 14px; border-radius: 10px 10px 0 0;
  border: 1px solid var(--line); border-bottom: none;
  background: var(--panel); color: var(--muted); white-space: nowrap;
}
.mode-tab b { font-size: 13.5px; font-weight: 700; }
.mode-tab small { font-size: 10.5px; letter-spacing: .04em; }
.mode-tab[aria-selected="true"] {
  background: var(--panel-2); color: var(--ink);
  box-shadow: inset 0 2px 0 var(--amber);
}

.mode-root { padding: 0 16px; max-width: 1180px; margin: 0 auto; }

.stage { display: flex; flex-direction: column; gap: 14px; padding: 14px 0 18px; }

/* ---------- now bar ---------- */
.nowbar {
  background: linear-gradient(180deg, #000 0%, #0d0f12 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 12px;
  box-shadow: var(--inset);
}
:root[data-theme="light"] .nowbar { background: linear-gradient(180deg, #2a2722, #37332b); }
.now-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.now-left { min-width: 0; }
.now-chord {
  font-family: var(--f-read);
  font-size: clamp(38px, 11vw, 68px);
  font-weight: 700; line-height: 1;
  color: var(--amber);
  text-shadow: 0 0 22px rgba(255,176,32,.45);
  overflow-wrap: anywhere;
  font-variant-ligatures: none;
}
.now-chord.counting { color: var(--green); text-shadow: 0 0 22px rgba(55,217,160,.45); }
.now-next {
  font-family: var(--f-read); font-size: 12px; letter-spacing: .02em;
  color: #7e8691; margin-top: 6px; min-height: 1.2em;
}
.now-right { text-align: right; flex-shrink: 0; }
.now-section { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #7e8691; }
.now-pos { font-family: var(--f-read); font-size: 17px; color: #c9cdd4; margin-top: 3px; }
:root[data-theme="light"] .now-next,
:root[data-theme="light"] .now-section { color: #a79e8c; }
:root[data-theme="light"] .now-pos { color: #e8e2d4; }

.lamps { display: flex; gap: 7px; margin-top: 12px; }
.lamp {
  flex: 1; height: 7px; border-radius: 3px;
  background: #22262d;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.7);
  transition: background .07s linear, box-shadow .07s linear;
}
.lamp.on { background: var(--amber); box-shadow: 0 0 12px rgba(255,176,32,.75); }
.lamp-one.on { background: var(--green); box-shadow: 0 0 12px rgba(55,217,160,.75); }

/* ---------- transport ---------- */
.transport {
  display: grid; gap: 14px;
  grid-template-columns: 1fr;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.transport-main { display: flex; gap: 10px; }

.xbtn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 60px; padding: 0 18px;
  border-radius: 10px; border: 1px solid var(--line);
  background: linear-gradient(var(--raise), var(--panel-2));
  box-shadow: var(--shadow);
  font-weight: 700; font-size: 16px;
  font-variation-settings: "wdth" 108;
  transition: transform .06s ease, box-shadow .12s ease, border-color .12s ease;
}
.xbtn:active { transform: translateY(1px); box-shadow: var(--inset); }
.xbtn-glyph { font-size: 17px; line-height: 1; }
.xbtn.play.on { border-color: var(--green); color: var(--green); box-shadow: 0 0 0 1px var(--green), var(--shadow); }
.xbtn.rec .lampdot {
  width: 13px; height: 13px; border-radius: 50%;
  background: #3a2020; border: 1px solid #52292a;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.6);
}
.xbtn.rec.on { border-color: var(--red); color: var(--red); }
.xbtn.rec.on .lampdot {
  background: var(--red); border-color: var(--red);
  box-shadow: 0 0 12px rgba(255,75,75,.9);
  animation: blink 1.1s steps(1, end) infinite;
}
@keyframes blink { 50% { opacity: .35; } }

.tempo { display: flex; flex-direction: column; gap: 8px; }
.tempo-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tempo-num { display: flex; align-items: baseline; gap: 5px; }
.tempo-val {
  width: 3.6em; padding: 2px 4px; text-align: right;
  font-family: var(--f-read); font-size: 24px; font-weight: 700;
  color: var(--amber); background: transparent;
  border: none; border-bottom: 1px solid var(--line);
  -moz-appearance: textfield;
}
.tempo-val::-webkit-inner-spin-button, .tempo-val::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.bpm { font-size: 10px; letter-spacing: .12em; color: var(--muted); }
.tempo-btns { display: flex; gap: 8px; }
.tempo-btns .mini { flex: 1; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 26px; background: transparent; margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: var(--panel-2); box-shadow: inset 0 1px 3px rgba(0,0,0,.6);
}
input[type="range"]::-moz-range-track {
  height: 6px; border-radius: 3px; background: var(--panel-2);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin-top: -8px; border-radius: 50%;
  background: linear-gradient(var(--raise), var(--panel-2));
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--raise); border: 1px solid var(--line);
}

.toggles { display: flex; gap: 8px; flex-wrap: wrap; }
.tgl {
  flex: 1; min-width: 92px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel-2);
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.tgl-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #2b3038; box-shadow: inset 0 1px 2px rgba(0,0,0,.6);
}
.tgl[aria-pressed="true"] { color: var(--ink); border-color: #3c434f; }
.tgl[aria-pressed="true"] .tgl-dot { background: var(--amber); box-shadow: 0 0 9px rgba(255,176,32,.8); }

.mini {
  padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel-2);
  font-size: 13px; font-weight: 600;
}
.mini:hover { border-color: #3c434f; }
.mini.primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.mini.danger:hover { border-color: var(--red); color: var(--red); }

/* ---------- chart ---------- */
.chart {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 12px 14px;
  max-height: 46vh; overflow-y: auto;
  box-shadow: var(--shadow);
}
.chart-section {
  display: flex; align-items: baseline; gap: 10px;
  margin: 12px 2px 7px;
}
.chart-section:first-child { margin-top: 2px; }
.chart-section-name {
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--amber);
}
.chart-section-meta { font-size: 11px; color: var(--muted); }
.chart-row {
  display: grid; gap: 7px;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
}
.chart-cell {
  position: relative; min-height: 62px;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 8px 6px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel-2);
  transition: background .1s linear, border-color .1s linear, box-shadow .1s linear;
}
.chart-barnum {
  position: absolute; top: 4px; left: 7px;
  font-family: var(--f-read); font-size: 9px; color: #5e656f;
}
.chart-chords { display: flex; flex-wrap: wrap; gap: 4px 9px; justify-content: center; }
.chart-chord {
  font-family: var(--f-read); font-size: 15px; font-weight: 600;
  color: var(--ink); overflow-wrap: anywhere;
}
.chart-cell.on {
  background: #2a2008; border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber), 0 0 18px rgba(255,176,32,.3);
}
.chart-cell.on .chart-chord { color: var(--amber); }
:root[data-theme="light"] .chart-cell.on { background: #ffeccb; }
.chart-empty { color: var(--muted); margin: 10px 4px; }

/* ---------- keyboard ---------- */
.kb-box {
  background: linear-gradient(var(--ebony), #16191e);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 9px 9px;
  overflow-x: auto; overflow-y: hidden;
  scroll-behavior: smooth;
  box-shadow: var(--inset);
}
.kb {
  position: relative; display: flex; margin: 0 auto;
  height: clamp(118px, 21vw, 180px);
  user-select: none; -webkit-user-select: none; touch-action: none;
}
.wk, .bk {
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  gap: 3px; transition: background .06s linear, box-shadow .06s linear;
}
.wk {
  position: relative; flex: 0 0 var(--kw); height: 100%;
  background: var(--ivory);
  border: 1px solid var(--ivory-edge); border-top: 0;
  border-radius: 0 0 5px 5px;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.14);
  padding-bottom: 8px;
}
.bk {
  position: absolute; top: 0; z-index: 2;
  width: calc(var(--kw) * .62); height: 61%;
  background: linear-gradient(#2b2f37, #0c0e11);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 3px 4px rgba(0,0,0,.5), inset 0 -4px 0 #000;
  padding-bottom: 6px;
}
.key-name { font-family: var(--f-read); font-size: 9px; color: #918a7c; pointer-events: none; }
.key-letter { font-family: var(--f-read); font-size: 8.5px; color: #b3ab9c; pointer-events: none; text-transform: uppercase; }
.bk .key-name, .bk .key-letter { color: #6f7681; }
.key-name.quiet { visibility: hidden; }
.wk.down { background: #cfcabc; }
.bk.down { background: #343a44; }
.wk.hl-cue { background: color-mix(in srgb, var(--amber) 34%, var(--ivory)); }
.bk.hl-cue { background: color-mix(in srgb, var(--amber) 62%, #14171c); }
.wk.hl-cue .key-name, .bk.hl-cue .key-name { visibility: visible; color: #241a04; font-weight: 700; }

/* ---------- panels ---------- */
.hint { font-size: 12.5px; color: var(--muted); margin: 0 2px; }
.panels {
  display: grid; gap: 14px; padding-bottom: 28px;
  grid-template-columns: 1fr;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.panel-head h2 {
  flex: 1; font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--amber); font-variation-settings: "wdth" 115;
}
.inline-field { display: inline-flex; align-items: center; gap: 7px; }
.select {
  padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  font-size: 13px;
}

/* mixer */
.mixer-head { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.feel-wrap, .swing-wrap { display: flex; align-items: center; gap: 8px; }
.swing-wrap { flex: 1; min-width: 150px; }
.swing-wrap.off { opacity: .35; pointer-events: none; }
.swing { flex: 1; }
.strips { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.strip { display: flex; flex-direction: column; gap: 4px; }
.part {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 11px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel-2);
  font-size: 13.5px; font-weight: 600; color: var(--muted);
}
.part-dot { width: 9px; height: 9px; border-radius: 50%; background: #2b3038; box-shadow: inset 0 1px 2px rgba(0,0,0,.6); }
.part[aria-pressed="true"] { color: var(--ink); }
.part-drums[aria-pressed="true"] .part-dot { background: var(--drums); box-shadow: 0 0 9px var(--drums); }
.part-bass[aria-pressed="true"]  .part-dot { background: var(--bass);  box-shadow: 0 0 9px var(--bass); }
.part-keys[aria-pressed="true"]  .part-dot { background: var(--keys);  box-shadow: 0 0 9px var(--keys); }
.part-me[aria-pressed="true"]    .part-dot { background: var(--me);    box-shadow: 0 0 9px var(--me); }

/* takes */
.takes-list { display: flex; flex-direction: column; gap: 8px; }
.take {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel-2);
}
.take.muted-take { opacity: .5; }
.take-mute {
  min-width: 58px; padding: 5px 9px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--panel);
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}
.take-mute[aria-pressed="true"] { color: var(--me); border-color: var(--me); }
.take-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.take-meta b { font-size: 14px; }
.take-meta small { font-size: 11.5px; color: var(--muted); }
.x { border: 0; background: none; color: var(--muted); padding: 4px 7px; font-size: 14px; }
.x:hover { color: var(--red); }

/* library */
.lib-grid { display: grid; gap: 9px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.lib-item {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  padding: 11px 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel-2);
  cursor: pointer; transition: border-color .12s ease, transform .06s ease;
}
.lib-item:hover { border-color: var(--amber); }
.lib-item:active { transform: translateY(1px); }
.lib-item b { font-size: 14px; overflow-wrap: anywhere; padding-right: 22px; }
.lib-item small { font-size: 11.5px; color: var(--muted); }
.lib-item .tag {
  position: absolute; top: 9px; right: 10px;
  font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: #5e656f;
}
.lib-item .x { position: absolute; top: 5px; right: 4px; }

/* editor */
.help {
  margin: 0 0 10px; padding: 9px 11px;
  border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line-soft);
  font-family: var(--f-ui); font-size: 12px; color: var(--muted);
  white-space: pre-wrap;
}
.chart-input {
  width: 100%; min-height: 190px; resize: vertical;
  padding: 11px 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font-family: var(--f-read); font-size: 12.5px; line-height: 1.7;
}
.status { margin: 9px 0 0; font-size: 12.5px; color: var(--muted); min-height: 1.3em; }
.status.ok { color: var(--green); }
.status.warn { color: var(--red); }

/* ---------- wider screens ---------- */
@media (min-width: 760px) {
  .transport { grid-template-columns: minmax(260px, 1fr) minmax(220px, 1fr); align-items: center; }
  .transport .toggles { grid-column: 1 / -1; }
  .panels { grid-template-columns: 1fr 1fr; }
  .panels .editor { grid-column: 1 / -1; }
  .song-title { font-size: 17px; }
}
@media (min-width: 1040px) {
  .panels { grid-template-columns: 1fr 1fr 1fr; }
  .panels .editor { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Stopped: the opening chord, shown but clearly not sounding. */
.now-chord.idle { color: #6d737d; text-shadow: none; }
:root[data-theme="light"] .now-chord.idle { color: #8d8674; }

/* ---------- learn piece: notation ---------- */
.staff {
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 4px;
  max-height: 58vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
:root[data-theme="dark"] .staff,
:root:not([data-theme="light"]) .staff { background: #e9e6dd; }
.staff.shake { animation: shake .26s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.staff-svg { display: block; width: 100%; height: auto; }

/* Notation is drawn on paper, in both themes — black on light is simply
   how music is read, and inverting it hurts more than it helps. */
.staff-svg .sl     { stroke: #2b2b2b; stroke-width: 1; }
.staff-svg .bl     { stroke: #2b2b2b; stroke-width: 1.2; }
.staff-svg .bl.thick { stroke-width: 2.2; }
.staff-svg .ledger { stroke: #2b2b2b; stroke-width: 1.3; }
.staff-svg .stem   { stroke: #15130f; stroke-width: 1.6; }
.staff-svg .beam   { stroke: #15130f; stroke-width: 4.2; stroke-linecap: butt; }
.staff-svg .nh     { fill: #15130f; }
.staff-svg .nh.hollow { fill: none; stroke: #15130f; stroke-width: 1.7; }
.staff-svg .dot    { fill: #15130f; }
.staff-svg .acc    { fill: #15130f; font: 15px "Archivo", serif; }
.staff-svg .acc.key{ font-size: 14px; }
.staff-svg .clef   { fill: #15130f; font-size: 34px; }
.staff-svg .timesig{ fill: #15130f; font: 700 15px "Archivo", serif; }
.staff-svg .rest   { fill: #4a463e; font-size: 17px; }
.staff-svg .flagp  { fill: #15130f; }
.staff-svg .tuplet { fill: #15130f; font: italic 600 10px "Archivo", serif; text-anchor: middle; }
.staff-svg .barnum { fill: #8a8372; font: 600 9px var(--f-read); }
.staff-svg .barhit { fill: transparent; cursor: pointer; }

.staff-svg .bar.on .barhit { fill: rgba(255, 176, 32, .17); }
.staff-svg .step.done .nh  { opacity: .4; }
.staff-svg .step.done .nh.hollow { opacity: .4; }

/* ---------- cue strip ---------- */
.cue {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  min-height: 52px; padding: 10px 14px;
  background: linear-gradient(180deg, #000, #0d0f12);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--inset);
}
:root[data-theme="light"] .cue { background: linear-gradient(180deg, #2a2722, #37332b); }
.cue-note {
  font-family: var(--f-read); font-size: clamp(19px, 5vw, 27px); font-weight: 700;
  padding: 2px 11px; border-radius: 8px;
  border: 2px solid currentColor; color: var(--keys);
}
.cue-note.l { color: var(--bass); }
.cue-note.got { background: currentColor; }
.cue-note.got::after { content: ""; }
.cue-note.got { color: var(--green); }
.cue-done { font-size: 17px; font-weight: 700; color: var(--green); }

/* ---------- practice controls ---------- */
.practice {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow);
}
.practice-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.field-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--panel-2); }
.seg button {
  border: 0; background: none; padding: 8px 13px;
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.seg button[aria-pressed="true"] { background: var(--amber); color: var(--amber-ink); }
.barnum-input {
  width: 3.4em; padding: 6px 7px; text-align: center;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--panel-2); color: var(--ink);
  font-family: var(--f-read); font-size: 13px;
  -moz-appearance: textfield;
}
.barnum-input::-webkit-inner-spin-button, .barnum-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.dash { color: var(--muted); }
.pstats { display: flex; gap: 16px; margin-left: auto; }
.pstat { display: flex; flex-direction: column; align-items: flex-end; }
.pstat b { font-family: var(--f-read); font-size: 16px; font-weight: 700; line-height: 1.1; }
.pstat span { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.muted.small { font-size: 12.5px; margin: 0 0 10px; }

/* ---------- sign-in gate ---------- */
.gate { display: flex; justify-content: center; padding: 56px 0 90px; }
.gate-card {
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  max-width: 420px; width: 100%;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 24px;
  box-shadow: var(--shadow);
}
.gate-eyebrow {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--amber); font-weight: 700;
}
.gate-card h2 { font-size: 23px; }
.gate-card p { margin: 0; }
.gate-btn { width: 100%; margin-top: 8px; }

/* ---------- focus view ----------
   Playing is not reading. Everything that is not the music in front of you,
   the bar after it, and the keys to press gets out of the way. */
.focusbar { display: none; }

/* The microphone control sits with practice, and survives into the
   playing view -- it is the one control you may need mid-piece. */
.micbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.micbar .mini.on { border-color: var(--green); color: var(--green); }
.micbar .meter { flex: 1; min-width: 90px; }
.meter {
  height: 6px; border-radius: 3px;
  background: var(--panel-2); overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6);
}
.meter-fill { display: block; height: 100%; width: 0; background: var(--green); transition: width .08s linear; }

body.focused .micbar { padding: 6px 10px; }

body.focused .mode-tabs,
body.focused .panels,
body.focused .practice,
body.focused .cue,
body.focused .hint,
body.focused .transport .tempo-btns,
body.focused .transport .toggles,
body.focused .topbar .brand,
body.focused .topbar-tools { display: none; }

body.focused .topbar { padding: 6px 16px; }
body.focused .song-title { font-size: 14px; }
body.focused .mode-root { max-width: 100%; }
body.focused .stage { gap: 10px; padding-top: 10px; }

body.focused .focusbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
}
.focus-where { display: flex; align-items: baseline; gap: 7px; }
.focus-where b { font-family: var(--f-read); font-size: 17px; color: var(--amber); }
.focusbar .spacer { flex: 1; }

/* The score fills the space it just gained; two bars, as large as they go. */
body.focused .staff { max-height: none; overflow: visible; padding: 10px 6px; }
body.focused .staff-svg { min-height: 34vh; }
body.focused .kb { height: clamp(150px, 30vh, 260px); }

/* Only the transport's two big buttons survive. */
body.focused .transport { padding: 8px; background: none; border: none; box-shadow: none; }
body.focused .transport-main { gap: 8px; }
body.focused .xbtn { min-height: 52px; }

@media (min-width: 760px) {
  body.focused .transport { grid-template-columns: 1fr; }
}

/* ---------- tuner ---------- */
.tuner-stage { max-width: 560px; margin: 0 auto; width: 100%; }
.tuner-head { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.tuner-head .inline-field.off { display: none; }
.tuner-actions { display: flex; }
.tuner-actions .xbtn { flex: 1; }

.dial {
  background: linear-gradient(180deg, #000, #0d0f12);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 14px 6px;
  box-shadow: var(--inset);
}
:root[data-theme="light"] .dial { background: linear-gradient(180deg, #2a2722, #37332b); }
.dial-readout { text-align: center; margin-bottom: 2px; }
.dial-note {
  font-family: var(--f-read); font-size: clamp(42px, 13vw, 66px);
  font-weight: 700; line-height: 1; color: var(--amber);
  text-shadow: 0 0 24px rgba(255, 176, 32, .4);
}
.dial-cents { font-size: 14px; letter-spacing: .04em; color: #8d94a0; min-height: 1.3em; }
.dial-hz { font-family: var(--f-read); font-size: 11.5px; color: #636a76; min-height: 1.3em; }

.dial[data-state="ok"] .dial-note { color: var(--green); text-shadow: 0 0 26px rgba(55, 217, 160, .5); }
.dial[data-state="ok"] .dial-cents { color: var(--green); font-weight: 700; }
.dial[data-state="idle"] .dial-note { color: #4d535d; text-shadow: none; }

.dial-svg { display: block; }
.dial-arc { fill: none; stroke: #2f353f; stroke-width: 2; }
.dial-band { fill: rgba(55, 217, 160, .18); stroke: none; }
.dial-tick { stroke: #3c434f; stroke-width: 1.5; }
.dial-tick.major { stroke: #5d6573; stroke-width: 2; }
.dial-label { fill: #6b7380; font: 600 10px var(--f-read); text-anchor: middle; }
.dial-needle {
  stroke: var(--amber); stroke-width: 3; stroke-linecap: round;
  transition: transform .09s cubic-bezier(.3, .7, .3, 1);
}
.dial[data-state="ok"] .dial-needle { stroke: var(--green); }
.dial[data-state="idle"] .dial-needle { stroke: #434a56; }
.dial-hub { fill: var(--raise); stroke: #4a515d; stroke-width: 1.5; }

.strings { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.string {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 54px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel-2); color: var(--muted);
}
.string b { font-family: var(--f-read); font-size: 17px; font-weight: 700; color: var(--ink); }
.string small { font-size: 10px; color: var(--muted); }
.string.near { border-color: var(--amber); color: var(--ink); box-shadow: 0 0 0 1px var(--amber); }
.string.pinned { background: var(--amber); border-color: var(--amber); }
.string.pinned b, .string.pinned small { color: var(--amber-ink); }

@media (prefers-reduced-motion: reduce) { .dial-needle { transition: none; } }

.tuner-meter[hidden] { display: none; }
.tuner-meter .pill { min-width: 62px; text-align: center; font-family: var(--f-read); }
