@font-face{font-family:ChimliUI;src:url('./assets/InstrumentSans-Regular.woff') format('woff');font-weight:400;font-display:block}
@font-face{font-family:ChimliUI;src:url('./assets/InstrumentSans-Medium.woff') format('woff');font-weight:600;font-display:block}
:root{color-scheme:dark;background:#161018;color:#f2f0f4;font-family:ChimliUI,Inter,system-ui,-apple-system,sans-serif;font-synthesis:none}
*{box-sizing:border-box}body{margin:0}button,input{font:inherit}button{cursor:pointer;touch-action:manipulation;-webkit-user-select:none;user-select:none}button:disabled{cursor:default;opacity:.4}button,input{-webkit-tap-highlight-color:transparent}button:focus-visible,canvas:focus-visible{outline:2px solid #8ebdef;outline-offset:3px}button svg{display:block;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}[hidden]{display:none!important}.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.chimli-demo{--panel:#211827;--button:#2f333c;--highlight:#8ebdef;--ink:#f2f0f4;--selected-ink:#122326;--muted:#b0abb8;--effect-pigment:#d89991;position:relative;isolation:isolate;min-height:100svh;background:#161018;overflow-x:clip}
.instrument-host{min-height:100svh;padding:max(10px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}.instrument{max-width:800px;margin:auto}.instrument-header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:69px}.instrument-brand{display:flex;align-items:center;gap:12px;font-size:15px;font-weight:400;letter-spacing:.02em;margin:0}.instrument-brand img{display:block;width:122px;height:auto;max-height:48px;object-fit:contain}.instrument-brand span{color:#c3bbc9}.header-actions{display:flex;gap:5px;align-items:center}.icon-button{width:44px;height:44px;display:grid;place-items:center;flex-shrink:0;background:linear-gradient(#30313b80,#22232d80);color:#bbb8c4;border:1px solid #aab8c01e;border-radius:13px}.icon-button:hover{color:#f2f0f4;background:#2f333c}
.presets{--preset-frame-radius:14px;--preset-padding:5px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:0 0 9px;padding:var(--preset-padding);border:1px solid #8b92a329;border-radius:var(--preset-frame-radius);background:#211827}.preset{border:1px solid transparent;min-height:41px;padding:8px 8px;border-radius:calc(var(--preset-frame-radius) - 1px - var(--preset-padding));background:#2f333c70;color:#c6c4cd;font-size:12px;line-height:1.2;white-space:normal;overflow-wrap:anywhere}.preset:hover{background:#3a3e4a}.preset[data-pigment=dew]{--preset-colour:#a8dac5}.preset[data-pigment=rose]{--preset-colour:#d89991}.preset[data-pigment=lilac]{--preset-colour:#c4aad9}.preset[aria-pressed=true]{background:var(--preset-colour,#c4aad9);color:#122326;font-weight:600;border-color:#c0e6ff38;box-shadow:inset 0 1px 0 #e6f6ff36}
.character-area{position:relative;margin:0 auto;height:clamp(400px,57svh,570px);border:1px solid #9097a52a;border-radius:22px;overflow:hidden;background:radial-gradient(ellipse at 12% 78%,#454e6740,transparent 65%),radial-gradient(ellipse at 78% 5%,#57365155,transparent 62%),radial-gradient(ellipse at 65% 86%,#4d526340,transparent 65%),#20212b;isolation:isolate}.character-canvas{width:100%;height:100%;display:block;touch-action:none}.character-canvas:focus-visible{outline-offset:-5px;border-radius:20px}.character-canvas[data-pointer-focus=true]:focus-visible{outline:none}.play-hint{font-size:11px;line-height:17px;color:#aaa6b7;text-align:center;margin:9px 0 11px;user-select:none}
.play-panel{border:1px solid #9ba5b22e;border-radius:15px;overflow:hidden;background:#211827;max-width:560px;margin:auto;padding:7px 12px;display:flex;align-items:center;justify-content:space-between;gap:12px}.step-control{display:flex;align-items:center;gap:11px}.step-caption{font-size:11px;line-height:16px;color:#c5bfce}.octave-value{font-variant-numeric:tabular-nums;display:inline-block;min-width:1.5em;text-align:center;color:#a9d7ed}.step-buttons{display:flex;border:1px solid #a7b4b736;border-radius:10px;overflow:hidden;background:linear-gradient(#353943,#292d36)}.step-buttons button{display:grid;place-items:center;width:44px;min-height:42px;padding:0;border:0;background:transparent;color:#e7e4eb;font-size:20px;line-height:1}.step-buttons button+button{border-left:1px solid #a7b4b724}.step-buttons button:hover:not(:disabled){background:#414854}.step-buttons button:active:not(:disabled){background:#8ebdef;color:#122326}.step-buttons button:focus-visible{outline-offset:-3px}.step-buttons button svg{width:18px;height:18px}.reverse-button{border:0;background:transparent;color:#c5bfce;display:flex;align-items:center;justify-content:flex-end;gap:7px;min-height:42px;padding:0 2px 0 4px;font-size:11px;line-height:1.15;white-space:nowrap}.switch-light{width:25px;height:15px;flex-shrink:0;border-radius:8px;border:1px solid #9ca9b544;background:#4f5361;position:relative}.switch-light:after{content:'';position:absolute;left:2px;top:2px;width:9px;height:9px;border-radius:50%;background:#b8bbc3;transition:transform .15s}.reverse-button[aria-pressed=true]{color:#b9e2ff}.reverse-button[aria-pressed=true] .switch-light{background:#5b849f;border-color:#a4d7f29e}.reverse-button[aria-pressed=true] .switch-light:after{transform:translateX(10px);background:#b9eaff}
.effects-panel{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));max-width:560px;margin:8px auto 0;padding:8px 7px 7px;border:1px solid #9ba5b22e;border-radius:15px;background:#211827}.effect-control{--effect-value:0%;min-width:0;min-height:65px;display:grid;grid-template-columns:1fr auto;grid-template-rows:20px 1fr;align-items:center;position:relative;padding:3px 15px 0}.effect-control+.effect-control{border-left:1px solid #b4bfca1f}.effect-control label{font-size:11px;letter-spacing:.02em;text-transform:uppercase;color:#d8d3df}.effect-value{font-size:11px;color:#e5d9df;font-variant-numeric:tabular-nums}.effect-track{position:relative;grid-column:1/-1;height:38px;align-self:end;margin:0 2px}.effect-spine{position:absolute;left:0;right:0;top:50%;height:4.2px;transform:translateY(-50%);border-radius:2.1px;background:linear-gradient(#09101682,#a7bec869)}.effect-spine:after{content:'';position:absolute;inset:.75px .65px;border-radius:1.35px;background:linear-gradient(#10181ff5,#1f2b33f5)}.effect-fill{position:absolute;top:50%;left:0;height:1.5px;transform:translateY(-50%);width:var(--effect-value);border-radius:1px;background:#d89991eb}.effect-handle{position:absolute;left:var(--effect-value);top:50%;transform:translate(-50%,-50%);width:20px;height:20px;pointer-events:none}.effect-track input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;appearance:none;-webkit-appearance:none;cursor:ew-resize;touch-action:none}.effect-track input::-webkit-slider-runnable-track{height:4px;background:none}.effect-track input::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:0;height:20px;margin-top:-8px}.effect-track input::-moz-range-thumb{width:0;height:20px;border:0}.effect-track:has(input:focus-visible){outline:2px solid #8ebdef88;outline-offset:2px;border-radius:5px}.effect-track:has(input:active) .effect-handle{content:url('./assets/orbs/effect-thumb-active.svg')}
.instrument-status{min-height:0;margin:0;text-align:center;color:#d9c4bf;font-size:11px;line-height:23px}.instrument-status:empty{display:none}.paused-overlay{position:absolute;z-index:4;inset:0;background:#211827c9;backdrop-filter:blur(9px);-webkit-backdrop-filter:blur(9px);display:flex;align-items:center;justify-content:center;flex-direction:column;gap:17px;padding:20px}.paused-overlay h2{font-size:18px;line-height:1.3;font-weight:400;margin:0;color:#f2f0f4}.resume-button,.open-button{border:1px solid #b7defa66;border-radius:12px;min-height:48px;min-width:124px;padding:12px 24px;background:#8ebdef;color:#122326;font-weight:600;font-size:14px}.resume-button:hover,.open-button:hover{background:#add8fb}.chimli-demo[data-state=opening] .instrument-host{pointer-events:none}
.launch-screen{min-height:100svh;display:flex;align-items:center;justify-content:center;padding:32px max(24px,env(safe-area-inset-left)) max(32px,env(safe-area-inset-bottom));text-align:center}.launch-main{display:flex;flex-direction:column;align-items:center;gap:34px}.launch-title{display:flex;flex-direction:column;align-items:center;gap:13px;margin:0;font-size:22px;font-weight:400;color:#d1c6d9;letter-spacing:.04em}.launch-title img{display:block;width:240px;max-width:75vw;height:auto;max-height:110px;object-fit:contain}.launch-error{max-width:350px;margin:0;padding:12px 16px;border:1px solid #d0a4a144;border-radius:10px;color:#edc7bc;font-size:13px;line-height:1.5}.loading-screen{min-height:100svh;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:18px;text-align:center;position:relative}.loading-close{position:absolute;right:max(16px,env(safe-area-inset-right));top:max(16px,env(safe-area-inset-top));font-size:24px}.loading-screen h2{font-size:15px;font-weight:400;margin:0;color:#cec7d4}.loading-spinner{width:27px;height:27px;border:2px solid #8ebdef24;border-top-color:#8ebdef;border-radius:50%;animation:loading-spin .8s linear infinite}@keyframes loading-spin{to{transform:rotate(360deg)}}
@media(max-width:600px){.instrument-host{padding-top:max(5px,env(safe-area-inset-top));padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right));padding-bottom:max(12px,env(safe-area-inset-bottom))}.instrument-header{min-height:62px;gap:5px}.instrument-brand{font-size:13px;gap:8px}.instrument-brand img{width:108px;max-height:42px}.header-actions{gap:3px}.icon-button{width:40px;height:42px;border-radius:11px}.presets{--preset-padding:4px;gap:4px}.preset{font-size:11px;min-height:40px;padding:8px 4px}.character-area{height:clamp(360px,51svh,500px);border-radius:19px}.play-hint{margin:8px 0 10px}.play-panel{padding:6px 10px}.effect-control{padding-left:12px;padding-right:12px}}
@media(max-width:360px){.instrument-host{padding-left:8px;padding-right:8px}.instrument-brand img{width:95px}.instrument-brand{gap:5px}.preset{font-size:10px}.step-control{gap:6px}.play-panel{gap:6px}.reverse-button{font-size:10px;gap:5px}.step-caption{font-size:10px}}
@media(max-height:600px) and (min-width:601px){.character-area{height:360px}.instrument{max-width:700px}}
@media(prefers-reduced-motion:reduce){.loading-spinner{animation-duration:1.6s}.switch-light:after{transition:none}}

.character-poster{position:absolute;inset:0;z-index:1;width:100%;height:100%;object-fit:contain;pointer-events:none;opacity:1;transition:opacity .16s ease,visibility 0s}
.character-poster[data-ready=true]{opacity:0;visibility:hidden;transition:opacity .16s ease,visibility 0s .16s}
.instrument-controls{min-width:0}
html:not([data-device-preview]) .instrument-host[data-prerendered]{display:none}
html[data-device-preview] .launch-screen[data-prerendered]{display:none}
html[data-device-preview][data-embedded],
html[data-device-preview][data-embedded] body,
html[data-device-preview][data-embedded] .chimli-demo,
html[data-device-preview][data-embedded] .instrument-host{background:#161018;min-height:0}
html[data-device-preview],html[data-device-preview] body,
html[data-device-preview] .chimli-demo{height:100%;min-height:0;overflow:hidden}
html[data-device-preview][data-embedded] .instrument-host{height:100%;min-height:0;padding:6px 12px 10px;overflow:hidden}
html[data-device-preview] .instrument-mount{height:100%;min-height:0}
html[data-device-preview] .instrument{display:flex;flex-direction:column;height:100%;min-height:0;max-width:none}
html[data-device-preview] .instrument-header{flex:0 0 48px;min-height:48px;gap:6px}
html[data-device-preview] .instrument-brand{gap:8px;font-size:12px}
html[data-device-preview] .instrument-brand img{width:104px;max-height:41px}
html[data-device-preview] .icon-button{width:44px;height:44px;border-radius:10px}
html[data-device-preview] .header-actions{gap:3px}
html[data-device-preview] .presets{flex:0 0 auto;padding:0;gap:3px;margin:2px 0 6px;border:0;border-radius:0;background:transparent}
html[data-device-preview] .preset{min-width:0;min-height:44px;padding:6px 2px;border-radius:8px;font-size:11px;line-height:1.2;white-space:normal;overflow-wrap:normal;word-break:normal}
html[data-device-preview][data-embedded] .chimli-demo .character-area{
  flex:0 0 clamp(218px,calc(100svh - 316px),390px);height:clamp(218px,calc(100svh - 316px),390px);min-height:0;width:100%;margin:0;
  border:1px solid #9097a52a;border-radius:14px;overflow:hidden;
  background:radial-gradient(ellipse at 12% 78%,#454e6740,transparent 65%),radial-gradient(ellipse at 78% 5%,#57365155,transparent 62%),radial-gradient(ellipse at 65% 86%,#4d526340,transparent 65%),#20212b;
}
html[data-device-preview] .character-canvas{position:relative;border-radius:inherit}
html[data-device-preview] .instrument-controls{flex:1 1 0;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:auto;scrollbar-width:thin;scrollbar-color:#6f7383 #211827;scroll-padding-block:8px;padding:0 2px 4px;margin:0 -2px;touch-action:pan-y}
html[data-device-preview] .instrument-controls:focus-visible{outline:2px solid #8ebdef;outline-offset:-2px;border-radius:12px}
html[data-device-preview] .play-hint{margin:8px 0;font-size:11px;line-height:16px}
html[data-device-preview] .play-panel,html[data-device-preview] .effects-panel{width:100%;max-width:none}
html[data-device-preview] .play-panel{padding:5px 8px;gap:6px;border-radius:12px}
html[data-device-preview] .step-control{gap:7px}
html[data-device-preview] .step-buttons button,html[data-device-preview] .reverse-button{min-height:44px}
html[data-device-preview] .step-caption,html[data-device-preview] .reverse-button{font-size:11px}
html[data-device-preview] .effects-panel{margin-top:6px;padding:4px 2px 3px;border-radius:12px}
html[data-device-preview] .effect-control{padding-inline:12px;min-height:62px}
html[data-device-preview] .effect-track{min-height:44px}
html[data-device-preview] .pocket-midi{padding-top:10px}
html[data-device-preview] .pocket-midi button,html[data-device-preview] .pocket-midi select,html[data-device-preview] .midi-direct{min-height:44px}
html[data-device-preview][data-embedded] .instrument-header,
html[data-device-preview][data-embedded] .presets,
html[data-device-preview][data-embedded] .play-panel,
html[data-device-preview][data-embedded] .effects-panel,
html[data-device-preview][data-embedded] .play-hint,
html[data-device-preview][data-embedded] .pocket-midi{opacity:1;transform:none;pointer-events:auto;transition:none}
@media(max-width:360px){
  html[data-device-preview][data-embedded] .instrument-host{padding-inline:8px}
  html[data-device-preview] .instrument-brand span{display:none}
  html[data-device-preview] .instrument-brand img{width:94px}
  html[data-device-preview] .step-control{gap:4px}
  html[data-device-preview] .reverse-button{font-size:10px;gap:4px}
  html[data-device-preview] .effect-control{padding-inline:10px}
}
@media(max-width:280px){
  html[data-device-preview] .instrument-header{gap:4px}
  html[data-device-preview] .instrument-brand img{width:82px}
  html[data-device-preview] .play-panel{display:grid;grid-template-columns:minmax(0,1fr);gap:3px}
  html[data-device-preview] .step-control{width:100%;justify-content:space-between;gap:8px}
  html[data-device-preview] .step-caption{white-space:nowrap}
  html[data-device-preview] .step-buttons{flex:0 0 auto}
  html[data-device-preview] .step-buttons button{min-width:44px}
  html[data-device-preview] .reverse-button{width:100%;min-height:44px;justify-content:flex-start;padding:4px 2px;border-top:1px solid #a7b4b724;font-size:11px;gap:8px}
}
@media(prefers-reduced-motion:reduce){.character-poster{transition:none!important}}

.pocket-midi{display:flex;align-items:center;justify-content:center;gap:6px 12px;flex-wrap:wrap;padding:9px 4px 2px;flex:0 0 auto;font:11px/1.4 Inter,system-ui,sans-serif;color:#cbd5da;min-width:0}
.pocket-midi[hidden],.pocket-midi [hidden]{display:none!important}
.pocket-midi button,.pocket-midi select{font:inherit;color:#e7f2ef;min-height:36px;padding:7px 12px;border:1px solid #a5cac74d;border-radius:18px;background:#c5e8e810;cursor:pointer;max-width:100%}
.pocket-midi button:hover,.pocket-midi button[aria-pressed=true]{background:#c5e8e824;border-color:#b7ddd67d}
.pocket-midi button:focus-visible,.pocket-midi select:focus-visible{outline:2px solid #b5e1d9;outline-offset:3px}
.pocket-midi button:disabled{opacity:.65;cursor:not-allowed}
.pocket-midi select{max-width:220px;background:#25202d}
.midi-status{flex-basis:100%;text-align:center;overflow-wrap:anywhere;font-size:10px;color:#abbfc1}
.midi-status:empty{display:none}
.midi-voice{color:#bad4d0}
.midi-direct{color:#c7e7df;font-size:11px;text-underline-offset:3px}

/* Same-origin product embeds share the shop's background; standalone previews
   keep their original presentation. Preserve layout while the controls wake. */
html[data-embedded], html[data-embedded] body,
html[data-embedded] .tumbow-demo, html[data-embedded] .chimli-demo,
html[data-embedded] .instrument-host { background: transparent; }
html[data-embedded] .instrument-host { overflow: visible; }
html[data-embedded] .instrument-layout, html[data-embedded] .character-area {
  background: transparent; border-color: transparent; overflow: visible;
}
html[data-embedded] .instrument-header, html[data-embedded] .presets,
html[data-embedded] .transpose-panel, html[data-embedded] .play-panel,
html[data-embedded] .effects-panel, html[data-embedded] .harmonics-panel, html[data-embedded] .play-hint,
html[data-embedded] .pocket-midi {
  opacity: 0; transform: translateY(9px); pointer-events: none;
  transition: opacity .65s ease, transform .85s cubic-bezier(.22,.72,.18,1);
}
html[data-preview-live] .instrument-header, html[data-preview-live] .presets,
html[data-preview-live] .transpose-panel, html[data-preview-live] .play-panel,
html[data-preview-live] .effects-panel, html[data-preview-live] .harmonics-panel, html[data-preview-live] .play-hint,
html[data-preview-live] .pocket-midi { opacity: 1; transform: none; pointer-events: auto; }
html[data-preview-live] .presets, html[data-preview-live] .transpose-panel { transition-delay: .12s; }
html[data-preview-live] .play-panel, html[data-preview-live] .effects-panel, html[data-preview-live] .harmonics-panel,
html[data-preview-live] .pocket-midi { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  html[data-embedded] * { transition-duration: .1s !important; transition-delay: 0s !important; }
}

html[data-device-preview] .preset { font-size: 12px; }
html[data-device-preview] .instrument-controls { touch-action: pan-y pinch-zoom; overscroll-behavior-y: auto; }
html[data-device-preview] .header-actions { gap: 3px; }
html[data-device-preview] .icon-button { width: 44px; height: 44px; }
/* Only the standalone document touches the physical screen edges. The shop
   provides the surrounding safe-area clearance when this document is framed. */
html:not([data-embedded]) {
  --pocket-viewport-height: 100vh;
}
@supports (height: 100svh) {
  html:not([data-embedded]) { --pocket-viewport-height: 100svh; }
}
html:not([data-embedded]) :is(.tumbow-demo,.chimli-demo,.instrument-host,.launch-screen,.loading-screen) {
  min-height: var(--pocket-viewport-height);
}
html:not([data-embedded]) .instrument-host {
  padding: max(8px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right))
    max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
}
html:not([data-embedded]) .launch-screen {
  padding: max(24px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right))
    max(24px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left));
}
@media (pointer:coarse) {
  .instrument .icon-button, .instrument .preset, .instrument .note-modes button,
  .instrument .harmonics-options button, .instrument .pulse-rate, .instrument .reset-pitch,
  .instrument .reverse-button, .instrument .step-buttons button,
  .instrument .effect-track, .pocket-midi :is(button,select) { min-height: 44px; }
  .instrument .icon-button { min-width: 44px; }
  .instrument .pocket-midi select { font-size: 16px; }
}
@media (pointer:coarse) and (orientation:portrait) {
  html:not([data-embedded]) :is(.instrument-layout,.chimli-demo .character-area) {
    height: clamp(280px,calc(var(--pocket-viewport-height) - 225px),610px);
  }
}

/* Portrait devices reserve a reachable strip of the scrollable shelf. */
html[data-device-preview][data-embedded] :is(.instrument-layout,.chimli-demo .character-area) {
  --play-height: clamp(278px,calc(100vh - 235px),600px);
  flex: 0 0 var(--play-height);
  height: var(--play-height);
  min-height: 0;
  margin-bottom: 5px;
}
html[data-device-preview][data-embedded] .tumbow-demo .instrument-layout {
  grid-template-columns: minmax(0,1fr) 54px;
  gap: 3px;
}
html[data-device-preview] .transpose-panel { padding-inline: 4px; }
@media (max-width:430px) {
  html[data-device-preview] .performance-actions { grid-template-columns: minmax(88px,1fr) minmax(134px,1fr); }
}
@media (max-width:350px) {
  html[data-device-preview] .note-shelf { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 2px; }
  html[data-device-preview] .harmonics-options { grid-template-columns: repeat(3,minmax(0,1fr)); }
  html[data-device-preview] .effects-panel { grid-template-columns: minmax(0,1fr); }
  html[data-device-preview] .effect-control + .effect-control { border: 0; border-top: 1px solid #b4bfca1f; }
}
@media (max-width:290px) {
  html[data-device-preview] .performance-actions {
    grid-template-columns: repeat(2,minmax(0,1fr)); padding-inline: 1px;
    grid-template-areas: "octave octave" "note note" "pulse tumble";
  }
  html[data-device-preview] .performance-actions .step-control {
    flex-direction: row; width: 100%; justify-content: space-between;
  }
  html[data-device-preview] .pulse-control { flex-direction: column; align-items: stretch; }
}
@media (min-width:460px) and (max-height:400px), (min-width:700px) and (max-height:530px) {
  /* Keeping the character beside the complete control column gives it the
     full short screen height, including the space next to the preset buttons. */
  html:not([data-embedded]) .instrument-host { height: var(--pocket-viewport-height); }
  html:not([data-embedded]) .instrument-mount { height: 100%; }
  html:is([data-device-preview],:not([data-embedded])) .instrument {
    display: grid;
    grid-template-columns: minmax(0,1.15fr) minmax(232px,1fr);
    grid-template-rows: 44px auto minmax(0,1fr);
    grid-template-areas: "scene header" "scene presets" "scene controls";
    gap: 5px 8px;
    width: 100%; max-width: none; height: 100%; min-height: 0;
  }
  html:is([data-device-preview],:not([data-embedded])) .instrument-header {
    grid-area: header; min-height: 44px; margin: 0; padding: 0; gap: 4px;
  }
  html:is([data-device-preview],:not([data-embedded])) .instrument-brand span { display: none; }
  html:is([data-device-preview],:not([data-embedded])) .instrument-brand img { width: 86px; }
  html:is([data-device-preview],:not([data-embedded])) .header-actions { gap: 3px; }
  html:is([data-device-preview],:not([data-embedded])) .presets {
    grid-area: presets; margin: 0; padding: 0; gap: 3px; border: 0;
  }
  html:is([data-device-preview],:not([data-embedded])) .preset {
    min-width: 0; min-height: 44px; padding: 4px 2px; border-radius: 8px; white-space: normal;
  }
  html[data-device-preview][data-embedded] :is(.instrument-layout,.chimli-demo .character-area),
  html:not([data-embedded]) :is(.instrument-layout,.chimli-demo .character-area) {
    grid-area: scene; min-height: 0; height: 100%; margin: 0; width: 100%;
  }
  html:not([data-embedded]) .tumbow-demo .instrument-layout { grid-template-columns: minmax(0,1fr) 54px; gap: 3px; }
  html:not([data-embedded]) .transpose-panel { padding: 5px 4px; }
  html:not([data-embedded]) .rail-endpoint { margin: 2px 0 12px; }
  html:not([data-embedded]) .rail-endpoint.lower { margin: 12px 0 2px; }
  html:not([data-embedded]) .rail-track { min-height: 38px; }
  html:not([data-embedded]) .transpose-unit { display: none; }
  html:is([data-device-preview],:not([data-embedded])) .instrument-controls {
    grid-area: controls; display: block; overflow-y: auto; overflow-x: hidden;
    margin: 0; min-width: 0; min-height: 0; height: 100%; touch-action: pan-y pinch-zoom;
  }
  html:is([data-device-preview],:not([data-embedded])) .note-shelf { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 2px; }
  html:is([data-device-preview],:not([data-embedded])) .performance-actions {
    display: flex; flex-wrap: wrap; align-items: flex-end;
    justify-content: space-between; gap: 5px; padding-inline: 0;
  }
  .performance-actions .note-control { order: 1; }
  .performance-actions .pulse-control, .performance-actions .tumble-button { order: 2; }
  html:is([data-device-preview],:not([data-embedded])) .shelf-controls { flex-wrap: wrap; padding: 2px; gap: 2px; }
  html:is([data-device-preview],:not([data-embedded])) .notes-caption { display: none; }
  html:is([data-device-preview],:not([data-embedded])) .auto-caption { white-space: normal; }
  html:is([data-device-preview],:not([data-embedded])) .harmonics-panel { flex-direction: column; align-items: stretch; }
  html:is([data-device-preview],:not([data-embedded])) .harmonics-options { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 3px; }
  html:is([data-device-preview],:not([data-embedded])) .effects-panel { grid-template-columns: 1fr; }
  html:is([data-device-preview],:not([data-embedded])) .effect-control + .effect-control { border-left: 0; border-top: 1px solid #b4bfca1f; }
  html:is([data-device-preview],:not([data-embedded])) .chimli-demo .play-panel { flex-wrap: wrap; }
}
@media (min-width:700px) and (max-height:530px) {
  html:is([data-device-preview],:not([data-embedded])) .note-shelf { grid-template-columns: repeat(var(--shelf-count,6),minmax(0,1fr)); }
}
html[data-device-preview][data-embedded] :is(.instrument-layout,.chimli-demo .character-area) {
  border-radius: 16px;
  border: 1px solid #c9ddf123;
  background: radial-gradient(ellipse at 28% 21%,#35465566,transparent 58%),
    radial-gradient(ellipse at 76% 74%,#5142514d,transparent 62%),#20232e;
}
html[data-device-preview][data-embedded] .chimli-demo .character-area {
  container-type: size;
  background: radial-gradient(ellipse at 36% 20%,#3d505e70,transparent 58%),
    radial-gradient(ellipse at 78% 72%,#52405955,transparent 62%),#24232f;
}
/* Feather the edge of the native capture's halo at its own image bounds. */
@supports (width: 1cqw) {
  html[data-device-preview] .chimli-demo .character-poster {
    inset: 50% auto auto 50%; transform: translate(-50%,-50%);
    width: min(100cqw, var(--chimli-poster-fit-width)); height: auto;
    mask-image: linear-gradient(to right,transparent,black 6%,black 94%,transparent),
      linear-gradient(to bottom,transparent,black 5%,black 95%,transparent);
    mask-composite: intersect;
  }
}
html[data-device-preview] .presets .preset { font-size: .81rem; }
html[data-device-preview] .instrument-controls .play-hint { font-size: .81rem; }
html[data-device-preview][data-embedded] .tumbow-demo .reset-pitch { min-width: 0; width: 100%; padding-inline: 0; }
.pocket-frame-reading {
  position: absolute; z-index: 3; top: 6px; left: 6px; padding: 3px 7px;
  width: max-content; max-width: calc(100% - 12px); pointer-events: none;
  border-radius: 6px; background: #171923eb; color: #e6f0ec;
  font: 12px/1.45 ui-monospace,monospace; font-variant-numeric: tabular-nums;
}

.effect-control[data-touch-editing] .effect-handle {
  content: url('./assets/orbs/effect-thumb-active.svg');
}
.effect-control[data-touch-editing] .effect-value {
  color: #eaf9ff;
}
