/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-outline-style:solid;--tw-duration:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-leading:initial;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--leading-snug:1.375;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-bg:#0b1020;--color-surface:#151c34;--color-surface-light:#1c2440;--color-border:#27314f;--color-text:#eaf1ff;--color-text-muted:#94a3c3;--color-grid-active:#63d9ff;--color-grid-generated:#e94b8a;--color-toggle:#ddf3ff;--color-build:#e6a817}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}body{background-color:var(--color-bg);color:var(--color-text);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;overflow-y:auto}#app{max-width:1600px;height:800px;margin:32px auto 0;overflow:hidden;border-radius:12px;border:2px solid #27314f;box-shadow:0 12px 48px rgba(0,0,0,0.6),0 0 0 1px rgba(169,109,255,0.08)}canvas{width:100%;height:100%;display:block}}@layer components{.logo-text{fill:#eaf1ff}.header-toggle{cursor:pointer;border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-border);padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-medium);font-size:11px;font-weight:var(--font-weight-medium);white-space:nowrap;color:var(--color-text-muted);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;background-color:#0000;transition-duration:.15s}.header-toggle:hover{border-color:var(--color-text-muted);color:var(--color-text)}.header-toggle.active{border-color:var(--color-toggle);background-color:var(--color-toggle);color:var(--color-bg)}.scale-btn{cursor:pointer;border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-border);padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-medium);font-size:11px;font-weight:var(--font-weight-medium);white-space:nowrap;color:var(--color-text-muted);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;background-color:#0000;transition-duration:.15s}.scale-btn:hover{border-color:var(--color-text-muted);color:var(--color-text)}.scale-menu{top:calc(100% + 4px);right:calc(var(--spacing) * 0);z-index:50;border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-border);background-color:var(--color-surface-light);min-width:140px;padding-block:calc(var(--spacing) * 1);--tw-shadow:0 8px 24px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);display:none;position:absolute}.scale-menu.open{display:block}.scale-menu-item{cursor:pointer;--tw-border-style:none;width:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2);text-align:left;--tw-font-weight:var(--font-weight-medium);font-size:13px;font-weight:var(--font-weight-medium);color:var(--color-text);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.1s;background-color:#0000;border-style:none;transition-duration:.1s;display:block}.scale-menu-item:hover{background-color:#ffffff14}@supports (color:color-mix(in lab, red, red)){.scale-menu-item:hover{background-color:color-mix(in oklab, var(--color-white) 8%, transparent)}}.scale-menu-item.active{color:var(--color-grid-active)}.knob-container{align-items:center;gap:calc(var(--spacing) * .5);flex-direction:column;min-width:62px;display:flex}.knob-label{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide);color:var(--color-text-muted);text-transform:capitalize;font-size:10px}.knob-svg{cursor:grab;-webkit-user-select:none;user-select:none}.knob-svg:active{cursor:grabbing}.knob-value{--tw-font-weight:var(--font-weight-medium);font-size:11px;font-weight:var(--font-weight-medium);color:var(--color-text);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.bars-btn{height:calc(var(--spacing) * 5);width:calc(var(--spacing) * 5);cursor:pointer;border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-border);padding:calc(var(--spacing) * 0);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:1;color:var(--color-text-muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;background-color:#0000;border-radius:.25rem;justify-content:center;align-items:center;line-height:1;transition-duration:.15s;display:flex}.bars-btn:hover{border-color:var(--color-text-muted);color:var(--color-text)}.generate-btn{cursor:pointer;border-radius:var(--radius-lg);--tw-border-style:none;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide);white-space:nowrap;color:var(--color-white);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;background:linear-gradient(135deg,#e94b8a,#ff6a6a);border-style:none;transition-duration:.15s}.generate-btn:hover{--tw-translate-y:-1px;translate:var(--tw-translate-x) var(--tw-translate-y);opacity:.9}.generate-btn:active{--tw-translate-y:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.generate-btn:disabled{--tw-translate-y:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y);cursor:not-allowed;opacity:.5}.secondary-btn{cursor:pointer;border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-border);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 1);--tw-font-weight:var(--font-weight-medium);font-size:11px;font-weight:var(--font-weight-medium);color:var(--color-text-muted);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;background-color:#0000;transition-duration:.15s}.secondary-btn:hover{border-color:var(--color-text-muted);background-color:var(--color-surface);color:var(--color-text)}.midi-drag-handle{cursor:pointer;border-radius:var(--radius-lg);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-border);padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * 1);--tw-font-weight:var(--font-weight-medium);font-size:11px;font-weight:var(--font-weight-medium);color:var(--color-text-muted);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;background-color:#0000;transition-duration:.15s;-webkit-user-select:none;user-select:none;align-items:center;gap:calc(var(--spacing) * 1);display:flex}.midi-drag-handle:hover{border-color:var(--color-text-muted);background-color:var(--color-surface);color:var(--color-text)}.midi-drag-handle.drag-active{cursor:grabbing;border-color:var(--color-grid-generated);background-color:var(--color-surface);color:var(--color-text)}.drop-zone{margin-top:calc(var(--spacing) * 1);cursor:pointer;border-radius:var(--radius-lg);border-style:var(--tw-border-style);--tw-border-style:dashed;border-style:dashed;border-width:2px;border-color:var(--color-border);padding-block:calc(var(--spacing) * 2);text-align:center;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-text-muted);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.2s;flex-shrink:0;transition-duration:.2s}.drop-zone:hover{border-color:var(--color-grid-generated);background:#e94b8a0f}.drop-zone.drag-over,.drop-zone.drag-active{--tw-border-style:solid;border-style:solid;border-color:var(--color-grid-generated);background:#e94b8a1f}.size-overlay{pointer-events:none;z-index:1000;--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y);background-color:color-mix(in oklab, var(--color-black) 75%, transparent);padding-inline:calc(var(--spacing) * 6);padding-block:calc(var(--spacing) * 3);font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider);color:var(--color-build);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);opacity:0;transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;border-radius:10px;transition-duration:.15s;position:fixed;top:50%;left:50%}.size-overlay.visible{opacity:1}@keyframes learnPulse{0%,to{box-shadow:0 0 4px 1px #e94b8a4d}50%{box-shadow:0 0 10px 3px #e94b8a99}}.knob-learn-mode .knob-svg{border-radius:50%;animation:1.2s ease-in-out infinite learnPulse}.knob-learn-selected .knob-svg{border-radius:50%;box-shadow:0 0 8px 2px #e94b8ab3}.cc-badge{--tw-font-weight:var(--font-weight-semibold);font-size:8px;font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide);color:var(--color-grid-generated)}.tooltip{pointer-events:none;z-index:999;border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-border);background-color:var(--color-surface-light);max-width:200px;padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * 1.5);--tw-leading:var(--leading-snug);font-size:10px;line-height:var(--leading-snug);color:var(--color-text-muted);opacity:0;transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;transition-duration:.15s;position:fixed;box-shadow:0 4px 12px #0006}.tooltip.visible{opacity:1}}@layer utilities{.visible{visibility:visible}.relative{position:relative}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.my-1{margin-block:calc(var(--spacing) * 1)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.h-\[34px\]{height:34px}.h-px{height:1px}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-9{min-height:calc(var(--spacing) * 9)}.w-auto{width:auto}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-\[50px\]{min-width:50px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.resize{resize:both}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.overflow-hidden{overflow:hidden}.rounded-lg{border-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-border{border-color:var(--color-border)}.bg-border{background-color:var(--color-border)}.bg-surface{background-color:var(--color-surface)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pb-1\.5{padding-bottom:calc(var(--spacing) * 1.5)}.text-center{text-align:center}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.text-build{color:var(--color-build)}.text-grid-active{color:var(--color-grid-active)}.text-grid-generated{color:var(--color-grid-generated)}.text-text{color:var(--color-text)}.text-text-muted{color:var(--color-text-muted)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}}:root{--surface:#151c34;--border:#27314f;--text:#eaf1ff;--text-muted:#94a3c3;--grid-active:#63d9ff;--grid-inactive:#202846;--grid-generated:#e94b8a;--knob-bg:#151c34;--knob-track:#27314f;--knob-body:#2a3352;--knob-highlight:#3d4a70;--knob-shadow:#0d1225;--knob-ring:#1e2844;--knob-tick:#5a6a8a;--knob-bevel:#3a4868;--knob-pointer:#b0bcd4;--accent-temp:#ff4f7a;--accent-density:#b35cff;--accent-velocity:#5a9cff;--accent-humanize:#42d9d1;--accent-swing:#ffb84d;--accent-influence:#A96DFF;--accent-volume:#4ade80}
.secondary-btn.active{background:var(--grid-generated);border-color:var(--grid-generated);color:#fff}
.secondary-btn:disabled{opacity:0.35;cursor:not-allowed}
.slot-btn{cursor:pointer;border-radius:var(--radius-lg);border:1px solid var(--border);background:transparent;padding:2px 0;width:28px;text-align:center;font-size:11px;font-weight:600;color:var(--text-muted);transition:all .15s}
.slot-btn:hover{border-color:var(--text-muted);color:var(--text)}
.slot-btn.has-data{border-color:var(--grid-active);color:var(--grid-active)}
.slot-btn.active{background:var(--grid-active);border-color:var(--grid-active);color:var(--color-bg,#0b1020)}
.genre-select{cursor:pointer;border-radius:var(--radius-lg);border:1px solid var(--border);background:var(--color-surface,#151c34);padding:3px 8px;font-size:11px;font-weight:600;color:var(--text-muted);transition:all .15s;-webkit-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3c3' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;padding-right:22px;min-width:90px}
.genre-select:hover{border-color:var(--text-muted);color:var(--text)}
.genre-select:focus{outline:none;border-color:var(--grid-generated)}
.genre-select option{background:var(--color-surface-light,#1c2440);color:var(--text)}
.genre-select option:disabled{color:var(--text-muted);opacity:0.45;font-style:italic}
#grooveSelect{min-width:90px;max-width:130px}
.genre-select{max-width:160px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}
.help-text{display:none;font-size:11px;color:var(--text-muted);font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.fill-btn{cursor:pointer;border-radius:var(--radius-lg);border:none;padding:6px 16px;font-size:var(--text-sm);font-weight:700;letter-spacing:.025em;white-space:nowrap;color:#fff;background:linear-gradient(135deg,#b35cff,#7c3aed);transition:all .15s}
.fill-btn:hover{opacity:.9;translate:0 -1px}
.fill-btn:active{translate:0 0}
.fill-btn:disabled{cursor:not-allowed;opacity:.5;translate:0 0}
.preview-btn{cursor:pointer;border-radius:var(--radius-lg);border:1px solid var(--grid-active);padding:6px 16px;font-size:var(--text-sm);font-weight:700;letter-spacing:.025em;white-space:nowrap;color:var(--grid-active);background:transparent;transition:all .15s}
.preview-btn:hover{background:rgba(99,217,255,0.1);translate:0 -1px}
.preview-btn:active{translate:0 0}
.preview-btn.active{background:var(--grid-active);color:var(--color-bg,#0b1020);border-color:var(--grid-active)}
.add-row-menu{display:none;position:fixed;background:var(--color-surface-light,#1c2440);border:1px solid var(--border);border-radius:6px;padding:4px 0;min-width:120px;box-shadow:0 4px 12px rgba(0,0,0,0.4);z-index:100}
.add-row-menu.open{display:block}
.add-row-menu-item{display:block;width:100%;padding:5px 12px;text-align:left;font-size:11px;font-weight:500;color:var(--text);background:none;border:none;cursor:pointer;font-family:-apple-system,sans-serif;transition:background .1s}
.add-row-menu-item:hover{background:rgba(255,255,255,0.08)}
.add-row-menu-item .row-dot{display:inline-block;width:6px;height:6px;border-radius:50%;margin-right:6px;vertical-align:middle}
.row-context-menu{display:none;position:fixed;background:var(--color-surface-light,#1c2440);border:1px solid var(--border);border-radius:6px;padding:4px 0;min-width:150px;box-shadow:0 4px 12px rgba(0,0,0,0.4);z-index:100}
.row-context-menu.open{display:block}
.row-context-menu-header{padding:4px 12px 2px;font-size:10px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em}
.row-context-menu-item{display:block;width:100%;padding:5px 12px;text-align:left;font-size:11px;font-weight:500;color:var(--text);background:none;border:none;cursor:pointer;font-family:-apple-system,sans-serif;transition:background .1s}
.row-context-menu-item:hover{background:rgba(255,255,255,0.08)}
.row-context-menu-sep{height:1px;background:var(--border);margin:3px 0}
.bpm-control{display:flex;align-items:center;gap:2px}
.bpm-display{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:20px;font-weight:700;color:#63d9ff;text-shadow:0 0 6px rgba(99,217,255,0.5),0 0 14px rgba(99,217,255,0.2);background:rgba(8,12,28,0.85);border:1px solid rgba(99,217,255,0.25);border-radius:6px;padding:1px 10px;letter-spacing:1.5px;min-width:58px;text-align:center;cursor:pointer;transition:all .2s;-webkit-font-variant-numeric:tabular-nums;font-variant-numeric:tabular-nums;line-height:1.4}
.bpm-display:hover{border-color:rgba(99,217,255,0.5);text-shadow:0 0 8px rgba(99,217,255,0.7),0 0 20px rgba(99,217,255,0.35)}
.bpm-display.editing{color:#fff;border-color:#63d9ff;outline:none;text-shadow:0 0 10px rgba(99,217,255,0.8),0 0 24px rgba(99,217,255,0.4)}
.bpm-display.flash{animation:bpmFlash .3s ease-out}
@keyframes bpmFlash{0%{text-shadow:0 0 12px rgba(99,217,255,0.9),0 0 28px rgba(99,217,255,0.6)}100%{text-shadow:0 0 6px rgba(99,217,255,0.5),0 0 14px rgba(99,217,255,0.2)}}
.bpm-adj{width:20px;height:26px;cursor:pointer;border-radius:4px;border:1px solid rgba(99,217,255,0.2);background:rgba(8,12,28,0.6);color:rgba(99,217,255,0.6);font-size:14px;font-weight:700;display:flex;align-items:center;justify-content:center;transition:all .15s;padding:0;line-height:1}
.bpm-adj:hover{border-color:rgba(99,217,255,0.5);color:#63d9ff;background:rgba(99,217,255,0.1)}
.shortcuts-overlay{display:none;position:fixed;inset:0;z-index:200;background:rgba(0,0,0,0.6);align-items:center;justify-content:center}
.shortcuts-overlay.open{display:flex}
.shortcuts-modal{background:var(--color-surface-light,#1c2440);border:1px solid var(--border);border-radius:10px;padding:0;min-width:340px;max-width:420px;box-shadow:0 12px 40px rgba(0,0,0,0.5)}
.shortcuts-header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px 8px;border-bottom:1px solid var(--border);font-size:13px;font-weight:700;color:var(--text)}
.shortcuts-close{background:none;border:none;color:var(--text-muted);font-size:18px;cursor:pointer;padding:0 4px;line-height:1}
.shortcuts-close:hover{color:var(--text)}
.shortcuts-body{padding:8px 16px 14px}
.shortcut-row{display:flex;justify-content:space-between;align-items:center;padding:5px 0;font-size:11px;color:var(--text-muted)}
.shortcut-row kbd{background:rgba(255,255,255,0.08);border:1px solid rgba(255,255,255,0.12);border-radius:4px;padding:2px 7px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10px;font-weight:600;color:var(--text);min-width:40px;text-align:center}
.generate-btn.generating{animation:genPulse 1s ease-in-out infinite}
@keyframes genPulse{0%,100%{box-shadow:0 0 0 0 rgba(233,75,138,0)}50%{box-shadow:0 0 16px 4px rgba(233,75,138,0.4)}}
.grid-generating{animation:gridShimmer 1.5s ease-in-out infinite}
@keyframes gridShimmer{0%,100%{opacity:1}50%{opacity:0.85}}
@keyframes knobPulse{0%{filter:drop-shadow(0 0 5px rgba(255,255,255,0.35))}100%{filter:none}}
.knob-svg.pulse{animation:knobPulse .25s ease-out}
button:focus-visible,.header-toggle:focus-visible,.genre-select:focus-visible,.secondary-btn:focus-visible,.slot-btn:focus-visible{outline:2px solid var(--grid-active);outline-offset:2px;border-radius:var(--radius-lg)}
html.light-theme{--color-bg:#d8dce6;--color-surface:#c8ced8;--color-surface-light:#bfc6d2;--color-border:#a8b0c0;--color-text:#1a1d2e;--color-text-muted:#4a5268;--color-grid-active:#0a7ab8;--color-grid-generated:#c42d72;--color-toggle:#1a2d50;--color-build:#7a6000;--surface:#c8ced8;--border:#a8b0c0;--text:#1a1d2e;--text-muted:#4a5268;--grid-active:#0a7ab8;--grid-inactive:#b0b8c6;--grid-generated:#c42d72;--knob-bg:#c0c8d4;--knob-track:#b0b8c6;--knob-body:#d8dce4;--knob-highlight:#f0f2f6;--knob-shadow:#a8b0c0;--knob-ring:#c4cad4;--knob-tick:#8890a0;--knob-bevel:#e8ecf0;--knob-pointer:#4a5268;--accent-temp:#d03860;--accent-density:#7830b8;--accent-velocity:#1868c0;--accent-humanize:#208a85;--accent-swing:#c08828;--accent-influence:#7830b8}
html.light-theme body{background-color:var(--color-bg)}
html.light-theme .logo-text{fill:#1a1d2e}
html.light-theme .header-toggle{border-color:var(--border);color:var(--text-muted)}
html.light-theme .header-toggle.active{border-color:var(--color-toggle);background-color:var(--color-toggle);color:#eaf1ff}
html.light-theme .generate-btn{background:linear-gradient(135deg,#c42d72,#e05050)}
html.light-theme .fill-btn{background:linear-gradient(135deg,#9040d0,#6828b0)}
html.light-theme .drop-zone{border-color:#a0a8b8;color:var(--text-muted)}
html.light-theme .bpm-display{color:#0a7ab8;text-shadow:none;background:rgba(10,122,184,0.12);border-color:rgba(10,122,184,0.35)}
html.light-theme .bpm-display:hover{border-color:rgba(10,122,184,0.55);text-shadow:none}
html.light-theme .bpm-display.editing{color:#0a7ab8;border-color:#0a7ab8;text-shadow:none}
html.light-theme .bpm-adj{border-color:rgba(10,122,184,0.3);background:rgba(10,122,184,0.08);color:rgba(10,122,184,0.65)}
html.light-theme .bpm-adj:hover{border-color:rgba(10,122,184,0.55);color:#0a7ab8;background:rgba(10,122,184,0.14)}
html.light-theme .shortcuts-modal{background:#ffffff;border-color:#cdd2de}
html.light-theme .shortcut-row kbd{background:rgba(0,0,0,0.05);border-color:rgba(0,0,0,0.1)}
html.light-theme .knob-svg.pulse{animation-name:knobPulseLight}
@keyframes knobPulseLight{0%{filter:drop-shadow(0 0 5px rgba(0,0,0,0.2))}100%{filter:none}}
/* Dark theme header & controls frames */
header{background:linear-gradient(180deg,#1c2440 0%,#151c34 60%,#121930 100%);border:1px solid #27314f;border-radius:4px;box-shadow:inset 0 1px 0 rgba(255,255,255,0.04),0 2px 6px rgba(0,0,0,0.3);padding-left:12px;padding-right:12px}
#controlsBar{background:linear-gradient(180deg,#1c2440 0%,#171e38 40%,#141a32 70%,#10162c 100%);border:1px solid #27314f;border-radius:6px;box-shadow:inset 0 1px 0 rgba(255,255,255,0.03),0 2px 8px rgba(0,0,0,0.3);padding:8px 14px;margin:0 -2px}
/* Light theme header & controls frames */
html.light-theme header{background:linear-gradient(180deg,#e8ecf2 0%,#d8dce6 60%,#d2d6e0 100%);border:1px solid #a8b0c0;border-radius:4px;box-shadow:inset 0 1px 0 rgba(255,255,255,0.5),0 2px 6px rgba(0,0,0,0.08);padding-left:12px;padding-right:12px}
html.light-theme #controlsBar{background:linear-gradient(180deg,#e4e8f0 0%,#dce0ea 40%,#d6dae4 70%,#d0d4de 100%);border:1px solid #a8b0c0;border-radius:6px;box-shadow:inset 0 1px 0 rgba(255,255,255,0.5),0 2px 8px rgba(0,0,0,0.06);padding:8px 14px;margin:0 -2px}
/* =========================================================================
   RETRO THEME -- Vintage Hardware Drum Machine
   Inspired by: Roland TR-808/909, Neve console panels, API rack units
   Apply with: html.retro-theme
   ========================================================================= */
html.retro-theme{--color-bg:#2A1F14;--color-surface:#3A2E22;--color-surface-light:#4A3C2E;--color-border:#5C4A38;--color-text:#F0E6D6;--color-text-muted:#A89880;--color-grid-active:#E85840;--color-grid-generated:#5A8AB8;--color-toggle:#D4A848;--color-build:#D4A848;--surface:#3A2E22;--border:#5C4A38;--text:#F0E6D6;--text-muted:#A89880;--grid-active:#E85840;--grid-inactive:#4A3C2E;--grid-generated:#5A8AB8;--knob-bg:#3A3230;--knob-track:#5C5450;--knob-body:#706860;--knob-highlight:#908880;--knob-shadow:#1E1814;--knob-ring:#585048;--knob-tick:#A89880;--knob-bevel:#807870;--knob-pointer:#F0E6D6;--accent-temp:#E85840;--accent-density:#D4A848;--accent-velocity:#5A8AB8;--accent-humanize:#4A9A8A;--accent-swing:#8A6ABB;--accent-influence:#8A6ABB}
html.retro-theme body{background-color:#2A1F14;background-image:repeating-linear-gradient(0deg,transparent,transparent 2px,rgba(0,0,0,0.03) 2px,rgba(0,0,0,0.03) 4px),repeating-linear-gradient(90deg,transparent,transparent 30px,rgba(0,0,0,0.04) 30px,rgba(0,0,0,0.04) 31px,transparent 31px,transparent 58px,rgba(60,40,20,0.06) 58px,rgba(60,40,20,0.06) 59px),repeating-linear-gradient(2deg,transparent,transparent 80px,rgba(80,50,25,0.05) 80px,rgba(80,50,25,0.05) 82px,transparent 82px,transparent 140px),radial-gradient(ellipse at 50% 50%,rgba(60,42,22,0.0) 30%,rgba(20,12,6,0.4) 100%),linear-gradient(180deg,#321E10 0%,#3A2818 25%,#2E1E10 50%,#3A2818 75%,#2A1A0C 100%)}
html.retro-theme header{background:repeating-linear-gradient(0deg,transparent,transparent 1px,rgba(255,255,255,0.02) 1px,rgba(255,255,255,0.02) 2px),linear-gradient(180deg,#4A4440 0%,#3E3834 30%,#363230 60%,#2E2A28 100%);border:1px solid #5C5450;border-radius:4px;box-shadow:inset 0 1px 0 rgba(255,255,255,0.06),0 2px 6px rgba(0,0,0,0.4);padding-left:12px;padding-right:12px}
html.retro-theme .logo-text{fill:#F0E6D6}
html.retro-theme .header-toggle{border-color:#5C5450;background:linear-gradient(180deg,#4A4440 0%,#3A3634 100%);color:#A89880;box-shadow:inset 0 1px 0 rgba(255,255,255,0.06),0 1px 2px rgba(0,0,0,0.3);text-shadow:0 -1px 0 rgba(0,0,0,0.4)}
html.retro-theme .header-toggle:hover{border-color:#7A7068;color:#F0E6D6;background:linear-gradient(180deg,#565250 0%,#444040 100%)}
html.retro-theme .header-toggle.active{border-color:#D4A848;background:linear-gradient(180deg,#D4A848 0%,#B08830 100%);color:#1E1814;text-shadow:0 1px 0 rgba(255,255,255,0.15);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 0 6px rgba(212,168,72,0.3)}
html.retro-theme .scale-btn{border-color:#5C5450;background:linear-gradient(180deg,#4A4440 0%,#3A3634 100%);color:#A89880;box-shadow:inset 0 1px 0 rgba(255,255,255,0.06),0 1px 2px rgba(0,0,0,0.3)}
html.retro-theme .scale-btn:hover{border-color:#7A7068;color:#F0E6D6}
html.retro-theme .flex-1.bg-surface.border.border-border.rounded-lg{position:relative;background:#3A2E22;border:3px solid #4A3A28;border-radius:6px;padding:8px;background-image:repeating-linear-gradient(0deg,transparent,transparent 1px,rgba(255,255,255,0.012) 1px,rgba(255,255,255,0.012) 2px),linear-gradient(180deg,#5C4A38 0%,#4A3A2A 20%,#3E3020 50%,#4A3A2A 80%,#5C4A38 100%);box-shadow:0 2px 8px rgba(0,0,0,0.5),0 1px 0 rgba(255,255,255,0.03),inset 0 1px 0 rgba(255,255,255,0.08),inset 0 -1px 0 rgba(0,0,0,0.3),inset 1px 0 0 rgba(255,255,255,0.05),inset -1px 0 0 rgba(0,0,0,0.15)}
html.retro-theme .flex-1.bg-surface.border.border-border.rounded-lg>canvas{border-radius:2px;box-shadow:inset 0 2px 6px rgba(0,0,0,0.5),inset 0 0 0 1px rgba(0,0,0,0.3),0 1px 0 rgba(255,255,255,0.06)}
html.retro-theme .flex-1.bg-surface.border.border-border.rounded-lg::before{content:"";position:absolute;inset:0;pointer-events:none;z-index:10;border-radius:6px;background:radial-gradient(circle at center,#908070 0%,#706050 40%,#5A4A3A 55%,transparent 56%) no-repeat 4px 4px,radial-gradient(circle at center,#908070 0%,#706050 40%,#5A4A3A 55%,transparent 56%) no-repeat calc(100% - 4px) 4px,radial-gradient(circle at center,#908070 0%,#706050 40%,#5A4A3A 55%,transparent 56%) no-repeat 4px calc(100% - 4px),radial-gradient(circle at center,#908070 0%,#706050 40%,#5A4A3A 55%,transparent 56%) no-repeat calc(100% - 4px) calc(100% - 4px);background-size:14px 14px}
html.retro-theme .flex-1.bg-surface.border.border-border.rounded-lg::after{content:"";position:absolute;inset:0;pointer-events:none;z-index:11;border-radius:6px;background:radial-gradient(circle at center,rgba(255,255,255,0.3) 0%,rgba(255,255,255,0.1) 15%,transparent 20%,transparent 38%,rgba(0,0,0,0.4) 40%,rgba(0,0,0,0.15) 50%,transparent 55%) no-repeat 4px 4px,radial-gradient(circle at center,rgba(255,255,255,0.3) 0%,rgba(255,255,255,0.1) 15%,transparent 20%,transparent 38%,rgba(0,0,0,0.4) 40%,rgba(0,0,0,0.15) 50%,transparent 55%) no-repeat calc(100% - 4px) 4px,radial-gradient(circle at center,rgba(255,255,255,0.3) 0%,rgba(255,255,255,0.1) 15%,transparent 20%,transparent 38%,rgba(0,0,0,0.4) 40%,rgba(0,0,0,0.15) 50%,transparent 55%) no-repeat 4px calc(100% - 4px),radial-gradient(circle at center,rgba(255,255,255,0.3) 0%,rgba(255,255,255,0.1) 15%,transparent 20%,transparent 38%,rgba(0,0,0,0.4) 40%,rgba(0,0,0,0.15) 50%,transparent 55%) no-repeat calc(100% - 4px) calc(100% - 4px);background-size:14px 14px}
html.retro-theme .drop-zone{border-color:#5C4A38;color:#A89880;background:rgba(30,20,12,0.3)}
html.retro-theme .drop-zone:hover{border-color:#D4A848;background:rgba(212,168,72,0.06)}
html.retro-theme .drop-zone.drag-over,html.retro-theme .drop-zone.drag-active{border-color:#D4A848;background:rgba(212,168,72,0.12)}
html.retro-theme #controlsBar{background:repeating-linear-gradient(0deg,transparent,transparent 1px,rgba(255,255,255,0.015) 1px,rgba(255,255,255,0.015) 2px),linear-gradient(180deg,#403830 0%,#362E28 40%,#302824 70%,#2A2420 100%);border:1px solid #5C4A38;border-radius:6px;box-shadow:inset 0 1px 0 rgba(255,255,255,0.04),0 2px 8px rgba(0,0,0,0.4);padding:8px 14px;margin:0 -2px}
html.retro-theme .knob-label{color:#C8B898;text-shadow:0 -1px 0 rgba(0,0,0,0.4);font-weight:600;letter-spacing:0.04em}
html.retro-theme .knob-value{color:#D4A848;text-shadow:0 0 4px rgba(212,168,72,0.3)}
html.retro-theme .generate-btn{background:linear-gradient(180deg,#D04030 0%,#B83020 35%,#A02818 65%,#882018 100%);border:1px solid #6A1810;border-top-color:#E05840;color:#FFF0E8;text-shadow:0 -1px 1px rgba(0,0,0,0.4);box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),inset 0 -1px 2px rgba(0,0,0,0.2),0 2px 4px rgba(0,0,0,0.4),0 4px 12px rgba(160,40,24,0.25);letter-spacing:0.04em}
html.retro-theme .generate-btn:hover{background:linear-gradient(180deg,#E04838 0%,#C83828 35%,#B03020 65%,#982820 100%);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),inset 0 -1px 2px rgba(0,0,0,0.2),0 2px 6px rgba(0,0,0,0.5),0 4px 16px rgba(180,48,28,0.35)}
html.retro-theme .generate-btn:active{background:linear-gradient(180deg,#A02818 0%,#B83020 50%,#D04030 100%);box-shadow:inset 0 2px 4px rgba(0,0,0,0.4),0 1px 2px rgba(0,0,0,0.3)}
html.retro-theme .generate-btn:disabled{background:linear-gradient(180deg,#5C4A38 0%,#4A3C2E 100%);border-color:#3A2E22;color:#8A7860;box-shadow:none;text-shadow:none}
html.retro-theme .generate-btn.generating{animation:genPulseRetro 1s ease-in-out infinite}
@keyframes genPulseRetro{0%,100%{box-shadow:inset 0 1px 0 rgba(255,255,255,0.15),inset 0 -1px 2px rgba(0,0,0,0.2),0 2px 4px rgba(0,0,0,0.4),0 4px 12px rgba(160,40,24,0.25)}50%{box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),inset 0 -1px 2px rgba(0,0,0,0.2),0 2px 6px rgba(0,0,0,0.5),0 4px 20px rgba(200,56,32,0.5),0 0 30px rgba(200,56,32,0.2)}}
html.retro-theme .fill-btn{background:linear-gradient(180deg,#7A5AA8 0%,#5C3A88 50%,#4A2A70 100%);border:1px solid #3A2058;border-top-color:#9070C0;color:#F0E6F8;text-shadow:0 -1px 1px rgba(0,0,0,0.4);box-shadow:inset 0 1px 0 rgba(255,255,255,0.12),inset 0 -1px 2px rgba(0,0,0,0.2),0 2px 4px rgba(0,0,0,0.35)}
html.retro-theme .fill-btn:hover{background:linear-gradient(180deg,#8A6AB8 0%,#6C4A98 50%,#5A3A80 100%)}
html.retro-theme .fill-btn:disabled{background:linear-gradient(180deg,#5C4A38 0%,#4A3C2E 100%);border-color:#3A2E22;color:#8A7860;box-shadow:none}
html.retro-theme .preview-btn{border-color:#D4A848;color:#D4A848;background:transparent}
html.retro-theme .preview-btn:hover{background:rgba(212,168,72,0.1);border-color:#E8BC58;color:#E8BC58}
html.retro-theme .preview-btn.active{background:linear-gradient(180deg,#D4A848 0%,#B08830 100%);border-color:#D4A848;color:#1E1814;box-shadow:0 0 8px rgba(212,168,72,0.3)}
html.retro-theme .secondary-btn{border-color:#5C4A38;color:#A89880;background:rgba(50,40,30,0.5);box-shadow:inset 0 1px 2px rgba(0,0,0,0.2)}
html.retro-theme .secondary-btn:hover{border-color:#7A6A58;color:#F0E6D6;background:rgba(60,50,38,0.6)}
html.retro-theme .secondary-btn.active{background:#D4A848;border-color:#D4A848;color:#1E1814}
html.retro-theme .slot-btn{border-color:#5C4A38;color:#A89880;background:rgba(50,40,30,0.5);box-shadow:inset 0 1px 2px rgba(0,0,0,0.2)}
html.retro-theme .slot-btn:hover{border-color:#7A6A58;color:#F0E6D6}
html.retro-theme .slot-btn.has-data{border-color:#D4A848;color:#D4A848}
html.retro-theme .slot-btn.active{background:#D4A848;border-color:#D4A848;color:#1E1814;box-shadow:0 0 6px rgba(212,168,72,0.3)}
html.retro-theme .bpm-display{color:#D4A848;text-shadow:0 0 6px rgba(212,168,72,0.5),0 0 14px rgba(212,168,72,0.2);background:rgba(20,14,8,0.85);border:1px solid rgba(212,168,72,0.25)}
html.retro-theme .bpm-display:hover{border-color:rgba(212,168,72,0.5);text-shadow:0 0 8px rgba(212,168,72,0.7),0 0 20px rgba(212,168,72,0.35)}
html.retro-theme .bpm-display.editing{color:#F0E6D6;border-color:#D4A848;text-shadow:0 0 10px rgba(212,168,72,0.8),0 0 24px rgba(212,168,72,0.4)}
html.retro-theme .bpm-display.flash{animation:bpmFlashRetro 0.3s ease-out}
@keyframes bpmFlashRetro{0%{text-shadow:0 0 12px rgba(212,168,72,0.9),0 0 28px rgba(212,168,72,0.6)}100%{text-shadow:0 0 6px rgba(212,168,72,0.5),0 0 14px rgba(212,168,72,0.2)}}
html.retro-theme .bpm-adj{border-color:rgba(212,168,72,0.2);background:rgba(20,14,8,0.6);color:rgba(212,168,72,0.6)}
html.retro-theme .bpm-adj:hover{border-color:rgba(212,168,72,0.5);color:#D4A848;background:rgba(212,168,72,0.1)}
html.retro-theme .bars-btn{border-color:#5C4A38;color:#A89880;background:rgba(50,40,30,0.5)}
html.retro-theme .bars-btn:hover{border-color:#7A6A58;color:#F0E6D6}
html.retro-theme .genre-select{border-color:#5C4A38;background-color:rgba(50,40,30,0.7);color:#C8B898;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23A89880' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");box-shadow:inset 0 1px 2px rgba(0,0,0,0.2)}
html.retro-theme .genre-select:hover{border-color:#7A6A58;color:#F0E6D6}
html.retro-theme .genre-select:focus{border-color:#D4A848}
html.retro-theme .genre-select option{background:#4A3C2E;color:#F0E6D6}
html.retro-theme .genre-select option:disabled{color:#8A7860}
html.retro-theme .scale-menu{background:#4A3C2E;border-color:#5C4A38;box-shadow:0 8px 24px rgba(0,0,0,0.6)}
html.retro-theme .scale-menu-item{color:#F0E6D6}
html.retro-theme .scale-menu-item:hover{background:rgba(212,168,72,0.1)}
html.retro-theme .scale-menu-item.active{color:#D4A848}
html.retro-theme .midi-drag-handle{border-color:#5C4A38;color:#A89880;background:rgba(50,40,30,0.5)}
html.retro-theme .midi-drag-handle:hover{border-color:#7A6A58;color:#F0E6D6;background:rgba(60,50,38,0.6)}
html.retro-theme .midi-drag-handle.drag-active{border-color:#D4A848;color:#D4A848;background:rgba(212,168,72,0.1)}
html.retro-theme .add-row-menu{background:#4A3C2E;border-color:#5C4A38;box-shadow:0 4px 16px rgba(0,0,0,0.5)}
html.retro-theme .add-row-menu-item{color:#F0E6D6}
html.retro-theme .add-row-menu-item:hover{background:rgba(212,168,72,0.1)}
html.retro-theme .row-context-menu{background:#4A3C2E;border-color:#5C4A38;box-shadow:0 4px 16px rgba(0,0,0,0.5)}
html.retro-theme .row-context-menu-header{color:#A89880}
html.retro-theme .row-context-menu-item{color:#F0E6D6}
html.retro-theme .row-context-menu-item:hover{background:rgba(212,168,72,0.1)}
html.retro-theme .row-context-menu-sep{background:#5C4A38}
html.retro-theme .tooltip{background:#2A2018;border-color:#5C4A38;color:#C8B898;box-shadow:0 4px 12px rgba(0,0,0,0.5)}
html.retro-theme .shortcuts-modal{background:repeating-linear-gradient(0deg,transparent,transparent 1px,rgba(255,255,255,0.01) 1px,rgba(255,255,255,0.01) 2px),linear-gradient(180deg,#4A3C2E 0%,#3A2E22 100%);border-color:#5C4A38;box-shadow:0 12px 40px rgba(0,0,0,0.6)}
html.retro-theme .shortcuts-header{border-bottom-color:#5C4A38;color:#F0E6D6}
html.retro-theme .shortcuts-close{color:#A89880}
html.retro-theme .shortcuts-close:hover{color:#F0E6D6}
html.retro-theme .shortcut-row{color:#A89880}
html.retro-theme .shortcut-row kbd{background:rgba(0,0,0,0.25);border-color:rgba(212,168,72,0.15);color:#D4A848}
html.retro-theme .size-overlay{background-color:rgba(30,20,12,0.85);color:#D4A848}
@keyframes learnPulseRetro{0%,100%{box-shadow:0 0 4px 1px rgba(212,168,72,0.3)}50%{box-shadow:0 0 10px 3px rgba(212,168,72,0.6)}}
html.retro-theme .knob-learn-mode .knob-svg{animation-name:learnPulseRetro}
html.retro-theme .knob-learn-selected .knob-svg{box-shadow:0 0 8px 2px rgba(212,168,72,0.7)}
html.retro-theme .cc-badge{color:#D4A848}
@keyframes knobPulseRetro{0%{filter:drop-shadow(0 0 5px rgba(212,168,72,0.35))}100%{filter:none}}
html.retro-theme .knob-svg.pulse{animation-name:knobPulseRetro}
html.retro-theme button:focus-visible,html.retro-theme .header-toggle:focus-visible,html.retro-theme .genre-select:focus-visible,html.retro-theme .secondary-btn:focus-visible,html.retro-theme .slot-btn:focus-visible{outline-color:#D4A848}
html.retro-theme ::-webkit-scrollbar{width:6px;height:6px}
html.retro-theme ::-webkit-scrollbar-track{background:rgba(30,20,12,0.4)}
html.retro-theme ::-webkit-scrollbar-thumb{background:#5C4A38;border-radius:3px}
html.retro-theme ::-webkit-scrollbar-thumb:hover{background:#7A6A58}
@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-leading{syntax:"*";inherits:false}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}

/* =========================================================================
   LANDING PAGE STYLES
   ========================================================================= */

.landing-divider {
    max-width: 800px;
    margin: 56px auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #27314f 20%, #63d9ff40 50%, #27314f 80%, transparent);
}

.landing-section {
    max-width: 960px;
    margin: 0 auto;
    padding: 60px 20px 40px;
    color: #94a3c3;
    font-size: 17px;
    line-height: 1.8;
}

/* Hero */
.landing-hero {
    text-align: center;
    margin-bottom: 48px;
}

.landing-logo {
    text-align: center;
    margin-bottom: 16px;
}
.landing-logo-inner {
    display: inline-flex;
    align-items: center;
    gap: 0;
    vertical-align: middle;
}
.landing-logo-icon {
    height: 96px;
    width: 96px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 4px 24px rgba(169, 109, 255, 0.35));
    margin-right: -14px;
}
.landing-logo-text {
    height: 56px;
    width: auto;
    display: block;
}
.footer-brand-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.footer-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}
.footer-wordmark {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(90deg, #A96DFF, #E94B8A);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.4px;
}
@media (max-width: 600px) {
    .landing-logo-icon { height: 72px; width: 72px; }
    .landing-logo-text { height: 40px; }
}

.landing-tagline {
    font-size: 36px;
    font-weight: 700;
    color: #eaf1ff;
    text-align: center;
    margin-bottom: 14px;
}

.landing-subtitle {
    font-size: 19px;
    color: #7a8bb0;
    text-align: center;
    margin: 0;
}

.landing-callout {
    margin: 28px auto 0;
    max-width: 720px;
    padding: 20px 28px;
    background: linear-gradient(135deg, rgba(169,109,255,0.08), rgba(233,75,138,0.08));
    border: 1px solid rgba(169,109,255,0.2);
    border-radius: 10px;
    text-align: center;
}
.landing-callout p {
    color: #b8c4e0;
    font-size: 17px;
    line-height: 1.7;
    margin: 0;
    font-style: italic;
}

.landing-screenshot {
    position: relative;
    margin: 32px auto 0;
    max-width: 900px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #27314f;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(169,109,255,0.1);
    cursor: pointer;
}
.landing-screenshot img {
    display: block;
    width: 100%;
    height: auto;
}
.landing-screenshot video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s;
}
.landing-screenshot:hover video {
    opacity: 1;
}
.landing-screenshot:hover img {
    opacity: 0;
}
.landing-screenshot .play-hint {
    position: absolute;
    bottom: 12px;
    right: 14px;
    font-size: 11px;
    color: #7a8bb0;
    background: rgba(11, 16, 32, 0.8);
    padding: 4px 10px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}
.landing-screenshot:hover .play-hint {
    opacity: 0;
}

/* Feature cards */
.landing-features {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 48px;
}

.feature-card {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
    background: #151c34;
    border: 1px solid #27314f;
    border-radius: 8px;
    padding: 24px;
}

.feature-card h3 {
    color: #eaf1ff;
    font-size: 19px;
    margin-bottom: 10px;
}

.feature-card p {
    color: #94a3c3;
    font-size: 16px;
    line-height: 1.6;
}
.feature-link {
    color: #63d9ff;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}
.feature-link:hover {
    text-decoration: underline;
}

/* Detail sections */
.landing-detail-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #1e2740;
}

.landing-detail-section h2 {
    font-size: 28px;
    font-weight: 700;
    color: #eaf1ff;
    margin: 0 0 24px 0;
    letter-spacing: 0.01em;
}

.landing-detail-section h3 {
    font-size: 20px;
    font-weight: 600;
    color: #63d9ff;
    margin: 36px 0 14px 0;
}

.landing-detail-section p {
    color: #94a3c3;
    font-size: 17px;
    line-height: 1.8;
    margin: 0 0 16px 0;
}

.landing-detail-section ul,
.landing-detail-section ol {
    color: #94a3c3;
    font-size: 17px;
    line-height: 1.8;
    margin: 0 0 18px 0;
    padding-left: 24px;
}

.landing-detail-section ul {
    list-style: none;
    padding-left: 0;
}

.landing-detail-section ul > li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
}

.landing-detail-section ul > li::before {
    content: "\2022";
    color: #63d9ff;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
}

/* Nested lists */
.landing-detail-section ul ul {
    margin-top: 8px;
    margin-bottom: 8px;
}

.landing-detail-section ul ul > li::before {
    content: "\2013";
    color: #7a8bb0;
}

.landing-numbered-list {
    list-style: decimal;
    padding-left: 28px !important;
}

.landing-numbered-list > li {
    padding-left: 6px;
    margin-bottom: 8px;
}

.landing-numbered-list > li::before {
    display: none;
}

.landing-detail-section strong {
    color: #c8d5ee;
    font-weight: 600;
}

.landing-detail-section em {
    color: #a8b8d8;
    font-style: italic;
}

.landing-detail-section code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: #1a2240;
    color: #a896ff;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.landing-detail-section kbd {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: #1a2240;
    color: #eaf1ff;
    border: 1px solid #2d3a5c;
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    line-height: 1.6;
}

/* Shortcuts table in landing */
.landing-shortcuts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 420px;
    margin: 12px 0 16px 0;
}

.landing-shortcut-row {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: #94a3c3;
}

.landing-shortcut-row kbd {
    min-width: 90px;
    text-align: center;
    flex-shrink: 0;
}

.landing-shortcut-row span {
    flex: 1;
}

/* Footer */
/* Download section */
.download-card {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    background: linear-gradient(135deg, #151c34, #1a2340);
    border: 1px solid #27314f;
    border-radius: 12px;
    padding: 32px;
    margin-top: 20px;
}
.download-icon {
    flex-shrink: 0;
    padding-top: 4px;
}
.download-info h3 {
    color: #eaf1ff;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 10px 0;
}
.download-info > p {
    color: #94a3c3;
    font-size: 16px;
    line-height: 1.7;
    margin: 0 0 16px 0;
}
.download-details {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.download-details span {
    font-size: 13px;
    color: #7a8bb0;
    background: rgba(99,217,255,0.06);
    border: 1px solid rgba(99,217,255,0.12);
    padding: 4px 12px;
    border-radius: 6px;
}
.download-btn {
    display: inline-block;
    padding: 12px 32px;
    background: linear-gradient(135deg, #A96DFF, #E94B8A);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}
.download-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(169,109,255,0.3);
}
.download-note {
    font-size: 13px !important;
    color: #5a6a8a !important;
    margin-top: 12px !important;
    font-style: italic;
}

.landing-info-box {
    margin: 16px 0 24px;
    padding: 16px 20px;
    background: rgba(233,75,138,0.06);
    border-left: 3px solid #e94b8a;
    border-radius: 0 8px 8px 0;
    color: #94a3c3;
    font-size: 15px;
    line-height: 1.7;
}
.landing-info-box strong {
    color: #e94b8a;
}

/* Yellow warning callout */
.landing-warn-box {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 16px 0 24px;
    padding: 14px 18px;
    background: rgba(250, 204, 21, 0.06);
    border-left: 3px solid #facc15;
    border-radius: 0 8px 8px 0;
    color: #94a3c3;
    font-size: 14px;
    line-height: 1.65;
}
.landing-warn-box strong {
    color: #facc15;
}
.landing-warn-orb {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-top: 4px;
    background: radial-gradient(circle at 35% 30%, #fde047, #eab308 70%, #a16207 100%);
    box-shadow: 0 0 8px rgba(250, 204, 21, 0.55),
                0 0 18px rgba(250, 204, 21, 0.22),
                inset 0 0 3px rgba(255, 255, 255, 0.6);
    animation: warnOrbPulse 2.4s ease-in-out infinite;
}
@keyframes warnOrbPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(250, 204, 21, 0.55), 0 0 18px rgba(250, 204, 21, 0.22), inset 0 0 3px rgba(255, 255, 255, 0.6); }
    50%      { box-shadow: 0 0 12px rgba(250, 204, 21, 0.75), 0 0 24px rgba(250, 204, 21, 0.35), inset 0 0 3px rgba(255, 255, 255, 0.6); }
}

/* Push #app below the floating-nav and make it fill the viewport so all
 * controls are visible without scrolling at 100% browser zoom.
 *
 * Previously `height: 800px` (fixed) + `margin-top: 58px` = 858px total,
 * which clipped the bottom controls on anything under ~950px viewport.
 *
 * Now: viewport-relative height minus the nav bar (58px top margin) and
 * a small bottom margin (12px). The canvas (only flex child without
 * shrink-0) absorbs the difference; header + knobs stay pinned.
 * min-height prevents the grid from collapsing on very small viewports. */
#app {
    margin-top: 58px !important;
    height: calc(100vh - 70px) !important;
    min-height: 500px;
}

/* Floating nav — two states:
 *   default (top of page)        : horizontal bar pinned to top-center
 *   .scrolled (after scrollY>200): left-side vertical rail
 * Always visible; the morph is purely positional/flex-direction.
 */
.floating-nav {
    position: fixed;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    background: rgba(11, 16, 32, 0.85);
    border: 1px solid rgba(39, 49, 79, 0.6);
    border-radius: 14px;
    padding: 6px 8px;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(99, 217, 255, 0.05);
    opacity: 1;
    pointer-events: auto;
    max-width: calc(100vw - 24px);
    overflow-x: auto;
    transition: top 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                left 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                padding 0.35s ease,
                border-radius 0.35s ease;
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
}
/* Hide the dot indicator in horizontal (top) mode — keeps 12 items readable */
.floating-nav a::before {
    display: none;
}
/* Scrolled: slide to left-side vertical rail (original design) */
.floating-nav.scrolled {
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 4px;
    overflow-x: visible;
}
.floating-nav.scrolled a::before {
    display: block;
}

/* Nav link items */
.floating-nav a {
    position: relative;
    color: #5a6a8a;
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.03em;
    padding: 8px 14px 8px 12px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Dot indicator before each link */
.floating-nav a::before {
    content: "";
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #2e3a55;
    flex-shrink: 0;
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}

.floating-nav a:hover {
    color: #c8d6f0;
    background: rgba(99, 217, 255, 0.06);
}
.floating-nav a:hover::before {
    background: #63d9ff;
    box-shadow: 0 0 6px rgba(99, 217, 255, 0.4);
}

/* Active section highlight */
.floating-nav a.active {
    color: #eaf1ff;
    background: rgba(99, 217, 255, 0.08);
}
.floating-nav a.active::before {
    background: #63d9ff;
    box-shadow: 0 0 8px rgba(99, 217, 255, 0.6);
    transform: scale(1.4);
}

/* Back-to-top floating button */
.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(39, 49, 79, 0.6);
    background: rgba(11, 16, 32, 0.85);
    color: #63d9ff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.2s, background 0.2s;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    display: flex;
    align-items: center;
    justify-content: center;
}
.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}
.back-to-top:hover {
    border-color: #63d9ff;
    background: rgba(21, 28, 52, 0.95);
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 12px rgba(99, 217, 255, 0.15);
}

/* Mobile: always force the left-side vertical dots layout (the horizontal
 * top bar doesn't fit 12 links in narrow viewports).
 */
@media (max-width: 768px) {
    .floating-nav,
    .floating-nav.scrolled {
        top: 50%;
        left: 10px;
        transform: translateY(-50%);
        flex-direction: column;
        align-items: stretch;
        padding: 6px;
        border-radius: 12px;
        gap: 0;
        overflow-x: visible;
    }
    .floating-nav a {
        font-size: 0;
        padding: 8px;
        justify-content: center;
        gap: 0;
    }
    .floating-nav a::before {
        display: block;
        width: 6px;
        height: 6px;
    }
    /* Show labels on hover for mobile dots */
    .floating-nav a:hover {
        font-size: 10px;
        padding: 6px 10px 6px 8px;
        gap: 6px;
    }
}

/* About Me card */
.about-me-card {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.about-me-avatar {
    flex-shrink: 0;
}

svg.avatar-placeholder {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(169, 109, 255, 0.3);
    overflow: hidden;
}

/* Blink animation: eyes hide, eyelids show */
@keyframes nerdBlink {
    0%, 92%, 100% { opacity: 1; }
    95%, 97% { opacity: 0; }
}
@keyframes nerdBlinkLids {
    0%, 92%, 100% { opacity: 0; }
    95%, 97% { opacity: 1; }
}
.nerd-eyes {
    animation: nerdBlink 4s ease-in-out infinite;
}
.nerd-eyelids {
    opacity: 0;
    animation: nerdBlinkLids 4s ease-in-out infinite;
}

.about-me-content {
    flex: 1;
    min-width: 0;
}

.about-me-content a {
    color: #63d9ff;
    text-decoration: none;
    border-bottom: 1px solid rgba(99, 217, 255, 0.3);
    transition: border-color 0.2s;
}

.about-me-content a:hover {
    border-bottom-color: #63d9ff;
}

@media (max-width: 600px) {
    .about-me-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Demo waveform player */
.demo-subtitle {
    color: var(--text-muted, #8090b0);
    font-size: 14px;
    margin-bottom: 20px;
}

.demo-player {
    background: linear-gradient(135deg, rgba(21, 28, 52, 0.9) 0%, rgba(11, 16, 32, 0.95) 100%);
    border: 1px solid #27314f;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 16px;
    transition: border-color 0.3s;
}
.demo-player:hover {
    border-color: rgba(169, 109, 255, 0.4);
}
.demo-player.playing {
    border-color: rgba(233, 75, 138, 0.5);
    box-shadow: 0 0 20px rgba(233, 75, 138, 0.1);
}

.demo-player-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.demo-play-btn {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #A96DFF, #E94B8A);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 2px 10px rgba(169, 109, 255, 0.3);
}
.demo-play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(169, 109, 255, 0.5);
}
.demo-play-btn:active {
    transform: scale(0.96);
}

.demo-track-info {
    flex: 1;
    min-width: 0;
}
.demo-track-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #eaf1ff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.demo-track-time {
    font-size: 11px;
    color: var(--text-muted, #8090b0);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    margin-top: 2px;
}

.demo-volume-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.demo-volume-icon {
    color: var(--text-muted, #8090b0);
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}
.demo-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 60px;
    height: 4px;
    border-radius: 2px;
    background: #27314f;
    outline: none;
    cursor: pointer;
}
.demo-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #A96DFF;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(169, 109, 255, 0.4);
}

.demo-waveform-wrap {
    position: relative;
    height: 80px;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.demo-waveform-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.demo-waveform-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, rgba(169, 109, 255, 0.2) 0%, rgba(233, 75, 138, 0.15) 100%);
    pointer-events: none;
    transition: none;
}

.demo-waveform-cursor {
    position: absolute;
    top: 0;
    left: 0%;
    width: 2px;
    height: 100%;
    background: #E94B8A;
    pointer-events: none;
    box-shadow: 0 0 6px rgba(233, 75, 138, 0.6);
    transition: none;
}

/* Light theme */
html.light-theme .demo-player {
    background: linear-gradient(135deg, #f0f2f6 0%, #e4e8f0 100%);
    border-color: #cdd2de;
}
html.light-theme .demo-player:hover {
    border-color: rgba(144, 64, 208, 0.4);
}
html.light-theme .demo-player.playing {
    border-color: rgba(196, 45, 114, 0.4);
    box-shadow: 0 0 20px rgba(196, 45, 114, 0.08);
}
html.light-theme .demo-waveform-wrap {
    background: rgba(0, 0, 0, 0.05);
}
html.light-theme .demo-waveform-progress {
    background: linear-gradient(90deg, rgba(144, 64, 208, 0.15) 0%, rgba(196, 45, 114, 0.1) 100%);
}
html.light-theme .demo-volume-slider {
    background: #cdd2de;
}
html.light-theme .demo-play-btn {
    background: linear-gradient(135deg, #9040d0, #c42d72);
}

/* Retro theme */
html.retro-theme .demo-player {
    background: repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(255,255,255,0.01) 1px, rgba(255,255,255,0.01) 2px),
                linear-gradient(135deg, #3A2E22 0%, #2A1F14 100%);
    border-color: #5C4A38;
}
html.retro-theme .demo-player:hover {
    border-color: rgba(212, 168, 72, 0.4);
}
html.retro-theme .demo-player.playing {
    border-color: rgba(232, 88, 64, 0.5);
    box-shadow: 0 0 20px rgba(232, 88, 64, 0.1);
}
html.retro-theme .demo-play-btn {
    background: linear-gradient(135deg, #D4A848, #E85840);
}
html.retro-theme .demo-track-title {
    color: #F0E6D6;
}
html.retro-theme .demo-track-time {
    color: #A89880;
}
html.retro-theme .demo-waveform-wrap {
    background: rgba(0, 0, 0, 0.3);
}
html.retro-theme .demo-waveform-progress {
    background: linear-gradient(90deg, rgba(212, 168, 72, 0.2) 0%, rgba(232, 88, 64, 0.15) 100%);
}
html.retro-theme .demo-waveform-cursor {
    background: #E85840;
    box-shadow: 0 0 6px rgba(232, 88, 64, 0.6);
}
html.retro-theme .demo-volume-slider {
    background: #5C4A38;
}
html.retro-theme .demo-volume-slider::-webkit-slider-thumb {
    background: #D4A848;
    box-shadow: 0 0 4px rgba(212, 168, 72, 0.4);
}
html.retro-theme .demo-subtitle {
    color: #A89880;
}

/* Feedback form */
.feedback-form {
    max-width: 600px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #7a8bb0;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group textarea {
    background: rgba(21, 28, 52, 0.6);
    border: 1px solid #27314f;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: #eaf1ff;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #3d4a66;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #63d9ff;
    box-shadow: 0 0 0 3px rgba(99, 217, 255, 0.1);
}

.form-captcha {
    padding: 4px 0;
}

.feedback-submit {
    align-self: flex-start;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
    color: #0B1020;
    background: #63d9ff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    letter-spacing: 0.2px;
}

.feedback-submit:hover {
    background: #7de4ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 217, 255, 0.3);
}

.feedback-submit:active {
    transform: translateY(0);
}

.feedback-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.feedback-status {
    font-size: 13px;
    min-height: 20px;
}

.feedback-status.success {
    color: #4ade80;
}

.feedback-status.error {
    color: #f87171;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .feedback-submit {
        align-self: stretch;
    }
}

/* ========================================
   Research References
   ======================================== */

.references-header {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    margin-bottom: 8px;
}

.references-header > div {
    flex: 1;
    min-width: 0;
}

.references-header h2 {
    margin-bottom: 14px !important;
}

.references-header p {
    margin: 0 !important;
}

.mad-scientist-svg {
    width: 180px;
    height: auto;
    flex-shrink: 0;
}

/* === Mad scientist dance animations === */

/* Body bobs up and down like feeling the beat */
@keyframes bodyBob {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-4px); }
    50% { transform: translateY(2px); }
    75% { transform: translateY(-3px); }
}
.scientist-body {
    animation: bodyBob 1.2s ease-in-out infinite;
}

/* Head tilts side to side */
@keyframes headGroove {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(4deg); }
    50% { transform: rotate(-5deg); }
    80% { transform: rotate(3deg); }
}
.scientist-head {
    animation: headGroove 1.8s ease-in-out infinite;
}

/* Hair bounces with extra exaggeration */
@keyframes hairBounce {
    0%, 100% { transform: scaleY(1) translateY(0); }
    15% { transform: scaleY(1.08) translateY(-3px); }
    40% { transform: scaleY(0.95) translateY(1px); }
    65% { transform: scaleY(1.06) translateY(-2px); }
    85% { transform: scaleY(0.97) translateY(1px); }
}
.scientist-hair {
    animation: hairBounce 1.2s ease-in-out infinite;
}

/* Left arm swings the flask */
@keyframes flaskSwing {
    0%, 100% { transform: rotate(0deg); }
    30% { transform: rotate(8deg); }
    60% { transform: rotate(-6deg); }
    85% { transform: rotate(3deg); }
}
.scientist-left-arm {
    animation: flaskSwing 1.8s ease-in-out infinite;
}

/* Right arm pumps up and down */
@keyframes armPump {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-12deg); }
    50% { transform: rotate(2deg); }
    75% { transform: rotate(-8deg); }
}
.scientist-right-arm {
    animation: armPump 1.2s ease-in-out infinite;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .scientist-body,
    .scientist-head,
    .scientist-hair,
    .scientist-left-arm,
    .scientist-right-arm,
    .bubble {
        animation: none;
    }
}

/* Bubble float animation */
@keyframes bubbleFloat {
    0% {
        transform: translateY(0);
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-18px);
        opacity: 0;
    }
}

.bubble {
    animation: bubbleFloat 3s ease-in-out infinite;
}
.bubble-1 { animation-delay: 0s; animation-duration: 2.8s; }
.bubble-2 { animation-delay: 0.6s; animation-duration: 3.2s; }
.bubble-3 { animation-delay: 1.2s; animation-duration: 2.5s; }
.bubble-4 { animation-delay: 1.8s; animation-duration: 3.5s; }
.bubble-5 { animation-delay: 0.3s; animation-duration: 2.9s; }

.references-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 24px;
}

.reference-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    background: rgba(21, 28, 52, 0.4);
    border-left: 3px solid;
    border-image: linear-gradient(180deg, #A96DFF, #E94B8A) 1;
    border-radius: 0 8px 8px 0;
    transition: background 0.2s ease, transform 0.15s ease;
}

.reference-item:hover {
    background: rgba(21, 28, 52, 0.65);
    transform: translateX(3px);
}

.reference-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 24px;
    padding: 0 8px;
    background: rgba(99, 217, 255, 0.12);
    color: #63d9ff;
    font-size: 12px;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    border-radius: 100px;
    flex-shrink: 0;
    margin-top: 2px;
}

.reference-body {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px;
    font-size: 15px;
    line-height: 1.7;
}

.reference-title {
    font-weight: 700;
    font-style: italic;
    color: #c8d5ee;
}

.reference-authors {
    color: #94a3c3;
    font-weight: 400;
}

.reference-venue {
    color: #7a8bb0;
    font-size: 14px;
}

.reference-link {
    color: #63d9ff;
    text-decoration: none;
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    border-bottom: 1px solid rgba(99, 217, 255, 0.3);
    transition: border-color 0.2s, color 0.2s;
}

.reference-link:hover {
    border-bottom-color: #63d9ff;
    color: #7de4ff;
}

@media (max-width: 600px) {
    .references-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .mad-scientist-svg {
        width: 140px;
    }
    .reference-item {
        flex-direction: column;
        gap: 8px;
    }
}

/* ========================================
   Footer
   ======================================== */

.landing-footer {
    position: relative;
    margin-top: 64px;
    padding: 56px 0 0;
    width: 100%;
    background: linear-gradient(180deg, rgba(21, 28, 52, 0.6) 0%, rgba(11, 16, 32, 0) 100%);
}

/* Subtle gradient top border */
.landing-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(99, 217, 255, 0.3) 20%,
        rgba(99, 217, 255, 0.3) 50%,
        rgba(99, 217, 255, 0.3) 80%,
        transparent 100%
    );
}

/* 3-column grid */
.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 48px;
    padding: 0 48px;
}

/* -- Left: Brand column -- */
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-logo {
    height: 56px;
    width: auto;
    object-fit: contain;
    object-position: left;
    filter: brightness(1.2) contrast(1.1);
    transition: filter 0.3s ease;
}

.footer-logo:hover {
    filter: brightness(1.4) contrast(1.15);
}

.footer-tagline {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: #7a8bb0;
    letter-spacing: 0.3px;
}

.footer-description {
    margin: 0;
    font-size: 12px;
    color: #4a5268;
    line-height: 1.5;
    max-width: 280px;
}

/* -- Center: Quick Links column -- */
.footer-links {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer-heading {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: #63d9ff;
    opacity: 0.6;
}

.footer-links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
}

.footer-link {
    font-size: 13px;
    color: #7a8bb0;
    text-decoration: none;
    transition: color 0.25s ease, text-shadow 0.25s ease;
    padding: 2px 0;
}

.footer-link:hover {
    color: #63d9ff;
    text-shadow: 0 0 12px rgba(99, 217, 255, 0.35);
}

/* -- Right: Tech Stack column -- */
.footer-tech {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 500;
    color: #7a8bb0;
    border: 1px solid #27314f;
    border-radius: 100px;
    background: rgba(21, 28, 52, 0.5);
    letter-spacing: 0.2px;
    transition: border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    white-space: nowrap;
}

.tech-badge:hover {
    border-color: rgba(99, 217, 255, 0.35);
    color: #eaf1ff;
    box-shadow: 0 0 10px rgba(99, 217, 255, 0.1);
}

/* -- Bottom bar -- */
.footer-bottom-separator {
    height: 1px;
    margin: 40px 0 0;
    background: linear-gradient(90deg,
        transparent 0%,
        #27314f 20%,
        #27314f 80%,
        transparent 100%
    );
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 48px 24px;
}

.footer-copyright,
.footer-made-with {
    font-size: 11px;
    color: #4a5268;
}

.footer-made-with {
    font-style: italic;
}

/* ========================================
   Footer Responsive
   ======================================== */

@media (max-width: 768px) {
    .landing-footer {
        padding: 40px 0 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
        padding: 0 24px;
    }

    .footer-brand {
        align-items: center;
    }

    .footer-logo {
        object-position: center;
    }

    .footer-description {
        max-width: 100%;
    }

    .footer-links {
        align-items: center;
    }

    .footer-links-grid {
        justify-items: center;
    }

    .footer-tech {
        align-items: center;
    }

    .footer-badges {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 6px;
        text-align: center;
        padding: 14px 24px 20px;
    }
}

@media (max-width: 480px) {
    .footer-tech {
        display: none;
    }

    .landing-footer {
        padding: 32px 0 0;
    }

    .footer-grid {
        gap: 24px;
        padding: 0 16px;
    }
}

/* FAQ section — visible 1:1 parity with FAQPage JSON-LD */
.faq-intro {
    color: var(--muted, #888);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
.faq-item {
    border: 1px solid var(--card-border, #ddd);
    border-radius: 6px;
    padding: 0.5rem 0.85rem;
    margin-bottom: 0.5rem;
}
.faq-item > summary {
    cursor: pointer;
    font-weight: 600;
    padding: 0.25rem 0;
}
.faq-item[open] > summary {
    margin-bottom: 0.5rem;
}
.faq-item > p {
    margin: 0;
    line-height: 1.55;
}

/* Empty-grid affordance — Generate button is disabled via the native
   :disabled attr (CSS for that is in the Tailwind layer above). The
   MIDI drag-handle has no native disabled state, so we tag it with a
   class and fade it the same way to keep the affordance consistent. */
.midi-drag-handle.disabled-empty {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: auto; /* keep tooltip + click handler reachable */
}
.midi-drag-handle.disabled-empty:hover {
    border-color: var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
}

/* ---------------------------------------------------------------------------
   Rate-limit modal — shown when /api/generate (or sibling) returns 429.
   Soft brand tones (purple → cyan), no alarming reds. Auto-dismisses when
   the retry-after timer reaches zero. Mirrors .shortcuts-overlay structure.
   ------------------------------------------------------------------------ */
.rate-limit-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: radial-gradient(ellipse at center,
        rgba(169, 109, 255, 0.10) 0%,
        rgba(11, 16, 32, 0.78) 70%);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.rate-limit-overlay.open { display: flex; animation: rlFadeIn .22s ease-out; }
@keyframes rlFadeIn { from { opacity: 0; } to { opacity: 1; } }

.rate-limit-modal {
    background: linear-gradient(180deg,
        var(--color-surface-light, #1c2440) 0%,
        var(--color-surface, #151c34) 100%);
    border: 1px solid rgba(169, 109, 255, 0.28);
    border-radius: 14px;
    padding: 26px 32px 22px;
    min-width: 340px;
    max-width: 420px;
    text-align: center;
    position: relative;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(169, 109, 255, 0.08),
        0 0 48px rgba(99, 217, 255, 0.06);
    animation: rlPopIn .32s cubic-bezier(.2, .9, .4, 1.05);
}
@keyframes rlPopIn {
    from { transform: scale(.92) translateY(6px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

.rate-limit-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted, #94a3c3);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color .15s;
}
.rate-limit-close:hover { color: var(--text, #eaf1ff); }

.rate-limit-logo {
    width: 64px;
    height: 64px;
    margin: 6px auto 14px;
    opacity: .92;
    filter: drop-shadow(0 4px 14px rgba(169, 109, 255, 0.28));
}

.rate-limit-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.2px;
    background: linear-gradient(135deg, #A96DFF, #63d9ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.rate-limit-message {
    font-size: 13px;
    color: var(--text-muted, #94a3c3);
    line-height: 1.55;
    margin: 0 auto 16px;
    max-width: 300px;
}

.rate-limit-countdown {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(99, 217, 255, 0.07);
    border: 1px solid rgba(99, 217, 255, 0.18);
    font-size: 11px;
    color: var(--text-muted, #94a3c3);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.rate-limit-countdown-num {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--color-grid-active, #63d9ff);
    font-variant-numeric: tabular-nums;
}

/* Sound-wave countdown: continuously flowing wave that drains from the
   right as the retry-after timer ticks down. The flow loop is independent
   of the drain — water keeps moving even at the end. */
.rate-limit-wave-wrap {
    margin-top: 14px;
    height: 26px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.02),
        rgba(99, 217, 255, 0.05));
    border: 1px solid rgba(99, 217, 255, 0.10);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}
.rate-limit-wave {
    width: 100%;
    height: 100%;
    display: block;
}
/* Pan the over-wide wave shape leftward in a seamless loop = "flow" */
.rate-limit-wave-flow {
    animation: rlWaveFlow 2.8s linear infinite;
    transform-origin: 0 50%;
}
@keyframes rlWaveFlow {
    from { transform: translateX(0); }
    to   { transform: translateX(-72px); }   /* exactly 3 wavelets — seamless */
}
/* Soft right-edge fade so the drained end doesn't look chopped */
.rate-limit-wave-wrap::after {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    width: 28px;
    background: linear-gradient(90deg,
        rgba(11, 16, 32, 0) 0%,
        rgba(11, 16, 32, 0.5) 100%);
    pointer-events: none;
}
/* Clip rect animates its width = drain effect */
#rateLimitWaveClipRect {
    transition: width 1s linear;
}

@media (prefers-reduced-motion: reduce) {
    .rate-limit-wave-flow { animation: none; }
    #rateLimitWaveClipRect { transition: none; }
}

/* Light theme */
html.light-theme .rate-limit-overlay {
    background: radial-gradient(ellipse at center,
        rgba(169, 109, 255, 0.10) 0%,
        rgba(245, 247, 252, 0.82) 70%);
}
html.light-theme .rate-limit-modal {
    background: linear-gradient(180deg, #ffffff 0%, #f5f7fc 100%);
    border-color: rgba(169, 109, 255, 0.32);
    box-shadow:
        0 20px 60px rgba(15, 23, 42, 0.15),
        0 0 0 1px rgba(169, 109, 255, 0.10);
}
html.light-theme .rate-limit-message { color: #5a6580; }
html.light-theme .rate-limit-countdown { background: rgba(99, 217, 255, 0.12); }
html.light-theme .rate-limit-wave-wrap {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.04), rgba(99, 217, 255, 0.08));
    border-color: rgba(99, 217, 255, 0.22);
}
html.light-theme .rate-limit-wave-wrap::after {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.7) 100%);
}

/* Retro theme */
html.retro-theme .rate-limit-overlay {
    background: radial-gradient(ellipse at center,
        rgba(230, 168, 23, 0.10) 0%,
        rgba(28, 22, 16, 0.85) 70%);
}
html.retro-theme .rate-limit-modal {
    background:
        repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(255,255,255,0.01) 1px, rgba(255,255,255,0.01) 2px),
        linear-gradient(180deg, #4A3C2E 0%, #3A2E22 100%);
    border-color: #5C4A38;
}
html.retro-theme .rate-limit-title {
    background: linear-gradient(135deg, #E6A817, #F0E6D6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
html.retro-theme .rate-limit-message { color: #A89880; }
html.retro-theme .rate-limit-countdown {
    background: rgba(230, 168, 23, 0.10);
    border-color: rgba(230, 168, 23, 0.32);
}
html.retro-theme .rate-limit-countdown-num { color: #E6A817; }
html.retro-theme .rate-limit-wave-wrap {
    background: linear-gradient(180deg, rgba(28, 22, 16, 0.4), rgba(230, 168, 23, 0.08));
    border-color: rgba(230, 168, 23, 0.22);
}
html.retro-theme .rate-limit-wave-wrap::after {
    background: linear-gradient(90deg, rgba(28, 22, 16, 0) 0%, rgba(28, 22, 16, 0.55) 100%);
}
/* Swap the SVG gradient stops to amber for the retro theme */
html.retro-theme #rateLimitWaveGrad stop:nth-of-type(1) { stop-color: #E6A817; }
html.retro-theme #rateLimitWaveGrad stop:nth-of-type(2) { stop-color: #F0E6D6; }

@media (prefers-reduced-motion: reduce) {
    .rate-limit-overlay.open,
    .rate-limit-modal { animation: none; }
    .rate-limit-progress-bar { transition: none; }
}
