/* Waffle — styles for both views. Dark and warm, so it reads well on a stage or at night. */
@font-face { font-family: 'Waffle Mono'; src: url('fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Waffle Mono'; src: url('fonts/jetbrains-mono-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root { --op: #FFB38A; --val: #E9D8A6; --shade: 0%; }
:root, [data-theme="waffle"] {
  --bg: #0E0C0A; --bg2: #16130F; --panel: #1F1B16; --panel2: #241F19; --panel3: #29241D; --line: #3A332A; --line2: #4A4237;
  --hair: #2E2820; --well: #16130F; --deep: #120F0C; --gutter: #5E5649; --grip: #4F473B; --sing: #FFC2AA; --singline: #5A3A30;
  --text: #F3EDE2; --muted: #B5AA98; --dim: #8C826F; --key: #F5C451; --ok: #9FD36B; --err: #FF8A5B; --warn: #FFB38A; --ink: #16130F;
  --mono: 'Waffle Mono', 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --code-size: 15px; --code-line: 28px;
  color-scheme: dark;
}
[data-theme="night"] {
  --bg: #0B0E16; --bg2: #111522; --panel: #171C2C; --panel2: #1C2234; --panel3: #222943; --line: #2E3652; --line2: #3B4566;
  --hair: #1F2638; --well: #111522; --deep: #0D111B; --gutter: #4C5677; --grip: #3E4763; --sing: #FFC2AA; --singline: #4A3550;
  --text: #E8ECF8; --muted: #A4ADC8; --dim: #7A84A3; --key: #7FD1FF; --ok: #8EE6A8; --err: #FF7A90; --warn: #FFB38A; --ink: #0B0E16;
}
[data-theme="candy"] {
  --bg: #140A16; --bg2: #1C0F1F; --panel: #26142A; --panel2: #2D1832; --panel3: #341C3A; --line: #45264C; --line2: #5A3362;
  --hair: #2F1934; --well: #1C0F1F; --deep: #170C1A; --gutter: #6E4A77; --grip: #5A3A62; --sing: #FFD1F0; --singline: #6A3060;
  --text: #FBEFFF; --muted: #D2B6DB; --dim: #A585B0; --key: #FF8AD8; --ok: #A9F0B0; --err: #FF8A8A; --warn: #FFC38A; --ink: #1C0F1F;
}
[data-theme="paper"] {
  --bg: #FBF7EF; --bg2: #F3ECDF; --panel: #FFFFFF; --panel2: #F6F0E4; --panel3: #EFE6D6; --line: #DCCFB8; --line2: #C9B999;
  --hair: #E6DCCB; --well: #F1E9DA; --deep: #EDE3D1; --gutter: #A8987C; --grip: #BFAE90; --sing: #B4472A; --singline: #E3B9A8;
  --text: #2A231B; --muted: #5E5245; --dim: #857762; --key: #B07A00; --ok: #3E8E2A; --err: #C2410C; --warn: #A3530F; --ink: #FFFFFF;
  --op: #B4472A; --val: #7A5A12; --shade: 38%;
  color-scheme: light;
}
[data-theme="contrast"] {
  --bg: #000000; --bg2: #0A0A0A; --panel: #141414; --panel2: #1C1C1C; --panel3: #242424; --line: #6B6B6B; --line2: #9A9A9A;
  --hair: #3A3A3A; --well: #0A0A0A; --deep: #050505; --gutter: #A0A0A0; --grip: #8A8A8A; --sing: #FFD0B8; --singline: #8A4A30;
  --text: #FFFFFF; --muted: #E0E0E0; --dim: #BDBDBD; --key: #FFE14D; --ok: #7DFF8A; --err: #FF6B6B; --warn: #FFB870; --ink: #000000;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
/* Everything is drawn at 75% of the browser's size. The page is made taller by the same amount so it
   still fills the window. (The screen-size rules below are 75% of their old widths to match.) */
:root { --ui-zoom: 0.75; }
body { font-family: var(--sans); display: flex; flex-direction: column; zoom: var(--ui-zoom); height: calc(100vh / var(--ui-zoom)); height: calc(100dvh / var(--ui-zoom)); overflow: hidden; }
#topbar { flex: none; }
.view { flex: 1 1 auto; min-height: 0; }
.view[hidden] { display: none !important; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--key); outline-offset: 2px; }

/* ---------- visual ---------- */
.vis { display: flex; flex-direction: column; overflow: hidden; height: 100%; background: var(--bg); font-family: var(--sans); color: var(--text); font-size: 14px; }
.vis button { cursor: pointer; }
.vh-grow { flex: 1 1 0px; min-width: 0; }
.vh-dim, .vis-dim, .vd-dim { color: var(--dim); }

/* header: one row */
.vh { flex: none; height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--hair); background: var(--bg2); position: relative; z-index: 40; }
.vh-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; margin-right: 2px; }
.vh-line { width: 1px; height: 24px; background: var(--line); }
.vh-btn { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--text); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.vh-btn:hover, .vh-round:hover { border-color: var(--line2); background: var(--panel); }
.vh-songname, .vh-loopname { max-width: 12em; overflow: hidden; text-overflow: ellipsis; }
.vh-play { flex: none; width: 38px; height: 38px; border-radius: 19px; border: none; background: var(--key); color: var(--well); display: flex; align-items: center; justify-content: center; padding: 0; }
.vh-play .ico-pause { display: none; }
.vh-play.playing .ico-pause { display: inline; }
.vh-play.playing .ico-play { display: none; }
.vh-round:disabled { opacity: 0.35; cursor: default; border-color: var(--line); background: transparent; }
.vh-undo, .vh-redo { width: 34px; height: 34px; }
.vh-round { flex: none; width: 38px; height: 38px; border-radius: 19px; border: 1px solid var(--line); background: transparent; color: var(--text); display: flex; align-items: center; justify-content: center; padding: 0; }
.vh-panel { border-radius: 9px; }
.vh-panel.on { color: var(--key); border-color: var(--line2); }
.vh-where { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.vh-sing { border-color: var(--singline); color: var(--sing); }
.vh-sing svg { color: #FF8A5B; }
.vh-steps { display: flex; align-items: center; gap: 2px; padding: 3px 3px 3px 9px; border: 1px solid var(--line); border-radius: 10px; }
.vh-steps .vh-dim { margin-right: 4px; font-size: 13px; }
.vh-steps button { height: 28px; min-width: 32px; padding: 0 8px; border: none; border-radius: 7px; background: transparent; color: var(--muted); font-family: var(--mono); font-size: 13px; }
.vh-steps button.on { background: var(--panel2); color: var(--key); font-weight: 700; box-shadow: inset 0 0 0 1px var(--line2); }
.vh-menu { position: relative; }
.vh-menu[hidden] { display: none; }
.vh-pop { position: absolute; left: 0; top: 44px; z-index: 50; min-width: 250px; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; box-shadow: 0 18px 44px rgba(0,0,0,0.55); }
.vh-pop.vh-right { left: auto; right: 0; }
.vh-pop[hidden] { display: none; }
.vh-pop button { display: flex; align-items: center; gap: 8px; text-align: left; background: transparent; border: none; color: var(--text); padding: 0 10px; height: 36px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.vh-pop button:hover, .vh-pop button:focus-visible { background: var(--panel2); }
.vh-pop kbd { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.vh-poplabel { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); padding: 6px 10px 4px; }
.vh-name { margin: 0 6px 4px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); font: inherit; font-weight: 600; }
.vh-sep2 { height: 1px; background: var(--line); margin: 4px 6px; }
.vh-check { width: 14px; color: var(--key); font-weight: 700; }

/* body: code on the left, the side panel on the right */
.vb { flex: 1 1 auto; min-height: 0; display: flex; position: relative; }
.ve { position: relative; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.vis-strip { flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--hair); }
.vis-strip[hidden] { display: none; }
/* where the music is: a pointer that sweeps across the longest line playing */
.ve-ruler { flex: none; position: relative; height: 20px; border-bottom: 1px solid var(--hair); font-family: var(--sans); }
.ve-rulercv { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.vis-strip-lab { font-size: 12px; color: var(--muted); white-space: nowrap; }
.vis-strip-lab b { color: var(--text); }
.vis-strip-bar { position: relative; flex: 1 1 auto; min-width: 0; display: flex; gap: 3px; height: 26px; }
.vis-seg { min-width: 0; border: none; border-radius: 6px; color: var(--well); font-size: 12px; font-weight: 700; display: flex; align-items: center; padding: 0 8px; overflow: hidden; white-space: nowrap; }
.vis-seg.fade { color: var(--text); }
.vis-strip-ph { position: absolute; top: -3px; bottom: -3px; width: 3px; border-radius: 2px; background: var(--text); box-shadow: 0 0 0 2px var(--bg); opacity: 0; pointer-events: none; }

.ve-editor { flex: 1 1 auto; min-height: 0; position: relative; overflow: hidden; }
.ve-editor .cm-editor { height: 100%; background: transparent; color: var(--text); }
.ve-bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; display: none; }
.vis-behind .ve-bg { display: block; }
.ve-editor .cm-editor { position: relative; z-index: 1; }
.vis-behind .ve-editor .cm-line { text-shadow: 0 0 6px var(--bg), 0 0 2px var(--bg); }
.vis-behind .ve-editor .cm-activeLine { background: color-mix(in srgb, var(--bg) 55%, transparent); }
.ve-editor .cm-editor.cm-focused { outline: none; }
.ve-editor .cm-scroller { font-family: var(--mono); font-size: var(--code-size); line-height: var(--code-line); overflow: auto; }
.ve-editor .cm-content { padding: 14px 0 80px; caret-color: var(--key); }
.ve-editor .cm-line { padding: 0 24px 0 14px; }
.ve-editor .cm-gutters { background: transparent; border: none; color: var(--gutter); }
.ve-editor .cm-lineNumbers .cm-gutterElement { min-width: 34px; padding: 0 6px 0 8px; font-size: 13px; cursor: grab; border-radius: 4px; }
.ve-editor .cm-lineNumbers .cm-gutterElement:hover { color: var(--key); background: var(--panel); }
/* the text cursor: thick and bright, so you always see where you clicked */
.ve-editor .cm-cursor, .ve-editor .cm-dropCursor { border-left: 3px solid var(--key) !important; margin-left: -1px; box-shadow: 0 0 8px color-mix(in srgb, var(--key) 70%, transparent); }
.ve-editor .cm-cursorLayer { z-index: 3; }
.ve-editor .cm-activeLineGutter { color: var(--key) !important; }
.ve-editor .cm-selectionBackground, .ve-editor .cm-focused .cm-selectionBackground { background: color-mix(in srgb, var(--key) 22%, transparent) !important; }
.ve-editor .cm-focused .cm-activeLine, .ve-editor .cm-activeLine { background: color-mix(in srgb, var(--key) 7%, transparent); }
.ve-editor .cm-activeLineGutter { background: transparent; font-weight: 700; }
.ve-editor .cm-placeholder { color: var(--dim); }
.ve-at { border-radius: 2px; box-shadow: inset 0 -3px 0 var(--c); color: var(--text) !important; }
.ve-on { background: color-mix(in srgb, var(--c) 24%, transparent); box-shadow: 0 0 0 1.5px var(--c), 0 0 14px color-mix(in srgb, var(--c) 45%, transparent); border-radius: 3px; color: #fff !important; }

/* the moving note strip under each sound line */
.ve-strip { display: flex; align-items: center; gap: 6px; height: 34px; margin: 0; padding: 2px 24px 8px 0; box-sizing: content-box; }
.ve-strip-tools { flex: none; width: 64px; display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.ve-strip canvas { flex: 1 1 auto; min-width: 0; height: 34px; border-radius: 7px; background: var(--well); cursor: pointer; }
.ve-strip.muted canvas { background: var(--deep); }
.ve-strip.tall { height: 96px; }
.ve-strip.tall canvas { height: 96px; cursor: default; }
.ve-strip[data-kind="wave"] canvas { cursor: default; }
.ve-grip { flex: none; width: 14px; height: 22px; border: none; border-radius: 4px; background: transparent; color: var(--grip); padding: 0; display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; }
.ve-strip:hover .ve-grip, .ve-grip:focus-visible { color: var(--muted); }
.ve-grip:hover { color: var(--key); background: var(--panel); }
.ve-mute { flex: none; width: 22px; height: 22px; border-radius: 5px; border: 1px solid transparent; background: transparent; color: var(--dim); display: flex; align-items: center; justify-content: center; padding: 0; }
.ve-mute:hover { border-color: var(--line); color: var(--text); }
.ve-strip.muted .ve-mute { color: var(--err); }
.ve-partbar { white-space: nowrap; }
.ve-partedit { margin-left: 6px; background: transparent; border: 1px solid var(--line2); color: var(--text); border-radius: 6px; padding: 0 8px; font-family: var(--sans); font-size: 12px; line-height: 20px; vertical-align: 1px; cursor: pointer; }
.ve-partedit:hover { border-color: var(--key); color: var(--key); }
.ve-partbtn { margin-left: 14px; background: transparent; border: 1px dashed var(--line2); color: var(--muted); border-radius: 6px; padding: 0 8px; font-family: var(--sans); font-size: 12px; line-height: 20px; vertical-align: 1px; }
.ve-partbtn:hover { border-color: var(--key); color: var(--key); }
.ve-partbtn.on { border: 1px solid transparent; color: var(--ok); }

.dragging, .dragging * { cursor: grabbing !important; user-select: none; }
.ve-drop { position: absolute; left: 40px; right: 8px; height: 3px; border-radius: 2px; background: var(--key); box-shadow: 0 0 10px color-mix(in srgb, var(--key) 60%, transparent); pointer-events: none; z-index: 20; }
.ve-dragsrc { position: absolute; left: 40px; right: 4px; border-radius: 6px; background: color-mix(in srgb, var(--key) 10%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--key) 55%, transparent); pointer-events: none; z-index: 19; }
.ve-rowmenu { position: absolute; z-index: 45; min-width: 220px; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; box-shadow: 0 18px 44px rgba(0,0,0,0.55); }
.ve-rowmenu button { display: flex; align-items: center; gap: 8px; text-align: left; background: transparent; border: none; color: var(--text); padding: 0 10px; height: 34px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.ve-rowmenu button:hover, .ve-rowmenu button:focus-visible { background: var(--panel2); }
.ve-rowmenu button.danger { color: var(--warn); }
.ve-rowmenu kbd { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.vis-tip { z-index: 30; }

/* sliders inside the code */
.ve-slider { display: inline-block; position: relative; width: 76px; height: 18px; margin: 0 6px 0 8px; vertical-align: -3px; cursor: ew-resize; touch-action: none; }
.ve-sl-track { position: absolute; left: 0; right: 0; top: 7px; height: 4px; border-radius: 2px; background: var(--line); }
.ve-sl-fill { position: absolute; left: 0; top: 7px; height: 4px; border-radius: 2px; width: calc(var(--f) * 100%); background: var(--c); }
.ve-sl-knob { position: absolute; top: 2px; left: calc(var(--f) * 100% - 7px); width: 14px; height: 14px; border-radius: 7px; background: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 35%, transparent); }
.ve-slider:hover .ve-sl-knob, .sliding .ve-sl-knob { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 55%, transparent); }
.sliding, .sliding * { cursor: ew-resize !important; user-select: none; }

/* the sound you hear */
.ve-master { flex: none; position: relative; height: 76px; margin: 6px 24px 10px 54px; border-radius: 9px; background: var(--well); }
.ve-master canvas { display: block; width: 100%; height: 100%; }
.ve-master-lab { position: absolute; left: 10px; top: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); pointer-events: none; }
.ve-flash { position: absolute; border-radius: 4px; background: color-mix(in srgb, var(--key) 45%, transparent); pointer-events: none; animation: wflash 0.9s ease-out forwards; z-index: 5; }
.ve-flash.soft { background: transparent; box-shadow: 0 0 0 1.5px var(--key), 0 0 14px color-mix(in srgb, var(--key) 35%, transparent); animation-duration: 0.7s; }
@keyframes wflash { to { opacity: 0; } }

.k-kw { color: var(--key); }
.k-name { font-weight: 700; }
.k-hit { color: var(--text); }
.k-rest { color: var(--dim); }
.k-maybe { color: var(--key); font-weight: 700; }
.k-num { color: var(--text); }
.k-op { color: var(--op); }
.k-str { color: var(--sing); }
.k-tweak { color: var(--muted); }
.k-flavor { color: var(--muted); }
.k-val { color: var(--val); }
.k-part { color: var(--text); font-weight: 700; }
.k-comment { color: var(--dim); font-style: italic; }
.k-err { text-decoration: underline wavy var(--err); text-underline-offset: 5px; }

/* autocomplete */
.ac { position: absolute; z-index: 30; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 18px 44px rgba(0,0,0,0.6); padding: 6px; display: flex; flex-direction: column; }
.ac[hidden] { display: none; }
.ac-row { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 8px; border-radius: 8px; cursor: pointer; min-width: 0; }
.ac-row.on { background: var(--hair); }
.ac-row:hover { background: var(--panel2); }
.ac-hear { flex: none; width: 26px; height: 26px; border-radius: 13px; border: 1px solid var(--line2); background: transparent; color: var(--text); display: flex; align-items: center; justify-content: center; padding: 0; }
.ac-row.on .ac-hear { background: var(--key); border-color: var(--key); color: var(--well); }
.ac-hear.none { border: none; }
.ac-label { flex: none; max-width: 46%; font-family: var(--mono); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-desc { flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-kind { flex: none; font-size: 11px; color: var(--dim); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.ac-foot { display: flex; justify-content: space-between; gap: 12px; padding: 7px 8px 3px; border-top: 1px solid var(--hair); margin-top: 4px; font-size: 12px; color: var(--dim); }

.vis-tip { position: absolute; z-index: 25; max-width: 320px; background: var(--panel3); border: 1px solid var(--line2); border-radius: 10px; padding: 9px 11px; font-size: 13px; line-height: 1.45; color: var(--text); box-shadow: 0 12px 30px rgba(0,0,0,0.45); pointer-events: none; }
.vis-tip b { color: var(--key); font-family: var(--mono); }
.vis-tip[hidden] { display: none; }

/* side panel */
.vd { flex: none; width: 340px; display: flex; flex-direction: column; border-left: 1px solid var(--hair); background: var(--bg2); overflow: hidden; }
.vd[hidden] { display: none; }
.vd-tabs { flex: none; display: flex; align-items: flex-end; gap: 0; padding: 8px 6px 0; border-bottom: 1px solid var(--hair); }
.vd-tabs [data-tab] { height: 38px; padding: 0 7px; border: none; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 14px; white-space: nowrap; }
.vd-tabs [data-tab].on { color: var(--text); font-weight: 600; border-bottom-color: var(--key); }
.vd-close { width: 26px; height: 36px; border: none; background: transparent; color: var(--dim); font-size: 20px; padding: 0; }
.vd-close:hover { color: var(--text); }
.vd-pane { flex: 1 1 auto; min-height: 0; padding: 14px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.vd-pane[hidden] { display: none; }
.vd-h { flex: none; font-size: 16px; font-weight: 700; line-height: 1.3; }
.vd-opts { flex: none; display: flex; flex-direction: column; gap: 5px; }
.vd-pick { display: grid; grid-template-columns: 24px 1fr; column-gap: 10px; align-items: center; text-align: left; min-height: 44px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); }
.vd-pick:hover, .vd-pick:focus-visible { border-color: var(--key); }
.vd-n { grid-row: span 2; width: 22px; height: 22px; border-radius: 11px; background: var(--key); color: var(--well); font-weight: 700; font-size: 12px; font-family: var(--mono); display: flex; align-items: center; justify-content: center; }
.vd-l { font-size: 14px; font-weight: 600; }
.vd-hint { font-size: 12px; color: var(--muted); }
.vd-opts.compact { gap: 4px; }
.vd-opts.compact .vd-pick { min-height: 34px; grid-template-columns: 22px auto 1fr; padding: 2px 10px; }
.vd-opts.compact .vd-n { grid-row: auto; }
.vd-opts.compact .vd-hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 4px; }
.vd-opts.two { display: grid; grid-template-columns: 1fr 1fr; }
.vd-opts.two .vd-hint { display: none; }
.vd-opts.two .vd-pick { grid-template-columns: 22px 1fr; }
.vd-opts.two .vd-l { font-size: 13px; line-height: 1.25; }
.vd-optfoot { flex: none; display: flex; gap: 6px; }
.vd-optfoot:empty { display: none; }
.vd-small { height: 32px; padding: 0 10px; border: none; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; }
.vd-small:hover { background: var(--panel); color: var(--text); }
.vd-wrote { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 6px; font-size: 12px; line-height: 1.5; color: var(--muted); border-top: 1px solid var(--hair); padding-top: 10px; }
.vd-wrote:empty { border: none; padding: 0; }
.vd-wrote p { margin: 0; color: var(--text); }
.vd-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.vd-w code { display: block; font-family: var(--mono); color: var(--key); font-size: 13px; white-space: pre-wrap; margin-bottom: 2px; }
.vd-w b { color: var(--text); font-family: var(--mono); font-weight: 600; }
.vd-tip { flex: none; font-size: 13px; line-height: 1.45; color: var(--muted); background: var(--panel); border-radius: 10px; padding: 10px 12px; }
.vd-tip b { color: var(--key); margin-right: 4px; }

.vd-find { flex: none; height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
.vd-chips { flex: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.vd-chips button { height: 28px; padding: 0 3px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--text); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vd-chips button:hover { border-color: var(--line2); }
.vd-chips button.on { border-color: var(--key); background: var(--hair); color: var(--key); font-weight: 600; }
.vd-list { flex: 1 1 auto; min-height: 60px; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: min-content; gap: 4px 8px; align-content: start; }
.vd-snd { display: flex; align-items: center; gap: 4px; height: 32px; min-width: 0; border-radius: 8px; padding: 0 2px; }
.vd-snd.on { background: var(--hair); }
.vd-hear { flex: none; width: 26px; height: 26px; border-radius: 13px; border: 1px solid var(--line2); background: transparent; color: var(--text); display: flex; align-items: center; justify-content: center; padding: 0; }
.vd-hear:hover { background: var(--key); border-color: var(--key); color: var(--well); }
.vd-sname { flex: 1 1 auto; min-width: 0; text-align: left; background: transparent; border: none; color: var(--text); font-family: var(--mono); font-size: 12px; padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 30px; }
.vd-add { flex: none; width: 24px; height: 24px; border-radius: 7px; border: 1px dashed var(--line2); background: transparent; color: var(--muted); padding: 0; font-size: 15px; line-height: 1; }
.vd-add:hover { color: var(--key); border-color: var(--key); }
.vd-more { grid-column: 1 / -1; font-size: 12px; color: var(--dim); padding: 6px 2px; }
.vd-own { grid-column: 1 / -1; height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px dashed var(--line2); border-radius: 8px; background: transparent; color: var(--text); font-size: 13px; text-align: left; }
.vd-own:hover { border-color: var(--key); }
.vd-word { height: 30px; text-align: left; padding: 0 8px; border: none; border-radius: 7px; background: transparent; color: var(--text); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 10px; min-width: 0; }
.vd-word b { font-family: var(--mono); font-weight: 400; flex: none; min-width: 2.5em; }
.vd-word span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.vd-list.one { grid-template-columns: 1fr; }
.vd-word:hover { background: var(--panel); }
.vd-word.on { background: var(--hair); color: var(--key); }
.vd-info { flex: none; border-top: 1px solid var(--hair); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.vd-info b { color: var(--text); font-family: var(--mono); }
.vd-ex code { font-family: var(--mono); color: var(--key); }
.vd-infobtns { display: flex; gap: 6px; flex-wrap: wrap; }
.vd-btn { height: 34px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 9px; background: transparent; color: var(--text); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.vd-btn:hover { border-color: var(--key); }
.vd-btn.key { background: var(--key); border-color: var(--key); color: var(--well); font-weight: 600; }

.vd-recipe { flex: none; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.vd-recipe li { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 3px 4px 3px 2px; border-radius: 9px; }
.vd-recipe li.next { background: var(--panel); padding: 8px 8px 8px 6px; }
.vd-check { flex: none; width: 24px; height: 24px; border-radius: 12px; border: 1.5px solid var(--line2); color: var(--muted); font-size: 12px; font-weight: 700; font-family: var(--mono); display: flex; align-items: center; justify-content: center; }
.vd-recipe li.done .vd-check { background: var(--ok); border-color: var(--ok); color: var(--well); }
.vd-recipe li.next .vd-check { border-color: var(--key); color: var(--key); }
.vd-rt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vd-rt b { font-size: 14px; font-weight: 600; }
.vd-recipe li.done .vd-rt b { color: var(--muted); font-weight: 400; }
.vd-rt span { font-size: 12px; line-height: 1.4; color: var(--muted); }
.vd-recipe .vd-btn { height: 28px; padding: 0 10px; font-size: 12px; }
.vd-tipcard { flex: 0 1 auto; min-height: 0; overflow: hidden; background: var(--panel); border-radius: 10px; padding: 10px 12px; margin-top: auto; }
.vd-tiphead { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.vd-tiphead b { color: var(--key); }
.vd-tipbtn { width: 28px; height: 26px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--text); padding: 0; }
.vd-tiptext { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--text); }

/* status bar */
.vf { flex: none; height: 32px; display: flex; align-items: center; gap: 16px; padding: 0 16px; border-top: 1px solid var(--hair); background: var(--bg2); font-size: 13px; white-space: nowrap; overflow: hidden; }
.vf-msg { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.vf-msg.ok { color: var(--text); }
.vf-msg.ok::before { content: '✓ '; color: var(--ok); }
.vf-msg.warn { color: var(--warn); }
.vf-help { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.vf-help b { color: var(--key); font-family: var(--mono); margin-right: 4px; }
.vf-keys { flex: none; color: var(--dim); }

/* dialogs */
.vis-dialog { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.vis-dialog-in { background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; padding: 22px; max-width: 640px; width: 100%; max-height: calc(100vh - 32px); overflow: hidden; display: flex; flex-direction: column; gap: 10px; color: var(--text); font-family: var(--sans); }
.vis-dialog-in h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.vis-dialog-in p { margin: 0; line-height: 1.5; }
.vis-exlist { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 6px; overflow: hidden; }
.vis-exlist button { text-align: left; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; min-height: 50px; color: var(--text); }
.vis-exlist button:hover { border-color: var(--key); }
.vis-exlist span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vis-exlist button { min-width: 0; }
.vis-exlist { overflow-y: auto; max-height: min(60vh, 520px); padding-right: 4px; }
.vs-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.vs-actions[hidden] { display: none; }
.vs-intro { color: var(--muted); }
.vs-setup { display: flex; flex-direction: column; gap: 8px; }
.vs-setup[hidden], .vs-live[hidden], .vs-done[hidden], .vs-q[hidden], .vs-choices[hidden] { display: none; }
.vs-q { font-weight: 700; margin-top: 4px; }
.vs-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.vs-choices button { min-height: 44px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 10px; background: var(--bg2); color: var(--text); font-size: 15px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.vs-choices button span { font-size: 11px; color: var(--muted); }
.vs-choices button.on { border-color: var(--key); background: var(--hair); color: var(--key); font-weight: 600; }
.vs-hint { font-size: 13px; color: var(--muted); }
.vs-live { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 0; }
.vs-big { font-size: 64px; font-weight: 800; line-height: 1; color: var(--key); font-variant-numeric: tabular-nums; }
.vs-big.rec { color: #FF8A5B; }
.vs-big.small { font-size: 30px; }
.vs-bar { width: 100%; height: 10px; border-radius: 5px; background: var(--bg2); overflow: hidden; }
.vs-bar span { display: block; height: 100%; width: 0; background: #FF8A5B; }
.vs-sub { color: var(--muted); }
.vs-done { display: flex; flex-direction: column; gap: 8px; }
.vs-line { font-family: var(--mono); color: var(--key); background: var(--bg2); border-radius: 8px; padding: 8px 10px; }
.vs-warn { color: var(--warn); }
.vs-keys { border-collapse: collapse; font-size: 14px; }
.vs-keys th { text-align: left; padding: 4px 16px 4px 0; font-weight: 400; }
.vs-keys kbd { font-family: var(--mono); font-size: 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; }
.vs-keys td { color: var(--muted); padding: 4px 0; }

/* smaller screens: things fold away, nothing scrolls */
@media (max-width: 1020px) {
  .vd { width: 316px; }
  .vd-tabs [data-tab] { padding: 0 6px; font-size: 13px; }
  .vf-keys { display: none; }
}
@media (max-width: 885px) {
  .vh-where { display: none; }
  .vh-brand span { display: none; }
}
@media (max-width: 735px) {
  .vh-sing span, .vh-steps .vh-dim { display: none; }
  }
@media (max-width: 645px) {
  .vd { position: absolute; right: 0; top: 0; bottom: 0; z-index: 35; box-shadow: -20px 0 40px rgba(0,0,0,0.5); }
  .vh-songbtn .vh-dim, .vh-loopbtn .vh-dim { display: none; }
}
@media (max-width: 480px) {
  .vh { gap: 6px; padding: 0 8px; }
  .vh-line,     .vd { width: 100%; }
}
@media (max-height: 480px) {
  .vh { height: 48px; }
  .vd-pane { padding: 10px; gap: 6px; }
  .vd-tipcard { display: none; }
}

/* settings and console */
.vd-tabs .vd-icontab { padding: 0 6px; display: inline-flex; align-items: center; }
.vd-set { display: flex; flex-direction: column; gap: 12px; overflow: auto; min-height: 0; }
.vd-row { display: flex; flex-direction: column; gap: 6px; }
.vd-row > span { font-size: 13px; color: var(--muted); }
.vd-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.vd-seg button { height: 32px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; }
.vd-seg button.on { background: var(--panel2); color: var(--key); font-weight: 700; border-color: var(--line2); }
.vd-switches { gap: 8px; }
.vd-switch { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text); cursor: pointer; }
.vd-switch input { width: 18px; height: 18px; accent-color: var(--key); }
.vd-select { height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); padding: 0 8px; font-size: 13px; }
.vd-conhead { display: flex; align-items: center; }
.vd-con { list-style: none; margin: 0; padding: 0; overflow: auto; min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.vd-con li { display: flex; gap: 10px; padding: 5px 6px; border-radius: 6px; line-height: 1.4; }
.vd-con li:nth-child(odd) { background: var(--panel); }
.vd-con time { flex: none; color: var(--dim); font-family: var(--mono); font-size: 12px; }
.vd-con li.warn span, .vd-con li.error span { color: var(--err); }
.vd-con li.ok span { color: var(--text); }
.vd-con .vd-dim { color: var(--dim); background: none; }

/* sing: microphone */
.vs-microw { display: flex; align-items: center; gap: 10px; }
.vs-micsel { flex: 1 1 auto; min-width: 0; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); padding: 0 8px; font-size: 14px; }
.vs-meter { flex: 0 0 120px; height: 10px; border-radius: 5px; background: var(--well); overflow: hidden; }
.vs-meter span { display: block; height: 100%; width: 0; background: var(--ok); border-radius: 5px; transition: width 60ms linear; }
.vs-meter span.loud { background: var(--warn); }
.vs-meter-live { flex: none; width: 100%; margin-top: 10px; }
.vs-phones { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; cursor: pointer; }
.vs-phones input { width: 18px; height: 18px; accent-color: var(--key); }
.vs-michint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.vs-michint.vs-warn { color: var(--warn); }

/* controls: a button on each strip, and the panel it opens */
.ve-knobs { flex: none; width: 22px; height: 22px; border-radius: 5px; border: 1px solid transparent; background: transparent; color: var(--dim); display: flex; align-items: center; justify-content: center; padding: 0; }
.ve-knobs:hover { border-color: var(--line); color: var(--key); }
.ve-ctl { position: absolute; z-index: 46; width: 340px; max-height: calc(100% - 12px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 18px 44px rgba(0,0,0,0.55); padding: 8px 10px 10px; }
.vc-head { display: flex; align-items: center; gap: 8px; height: 30px; font-size: 14px; }
.vc-dot { width: 10px; height: 10px; border-radius: 50%; }
.vc-close { width: 26px; height: 26px; border: none; background: transparent; color: var(--dim); font-size: 18px; border-radius: 6px; }
.vc-close:hover { color: var(--text); background: var(--panel2); }
.vc-list { overflow: auto; min-height: 0; display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.vc-row { display: grid; grid-template-columns: 92px 1fr 66px 22px; align-items: center; gap: 8px; height: 30px; }
.vc-row label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.vc-row input { width: 100%; accent-color: var(--key); }
.vc-row output { font-family: var(--mono); font-size: 12px; color: var(--dim); text-align: right; }
.vc-row.set label { color: var(--text); }
.vc-row.set output { color: var(--key); }
.vc-reset { width: 22px; height: 22px; border: none; background: transparent; color: var(--dim); border-radius: 5px; visibility: hidden; }
.vc-row.set .vc-reset { visibility: visible; }
.vc-reset:hover { color: var(--warn); background: var(--panel2); }
.vc-note { margin: 8px 0 0; font-size: 12px; color: var(--dim); }

.ve-editor .k-slider { color: var(--dim); font-style: italic; opacity: 0.75; }
.vh-popsep { height: 1px; background: var(--line); margin: 6px 4px; }
.vh-pop button .vh-dim { margin-left: 6px; font-size: 12px; }
/* the Vim mode line */
.ve-editor .cm-panels, .ve-editor .cm-panels-bottom { background: var(--panel) !important; color: var(--muted) !important; border-top: 1px solid var(--line) !important; }
.ve-editor .cm-vim-panel { padding: 2px 12px; min-height: 22px; font-family: var(--mono); font-size: 12px; color: var(--key); }
.ve-editor .cm-vim-panel input { background: transparent; color: var(--text); border: none; outline: none; font-family: var(--mono); }

/* after exporting: the saved file, ready to play */
.vh-saved { position: fixed; top: 58px; right: 16px; z-index: 40; width: 320px; max-width: calc(100vw - 32px); background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 10px 12px 12px; box-shadow: 0 18px 44px rgba(0,0,0,0.55); color: var(--text); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.vh-saved .vs-top { display: flex; align-items: center; gap: 8px; }
.vh-saved .vs-top b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vh-saved .vs-x { background: transparent; border: none; color: var(--muted); font-size: 20px; line-height: 1; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; }
.vh-saved .vs-x:hover { background: var(--panel2); color: var(--text); }
.vh-saved .vs-dim { color: var(--dim); font-size: 12px; }
.vh-saved .vs-ok { color: var(--ok); font-size: 12px; }
.vh-saved .vs-note { color: var(--muted); font-size: 12px; line-height: 1.4; }
.vh-saved audio { width: 100%; height: 36px; }
.vh-saved .vs-row { display: flex; }
.vh-saved .vs-as { background: var(--panel2); border: 1px solid var(--line2); color: var(--text); border-radius: 8px; height: 32px; padding: 0 12px; font: inherit; font-size: 13px; cursor: pointer; }
.vh-saved .vs-as:hover { border-color: var(--key); }

/* the song order at the top: click a part, the ending, or + */
.vis-seg { cursor: pointer; }
.vis-seg:hover, .vis-seg:focus-visible { filter: brightness(1.12); outline: 2px solid var(--text); outline-offset: 1px; }
.vis-chip { flex: none; height: 26px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.vis-chip:hover { border-color: var(--key); color: var(--key); }
.vis-add { width: 30px; padding: 0; font-size: 16px; font-weight: 700; }
.vis-make { height: 26px; padding: 0 12px; border-radius: 6px; border: 1px dashed var(--key); background: transparent; color: var(--key); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ve-rename { margin: 2px 6px 6px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); font: inherit; font-family: var(--mono); }
.ve-rename:focus { outline: none; border-color: var(--key); }

/* ---------------- the Kids tab ---------------- */
.vh-mode { flex: none; display: flex; align-items: center; gap: 4px; height: 38px; padding: 0 6px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line2); }
.vh-modelab { height: 30px; padding: 0 8px; border-radius: 8px; border: none; background: transparent; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--dim); white-space: nowrap; }
.vh-modelab:hover { color: var(--text); }
.vh-modelab.on { color: var(--text); }
.vh-switch { position: relative; width: 46px; height: 26px; border-radius: 13px; border: none; padding: 0; background: var(--key); cursor: pointer; flex: none; }
.vh-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .4); transition: left .16s ease; }
.vh-switch.studio { background: #6FB7FF; }
.vh-switch.studio .vh-knob { left: 23px; }
body[data-mode="kids"] .vh-steps, body[data-mode="kids"] .vh-panel, body[data-mode="kids"] [data-menu="loop"], body[data-mode="kids"] .vh-where,
body[data-mode="kids"] .vh-play, body[data-mode="kids"] .vh-stop, body[data-mode="kids"] .vh-line { display: none !important; }

.kz { position: relative; display: flex; flex-direction: column; overflow: hidden; font-family: var(--sans); color: var(--text);
  background: radial-gradient(circle at 12% -10%, color-mix(in srgb, var(--key) 14%, transparent), transparent 45%), radial-gradient(circle at 95% 110%, color-mix(in srgb, #6FB7FF 12%, transparent), transparent 40%), var(--bg); }
.kz button { font-family: inherit; }
.kz-bar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.kz-play { height: 58px; min-width: 136px; padding: 0 24px; border-radius: 30px; border: none; background: #7BE08A; color: #10240f; font-size: 26px; font-weight: 900; display: flex; gap: 10px; align-items: center; justify-content: center; box-shadow: 0 6px 0 #3f9c4c; cursor: pointer; transition: transform .06s; }
.kz-play span { font-size: 21px; }
.kz-play:active { transform: translateY(4px); box-shadow: 0 2px 0 #3f9c4c; }
.kz-play.playing { background: #FF8A8A; color: #3a0b0b; box-shadow: 0 6px 0 #c44f4f; }
.kz-group { display: flex; gap: 8px; flex-wrap: wrap; }
.kz-btn { height: 46px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--line2); background: var(--panel); color: var(--text); font-size: 21px; font-weight: 800; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; transition: transform .08s, border-color .08s; white-space: nowrap; }
.kz-btn span { font-size: 15px; }
.kz-btn:hover { border-color: var(--key); transform: translateY(-1px); }
.kz-speed { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border-radius: 14px; background: var(--panel); border: 2px solid var(--line2); cursor: pointer; }
.kz-speed .kz-ico { font-size: 24px; }
.kz-speed input { width: 110px; accent-color: var(--key); cursor: pointer; }
.kz-speedval { min-width: 32px; font-size: 16px; }
.kz-moods { display: flex; gap: 3px; padding: 3px; height: 46px; box-sizing: border-box; align-items: center; border-radius: 14px; background: var(--panel); border: 2px solid var(--line2); }
.kz-moods button { width: 38px; height: 36px; border-radius: 10px; border: 2px solid transparent; background: transparent; font-size: 21px; cursor: pointer; filter: grayscale(.6); opacity: .7; transition: transform .08s; }
.kz-moods button:hover { filter: none; opacity: 1; }
.kz-moods button.on { background: var(--panel3); border-color: var(--key); filter: none; opacity: 1; transform: scale(1.1); }
.kz-len { display: flex; gap: 3px; align-items: center; height: 46px; box-sizing: border-box; padding: 0 6px 0 10px; border-radius: 14px; background: var(--panel); border: 2px solid var(--line2); font-size: 20px; }
.kz-len button { height: 34px; min-width: 40px; border-radius: 10px; border: 2px solid transparent; background: transparent; color: var(--text); font-weight: 900; font-size: 15px; cursor: pointer; }
.kz-len button.on { background: var(--key); color: var(--ink); }
.kz-helpbtn { flex: none; }
.kz-banner { flex: none; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 16px; background: color-mix(in srgb, var(--warn) 16%, var(--bg2)); font-size: 16px; }
.kz-banner .kz-btn { height: 38px; font-size: 15px; }

.kz-board { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 24px 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.kz-head, .kz-row { display: grid; grid-template-columns: 190px minmax(0, 1fr) 240px; gap: 12px; align-items: center; min-width: 760px; }
.kz-head { padding: 0 10px; }
.kz-nums { position: relative; display: flex; gap: 6px; }
.kz-nums span { flex: 1 1 0; min-width: 30px; text-align: center; font-size: 13px; color: var(--dim); font-weight: 800; }
.kz-nums span.beat { color: var(--text); font-size: 16px; }
.kz-nums span.beat:not(:first-child), .kz-cell.gap { margin-left: 10px; }
.kz-now { position: absolute; top: -20px; transform: translateX(-50%); font-style: normal; color: var(--key); font-size: 20px; line-height: 1; transition: left .09s linear; pointer-events: none; }
.kz-row { background: var(--panel); border-radius: 18px; padding: 8px; border: 2px solid color-mix(in srgb, var(--c) 35%, transparent); }
.kz-row.muted { opacity: .45; }
.kz-inst { height: 66px; border-radius: 14px; border: none; background: color-mix(in srgb, var(--c) 24%, var(--panel2)); color: var(--text); display: flex; align-items: center; gap: 10px; padding: 0 12px; cursor: pointer; text-align: left; transition: transform .08s; }
.kz-inst:hover { transform: scale(1.03); }
.kz-instemo { font-size: 34px; line-height: 1; }
.kz-instname { font-size: 17px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kz-cells { display: flex; gap: 6px; }
.kz-cell { flex: 1 1 0; min-width: 30px; height: 66px; border-radius: 12px; border: 2px dashed color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 7%, transparent); position: relative; cursor: pointer; padding: 0; transition: transform .08s, background .08s; display: flex; align-items: center; justify-content: center; }
.kz-cell:hover { background: color-mix(in srgb, var(--c) 20%, transparent); transform: scale(1.05); }
.kz-cell.on { border-style: solid; border-color: var(--c); background: var(--c); }
.kz-emo { font-size: 24px; line-height: 1; filter: drop-shadow(0 2px 2px rgb(0 0 0 / .3)); }
.kz-cell.loud { box-shadow: 0 0 0 3px #ffffffaa, 0 0 22px var(--c); }
.kz-cell.loud .kz-emo { font-size: 34px; }
.kz-cell.soft { opacity: .55; }
.kz-cell.maybe { background: color-mix(in srgb, var(--c) 45%, transparent); }
.kz-cell.note { background: color-mix(in srgb, var(--n) 14%, transparent); border-style: solid; border-color: color-mix(in srgb, var(--n) 70%, transparent); }
.kz-note { position: absolute; left: 4px; right: 4px; height: 24px; bottom: calc(4px + var(--y) * (100% - 32px)); border-radius: 8px; background: var(--n); color: #1b1b1b; font-weight: 900; font-size: 15px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 0 rgb(0 0 0 / .25); }
.kz-cell.hold { border-style: solid; border-color: color-mix(in srgb, var(--n) 45%, transparent); background: color-mix(in srgb, var(--n) 8%, transparent); }
.kz-holdbar { position: absolute; left: -10px; right: 6px; height: 10px; bottom: calc(11px + var(--y) * (100% - 32px)); background: var(--n); border-radius: 0 6px 6px 0; opacity: .85; }
.kz-cell.now { background: color-mix(in srgb, #ffffff 16%, transparent); border-color: #ffffffaa; }
.kz-cell.on.now { background: var(--c); filter: brightness(1.25); border-color: #fff; }
.kz-cell.note.now { background: color-mix(in srgb, var(--n) 35%, transparent); border-color: #fff; }
.kz-cell.hit { animation: kz-bounce .28s ease-out; }
@keyframes kz-bounce { 0% { transform: scale(1.22); } 100% { transform: scale(1); } }
.kz-tools { display: flex; gap: 6px; justify-content: flex-end; }
.kz-tool { width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--line2); background: var(--panel2); font-size: 19px; cursor: pointer; transition: transform .08s; }
.kz-tool:hover { transform: scale(1.1); border-color: var(--key); }
.kz-add { align-self: flex-start; height: 60px; padding: 0 24px; border-radius: 18px; border: 3px dashed var(--key); background: transparent; color: var(--key); font-size: 28px; font-weight: 900; display: flex; gap: 10px; align-items: center; cursor: pointer; margin-top: 4px; }
.kz-add span { font-size: 18px; }
.kz-add:hover { background: color-mix(in srgb, var(--key) 12%, transparent); }
.kz-empty { text-align: center; padding: 26px 10px 10px; }
.kz-emptybig { font-size: 72px; line-height: 1.1; }
.kz-emptytxt { font-size: 30px; font-weight: 900; margin: 8px 0 18px; }
.kz-emptybtns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.kz-empty:not([hidden]) ~ .kz-add { display: none; }
.kz-big { height: 64px; font-size: 28px; padding: 0 22px; border-radius: 18px; }
.kz-big span { font-size: 18px; }
.kz-locked { margin-top: 8px; padding: 10px 14px; border-radius: 16px; border: 2px dashed var(--line2); font-size: 15px; }
.kz-lockhead { font-weight: 800; margin-bottom: 6px; color: var(--muted); }
.kz-lockrow { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.kz-lockemo { font-size: 22px; }
.kz-lockrow code { font-family: var(--mono); font-size: 13px; color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kz-link { background: none; border: none; color: var(--key); text-decoration: underline; cursor: pointer; font-weight: 800; font-size: 14px; }

.kz-buddy { flex: none; display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--bg2); }
.kz-face { font-size: 46px; line-height: 1; animation: kz-bob 3s ease-in-out infinite; }
@keyframes kz-bob { 50% { transform: translateY(-4px) rotate(-5deg); } }
.kz-bubble { flex: 1; min-width: 0; position: relative; background: var(--panel); border: 2px solid var(--line2); border-radius: 16px; padding: 7px 14px; font-size: 17px; line-height: 1.35; min-height: 46px; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; }
.kz-bubble::before { content: ''; position: absolute; left: -9px; top: calc(50% - 8px); border: 8px solid transparent; border-left: 0; border-right-color: var(--line2); border-width: 8px 9px 8px 0; }
.kz-bubble b { font-size: 11px; color: var(--key); text-transform: uppercase; letter-spacing: .08em; }
.kz-bubble.warn { border-color: var(--warn); }
.kz-bubble.pop { animation: kz-pop .3s ease-out; }
@keyframes kz-pop { 0% { transform: scale(.97); } 60% { transform: scale(1.015); } 100% { transform: scale(1); } }

.kz-pop { position: absolute; z-index: 30; background: var(--panel); border: 2px solid var(--line2); border-radius: 16px; padding: 10px; box-shadow: 0 18px 50px rgb(0 0 0 / .5); display: flex; flex-direction: column; gap: 6px; width: 230px; box-sizing: border-box; }
.kz-poptitle { font-weight: 900; font-size: 16px; text-align: center; }
.kz-poprow { text-align: center; }
.kz-arrow { font-size: 12px; color: var(--dim); font-weight: 700; }
.kz-notes { display: flex; flex-direction: column; gap: 4px; }
.kz-notebtn { height: 28px; border-radius: 9px; border: 2px solid transparent; background: var(--n); color: #1b1b1b; font-weight: 900; font-size: 15px; cursor: pointer; transition: transform .06s; }
.kz-notebtn:hover { transform: scale(1.04); }
.kz-notebtn.on { border-color: #fff; box-shadow: 0 0 0 2px var(--n); }
.kz-popbtn { height: 38px; border-radius: 10px; border: 2px solid var(--line2); background: var(--panel2); color: var(--text); font-weight: 700; font-size: 15px; text-align: left; padding: 0 12px; cursor: pointer; }
.kz-popbtn:hover { border-color: var(--key); }

.kz-modal { position: absolute; inset: 0; z-index: 40; background: rgb(0 0 0 / .55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.kz-modalbox { position: relative; background: var(--bg2); border: 2px solid var(--line2); border-radius: 22px; padding: 22px; max-width: 920px; width: 100%; max-height: 100%; overflow: auto; box-sizing: border-box; }
.kz-close { position: absolute; top: 12px; right: 12px; width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--line2); background: var(--panel); color: var(--text); font-size: 18px; cursor: pointer; }
.kz-modaltitle { font-size: 26px; font-weight: 900; padding-right: 50px; }
.kz-modalsub { color: var(--muted); margin: 4px 0 10px; font-size: 16px; }
.kz-section { font-weight: 900; font-size: 18px; margin: 14px 0 8px; }
.kz-section span { color: var(--dim); font-weight: 600; font-size: 14px; }
.kz-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; }
.kz-card { min-height: 100px; border-radius: 16px; border: 2px solid var(--line2); background: var(--panel); color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-weight: 800; font-size: 15px; cursor: pointer; transition: transform .08s, border-color .08s; padding: 8px; }
.kz-card:hover, .kz-card:focus-visible { border-color: var(--key); transform: translateY(-2px); }
.kz-cardemo { font-size: 40px; line-height: 1; }
.kz-starters { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.kz-starter { min-height: 138px; }
.kz-starter b { font-size: 18px; }
.kz-carddesc { font-size: 13px; color: var(--muted); font-weight: 600; text-align: center; }

.kz-tooltip { position: absolute; z-index: 60; max-width: 260px; background: #FFF6C9; color: #2b2116; border-radius: 12px; padding: 8px 12px; font-size: 15px; font-weight: 700; line-height: 1.3; box-shadow: 0 10px 30px rgb(0 0 0 / .45); pointer-events: none; }

.kz-help { position: absolute; inset: 0; z-index: 45; background: rgb(0 0 0 / .62); }
.kz-helpcard { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--bg2); border: 3px solid var(--key); border-radius: 22px; padding: 18px 24px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; font-size: 17px; width: min(380px, calc(100% - 40px)); box-sizing: border-box; }
.kz-helptitle { font-size: 24px; font-weight: 900; }
.kz-callout { position: absolute; max-width: 210px; background: #FFF6C9; color: #2b2116; border-radius: 12px; padding: 6px 10px 6px 34px; font-size: 14px; font-weight: 700; line-height: 1.3; box-shadow: 0 8px 24px rgb(0 0 0 / .45); }
.kz-callout b { position: absolute; left: 8px; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--key); color: var(--ink); font-size: 12px; display: flex; align-items: center; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .kz-face, .kz-cell.hit, .kz-bubble.pop { animation: none; } }

/* Kids: record, the squares/code switch, the wave and bars */
.kz-rec { height: 58px; padding: 0 18px 0 16px; border-radius: 30px; border: 2px solid var(--line2); background: var(--panel); color: var(--text); font-size: 18px; font-weight: 900; display: flex; gap: 10px; align-items: center; cursor: pointer; box-shadow: 0 6px 0 rgb(0 0 0 / .25); transition: transform .06s; white-space: nowrap; }
.kz-rec:active { transform: translateY(4px); box-shadow: 0 2px 0 rgb(0 0 0 / .25); }
.kz-recdot { width: 18px; height: 18px; border-radius: 50%; background: #FF4D4D; box-shadow: 0 0 0 3px #ff4d4d33; }
.kz-rec.on { background: #FF4D4D; border-color: #FF4D4D; color: #fff; }
.kz-rec.on .kz-recdot { background: #fff; border-radius: 4px; animation: kz-blink 1s steps(2) infinite; }
@keyframes kz-blink { 50% { opacity: .35; } }
.kz-bar .kz-btn { padding: 0 12px; }
.kz-views { flex: none; display: flex; align-items: center; gap: 16px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg2) 60%, transparent); }
.kz-viewswitch { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 8px; border-radius: 12px; background: var(--panel); border: 2px solid var(--line2); }
.kz-viewlab { height: 32px; padding: 0 8px; border: none; border-radius: 8px; background: transparent; color: var(--dim); font-weight: 800; font-size: 15px; cursor: pointer; white-space: nowrap; }
.kz-viewlab.on { color: var(--text); }
.kz-vsw { position: relative; width: 50px; height: 28px; border-radius: 14px; border: none; padding: 0; background: var(--key); cursor: pointer; flex: none; }
.kz-vknob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .4); transition: left .16s ease; }
.kz-vsw.code { background: #6FB7FF; }
.kz-vsw.code .kz-vknob { left: 25px; }
.kz-scope { margin-left: auto; width: min(380px, 40vw); height: 44px; border-radius: 12px; background: var(--panel); border: 2px solid var(--line2); }
/* rows made in Studio */
.kz-inst { position: relative; }
.kz-star { position: absolute; top: -9px; right: -7px; font-size: 18px; line-height: 1; filter: drop-shadow(0 2px 2px rgb(0 0 0 / .4)); }
.kz-toolgap { width: 42px; flex: none; }
.kz-row.many .kz-cells { gap: 3px; }
.kz-row.many .kz-cell { min-width: 16px; border-radius: 7px; }
.kz-row.many .kz-cell.gap { margin-left: 6px; }
.kz-row.many .kz-emo { font-size: 15px; }
.kz-row.many .kz-note { font-size: 11px; left: 1px; right: 1px; }
.kz-pic { position: relative; height: 66px; border-radius: 12px; border: 2px dashed color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 6%, transparent); overflow: hidden; }
.kz-picnote { position: absolute; height: 8px; bottom: calc(6px + var(--y) * (100% - 20px)); border-radius: 4px; background: var(--n); box-shadow: 0 1px 0 rgb(0 0 0 / .3); }
.kz-picbeat { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -2px; border-radius: 50%; background: var(--c); }
.kz-picnow { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 8px #fff; }
.kz-partlab { position: absolute; right: 8px; top: 4px; font-size: 12px; font-weight: 800; color: var(--muted); background: var(--panel); padding: 1px 6px; border-radius: 6px; }
/* the note picker: low, middle, high */
.kz-notegrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kz-notecol { display: flex; flex-direction: column; gap: 4px; }
.kz-colhead { font-size: 12px; font-weight: 800; color: var(--muted); text-align: center; }
.kz-pophint { font-size: 12px; color: var(--dim); text-align: center; font-weight: 700; }
.kz-popsay { font-size: 15px; line-height: 1.35; padding: 2px 4px 4px; }
/* 🎚️ settings */
.kz-knob { display: flex; flex-direction: column; gap: 2px; padding: 2px 2px 4px; }
.kz-knoblab { font-size: 13px; font-weight: 800; color: var(--muted); }
.kz-knobrow { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.kz-knobrow input { flex: 1; accent-color: var(--key); cursor: pointer; }
/* the Code view */
.kz-code { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr); gap: 16px; padding: 14px 16px; overflow: hidden; }
.kz-codeleft, .kz-coderight { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.kz-coderight { overflow: auto; }
.kz-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kz-chiplab { font-size: 14px; font-weight: 800; color: var(--muted); margin-right: 2px; }
.kz-chip { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; border: 2px solid var(--line2); background: var(--panel); color: var(--text); font-family: var(--mono); font-size: 18px; font-weight: 700; cursor: pointer; }
.kz-chip:hover { border-color: var(--key); }
.kz-chipnote { background: var(--n); color: #1b1b1b; border-color: transparent; }
.kz-chipline { font-family: var(--sans); font-size: 14px; font-weight: 800; }
.kz-editor { position: relative; flex: 1 1 auto; min-height: 240px; border-radius: 16px; background: var(--bg2); border: 2px solid var(--line2); overflow: hidden; }
.kz-editor:focus-within { border-color: var(--key); }
.kz-hl, .kz-ta { position: absolute; inset: 0; margin: 0; padding: 14px 16px; font-family: var(--mono); font-size: 20px; line-height: 1.75; white-space: pre; overflow: auto; tab-size: 2; border: 0; box-sizing: border-box; letter-spacing: 0; word-spacing: 0; font-weight: 400; }
.kz-ta { background: transparent; color: transparent; caret-color: var(--text); resize: none; outline: none; }
.kz-ta::selection { background: color-mix(in srgb, var(--key) 35%, transparent); color: transparent; }
.kz-hl { pointer-events: none; color: var(--text); }
.kz-hl span { border-radius: 4px; }
.kc-name { color: var(--c); }
.kc-kw { color: #C59BFF; }
.kc-num, .kc-val { color: #FFD93D; }
.kc-mood { color: #F7A6C8; }
.kc-x { color: #FF9F43; }
.kc-X { color: #FF5A5A; text-shadow: 0 0 8px #FF5A5A; }
.kc-rest { color: var(--dim); }
.kc-hold { color: var(--n); }
.kc-note { color: var(--n); }
.kc-set { color: #4ECDC4; }
.kc-word { color: var(--muted); }
.kc-com { color: var(--dim); font-style: italic; }
.kc-bad { text-decoration: underline wavy #FF5A5A; text-underline-offset: 4px; }
.kz-hl .now { background: color-mix(in srgb, #ffffff 26%, transparent); box-shadow: 0 0 0 2px #fff; }
.kz-codenote { font-size: 14px; color: var(--muted); padding: 8px 12px; border-radius: 12px; border: 2px dashed var(--line2); }
.kz-meanstitle { font-size: 16px; font-weight: 900; }
.kz-means { display: flex; flex-direction: column; gap: 6px; }
.kz-mean { display: flex; align-items: flex-start; gap: 8px; padding: 7px 10px; border-radius: 12px; background: var(--panel); border: 2px solid var(--line2); font-size: 15px; line-height: 1.35; }
.kz-mean.bad { border-color: #FF8A8A; }
.kz-meanno { min-width: 20px; height: 20px; margin-top: 1px; border-radius: 6px; background: var(--panel3); color: var(--muted); font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.kz-meanemo { font-size: 20px; line-height: 1; }
.kz-legend { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; border-radius: 14px; background: var(--bg2); border: 2px solid var(--line2); font-size: 14px; line-height: 1.4; color: var(--muted); }
.kz-legend code { font-family: var(--mono); color: var(--text); background: var(--panel3); padding: 0 5px; border-radius: 5px; }
/* Studio's record button */
.vh-rec { gap: 7px; }
.vh-recdot { width: 12px; height: 12px; border-radius: 50%; background: #FF4D4D; flex: none; }
.vh-rec.on { background: #FF4D4D; border-color: #FF4D4D; color: #fff; }
.vh-rec.on .vh-recdot { background: #fff; border-radius: 3px; animation: kz-blink 1s steps(2) infinite; }
body[data-mode="kids"] .vh-rec { display: none !important; }
/* a narrower window: the top bar keeps every button, with fewer words */
@media (max-width: 1050px) {
  .vh-steps > .vh-dim, .vh-sing span, .vh-loopbtn > .vh-dim { display: none; }
  .vh-sing { padding: 0 10px; }
}
/* Tab ideas in the kids Code view */
.kz-tabhint { font-size: 14px; color: var(--muted); padding: 4px 10px; border-radius: 10px; background: var(--panel); border: 2px dashed var(--key); margin-right: 6px; white-space: nowrap; }
.kz-tabhint b { color: var(--text); font-family: var(--mono); }
.kz-ac { position: absolute; z-index: 35; width: 320px; max-height: 340px; overflow: auto; background: var(--panel); border: 2px solid var(--key); border-radius: 16px; padding: 8px; box-shadow: 0 18px 50px rgb(0 0 0 / .55); display: flex; flex-direction: column; gap: 3px; box-sizing: border-box; }
.kz-actitle { flex: none; font-size: 13px; font-weight: 900; color: var(--key); padding: 2px 6px 4px; }
.kz-acitem { flex: none; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 8px; border: 2px solid transparent; border-radius: 10px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.kz-acitem.on, .kz-acitem:hover { background: var(--panel3); border-color: var(--line2); }
.kz-acitem.on { border-color: var(--key); }
.kz-acword { min-width: 44px; font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--n, var(--text)); }
.kz-acdesc { font-size: 14px; color: var(--muted); line-height: 1.25; }
.kz-acfoot { flex: none; font-size: 11px; color: var(--dim); padding: 4px 6px 0; font-weight: 700; }
/* instrument types, the big picker, longer rows */
.kz-instwords { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.kz-insttype { font-size: 12px; font-weight: 800; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kz-pickbar { margin: 4px 0 8px; }
.kz-search { width: 100%; box-sizing: border-box; height: 46px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--line2); background: var(--panel); color: var(--text); font: inherit; font-size: 17px; }
.kz-search:focus { outline: none; border-color: var(--key); }
.kz-fams { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.kz-fam { height: 34px; padding: 0 12px; border-radius: 17px; border: 2px solid var(--line2); background: var(--panel); color: var(--text); font-size: 14px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.kz-fam:hover { border-color: var(--key); }
.kz-fam.on { background: var(--key); color: var(--ink); border-color: var(--key); }
.kz-card { position: relative; }
.kz-types { font-size: 11px; font-weight: 800; color: var(--key); }
.kz-back { height: 38px; font-size: 16px; margin-bottom: 8px; }
.kz-typecards { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.kz-typecard { position: relative; display: flex; border-radius: 16px; border: 2px solid var(--line2); background: var(--panel); transition: border-color .08s, transform .08s; }
.kz-typecard:hover { border-color: var(--key); transform: translateY(-2px); }
.kz-typecard.on { border-color: var(--key); box-shadow: 0 0 0 2px var(--key); }
.kz-typepick { flex: 1; min-height: 118px; border: none; background: transparent; color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px 8px; cursor: pointer; font-size: 15px; }
.kz-typepick b { font-size: 17px; }
.kz-typehear { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line2); background: var(--panel2); color: var(--text); font-size: 13px; cursor: pointer; }
.kz-typehear:hover { border-color: #7BE08A; color: #7BE08A; }
.kc-type { color: #F5C451; font-style: italic; }
.kz-head.many .kz-nums { gap: 3px; }
.kz-head.many .kz-nums span { min-width: 16px; font-size: 10px; }
.kz-head.many .kz-nums span.beat { font-size: 13px; }
.kz-head.many .kz-nums span.beat:not(:first-child) { margin-left: 6px; }
.kz-head.many .kz-nums span:not(.beat) { color: transparent; }
/* Studio: types of an instrument */
.vd-ntypes { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--key); margin-left: 5px; vertical-align: middle; }
.kz-instname.long { font-size: 14px; }
.vd-types { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.vd-types .vd-label { margin-right: 4px; }
.vd-types button { height: 26px; padding: 0 9px; border: 1px solid var(--line2); border-radius: 13px; background: transparent; color: var(--text); font-size: 12px; white-space: nowrap; }
.vd-types button:hover { border-color: var(--key); }
.vd-types button.on { background: var(--key); border-color: var(--key); color: var(--well); font-weight: 600; }
/* a newer Waffle is on the site */
.wf-update { position: fixed; left: 50%; top: 66px; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 16px; background: var(--panel2, #2a1a2e); border: 2px solid var(--key); color: var(--text); font-size: 15px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.wf-update button { white-space: nowrap; height: 36px; border-radius: 10px; border: none; font: inherit; cursor: pointer; }
.wf-upgo { padding: 0 14px; background: var(--key); color: var(--ink, #1a0f1c); }
.wf-upx { width: 36px; background: transparent; color: var(--muted); font-size: 20px; }
/* hear only this row */
.kz-solo.on { background: #7BE08A; border-color: #7BE08A; box-shadow: 0 0 0 3px color-mix(in srgb, #7BE08A 35%, transparent); }
/* how many squares every row has */
.kz-lenstep { font-size: 20px !important; min-width: 34px !important; }
.kz-lenstep:disabled { opacity: .3; cursor: default; }
.kz-lenval { min-width: 30px; text-align: center; font-size: 17px; font-weight: 900; }
.kz-lensep { width: 2px; height: 24px; background: var(--line2); margin: 0 4px; border-radius: 1px; }
/* the note the mouse wheel changes: click a note first */
.kz-cell.note.armed { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--n) 55%, transparent), 0 0 18px color-mix(in srgb, var(--n) 70%, transparent); z-index: 2; }
/* tap a number to play from there */
.kz-nums span[data-from] { cursor: pointer; border-radius: 8px; padding: 2px 0; transition: background .1s, color .1s; }
.kz-nums span[data-from]:hover, .kz-nums span[data-from]:focus-visible { background: color-mix(in srgb, var(--key) 22%, transparent); color: var(--text); outline: none; }

/* ================= the phone version of the Kids tab ================= */
html.phone { --ui-zoom: 1; }
.phone body { -webkit-text-size-adjust: 100%; }
.phone button, .phone .kz-cell, .phone [data-from] { touch-action: manipulation; }
.phone .kz { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.phone .kz textarea, .phone .kz input { -webkit-user-select: text; user-select: text; }
.phone .kz-tooltip { display: none !important; }
/* top bar: just what a phone needs */
.phone .vh { height: 48px; gap: 6px; padding: 0 8px; }
.phone .vh-mode, .phone .vh-sing, .phone .vh-line { display: none !important; }
.phone .vh-brand { font-size: 0; gap: 0; margin: 0; }
.phone .vh-brand svg { width: 22px; height: 22px; }
.phone .vh-songbtn { max-width: 38vw; }
.phone .vh-songname { max-width: 24vw; }
.phone .vh-pop { max-width: calc(100vw - 16px); }
.phone .vh-pop.vh-right { right: 0; }
/* toolbar: play, record and the buttons on one line, speed and moods on the next */
.phone .kz-bar { gap: 8px; padding: 8px; }
.phone .kz-play { height: 48px; min-width: 0; flex: 1 1 auto; padding: 0 14px; font-size: 22px; box-shadow: 0 4px 0 #3f9c4c; }
.phone .kz-play.playing { box-shadow: 0 4px 0 #c44f4f; }
.phone .kz-play span { font-size: 18px; }
.phone .kz-rec { height: 48px; padding: 0 12px; font-size: 15px; box-shadow: 0 4px 0 rgb(0 0 0 / .25); }
.phone .kz-group { gap: 6px; flex-wrap: nowrap; }
.phone .kz-bar .kz-btn { height: 44px; padding: 0 10px; font-size: 20px; }
.phone .kz-bar .kz-btn span, .phone .kz-rec span { display: none; }
.phone .kz-speed { flex: 1 1 140px; height: 42px; padding: 0 10px; gap: 6px; }
.phone .kz-speed input { width: auto; flex: 1; min-width: 60px; }
.phone .kz-speed .kz-ico { font-size: 20px; }
.phone .kz-moods { height: 42px; overflow-x: auto; max-width: 100%; }
.phone .kz-moods button { width: 34px; height: 32px; font-size: 19px; flex: none; }
/* squares or code, and how many squares */
.phone .kz-views { gap: 8px; padding: 6px 8px; flex-wrap: wrap; }
.phone .kz-viewswitch { height: 38px; padding: 0 4px; gap: 2px; }
.phone .kz-viewlab { padding: 0 4px; font-size: 13px; }
.phone .kz-len { height: 38px; padding: 0 4px 0 6px; font-size: 16px; }
.phone .kz-len button { min-width: 30px; height: 30px; font-size: 13px; }
.phone .kz-lenstep { min-width: 30px !important; }
.phone .kz-len [data-len="32"] { display: none; }
.phone .kz-scope { flex: 1 1 60px; width: auto; min-width: 60px; height: 38px; margin-left: 0; }
/* the board: each instrument is a card, squares 8 to a line */
.phone .kz-board { padding: 14px 8px 12px; gap: 8px; }
.phone .kz-head { display: block; min-width: 0; padding: 0 8px; }
.phone .kz-headpad, .phone .kz-headpad2 { display: none; }
.phone .kz-nums { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 18px 4px; padding-top: 4px; }
.phone .kz-nums span, .phone .kz-head.many .kz-nums span { min-width: 0; margin-left: 0 !important; font-size: 12px; color: var(--dim); padding: 4px 0; }
.phone .kz-nums span.beat, .phone .kz-head.many .kz-nums span.beat { font-size: 14px; color: var(--text); }
.phone .kz-now { font-size: 16px; }
.phone .kz-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "inst tools" "cells cells"; gap: 6px 6px; min-width: 0; padding: 6px; border-radius: 16px; }
.phone .kz-inst { grid-area: inst; height: 40px; padding: 0 8px; gap: 6px; border-radius: 12px; min-width: 0; }
.phone .kz-instemo { font-size: 24px; }
.phone .kz-instname, .phone .kz-instname.long { font-size: 15px; }
.phone .kz-insttype { font-size: 11px; }
.phone .kz-star { top: -7px; right: -5px; font-size: 15px; }
.phone .kz-tools { grid-area: tools; gap: 4px; }
.phone .kz-tool { width: 36px; height: 36px; border-radius: 10px; font-size: 16px; }
.phone .kz-toolgap { width: 36px; }
.phone .kz-cells, .phone .kz-row.many .kz-cells { grid-area: cells; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.phone .kz-cell, .phone .kz-row.many .kz-cell { min-width: 0; height: 48px; border-radius: 10px; margin-left: 0 !important; }
.phone .kz-cell:hover { transform: none; }
.phone .kz-emo, .phone .kz-row.many .kz-emo { font-size: 20px; }
.phone .kz-cell.loud .kz-emo { font-size: 26px; }
.phone .kz-note, .phone .kz-row.many .kz-note { left: 2px; right: 2px; height: 20px; font-size: 13px; bottom: calc(3px + var(--y) * (100% - 26px)); }
.phone .kz-holdbar { left: -6px; right: 3px; height: 8px; bottom: calc(9px + var(--y) * (100% - 26px)); }
.phone .kz-pic { grid-area: cells; height: 52px; }
.phone .kz-add { height: 50px; padding: 0 18px; font-size: 22px; align-self: stretch; justify-content: center; }
.phone .kz-add span { font-size: 16px; }
.phone .kz-emptybig { font-size: 52px; }
.phone .kz-emptytxt { font-size: 24px; margin: 4px 0 12px; }
.phone .kz-big { height: 54px; font-size: 22px; padding: 0 16px; }
.phone .kz-big span { font-size: 16px; }
.phone .kz-banner { font-size: 14px; padding: 8px; }
.phone .kz-banner [data-k="code"] { display: none; }
/* Waffle the helper: one small line at the bottom */
.phone .kz-buddy { gap: 8px; padding: 6px 8px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
.phone .kz-face { font-size: 28px; }
.phone .kz-bubble { font-size: 14px; padding: 4px 10px; min-height: 40px; border-radius: 12px; }
.phone .kz-bubble b { font-size: 9px; }
.phone .kz-buddy .kz-btn { height: 40px; padding: 0 9px; font-size: 18px; }
.phone .kz-buddy .kz-btn span { display: none; }
/* pickers and settings slide up from the bottom */
.phone .kz-modal { align-items: flex-end; padding: 0; }
.phone .kz-modalbox { border-radius: 22px 22px 0 0; padding: 16px 12px; padding-bottom: max(16px, env(safe-area-inset-bottom)); max-height: 92%; }
.phone .kz-modaltitle { font-size: 20px; }
.phone .kz-modalsub { font-size: 14px; }
.phone .kz-close { width: 38px; height: 38px; top: 10px; right: 10px; }
.phone .kz-cards { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.phone .kz-card { min-height: 82px; font-size: 13px; padding: 6px 4px; border-radius: 14px; }
.phone .kz-cardemo { font-size: 30px; }
.phone .kz-starters { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.phone .kz-starter { min-height: 110px; }
.phone .kz-typecards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.phone .kz-typepick { min-height: 96px; font-size: 13px; }
.phone .kz-fams { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.phone .kz-fam { flex: none; }
.phone .kz-search { font-size: 16px; height: 42px; }
.phone .kz-pop { position: fixed; left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto !important; max-height: 78%; overflow: auto; border-radius: 22px 22px 0 0; padding: 14px 12px; padding-bottom: max(14px, env(safe-area-inset-bottom)); z-index: 55; box-shadow: 0 -12px 40px rgb(0 0 0 / .55); }
.phone .kz-notebtn { height: 38px; font-size: 16px; }
.phone .kz-popbtn { height: 44px; }
.phone .kz-knobrow input { height: 32px; }
/* help as a list */
.phone .kz-help { overflow: auto; }
.phone .kz-helplist { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92%; overflow: auto; background: var(--bg2); border-top: 3px solid var(--key); border-radius: 22px 22px 0 0; padding: 16px 14px; padding-bottom: max(16px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; box-sizing: border-box; }
.phone .kz-helplist .kz-helptitle { font-size: 22px; text-align: center; }
.phone .kz-helpitem { display: flex; gap: 10px; align-items: flex-start; background: #FFF6C9; color: #2b2116; border-radius: 12px; padding: 8px 10px; font-size: 15px; font-weight: 700; line-height: 1.3; }
.phone .kz-helpitem b { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--key); color: var(--ink); font-size: 12px; display: flex; align-items: center; justify-content: center; }
.phone .kz-helplist .kz-btn { align-self: center; margin-top: 6px; }
/* the code view: the code, then what it means, one under the other */
.phone .kz-code { grid-template-columns: minmax(0, 1fr); overflow: auto; padding: 8px; gap: 10px; }
.phone .kz-codeleft { min-height: 0; }
.phone .kz-coderight { overflow: visible; }
.phone .kz-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.phone .kz-chip, .phone .kz-tabhint { flex: none; }
.phone .kz-editor { min-height: 46vh; }
.phone .kz-hl, .phone .kz-ta { font-size: 16px; padding: 10px 12px; }
.phone .kz-ac { width: min(320px, calc(100vw - 24px)); max-height: 46vh; }
.kz-tabhint { cursor: pointer; font: inherit; font-size: 14px; color: var(--muted); }
/* phone: fit the controls in fewer lines */
.phone .kz-bar { row-gap: 6px; }
.phone .kz-speed { flex: 1 1 100px; min-width: 0; padding: 0 8px; }
.phone .kz-speed .kz-ico { font-size: 17px; }
.phone .kz-speedval { min-width: 26px; font-size: 14px; }
.phone .kz-moods { flex: none; padding: 2px; gap: 1px; }
.phone .kz-moods button { width: 29px; height: 32px; font-size: 17px; border-radius: 8px; }
.phone .kz-moods button.on { transform: none; }
.phone .kz-views { flex-wrap: nowrap; }
.phone .kz-viewswitch .kz-viewlab { font-size: 0; padding: 0 3px; }
.phone .kz-viewswitch .kz-viewlab::first-letter { font-size: 18px; }
.phone .kz-len [data-len] , .phone .kz-lensep { display: none; }
.phone .kz-scope { flex: 1 1 auto; }
/* phone: Waffle's tips stay short (two lines) so the squares get the room */
.phone .kz-bubble .kz-tip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.phone .kz-scope { min-width: 0; flex: 1 1 0; }
.phone .kz-speed input { min-width: 36px; }
/* small phones */
@media (max-width: 370px) {
  .phone .kz-speed .kz-ico { display: none; }
  .phone .kz-tool { width: 32px; height: 32px; font-size: 14px; border-radius: 9px; }
  .phone .kz-toolgap { width: 32px; }
  .phone .kz-tools { gap: 3px; }
  .phone .kz-inst { padding: 0 6px; }
  .phone .kz-instemo { font-size: 20px; }
  .phone .kz-instname, .phone .kz-instname.long { font-size: 13px; }
  .phone .kz-cell, .phone .kz-row.many .kz-cell { height: 40px; }
  .phone .kz-bar .kz-btn { padding: 0 8px; }
  .phone .kz-play { padding: 0 10px; }
  .phone .kz-viewswitch { padding: 0 2px; }
}
