* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: #08090c;
    color: #c5cdd8;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    font-size: 11px;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 1. TOP HEADER */
#top-header {
    height: 48px;
    background: #0e1117;
    border-bottom: 1px solid #1c222d;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
}

/* --- TOP-LEFT BRANDING --- */
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Optional Logo Icon Square */
.brand-badge-icon {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #1c2433 0%, #0d121a 100%);
    border: 1px solid #00e5ff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
    color: #00e5ff;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.brand-text-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.15;
}

/* Company / Studio Name */
.company-name {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1.8px;
    color: #5c6b7e;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.title-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

/* Main Product Title */
.brand-title {
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 1px;
    color: #ffffff;
}

.accent {
    color: #00e5ff;
}

.brand-divider {
    color: #283344;
    font-weight: 600;
    font-size: 12px;
}

/* Subtitle / Tagline */
.brand-subtitle {
    font-size: 11px;
    color: #8c9ba5;
    font-weight: 500;
}

/* Version Tag */
.version-tag {
    background: #16202c;
    color: #00e5ff;
    border: 1px solid #233549;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.header-center {
    flex: 1;
    margin: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Reserved for future tools */
}

/* 2. MAIN CANVAS VIEWPORT */
#canvas-container {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #040507;
}

#wtCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

/* 3. BOTTOM CONTROL DOCK */
#control-dock {
    height: 82px;
    background: #0e1117;
    border-top: 1px solid #1c222d;
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 16px;
    flex-shrink: 0;
    overflow-x: auto;
}

.dock-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #131720;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #1c2331;
    height: 66px;
    justify-content: center;
}

.group-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #5a6679;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ctrl-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ctrl-field label {
    font-size: 9px;
    color: #8c9ba5;
    font-weight: 600;
}

.stepper-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sep {
    color: #4a5568;
    font-weight: bold;
}

/* FORM CONTROLS (Selects, Inputs, Buttons) */
select, input[type="number"] {
    background: #0a0d13;
    border: 1px solid #232c3d;
    color: #e2e8f0;
    font-size: 11px;
    padding: 4px 6px;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s;
}

select:focus, input[type="number"]:focus {
    border-color: #00e5ff;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #232c3d;
    border-radius: 2px;
    outline: none;
    width: 90px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #00e5ff;
    cursor: pointer;
}

button {
    cursor: pointer;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background: #00e5ff;
    color: #040507;
    padding: 6px 14px;
}

.btn-primary:hover {
    background: #33ecff;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

.btn-small {
    background: #1f2737;
    color: #c5cdd8;
    padding: 4px 8px;
    border: 1px solid #2d384e;
}

.btn-small:hover {
    background: #2a354b;
    color: #ffffff;
}

.btn-accent {
    background: #1a2c38;
    border-color: #00a8bb;
    color: #00e5ff;
}

.btn-accent:hover {
    background: #00e5ff;
    color: #000;
}

/* FLOATING TOOLTIP CARD */
#app-tooltip {
    position: fixed;
    pointer-events: none;
    background: rgba(13, 17, 24, 0.95);
    border: 1px solid #00e5ff;
    border-radius: 6px;
    padding: 8px 12px;
    color: #e2e8f0;
    font-size: 11px;
    max-width: 250px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 10px rgba(0, 229, 255, 0.2);
    z-index: 10000;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    backdrop-filter: blur(8px);
}

#app-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.tip-title {
    font-weight: 700;
    color: #00e5ff;
    font-size: 11px;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.tip-desc {
    color: #a0aec0;
    font-size: 10px;
    line-height: 1.4;
}

.tip-key {
    display: inline-block;
    margin-top: 5px;
    background: #1a2233;
    color: #81e6d9;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    border: 1px solid #23304a;
}

.btn-secondary {
    background: #151a24;
    color: #a0aec0;
    border: 1px solid #242e42;
    padding: 6px 12px;
}
.btn-secondary:hover {
    background: #1f2737;
    color: #ffffff;
    border-color: #3b4968;
}

/* EXTENDED BOTTOM DOCK LAYOUT */
#control-dock {
    height: 84px;
    background: #0e1117;
    border-top: 1px solid #1c222d;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Spreads panels cleanly */
    padding: 0 16px;
    gap: 12px;
    flex-shrink: 0;
    overflow-x: auto;
}

/* Central Scrubber Emphasis */
.dock-center-group {
    background: #111622 !important;
    border-color: #243247 !important;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.08);
}

.wide-slider {
    width: 140px !important; /* Wider track for precision frame scrubbing */
}

/* --- LIVE AUDITION & SYNTH STATION --- */
.synth-station {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #090c12;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid #1a2333;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.btn-synth-play {
    background: #16202c;
    color: #00e5ff;
    border: 1px solid #00e5ff;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-synth-play:hover {
    background: #00e5ff;
    color: #040507;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

.btn-synth-play.playing {
    background: #ff3366 !important;
    border-color: #ff3366 !important;
    color: #ffffff !important;
    box-shadow: 0 0 14px rgba(255, 51, 102, 0.5) !important;
}

.btn-sweep-off {
    background: #131822;
    color: #718096;
    border: 1px solid #232c3d;
}

.btn-sweep-on {
    background: #112836 !important;
    color: #00e5ff !important;
    border-color: #00e5ff !important;
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.synth-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.synth-field label {
    font-size: 8px;
    font-weight: 700;
    color: #5a6679;
    letter-spacing: 0.5px;
}

.synth-key-hint {
    background: #121722;
    border: 1px solid #1d2638;
    color: #8c9ba5;
    font-size: 9px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}