/* LoopDeck — a panel of brushed metal, screen-printed labels and LEDs. */

:root {
  --bg: #0f1113;
  --bg-deep: #0a0b0d;
  --panel: #1b1e23;
  --panel-hi: #23272e;
  --panel-edge: #33383f;
  --ink: #e9edf2;
  --ink-dim: #8d97a4;
  --ink-faint: #5d6672;
  --amber: #ffb020;
  --cyan: #35d0d8;
  --green: #6ee07a;
  --red: #ff4d5e;
  --violet: #b088ff;
  --radius: 10px;
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 -1px 0 rgba(0, 0, 0, 0.5);
  font-synthesis-weight: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 500px at 50% -10%, #1a1e24 0%, transparent 70%),
    var(--bg);
  color: var(--ink);
  font: 13px/1.4 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.01em;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  gap: 8px;
  padding: 8px 8px 0;
}

/* Short or narrow screens give up the fixed frame and scroll instead. */
@media (max-height: 800px), (max-width: 1180px) {
  body { height: auto; min-height: 100vh; overflow: auto; }
}

h1, h2 { margin: 0; font-weight: 650; }

/* --- start gate ---------------------------------------------------------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(8, 9, 11, 0.93);
  backdrop-filter: blur(6px);
  transition: opacity 0.35s ease, visibility 0.35s;
}
.gate.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.gate-card {
  width: min(520px, 92vw);
  padding: 34px 32px;
  text-align: center;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  border: 1px solid var(--panel-edge);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), var(--shadow-inset);
}
.gate-card h1 { font-size: 34px; letter-spacing: 0.34em; color: var(--amber); }
.gate-tag { color: var(--ink-dim); margin: 10px 0 22px; letter-spacing: 0.04em; }
.gate-start {
  width: 100%;
  padding: 16px;
  font: 600 15px/1 inherit;
  letter-spacing: 0.22em;
  color: #16181c;
  background: linear-gradient(180deg, #ffd06a, var(--amber));
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 176, 32, 0.28);
}
.gate-start:hover { filter: brightness(1.08); }
.gate-io { display: flex; gap: 8px; margin-top: 14px; }
.gate-io .select { flex: 1; }
.gate-keys {
  display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center;
  margin: 22px 0 0; padding: 16px 0 0; list-style: none;
  border-top: 1px solid var(--panel-edge);
  color: var(--ink-faint); font-size: 11.5px;
}
.gate-keys b { color: var(--cyan); font-weight: 600; }

/* --- transport ----------------------------------------------------------- */

.transport {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  box-shadow: var(--shadow-inset), 0 6px 18px rgba(0, 0, 0, 0.35);
}
.brand { padding-right: 16px; border-right: 1px solid var(--panel-edge); }
.brand-mark { font-weight: 700; letter-spacing: 0.26em; color: var(--amber); }
.brand-sub { font-size: 10px; letter-spacing: 0.2em; color: var(--ink-faint); text-transform: uppercase; }

.transport-main { display: flex; align-items: center; gap: 12px; }
.transport-play {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  font: 600 12px/1 inherit; letter-spacing: 0.18em;
  color: var(--ink);
  background: linear-gradient(180deg, #2a2f36, #1f232a);
  border: 1px solid var(--panel-edge);
  border-radius: 8px; cursor: pointer;
}
.transport-play .play-glyph {
  width: 0; height: 0;
  border-left: 11px solid var(--green);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}
.transport-play.is-on { border-color: var(--green); box-shadow: 0 0 0 1px rgba(110, 224, 122, 0.3), 0 0 22px rgba(110, 224, 122, 0.18); }
.transport-play.is-on .play-glyph {
  border: none; width: 11px; height: 12px; background: var(--green);
}

.bpm {
  min-width: 96px; padding: 6px 12px; text-align: center; cursor: ns-resize;
  background: var(--bg-deep); border: 1px solid var(--panel-edge); border-radius: 8px;
  touch-action: none;
}
.bpm-label { font-size: 9px; letter-spacing: 0.24em; color: var(--ink-faint); }
.bpm-value { font: 600 24px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--amber); }

.position-block { text-align: center; }
.mini-label { font-size: 9px; letter-spacing: 0.22em; color: var(--ink-faint); }
.position { font: 600 20px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--cyan); }
.beat-leds { display: flex; gap: 5px; justify-content: center; margin-top: 3px; }
.beat-led {
  width: 9px; height: 9px; border-radius: 50%;
  background: #24282e; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.7);
}
.beat-led.is-on { background: var(--amber); box-shadow: 0 0 10px rgba(255, 176, 32, 0.8); }

.transport-set, .transport-master { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.field { display: flex; flex-direction: column; gap: 3px; font-size: 9px; letter-spacing: 0.2em; color: var(--ink-faint); text-transform: uppercase; }
.field-inline { flex-direction: row; align-items: center; gap: 6px; }
.field-wide { min-width: 130px; }
.meter { background: var(--bg-deep); border: 1px solid var(--panel-edge); border-radius: 3px; }

/* --- deck layout --------------------------------------------------------- */

.deck {
  flex: 1; min-height: 0;
  display: grid; grid-template-rows: minmax(280px, 0.93fr) minmax(300px, 1.07fr); gap: 8px;
}
.deck-row { display: grid; gap: 8px; min-height: 0; }
.deck-row-top { grid-template-columns: minmax(280px, 332px) minmax(360px, 1fr) minmax(258px, 300px); }
.deck-row-bottom { grid-template-columns: minmax(392px, 470px) minmax(380px, 1fr); }
.mount { min-width: 0; min-height: 0; display: flex; }

.panel {
  display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  box-shadow: var(--shadow-inset), 0 6px 18px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.panel { position: relative; }
/* Panels that hold more than fits fade at the bottom, so the cut reads as
   "there is more below" rather than as a clipped layout. */
.panel-instrument::after, .panel-sampler::after {
  content: ''; position: absolute; left: 1px; right: 1px; bottom: 1px; height: 20px;
  background: linear-gradient(transparent, var(--panel)); pointer-events: none; border-radius: 0 0 12px 12px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; row-gap: 6px;
  padding: 7px 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
  border-bottom: 1px solid var(--panel-edge);
}
.panel-head h2 { white-space: nowrap; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-dim); }
.panel-head-tools { display: flex; align-items: center; justify-content: flex-end; gap: 5px; flex-wrap: wrap; flex: 1 1 auto; }
.panel-body { flex: 1; min-height: 0; padding: 8px 10px 14px; display: flex; flex-direction: column; gap: 8px; overflow: auto; }
.panel-body::-webkit-scrollbar, .rack::-webkit-scrollbar, .grid-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.panel-body::-webkit-scrollbar-thumb, .rack::-webkit-scrollbar-thumb, .grid-wrap::-webkit-scrollbar-thumb {
  background: #333941; border-radius: 4px; border: 2px solid transparent; background-clip: padding-box;
}

/* --- groups and controls ------------------------------------------------- */

.group { border-top: 1px solid rgba(255, 255, 255, 0.05); padding-top: 6px; }
.group:first-child { border-top: none; padding-top: 0; }
.group-title { font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 4px; }
.group-body { display: flex; flex-wrap: wrap; gap: 7px 3px; align-items: flex-start; }
.group-body-stack { flex-direction: column; align-items: stretch; }
.row { display: flex; gap: 8px; align-items: center; }

.knob {
  position: relative;
  width: 49px; display: flex; flex-direction: column; align-items: center; gap: 1px;
  cursor: ns-resize; touch-action: none; user-select: none;
  border-radius: 8px; padding: 2px 0;
}
.knob:focus-visible { outline: 1px solid var(--cyan); }
.knob-face { width: 43px; height: 43px; }
.knob-track { fill: none; stroke: #2b3037; stroke-width: 4; stroke-linecap: round; }
.knob-value-arc { fill: none; stroke: var(--amber); stroke-width: 4; stroke-linecap: round; }
.knob-cap { fill: url(#none); fill: #262b32; stroke: #3a4048; }
.knob-needle { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.knob.is-active .knob-value-arc, .knob:hover .knob-value-arc { stroke: #ffc85c; }
.knob.is-active .knob-cap { fill: #2d333b; }
.knob-label { font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.knob-readout { font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--cyan); }
.knob.is-learning { box-shadow: 0 0 0 1px var(--violet), 0 0 16px rgba(176, 136, 255, 0.4); }
.learn-badge {
  position: absolute; top: 0; right: 2px;
  font: 600 8px/1 ui-monospace, monospace; color: var(--violet); opacity: 0;
}
.learn-badge.is-bound { opacity: 1; }

.control { display: flex; flex-direction: column; gap: 4px; }
.control-label { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.segmented { display: inline-flex; background: var(--bg-deep); border: 1px solid var(--panel-edge); border-radius: 7px; overflow: hidden; }
.seg {
  padding: 6px 7px; font: 500 10px/1 inherit; letter-spacing: 0.06em; text-transform: capitalize;
  color: var(--ink-dim); background: transparent; border: none; cursor: pointer;
}
.seg + .seg { border-left: 1px solid var(--panel-edge); }
.seg.is-on { color: #14161a; background: var(--amber); }

.select {
  padding: 6px 8px; font: 500 11px/1 inherit; color: var(--ink);
  background: var(--bg-deep); border: 1px solid var(--panel-edge); border-radius: 7px; cursor: pointer;
}
.select-tiny { padding: 4px 6px; font-size: 10px; }

.switch {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 11px; font: 500 10px/1 inherit; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-dim); background: linear-gradient(180deg, #262b32, #1d2128);
  border: 1px solid var(--panel-edge); border-radius: 7px; cursor: pointer;
}
.switch-small { padding: 5px 9px; }
.switch .led, .unit-power .led {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2e333a; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
}
.switch.is-on { color: var(--ink); border-color: #4a5560; }
.switch.is-on .led { background: var(--green); box-shadow: 0 0 9px rgba(110, 224, 122, 0.8); }

.chip {
  padding: 6px 10px; font: 600 10px/1 inherit; letter-spacing: 0.14em;
  color: var(--ink-dim); background: linear-gradient(180deg, #262b32, #1d2128);
  border: 1px solid var(--panel-edge); border-radius: 7px; cursor: pointer;
}
.chip:hover { color: var(--ink); border-color: #4a5560; }
.chip.is-on { color: #14161a; background: var(--amber); border-color: var(--amber); }
.chip-warn:hover { color: var(--red); border-color: var(--red); }
.chip-rec.is-on { background: var(--red); border-color: var(--red); color: #fff; animation: pulse 0.8s steps(2, end) infinite; }
.capture-state { font: 600 9.5px/1 ui-monospace, monospace; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); }
.panel-sampler.is-capturing { border-color: rgba(255, 77, 94, 0.5); }
.chip-value { font: 600 11px/1 ui-monospace, monospace; color: var(--cyan); min-width: 26px; text-align: center; }
.chip-pattern { min-width: 30px; }
.chip-pattern.is-queued { border-color: var(--cyan); color: var(--cyan); }

.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 3px; background: #2a2f36; outline: none; }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: linear-gradient(180deg, #f2f5f8, #b9c1cb); border: 1px solid #0c0d10; cursor: pointer;
}
.slider::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #e7ebf0; border: 1px solid #0c0d10; cursor: pointer; }
.slider-small { width: 88px; }

/* --- effects rack -------------------------------------------------------- */

.panel-body-rack { padding: 10px; }
.rack { display: flex; align-items: flex-start; gap: 9px; overflow-x: auto; padding-bottom: 6px; }
.rack-empty { color: var(--ink-faint); padding: 26px 12px; font-style: italic; }
.unit {
  flex: 0 0 auto; width: 178px;
  background: linear-gradient(180deg, #212530, #1a1d24);
  border: 1px solid var(--panel-edge); border-radius: 10px; padding: 8px;
  box-shadow: var(--shadow-inset);
}
.unit.is-bypassed { opacity: 0.5; }
.unit-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.unit-name { flex: 1; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-dim); }
.unit-power {
  display: grid; place-items: center; width: 20px; height: 20px;
  background: #1a1d23; border: 1px solid var(--panel-edge); border-radius: 50%; cursor: pointer;
}
.unit-power.is-on .led { background: var(--amber); box-shadow: 0 0 9px rgba(255, 176, 32, 0.85); }
.unit-tools { display: flex; gap: 2px; }
.icon {
  width: 20px; height: 20px; font-size: 9px; color: var(--ink-faint);
  background: transparent; border: 1px solid transparent; border-radius: 5px; cursor: pointer;
}
.icon:hover { color: var(--ink); border-color: var(--panel-edge); }
.icon-danger:hover { color: var(--red); border-color: var(--red); }
.unit-body { display: flex; flex-wrap: wrap; gap: 8px 4px; }
.pad-choke { align-self: center; width: 84px; }
/* The selected pad's own controls: the same card, a little wider for its name. */
/* Wide enough that Level, Pitch, Start, Decay, Pan and the choke selector
   share one row — which is what keeps the rack under the pads on screen. */
.unit-pad { width: 372px; border-color: #3c4a52; }
.unit-pad .unit-name { color: var(--cyan); text-transform: none; letter-spacing: 0.06em; font-size: 10.5px; }
.unit-note { margin-top: 6px; font-size: 10px; color: var(--red); }
.reduction { height: 3px; margin-top: 8px; background: #2a2f36; border-radius: 2px; overflow: hidden; }
.reduction-fill { height: 100%; width: 0; background: var(--cyan); transition: width 0.08s linear; }

/* --- looper lanes -------------------------------------------------------- */

.panel-body-lanes { gap: 8px; }
.lanes { display: flex; flex-direction: column; gap: 4px; }
.lane {
  padding: 4px 8px; border-radius: 9px;
  background: linear-gradient(180deg, #202530, #1a1d23);
  border: 1px solid var(--panel-edge);
}
.lane.is-recording { border-color: var(--red); box-shadow: 0 0 0 1px rgba(255, 77, 94, 0.35), 0 0 20px rgba(255, 77, 94, 0.12); }
.lane.is-armed { border-color: var(--amber); animation: pulse 0.6s steps(2, end) infinite; }
.lane.is-playing { border-color: rgba(110, 224, 122, 0.55); }
.lane.is-muted { opacity: 0.55; }
@keyframes pulse { 50% { opacity: 0.55; } }
.lane-head { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.lane-name { font-size: 11px; letter-spacing: 0.06em; color: var(--ink); white-space: nowrap; }
.lane-state { flex: 0 0 auto; min-width: 46px; font: 600 9px/1 ui-monospace, monospace; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); }
.lane.is-recording .lane-state { color: var(--red); }
.lane.is-playing .lane-state { color: var(--green); }
.lane-controls { display: flex; gap: 5px; }
.lane-rec {
  display: flex; align-items: center; gap: 6px; flex: 1.2;
  padding: 5px 9px; font: 600 10px/1 inherit; letter-spacing: 0.14em;
  color: var(--ink-dim); background: linear-gradient(180deg, #2a2026, #201a1e);
  border: 1px solid #443036; border-radius: 7px; cursor: pointer;
}
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #4a2b31; }
.lane-rec.is-on { color: #fff; background: linear-gradient(180deg, #ff5c6c, #d63146); border-color: #ff8a95; }
.lane-rec.is-on .rec-dot { background: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, 0.9); }
.lane-btn {
  flex: 1; padding: 5px 4px; font: 600 9.5px/1 inherit; letter-spacing: 0.1em;
  color: var(--ink-dim); background: linear-gradient(180deg, #262b32, #1d2128);
  border: 1px solid var(--panel-edge); border-radius: 7px; cursor: pointer;
}
.lane-btn.is-on { color: #14161a; background: var(--green); border-color: var(--green); }
.lane-btn-danger:hover { color: var(--red); border-color: var(--red); }
.lane-progress { height: 3px; margin: 5px 0 0; background: #191c22; border-radius: 3px; overflow: hidden; }
.lane-progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--amber)); }
.lane-head .slider { flex: 1; width: auto; min-width: 46px; }

/* --- sampler pads -------------------------------------------------------- */

.panel-body-pads { gap: 8px; }
.panel-body-pads .pads-area { flex: 1 1 auto; min-height: min-content; }
.panel-body-pads .pad-editor { flex: 0 0 auto; min-width: 0; }
.pads-area { display: grid; grid-template-columns: 1fr 18px; gap: 6px; align-items: stretch; }
/* Pads swallow touch drags so playing never scrolls the page; the rail beside
   them is the deliberate way to scroll. */
/* Pads fill whatever height the panel has, with a floor that keeps them
   thumb-sized when the layout stacks on a phone. */
.pads { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(36px, 1fr); gap: 5px; height: 100%; touch-action: none; }
.pads-rail {
  display: grid; place-items: center; touch-action: pan-y; cursor: grab;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.18));
  border: 1px solid var(--panel-edge); border-radius: 7px;
}
.pads-rail:active { cursor: grabbing; }
.pads-rail-grip {
  width: 3px; height: 34px; border-radius: 2px;
  background: repeating-linear-gradient(180deg, var(--ink-faint) 0 2px, transparent 2px 5px);
  opacity: 0.7;
}
.pad {
  position: relative; padding: 5px 7px;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  color: var(--ink-faint); text-align: left;
  background: linear-gradient(180deg, #232830, #1a1e24);
  border: 1px solid var(--panel-edge); border-radius: 9px; cursor: pointer;
  box-shadow: var(--shadow-inset);
}
.pad-index { font: 600 9px/1 ui-monospace, monospace; color: var(--ink-faint); }
.pad-name { font-size: 10.5px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pad.is-loaded { border-color: #3d4650; }
.pad.is-loaded .pad-name { color: var(--ink); }
.pad.is-selected { border-color: var(--cyan); box-shadow: 0 0 0 1px rgba(53, 208, 216, 0.35), var(--shadow-inset); }
.pad.is-drop { border-color: var(--amber); border-style: dashed; }
.pad.is-hit { animation: padflash 0.22s ease-out; }
@keyframes padflash {
  from { background: var(--amber); color: #14161a; }
  to { background: linear-gradient(180deg, #232830, #1a1e24); }
}
.pad-editor { border-top: 1px solid var(--panel-edge); padding-top: 8px; min-width: 0; }
.pad-editor-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pad-editor-head .mini-label { flex: 1; }

/* --- sequencer ----------------------------------------------------------- */

.panel-body-grid { padding: 8px 10px 12px; }
.grid-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-x: auto; }
.grid-row { display: flex; align-items: center; gap: 4px; }
.grid-label {
  flex: 0 0 86px; padding: 5px 7px; font: 500 10px/1 inherit; text-align: left;
  color: var(--ink-dim); background: #1a1e24; border: 1px solid var(--panel-edge); border-radius: 6px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.grid-label:hover { color: var(--ink); border-color: #4a5560; }
.grid-label.is-selected { color: #14161a; background: var(--cyan); border-color: var(--cyan); }
.grid-clear { width: 20px; padding: 4px 0; font-size: 9px; color: var(--ink-faint); background: transparent; border: none; cursor: pointer; }
.grid-clear:hover { color: var(--red); }
.step {
  flex: 1 1 0; min-width: 14px; height: 26px; padding: 0;
  background: #1c2027; border: 1px solid #262b33; border-radius: 4px; cursor: pointer;
}
.step.step-downbeat { background: #21262e; border-color: #2e343d; }
.step:hover { border-color: #4a5560; }
.step.is-on { background: var(--amber); border-color: #ffd06a; }
.step.is-on[data-velocity="mid"] { background: #c98b1e; }
.step.is-on[data-velocity="low"] { background: #8a6220; }
.step.is-playhead { box-shadow: inset 0 0 0 1px var(--cyan); }
.step.is-on.is-playhead { background: #fff0cd; }
.patterns { display: flex; gap: 4px; }

/* --- keyboard strip ------------------------------------------------------ */

.keys-strip {
  position: sticky; bottom: 0; z-index: 10;
  padding: 8px 12px 10px; margin: 0 -10px;
  background: linear-gradient(180deg, rgba(15, 17, 19, 0.6), var(--bg-deep) 40%);
  border-top: 1px solid var(--panel-edge);
}
.keys-hint { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 10px; color: var(--ink-faint); letter-spacing: 0.1em; text-transform: uppercase; }
.chip-keys { margin-left: auto; }
.keys-strip.is-collapsed .keys-mount { display: none; }
.keys-strip.is-collapsed .keys-hint { margin-bottom: 0; }
.flow b { color: var(--amber); }
.flow-arrow { color: var(--panel-edge); }
.keyboard {
  position: relative; height: 104px; width: 100%;
  background: #0c0e11; border: 1px solid var(--panel-edge); border-radius: 8px; overflow: hidden;
  touch-action: none; user-select: none;
}
.key { position: absolute; top: 0; cursor: pointer; }
.key-white {
  height: 100%;
  background: linear-gradient(180deg, #f3f5f8 0%, #d9dee5 88%, #c2c8d0 100%);
  border-right: 1px solid #aeb5be; border-radius: 0 0 4px 4px;
}
.key-black {
  height: 62%; z-index: 2;
  background: linear-gradient(180deg, #2b3038, #12151a);
  border-radius: 0 0 4px 4px; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6);
}
.key-white.is-on { background: linear-gradient(180deg, #ffd88a, var(--amber)); }
.key-black.is-on { background: linear-gradient(180deg, #ffb84a, #d98a12); }
.key-name { position: absolute; bottom: 5px; left: 0; right: 0; text-align: center; font-size: 9px; color: #8b93a0; pointer-events: none; }

/* --- toasts -------------------------------------------------------------- */

.toasts { position: fixed; right: 14px; bottom: 172px; z-index: 40; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
/* With the keyboard hidden the strip is a single row, so drop them down. */
.keys-strip.is-collapsed ~ .toasts { bottom: 56px; }
.toast {
  padding: 8px 12px; font-size: 11.5px; color: var(--ink);
  background: rgba(28, 32, 39, 0.96); border: 1px solid var(--panel-edge); border-radius: 8px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45); transition: opacity 0.35s ease, transform 0.35s ease;
}
.toast.is-out { opacity: 0; transform: translateY(-6px); }

body.is-learning { cursor: crosshair; }

.input-meter { flex: 1; height: 6px; background: #191c22; border-radius: 3px; overflow: hidden; }
.input-meter-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--green)); }

/* --- narrow screens ------------------------------------------------------ */

@media (max-width: 1180px) {
  .deck-row-top, .deck-row-bottom { grid-template-columns: 1fr; }
  .transport-set, .transport-master { margin-left: 0; }
}
