/* Yocoda — styles */
:root {
  --bg: #0e0f13; --panel: #171920; --panel2: #1e2029; --line: #2a2d38;
  --text: #e8e9ee; --muted: #8b8fa0; --accent: #ff5c8a; --accent2: #5ce1ff;
  --ok: #6be38a; --warn: #ffb347;
  --dock-h: 0px;
}
* { box-sizing: border-box; }
/* No double-tap-to-zoom anywhere (taps also fire instantly); pinch-zoom still works for accessibility. */
html, body { touch-action: manipulation; }
/* An instrument, not a document: no text selection, no long-press callout/magnifier, no dragging images. */
html, body, * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
img, svg, canvas { -webkit-user-drag: none; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 20px; padding-top: max(14px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: #12131a; position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; }
.transport { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
h1 { margin: 0 12px 0 0; font-size: 20px; letter-spacing: .5px; white-space: nowrap; }
h1 span { color: var(--accent); }
h2 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); font-weight: 600; }
button, select, input, summary, label, canvas, .card, header, main { touch-action: manipulation; }
button, select { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer; touch-action: manipulation; }
select { max-width: 100%; }
@media (hover: hover) { button:hover { border-color: #444857; } }
button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
button.big { font-weight: 600; min-width: 150px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #555; margin-right: 8px; vertical-align: middle; }
button.on .dot { background: #fff; box-shadow: 0 0 8px #fff; }
.meters { display: flex; gap: 8px; align-items: center; }
header > .meters-slot { margin-left: auto; }
.meter { width: 110px; height: 8px; background: var(--panel2); border-radius: 4px; overflow: hidden; }
.meter > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), var(--warn) 75%, var(--accent)); transition: width .05s; }
.mlabel { font-size: 11px; color: var(--muted); margin-left: 6px; }
main { padding: 16px 20px 40px; max-width: 1400px; margin: 0 auto; display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.full { grid-column: 1 / -1; }
details.card > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h2 { margin: 0; }
details.card > summary::after { content: '▾'; color: var(--muted); transition: transform .15s; }
details.card:not([open]) > summary::after { transform: rotate(-90deg); }
details.card[open] > summary { margin-bottom: 12px; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.presets button { text-align: left; padding: 10px 12px; }
.presets button small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.presets button.on small { color: #ffe3ec; }
.controls { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 18px; }
.ctl { min-width: 0; }
.ctl label { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.ctl label b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ctl input[type=range] { width: 100%; margin: 4px 0; accent-color: var(--accent); }
.ctl select { width: 100%; padding: 5px 8px; }
#roll { height: 220px; } #bands { height: 120px; margin-bottom: 12px; }
canvas { display: block; width: 100%; background: #0b0c10; border-radius: 8px; border: 1px solid var(--line); }
.dock-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.dock-bar .oct { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.dock-bar .oct b { color: var(--text); font-size: 14px; min-width: 1ch; text-align: center; }
.dock-quick { display: none; gap: 8px; }
#piano { position: relative; height: 150px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; margin-top: 10px; }
.wk, .bk { position: absolute; top: 0; border-radius: 0 0 6px 6px; display: flex; align-items: flex-end; justify-content: center; font-size: 11px; padding-bottom: 6px; font-weight: 600; }
.wk { height: 100%; background: linear-gradient(#f4f4f6, #d9dae0); border: 1px solid #999; color: #555; z-index: 1; }
.bk { height: 62%; background: linear-gradient(#2c2e36, #111); border: 1px solid #000; color: #bbb; z-index: 2; }
.wk.down { background: linear-gradient(#ffd0de, var(--accent)); color: #fff; }
.bk.down { background: linear-gradient(#ff8fb0, #b8325a); }
.wk .c { position: absolute; bottom: 24px; font-size: 10px; color: #999; font-weight: 400; pointer-events: none; }
.lab { pointer-events: none; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hint { color: var(--muted); font-size: 12px; }
kbd { background: var(--panel2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; font-size: 11px; font-family: ui-monospace, monospace; color: var(--text); }
.warn { color: var(--warn); }
#status { font-size: 12px; color: var(--muted); flex-basis: 100%; }

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; padding: 12px; }
}

/* touch devices: no physical keyboard labels */
@media (hover: none) and (pointer: coarse) {
  .kbd-hint, .lab { display: none; }
  .wk .c { bottom: 8px; }
}

/* phones */
@media (max-width: 700px) {
  header { position: static; padding: 10px 12px; gap: 8px; padding-top: max(10px, env(safe-area-inset-top)); }
  .brand { width: 100%; justify-content: space-between; }
  h1 { font-size: 18px; }
  .meter { width: 56px; }
  .transport { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .transport button { padding: 11px 10px; min-width: 0; white-space: nowrap; }
  .transport select { padding: 9px 10px; min-width: 0; width: 100%; }
  #status { font-size: 12px; }
  main { padding: 10px 10px calc(var(--dock-h) + 20px); gap: 10px; }
  .card { padding: 12px; border-radius: 10px; }
  .presets { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -12px; padding: 0 12px 4px; scrollbar-width: none; }
  .presets::-webkit-scrollbar { display: none; }
  .presets button { flex: 0 0 auto; min-width: 128px; scroll-snap-align: start; }
  .controls { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px 14px; }
  .ctl input[type=range] { height: 28px; }
  .ctl select { padding: 8px; }
  #roll { height: 120px; }
  #bands { height: 80px; }
  /* keyboard docks to the bottom of the screen */
  #dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: #12131a; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 8px 8px max(8px, env(safe-area-inset-bottom)); padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
  .dock-bar { margin-top: 0; }
  .dock-bar button { padding: 9px 14px; }
  .dock-quick { display: flex; }
  #piano { height: 140px; margin-top: 8px; }
}
@media (max-width: 700px) and (max-height: 500px), (max-height: 500px) and (pointer: coarse) {
  /* landscape phones */
  #dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: #12131a; border-top: 1px solid var(--line); padding: 6px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .dock-bar { margin-top: 0; }
  .dock-quick { display: flex; }
  .dock-bar button { padding: 6px 12px; }
  #piano { height: 100px; margin-top: 6px; }
  main { padding-bottom: calc(var(--dock-h) + 20px); }
  header { position: static; }
  #roll { height: 100px; }
}

/* formerly inline style attributes (the CSP allows no inline styles) */
.row.spread { justify-content: space-between; margin-bottom: 8px; }
h2.flush { margin: 0; }
h2.sub { margin: 16px 0 8px; }
p.hint.note { margin: 8px 0 0; }

/* iOS zooms into any focused form control with text smaller than 16px — keep them at 16px on touch screens */
@media (hover: none) and (pointer: coarse) {
  select, input { font-size: 16px; }
}
