:root{
  --control-h:36px;
  --control-h-sm:30px;
  --control-radius:8px;
  --control-gap:6px;
}

/* Unified control sizing */
.button{height:var(--control-h);min-height:var(--control-h);padding:0 11px;border-radius:var(--control-radius);display:inline-flex;align-items:center;justify-content:center;line-height:1;white-space:nowrap}
.inspector .button{height:32px!important;min-height:32px!important;padding:0 9px!important;font-size:10px!important}
.inspector .button.accent{font-size:10px!important}
.button.mini{height:var(--control-h-sm);min-height:var(--control-h-sm);padding:0 9px;font-size:10px}
.card select,.card input[type=text]{height:var(--control-h);min-height:var(--control-h);padding-top:0;padding-bottom:0;border-radius:var(--control-radius)}
.card select{-webkit-appearance:none;appearance:none;background-color:#0a0f11;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23c9c2b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;background-size:14px 14px;padding-right:38px}
.card select:hover{border-color:#4b4439}.card select:focus,.card input[type=text]:focus{outline:none;border-color:#9c7444;box-shadow:0 0 0 2px rgba(210,161,91,.10)}.card select:disabled{opacity:.55}

/* Compact upload controls */
.upload-zone,.upload-zone.compact{min-height:64px;flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;padding:10px 12px;text-align:left}
.upload-zone .upload-icon{order:3;flex:0 0 28px;width:28px;height:28px;margin:0 0 0 auto;border:1px solid #5a4934;border-radius:8px;display:grid;place-items:center;font-size:16px;line-height:1;color:#e1b568;background:#18150f}
.upload-zone b{flex:0 0 auto;font-size:11px;white-space:nowrap}.upload-zone small{flex:1 1 auto;min-width:0;max-width:none;margin:0;font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Cleaner waveform selectors */
.choice-row{grid-template-columns:44px minmax(0,1fr);align-items:center;gap:8px;margin-bottom:8px}.choice-row label{display:block;margin:0;font-size:0}.choice-row label select{margin-top:0;font-size:12px}.choice-icon{margin-bottom:0}

/* Multi-wave */
.multi-wave-card.mw-embedded{margin:10px 0 14px!important;padding:10px!important;border:1px solid #3a3022!important;border-radius:10px!important;background:linear-gradient(180deg,#12110e,#0b1012)!important;box-shadow:0 0 0 1px rgba(217,169,95,.04) inset}
.multi-wave-card.mw-embedded .card-title{margin-bottom:8px}.multi-wave-card.mw-embedded .card-title strong{color:#e8c17e}.multi-wave-card.mw-embedded .hint{margin-bottom:0}.multi-wave-card.mw-embedded .mw-actions{display:flex!important;align-items:center;justify-content:flex-start;gap:var(--control-gap);margin-bottom:8px}.multi-wave-card.mw-embedded .mw-actions .button{width:auto!important;min-width:0!important;height:var(--control-h-sm);min-height:var(--control-h-sm);padding:0 9px;font-size:9px}.multi-wave-card.mw-embedded .mw-add,.multi-wave-card.mw-embedded .mw-duplicate{flex:0 0 auto}

/* Global Wave Look */
.wave-look-block{margin:10px 0;padding:10px;border:1px solid #2b3033;border-radius:10px;background:rgba(8,12,14,.50)}
.wave-look-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px 10px}.wave-look-grid label{min-width:0}.wave-look-grid .wave-look-outline{grid-column:1/-1}.wave-look-note{margin-top:6px!important}.color-row.has-hex-code #autoContrastColor.active-look{border-color:#9b7442;color:#e5be7b;background:#1b1710}

/* Center Plate */
.center-plate-block{margin:10px 0;padding:10px;border:1px solid #2b3033;border-radius:10px;background:rgba(8,12,14,.58)}
.center-plate-title{margin:0 0 8px}.center-plate-enable{display:flex!important;align-items:center;gap:7px;font-size:10px!important;font-weight:600;color:#ddd3c5!important;margin:0 0 9px!important}.center-plate-enable .badge{margin-left:auto}.center-plate-grid{margin-bottom:8px}.center-plate-hint{margin:6px 0 0!important}
.center-plate-color-row{display:grid;grid-template-columns:46px minmax(72px,1fr) minmax(112px,auto);align-items:center;gap:6px;margin-top:6px}.center-plate-color-row input[type=color]{width:46px;height:var(--control-h);border:1px solid #30363a;border-radius:var(--control-radius);background:#0b0f11;padding:3px}.center-plate-color-row input[type=text]{margin:0!important;font:600 10px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace!important;letter-spacing:.06em;text-transform:uppercase}.center-plate-color-row .button{height:var(--control-h)}

/* Wave color row + HEX */
.color-row.has-hex-code{grid-template-columns:46px minmax(88px,1fr) 96px 58px;align-items:center;gap:6px}.wave-hex-wrap{height:var(--control-h);display:grid;grid-template-columns:minmax(0,1fr) 32px;border:1px solid #30363a;border-radius:var(--control-radius);background:#0b0f11;overflow:hidden}.wave-hex-input{min-width:0;width:100%;height:34px!important;margin:0!important;padding:0 8px!important;border:0!important;border-radius:0!important;background:transparent!important;color:#eee6da!important;font:600 10px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace!important;letter-spacing:.06em;text-transform:uppercase;outline:none!important;box-shadow:none!important}.wave-hex-copy{width:32px;height:34px;border:0;border-left:1px solid #2b3135;background:#11171a;color:#bdb5aa;cursor:pointer;font-size:13px;padding:0}.wave-hex-copy:hover{background:#1b1711;color:#e4b66d}.color-row.has-hex-code:focus-within .wave-hex-wrap{border-color:#9c7444;box-shadow:0 0 0 2px rgba(210,161,91,.10)}.color-row.has-hex-code #autoColor,.color-row.has-hex-code #autoContrastColor,.color-row.has-hex-code #pickColor{height:var(--control-h)!important;min-height:var(--control-h)!important;padding:0 8px!important;font-size:9px!important;line-height:1!important;display:flex!important;align-items:center!important;justify-content:center!important}

/* Wave toggles */
.toggle-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.toggle-grid label{min-width:0;justify-content:flex-start;padding:8px 7px;font-size:9px}

/* Text controls */
.text-card .delete-text{width:var(--control-h-sm);height:var(--control-h-sm);border:1px solid #2b3034!important;border-radius:var(--control-radius);background:#101517!important;display:inline-grid;place-items:center;padding:0;color:#9b7468!important;font-size:16px!important}.text-card .delete-text:hover{border-color:#71443a!important;background:#1b1110!important;color:#f1b8a7!important}

/* Layout presets */
.user-presets-card{margin-top:12px}.user-preset-save-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}.user-preset-transfer-row{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:8px}.user-preset-transfer-row .button{height:var(--control-h-sm);min-height:var(--control-h-sm);font-size:9px}.user-preset-name{width:100%;height:var(--control-h);padding:0 11px;border:1px solid #2b3236;border-radius:var(--control-radius);background:#0a0f11;color:#eee6da;outline:none;font:500 10px Inter,system-ui,sans-serif}.user-preset-save{height:var(--control-h);white-space:nowrap}.user-preset-list{display:grid;gap:6px;margin-top:9px}.user-preset-item{display:grid;grid-template-columns:minmax(0,1fr) 36px;gap:6px;align-items:stretch}.user-preset-load{min-width:0;height:42px;border:1px solid #293034;border-radius:9px;background:#0c1113;color:#d8d0c4;display:flex;align-items:center;gap:9px;padding:0 10px;text-align:left;cursor:pointer}.user-preset-load:hover{border-color:#7d5c36;background:#15130f}.user-preset-load>span:last-child{min-width:0;display:flex;align-items:center;gap:8px;flex:1}.user-preset-load b{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}.user-preset-load small{font-size:8px;color:#777;white-space:nowrap}.user-preset-icon{width:22px;height:22px;border-radius:7px;display:grid;place-items:center;background:#1b1710;color:#d9a95f;border:1px solid #5b4327;font-size:10px;flex:none}.user-preset-delete{height:42px;border:1px solid #293034;border-radius:9px;background:#0c1113;color:#777;cursor:pointer;font-size:16px}.user-preset-delete:hover{color:#f1b8a7;border-color:#71443a;background:#1b1110}.user-preset-empty{padding:9px 10px;border:1px dashed #293034;border-radius:9px;color:#777;font-size:9px;text-align:center}

/* Template browsing */
.compact-templates-card{padding:10px!important}.compact-templates-card .card-title{margin-bottom:7px!important}.compact-templates-card .card-title strong{font-size:12px!important}.compact-templates-card .card-title small{font-size:8px!important}.compact-templates-card .template-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px!important}.compact-templates-card .template-card{min-height:48px!important;height:auto!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;gap:6px!important;padding:6px 7px!important;border-radius:8px!important;text-align:left!important}.compact-templates-card .template-card b{width:20px!important;min-width:20px!important;font-size:17px!important;line-height:1!important;text-align:center!important}.compact-templates-card .template-card span{font-size:8px!important;line-height:1.15!important;text-align:left!important;overflow-wrap:anywhere}.compact-templates-card .template-section-divider{grid-column:1/-1;margin:5px 1px 0!important;padding-top:6px!important;border-top:1px solid rgba(210,161,91,.18);display:flex;align-items:center;justify-content:space-between;gap:8px;color:#d9aa64;font-size:8px!important;font-weight:700;letter-spacing:.11em;text-transform:uppercase;line-height:1!important}.compact-templates-card .template-section-divider small{font-size:7px!important}[data-panel="presets"] .user-presets-card{margin-top:0!important}[data-panel="presets"] .user-preset-list{max-height:none}

/* Keep two-column controls in the desktop inspector instead of collapsing too early. */
@media(min-width:821px) and (max-width:1100px){.control-grid.two{grid-template-columns:1fr 1fr}.compact-templates-card .template-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
@media(max-width:820px){.tool-rail{grid-template-columns:repeat(5,1fr)!important}.upload-zone,.upload-zone.compact{min-height:58px;padding:9px 10px}.wave-look-grid{grid-template-columns:1fr}.wave-look-grid .wave-look-outline{grid-column:auto}.center-plate-color-row{grid-template-columns:46px 1fr}.center-plate-color-row .button{grid-column:1/-1;width:100%}.toggle-grid{grid-template-columns:1fr 1fr}.compact-templates-card .template-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.compact-templates-card .template-card{min-height:44px!important}}
@media(max-width:520px){.tool-rail{grid-template-columns:repeat(5,1fr)!important}.tool{gap:3px!important;padding:4px 2px!important}.tool b{font-size:8px!important}.user-preset-save-row,.user-preset-transfer-row{grid-template-columns:1fr}.user-preset-save{width:100%}.toggle-grid{grid-template-columns:1fr}.color-row.has-hex-code{grid-template-columns:46px 1fr 1fr}.color-row.has-hex-code #pickColor{grid-column:3}.color-row.has-hex-code #autoColor,.color-row.has-hex-code #autoContrastColor{grid-column:2/-1}}

/* Text color + HEX */
.text-card label.text-color-label{min-width:0}.text-color-control{display:grid;grid-template-columns:42px minmax(0,1fr) 34px;height:35px;margin-top:5px;border:1px solid #2a3034;border-radius:var(--control-radius);background:#0a0f11;overflow:hidden}.text-color-control:focus-within{border-color:#9c7444;box-shadow:0 0 0 2px rgba(210,161,91,.10)}.text-color-control>input[type=color]{width:42px!important;height:33px!important;margin:0!important;padding:3px!important;border:0!important;border-right:1px solid #2a3034!important;border-radius:0!important;background:#0a0f11!important}.text-color-hex{min-width:0;width:100%;height:33px!important;margin:0!important;padding:0 8px!important;border:0!important;border-radius:0!important;background:transparent!important;color:#eee6da!important;outline:none!important;box-shadow:none!important;font:600 10px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace!important;letter-spacing:.06em;text-transform:uppercase}.text-color-copy{width:34px;height:33px;border:0;border-left:1px solid #2a3034;background:#11171a;color:#bdb5aa;cursor:pointer;font-size:13px;padding:0}.text-color-copy:hover{background:#1b1711;color:#e4b66d}

/* Wave layer list (owned by CSS, not injected by JS) */
.multi-wave-card{margin-bottom:12px}.mw-actions{display:flex;gap:6px;margin-bottom:8px}.mw-list{display:grid;gap:6px}.mw-item{display:grid;grid-template-columns:minmax(0,1fr) 32px 32px;gap:5px;align-items:stretch}.mw-item.active .mw-select{border-color:#9a6c39;background:#18130e;box-shadow:0 0 0 1px rgba(217,169,95,.11) inset}.mw-select{min-width:0;height:46px;border:1px solid #293034;border-radius:9px;background:#0c1113;color:#ddd3c5;display:flex;align-items:center;gap:9px;padding:0 10px;text-align:left;cursor:pointer}.mw-select:hover{border-color:#5f4a32}.mw-icon{width:24px;height:24px;border:1px solid #574228;background:#1a160f;color:#d9a95f;border-radius:7px;display:grid;place-items:center;flex:none;font-size:11px}.mw-copy{min-width:0;display:flex;flex-direction:column;gap:2px}.mw-copy b{font-size:10px}.mw-copy small{font-size:8px;color:#777;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mw-eye,.mw-delete,.mw-lock{height:46px;border:1px solid #293034;border-radius:9px;background:#0c1113;color:#777;display:grid;place-items:center}.mw-eye{cursor:pointer;font-size:10px}.mw-eye.on{color:#d9a95f}.mw-delete{cursor:pointer;font-size:15px}.mw-lock{font-size:8px;font-weight:700;color:#92744e}

/* Text editor controls */
.text-show-toggle{display:inline-flex!important;align-items:center;gap:5px;margin:0 8px 0 0!important}.text-native-color{width:100%;height:35px;margin-top:5px;background:#0a0f11;border:1px solid #2a3034;border-radius:8px}.text-card:first-child textarea[data-k="text"]{width:100%;min-height:62px;margin-top:5px;padding:9px 10px;border:1px solid #2a3034;border-radius:8px;background:#0a0f11;color:#eee6da;font:inherit;line-height:1.35;resize:vertical;outline:none;box-sizing:border-box}.text-card:first-child textarea[data-k="text"]:focus{border-color:#9c7444;box-shadow:0 0 0 2px rgba(210,161,91,.10)}.fw-song-title-hint{display:block;margin-top:5px;color:#777;font-size:9px;line-height:1.35}