/* Oh My Ondas v1.2.0 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

:root {
    --bg: #f5f5f5;
    --panel: #ffffff;
    --panel-alt: #fafafa;
    --border: #e0e0e0;
    --accent: #ff6b2b;
    --accent-dark: #e55a1b;
    --green: #1aa167;
    --red: #ce2021;
    --blue: #1270b8;
    --yellow: #ffc003;
    --text: #1a1a1a;
    --text-light: #888;
    --gold: #ffc003;
    --cream: #fafafa;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: var(--text);
    -webkit-overflow-scrolling: touch;
}

/* ===== FULL-PAGE BACKGROUND ===== */
.map-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #e8e8e8;
    background-image: url('https://media.rhizome.org/blog/8979/Chombart-de-Lauwe.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

/* ===== MAIN APP ===== */
#app {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    border: none;
    border-radius: 0;
    overflow: hidden;
    background: rgba(255,255,255,0.9);
}

/* ===== PAGE HEADER (unified nav — immutable) ===== */
.page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    height: 60px;
    flex-shrink: 0;
}
.page-header .logo {
    text-decoration: none;
}
.page-header .logo:hover {
    opacity: 0.8;
}

.logo { font-weight: 800; font-size: 22px; color: var(--text); letter-spacing: 1px; }
.transport { display: flex; gap: 6px; }
.tr-btn {
    width: 56px; height: 56px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--cream);
    cursor: pointer;
    font-size: 24px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: all 0.1s ease;
}
.tr-btn:hover { transform: translateY(-1px); box-shadow: 0 3px 6px rgba(0,0,0,0.2); }
.tr-btn:active, .tr-btn.active { background: var(--border); color: #fff; transform: translateY(0); box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.tr-btn.play.active { background: var(--green); border-color: var(--green); }
.tr-btn.rec.active { background: var(--red); border-color: var(--red); animation: pulse-rec 1s infinite; }
@keyframes pulse-rec { 0%,100% { opacity: 1; } 50% { opacity: 0.7; } }
.tr-btn.rec.ready {
    background: var(--red);
    border-color: var(--red);
    animation: blink-rec 0.5s infinite;
    box-shadow: 0 0 15px rgba(206, 32, 33, 0.6);
}
@keyframes blink-rec {
    0%, 100% { opacity: 1; box-shadow: 0 0 15px rgba(206, 32, 33, 0.6); }
    50% { opacity: 0.4; box-shadow: 0 0 5px rgba(206, 32, 33, 0.3); }
}

.tempo-box { display: flex; align-items: center; gap: 8px; }
.tempo-box input { width: 100px; height: 20px; }
.tempo-box span { font-size: 20px; font-weight: 600; width: 44px; }
.tap-btn {
    width: 56px; height: 44px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--cream);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.1s;
}
.tap-btn:active, .tap-btn.tap-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.help-btn {
    width: 44px; height: 44px;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--cream);
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-light);
}
.help-btn:hover { background: var(--border); color: #fff; }
.gps-box { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-light); }
.mini-map { width: 60px; height: 60px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.mini-map-img { width: 100%; height: 100%; background: #e8e8e8 center/cover no-repeat; }
.time-box { font-size: 18px; font-weight: 600; color: var(--green); }
.admin-btn { width: 44px; height: 44px; border: 2px solid var(--border); border-radius: 6px; background: var(--cream); cursor: pointer; font-size: 20px; }
.version { font-size: 11px; color: var(--text-light); margin-left: auto; }
.version .build-time { font-size: 9px; color: #999; margin-left: 4px; }

/* Navigation Links */
.nav-links { display: flex; gap: 8px; }
.nav-link {
    padding: 8px 14px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--cream);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.15s ease;
}
.nav-link:hover { background: var(--border); color: #fff; }
.nav-link.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ===== GRID LAYOUT - Matches Hardware: Display top, 3-column controls ===== */
.device {
    display: grid;
    grid-template-columns: 140px 1fr 1fr 1fr;
    grid-template-rows: auto 1fr 1fr auto;
    gap: 4px;
    padding: 6px;
    flex: 1;
    overflow: hidden;
    background: var(--border);
    border-radius: 8px;
}

.device > .panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* TOP ROW: SEQ spans full width (like hardware display) */
.device > .seq-panel { grid-column: 1 / 5; grid-row: 1; min-height: 140px; }

/* ROW 2: MIXER | PADS | KNOBS/CTRL | SYNTH */
.device > .mixer-panel { grid-column: 1; grid-row: 2 / 4; }
.device > .pads-panel:not(.pads2) { grid-column: 2; grid-row: 2; }
.device > .knobs-panel { grid-column: 3; grid-row: 2; }
.device > .synth-panel { grid-column: 4; grid-row: 2; }

/* ROW 3: (mixer continues) | SCENES | FX | AI GEN (spans 2 rows) */
.device > .scenes-panel { grid-column: 2; grid-row: 3; }
.device > .fx-panel { grid-column: 3; grid-row: 3; }
.device > .ai-panel { grid-column: 4; grid-row: 3 / 5; }

/* ROW 4 (bottom): EQ | RADIO (spans 2 cols) */
.device > .eq-panel { grid-column: 1; grid-row: 4; }
.device > .radio-panel { grid-column: 2 / 4; grid-row: 4; }

/* Hide PADS B for now */
.device > .pads2 { display: none; }

/* REC panel styling */
.device > .rec-panel {
    display: flex;
    background: #ffffff !important;
    border-color: #e0e0e0 !important;
    border-left: 3px solid var(--red) !important;
}

/* TOP ROW - SEQ display area (dark like hardware screen) */
.device > .seq-panel {
    background: #1a1a1a !important;
    border-color: #333 !important;
}

/* CENTER PANELS - White + orange accent (PADS/KNOBS/SCENES) */
.device > .pads-panel,
.device > .knobs-panel,
.device > .scenes-panel {
    background: #ffffff !important;
    border-color: #e0e0e0 !important;
    border-left: 3px solid var(--accent) !important;
}

/* SEQ panel has dark background - light text */
.device > .seq-panel .panel-title {
    color: var(--green) !important;
}
.device > .seq-panel .seq-header,
.device > .seq-panel .seq-row2,
.device > .seq-panel span,
.device > .seq-panel label {
    color: #ccc !important;
}
.device > .seq-panel .src-btn,
.device > .seq-panel .seq-btn,
.device > .seq-panel .pattern-btn {
    background: #333 !important;
    border-color: #444 !important;
    color: #aaa !important;
}
.device > .seq-panel .src-btn.active,
.device > .seq-panel .pattern-btn.active {
    background: var(--green) !important;
    border-color: var(--green) !important;
    color: #fff !important;
}

.device > .pads-panel .panel-title,
.device > .knobs-panel .panel-title,
.device > .scenes-panel .panel-title {
    color: #2c3e50 !important;
}

.device > .knobs-panel .ctrl-header select {
    background: #fff;
    color: #2c3e50;
    border-color: #b0b0b0;
}

.device > .knobs-panel .knob-group span {
    color: #2c3e50;
}

/* LEFT COLUMN - White + blue accent (Mixer/EQ) */
.device > .mixer-panel,
.device > .eq-panel {
    background: #ffffff !important;
    border-color: #e0e0e0 !important;
    border-left: 3px solid var(--blue) !important;
}

.device > .mixer-panel .panel-title,
.device > .eq-panel .panel-title {
    color: var(--blue) !important;
}

.device > .mixer-panel .ch-name,
.device > .eq-panel .eq-band span {
    color: var(--blue);
}

/* RIGHT COLUMN - White + purple accent (Synth/FX) */
.device > .synth-panel,
.device > .fx-panel {
    background: #ffffff !important;
    border-color: #e0e0e0 !important;
    border-left: 3px solid #9b59b6 !important;
    color: var(--text);
}

/* AI panel - White + green accent (prominent) */
.device > .ai-panel {
    background: #ffffff !important;
    border-color: #e0e0e0 !important;
    border-left: 3px solid var(--green) !important;
    color: var(--text);
}

/* Radio panel - White + yellow accent */
.device > .radio-panel {
    background: #ffffff !important;
    border-color: #e0e0e0 !important;
    border-left: 3px solid var(--yellow) !important;
    color: var(--text);
}

.synth-panel .panel-title,
.fx-panel .panel-title {
    color: #9b59b6 !important;
}

.ai-panel .panel-title {
    color: var(--green) !important;
}

.radio-panel .panel-title {
    color: #b8860b !important;
}

.synth-panel .wave-btn,
.fx-panel .punch-btn {
    background: #f0f0f0 !important;
    border-color: #ccc !important;
    color: var(--text) !important;
}

.synth-panel .wave-btn.active {
    background: #9b59b6 !important;
    color: #fff !important;
}

.radio-panel input,
.radio-panel button {
    background: #fff !important;
    border-color: #ddd !important;
    color: var(--text) !important;
}

.fx-panel .fx-row span,
.synth-panel .adsr-param span {
    color: var(--text) !important;
}

/* Scenes panel buttons */
.scenes-panel .scene-btn {
    background: #f5f5f5 !important;
    border-color: #ddd !important;
    color: var(--text) !important;
}

.scenes-panel .scene-btn.active {
    background: var(--green) !important;
    border-color: var(--green) !important;
    color: #fff !important;
}

/* Button groups for selectors */
.src-btns, .kit-btns, .target-btns {
    display: flex;
    gap: 2px;
}

.ch-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.src-btn, .kit-btn, .target-btn {
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
    border: 2px solid #999;
    border-radius: 4px;
    background: #f0f0f0;
    color: #333;
    cursor: pointer;
    min-width: 36px;
}

.ch-btn {
    padding: 4px 6px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #999;
    border-radius: 3px;
    background: #f0f0f0;
    color: #333;
    cursor: pointer;
}

.src-btn.active, .kit-btn.active, .target-btn.active, .ch-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* AI sense readout */
.ai-sense-readout {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(26, 161, 103, 0.05);
    border: 1px solid rgba(26, 161, 103, 0.15);
    border-radius: 6px;
}
.ai-sense-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ai-sense-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.ai-sense-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.ai-sense-vibe {
    padding-top: 6px;
    border-top: 1px solid rgba(26, 161, 103, 0.15);
}
.ai-vibe-display {
    font-size: 16px;
    font-weight: 800;
    color: var(--green);
    letter-spacing: 0.5px;
}

.ai-panel .ai-btn {
    background: var(--green) !important;
    border-color: var(--green) !important;
    color: #fff !important;
    font-size: 15px !important;
    height: 48px !important;
}

/* Embedded AI panel tweaks */
body.embedded-mode .device > .ai-panel.panel-visible .ai-sense-readout {
    padding: 12px;
    gap: 8px;
}
body.embedded-mode .device > .ai-panel.panel-visible .ai-vibe-display {
    font-size: 20px;
}
body.embedded-mode .device > .ai-panel.panel-visible .ai-btn {
    height: 56px !important;
    font-size: 17px !important;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px;
}

.panel-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 6px;
}

/* ===== MIXER ===== */
.mixer-panel { flex: 1; }
.mixer-channels { display: flex; gap: 4px; height: calc(100% - 20px); }
.ch { display: flex; flex-direction: column; align-items: center; flex: 1; gap: 2px; }
.ch-name { font-size: 11px; font-weight: 700; color: var(--text-light); }

/* Gain knob (input gain) */
.gain-knob {
    width: 28px;
    height: 6px;
    appearance: none;
    background: linear-gradient(to right, #27ae60 0%, #f1c40f 50%, #e74c3c 100%);
    border-radius: 3px;
    cursor: pointer;
}
.gain-knob::-webkit-slider-thumb {
    appearance: none;
    width: 8px;
    height: 12px;
    background: #fff;
    border: 1px solid #666;
    border-radius: 2px;
    cursor: pointer;
}

.v-fader {
    writing-mode: vertical-lr;
    direction: rtl;
    width: 100%;
    touch-action: none;
    flex: 1;
    cursor: pointer;
    min-height: 60px;
}

/* Pan knob */
.pan-knob {
    width: 28px;
    height: 6px;
    appearance: none;
    background: linear-gradient(to right, #3498db 0%, #888 50%, #e74c3c 100%);
    border-radius: 3px;
    cursor: pointer;
}
.pan-knob::-webkit-slider-thumb {
    appearance: none;
    width: 6px;
    height: 10px;
    background: #fff;
    border: 1px solid #666;
    border-radius: 2px;
    cursor: pointer;
}

/* Channel buttons row */
.ch-btns { display: flex; gap: 2px; width: 100%; }
.mute, .solo {
    flex: 1;
    height: 22px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--panel-alt);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}
.mute.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.solo.active { background: #f1c40f; color: #000; border-color: #f1c40f; }
.ch.master .ch-name { color: var(--green); font-weight: 800; }

/* Limiter indicator */
.limiter-indicator {
    width: 20px;
    height: 6px;
    background: #27ae60;
    border-radius: 3px;
    transition: background 0.1s;
}
.limiter-indicator.active { background: #e74c3c; animation: limiter-flash 0.2s ease-out; }
@keyframes limiter-flash { 0% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* Meter mode buttons */
.meter-mode { display: flex; gap: 2px; width: 100%; }
.meter-btn {
    flex: 1;
    height: 18px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--panel-alt);
    font-size: 9px;
    font-weight: 600;
    cursor: pointer;
}
.meter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* VU Meters */
.vu-meter {
    width: 8px;
    height: 50px;
    background: #333;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}
.vu-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: #27ae60;
    transition: height 0.05s ease-out;
    border-radius: 2px;
}
.vu-peak {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: #fff;
    transition: bottom 0.1s ease-out;
    bottom: 0;
}

/* ===== SEQUENCER ===== */
.seq-panel { display: flex; flex-direction: column; }
.seq-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.seq-controls { display: flex; gap: 2px; }
.seq-controls select { height: 30px; font-size: 13px; border: 2px solid var(--border); border-radius: 4px; background: #333; color: #0f0; }
.seq-btn { height: 30px; padding: 0 12px; border: 2px solid #444; border-radius: 4px; background: #333; color: #0f0; font-size: 12px; font-weight: 600; cursor: pointer; }
.col-screen .seq-btn:hover { background: #444; }
.col-screen .seq-btn:active { background: #0f0; color: #000; }
.seq-btn:active { background: var(--border); color: #fff; }
.dub-btn.dub-active { background: #f39c12; color: #fff; }
.dub-btn.overdub-active { background: var(--accent); color: #fff; }
.fill-btn:active, .fill-btn.active { background: var(--green); color: #fff; }

/* SEQ Row 2 - Pattern slots, tools, length, swing */
.seq-row2 { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.pattern-btns { display: flex; gap: 2px; }
.pattern-btn { width: 24px; height: 24px; border: 2px solid var(--border); border-radius: 4px; background: var(--panel-alt); font-size: 11px; font-weight: 700; cursor: pointer; }
.pattern-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pattern-btn.has-data { border-color: var(--gold); }
.seq-tools { display: flex; gap: 2px; }
.length-ctrl, .swing-ctrl { display: flex; align-items: center; gap: 4px; }
.length-ctrl span, .swing-ctrl span { font-size: 10px; font-weight: 600; color: var(--text-light); }
.length-ctrl select { height: 24px; font-size: 11px; padding: 0 4px; border: 1px solid var(--border); border-radius: 3px; background: var(--panel-alt); }
.swing-ctrl input { width: 50px; height: 8px; }
.swing-ctrl span:last-child { font-size: 10px; width: 20px; }

/* Track mute/solo buttons */
.oct-track-btns { display: flex; gap: 2px; }
.oct-track-mute, .oct-track-solo { width: 18px; height: 18px; border: 1px solid var(--border); border-radius: 3px; background: var(--panel-alt); font-size: 9px; font-weight: 700; cursor: pointer; }
.oct-track-mute.active { background: #e74c3c; color: #fff; border-color: #e74c3c; }
.oct-track-solo.active { background: #f1c40f; color: #000; border-color: #f1c40f; }
.oct-track.muted .oct-steps { opacity: 0.3; }

/* Step probability indicator */
.oct-step.has-condition::after { content: ''; position: absolute; top: 1px; right: 1px; width: 4px; height: 4px; background: var(--gold); border-radius: 50%; }
.oct-step { position: relative; }

.oct-tracks { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 320px; min-height: 160px; overflow-y: auto; }
.oct-track { display: flex; align-items: center; gap: 3px; height: 22px; padding: 2px; background: rgba(0,0,0,0.03); border-radius: 2px; cursor: pointer; }
.oct-track.selected { background: rgba(233, 69, 96, 0.15); border: 1px solid var(--accent); }
.oct-track-num { width: 14px; font-size: 11px; font-weight: 700; color: var(--text-light); }
.oct-track.selected .oct-track-num { color: var(--accent); }
.oct-track-src { font-size: 10px; color: var(--text-light); width: 24px; }
.oct-steps { flex: 1; display: flex; gap: 1px; height: 14px; }
.oct-step { flex: 1; height: 100%; background: var(--panel-alt); border-radius: 2px; min-width: 3px; }
.oct-step.beat { background: #ddd; }
.oct-step.active { background: var(--accent); }
.oct-step.current { background: var(--green) !important; }
.oct-step.has-plock { border: 1px solid var(--gold); }
.oct-step.has-condition { box-shadow: inset 0 -2px 0 var(--gold); }

/* Dark screen variants */
.col-screen .oct-track { background: #222; }
.col-screen .oct-track.selected { background: #333; border-color: #0f0; }
.col-screen .oct-track-num { color: #0f0; }
.col-screen .oct-track-src { color: #0a0; }
.col-screen .oct-step { background: #333; }
.col-screen .oct-step.beat { background: #444; }
.col-screen .oct-step.active { background: #0f0; }
.col-screen .oct-step.current { background: #ff0 !important; }

/* P-Lock Editor */
.plock-editor { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--cream); border: 2px solid var(--border); border-radius: 6px; padding: 8px; min-width: 180px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); z-index: 100; }
.plock-editor.hidden { display: none; }
.plock-header { display: flex; justify-content: space-between; margin-bottom: 6px; }
.plock-title { font-size: 10px; font-weight: 700; color: var(--accent); }
.plock-close { width: 16px; height: 16px; border: none; background: none; cursor: pointer; }
.plock-row { display: flex; align-items: center; gap: 4px; margin-bottom: 3px; }
.plock-row span:first-child { font-size: 12px; width: 44px; color: var(--text-light); }
.plock-row input { flex: 1; height: 8px; }
.plock-row span:last-child { font-size: 13px; width: 32px; text-align: right; }
.trig-cond { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding-top: 6px; border-top: 1px solid rgba(0,0,0,0.1); }
.trig-cond span { font-size: 12px; }
.trig-cond .trig-btns { display: flex; flex-wrap: wrap; gap: 3px; flex: 1; }
.trig-cond .trig-btn { padding: 5px 10px; font-size: 11px; font-weight: 600; border: 1px solid var(--border); border-radius: 3px; background: var(--panel-alt); cursor: pointer; }
.trig-cond .trig-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.trig-cond input { width: 44px; height: 26px; font-size: 13px; text-align: center; }

/* PADS */
.pads-panel { }
.pads-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.pads-header select { height: 30px; font-size: 13px; border: 2px solid var(--border); border-radius: 4px; }
.pads-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); gap: 6px; }
.pad { width: 100%; aspect-ratio: 1; max-height: 55px; border: none; border-radius: 6px; background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; transition: transform 0.05s, box-shadow 0.1s; }
.pad:nth-child(odd) { background: linear-gradient(135deg, #9b59b6 0%, #7d3c98 100%); }
.pad:active, .pad.active { transform: scale(0.95); }
.pad.flash {
    animation: pad-flash 0.15s ease-out;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 40px rgba(233, 69, 96, 0.6);
}
@keyframes pad-flash {
    0% { filter: brightness(1.8); transform: scale(1.05); }
    100% { filter: brightness(1); transform: scale(1); }
}

/* Dark screen pads */
.col-screen .pads-header select { background: #333; color: #0f0; border-color: #444; }
.col-screen .pad { background: #333; border: 2px solid #444; }
.col-screen .pad:nth-child(odd) { background: #2a2a2a; }
.col-screen .pad:active, .col-screen .pad.active { background: #0f0; color: #000; }
.col-screen .pad.flash { box-shadow: 0 0 20px rgba(0, 255, 0, 0.8); }

/* EQ */
.eq-panel { }
.eq-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.eq-header select { font-size: 13px; padding: 4px 8px; border: 2px solid var(--border); border-radius: 4px; background: var(--panel-alt); }
.eq-sliders { display: flex; justify-content: space-around; gap: 4px; flex: 1; }
.eq-band { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; }
.eq-band span { font-size: 12px; color: var(--text-light); }
.eq-slider {
    writing-mode: vertical-lr;
    direction: rtl;
    flex: 1;
    touch-action: none;
    width: 100%;
    cursor: pointer;
}

/* ===== KNOBS ===== */
.knobs-panel { }
.knobs-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; flex: 1; align-items: center; }
.knob-group { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.knob-group span { font-size: 12px; color: var(--text-light); font-weight: 600; }
.knob {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f0f0f0, #d0d0d0);
    border: 2px solid var(--border);
    position: relative;
    touch-action: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.knob::before {
    content: '';
    position: absolute;
    top: 5px; left: 50%;
    width: 3px; height: 10px;
    background: var(--accent);
    transform: translateX(-50%) rotate(var(--rotation, 0deg));
    transform-origin: center 15px;
}
.knob::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 6px; height: 6px;
    background: var(--border);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* Knob value tooltip */
.knob-value {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--border);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 100;
}
.knob.dragging .knob-value {
    opacity: 1;
}

/* MAP BOX */
.map-panel { }
.map-box { width: 100%; height: 80px; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; background: #e8e8e8; }
.map-img { width: 100%; height: 100%; background: center/cover no-repeat; }
.map-coords { font-size: 8px; text-align: center; color: var(--text-light); margin-top: 2px; }

/* AI */
.ai-panel { display: flex; flex-direction: column; }
.vibe-btns { display: flex; gap: 4px; margin-bottom: 8px; }
.vibe-btns-large { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.vibe-btns-large .vibe-btn { height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 18px; }
.vibe-btns-large .vibe-btn span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.vibe-btn { flex: 1; height: 34px; border: 2px solid var(--border); border-radius: 6px; background: var(--panel-alt); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.vibe-btn:hover { border-color: var(--green); }
.vibe-btn.active { background: var(--green); color: #fff; border-color: var(--green); }
.ai-action-btns { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ai-btn { flex: none; height: 48px; border: 2px solid var(--green); border-radius: 6px; background: var(--green); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.15s; letter-spacing: 0.5px; }
.ai-btn:hover { box-shadow: 0 0 12px rgba(26, 161, 103, 0.4); }
.ai-btn-generate { height: 56px; font-size: 16px; }
.ai-status { font-size: 11px; color: var(--text-light); text-align: center; padding-top: 8px; margin-top: auto; }
.landmark-btn {
    flex: 1;
    height: 48px;
    border: 2px solid var(--accent);
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}
.landmark-btn:hover {
    background: var(--accent-dark);
    box-shadow: 0 0 12px rgba(255, 107, 43, 0.5);
}
.landmark-btn.active {
    animation: landmark-pulse 1s infinite;
}
@keyframes landmark-pulse {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 107, 43, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 107, 43, 0.8); }
}

/* RADIO - Compact Style */
.radio-panel { }
.radio-search { margin-bottom: 4px; }
.radio-search input {
    width: 100%;
    height: 28px;
    font-size: 13px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
}
.radio-controls { display: flex; gap: 3px; margin-bottom: 4px; }
.radio-btn {
    flex: 1;
    height: 30px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: #f5f5f5;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
}
.radio-btn:hover { background: #e8e8e8; }
.radio-btn:disabled { opacity: 0.5; }
.station-list { max-height: 80px; overflow-y: auto; flex: 1; }
.station-item { padding: 4px 8px; font-size: 12px; cursor: pointer; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.station-item:hover { background: #f0f0f0; }
.station-item.playing { background: var(--green); color: #fff; }

/* REC */
.rec-panel { }
.rec-header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.rec-header span:nth-child(2) { font-size: 11px; font-weight: 600; color: var(--accent); margin-left: auto; }
.rec-last { display: flex; align-items: center; gap: 6px; padding: 6px; background: var(--panel-alt); border-radius: 4px; margin-bottom: 6px; flex: 1; }
.rec-map-icon { font-size: 14px; }
.rec-last-name { flex: 1; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-last-time { font-size: 12px; color: var(--text-light); font-family: monospace; }
.rec-actions { display: flex; gap: 4px; }
.rec-actions button { flex: 1; height: 28px; border-radius: 3px; font-size: 12px; font-weight: 600; cursor: pointer; }
.rec-list-btn { border: 1px solid var(--border); background: var(--panel-alt); }
.rec-list { margin-top: 4px; max-height: 60px; overflow-y: auto; font-size: 12px; }
.rec-item { display: flex; align-items: center; gap: 4px; padding: 3px 6px; font-size: 12px; }
.rec-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.rec-item-name:hover { text-decoration: underline; }
.rec-item button { width: 22px; height: 20px; border: 1px solid var(--border); border-radius: 2px; background: var(--panel-alt); font-size: 11px; cursor: pointer; }
.rec-item-del { color: var(--accent); }
.rec-item-del:hover { background: var(--accent); color: #fff; }

/* CTRL header */
.ctrl-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ctrl-header select { height: 28px; font-size: 11px; border: 2px solid var(--border); border-radius: 4px; background: var(--panel-alt); }

/* ===== COL 4: SYNTH + SCENES + FX ===== */
.synth-panel { overflow-y: auto; }
.synth-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.synth-header-ctrls { display: flex; gap: 4px; }
.power-btn { height: 26px; padding: 0 10px; border: 2px solid var(--border); border-radius: 4px; background: var(--panel-alt); font-size: 11px; font-weight: 600; cursor: pointer; }
.power-btn.active { background: var(--green); color: #fff; }
.preset-btn { height: 26px; padding: 0 8px; border: 1px solid var(--border); border-radius: 3px; background: var(--panel-alt); font-size: 10px; font-weight: 600; cursor: pointer; }
.preset-btn:hover { background: var(--accent); color: #fff; }

/* Oscilloscope */
.synth-scope { height: 44px; background: #1a1a2e; border-radius: 4px; margin-bottom: 4px; overflow: hidden; }
.synth-scope canvas { width: 100%; height: 100%; }

/* Synth sections */
.synth-section { display: flex; flex-direction: column; gap: 4px; }
.synth-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* Oscillator groups */
.osc-group { flex: 1; min-width: 100px; }
.osc-label, .filter-label, .lfo-label, .unison-label { font-size: 10px; font-weight: 700; color: var(--accent); margin-bottom: 2px; display: block; }
.osc2-params { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.osc2-params span { font-size: 9px; color: var(--text-light); }
.osc2-params input { width: 50px; height: 6px; }
.osc2-params span:last-child { width: 20px; font-size: 9px; }

/* Pitch group */
.pitch-group { display: flex; gap: 6px; flex: 1; }
.pitch-param { display: flex; align-items: center; gap: 3px; }
.pitch-param span { font-size: 9px; color: var(--text-light); font-weight: 600; }
.pitch-param span:first-child { width: 30px; }
.pitch-param input { width: 40px; height: 6px; }
.pitch-param span:last-child { width: 18px; font-size: 9px; }

/* Filter group */
.filter-group { flex: 1; }
.filter-type-btns { display: flex; gap: 2px; margin-bottom: 3px; }
.flt-btn { flex: 1; height: 22px; border: 1px solid var(--border); border-radius: 3px; background: var(--panel-alt); font-size: 10px; font-weight: 600; cursor: pointer; }
.flt-btn.active { background: var(--accent); color: #fff; }
.filter-params { display: flex; gap: 6px; }
.flt-param { display: flex; align-items: center; gap: 3px; flex: 1; }
.flt-param span { font-size: 9px; color: var(--text-light); }
.flt-param span:first-child { width: 22px; }
.flt-param input { flex: 1; height: 6px; }
.flt-param span:last-child { width: 22px; font-size: 9px; }

/* LFO group */
.lfo-group { flex: 1; }
.lfo-params { display: flex; gap: 6px; margin-bottom: 3px; }
.lfo-param { display: flex; align-items: center; gap: 3px; flex: 1; }
.lfo-param span { font-size: 9px; color: var(--text-light); }
.lfo-param span:first-child { width: 26px; }
.lfo-param input { flex: 1; height: 6px; }
.lfo-param span:last-child { width: 18px; font-size: 9px; }
.lfo-target-btns { display: flex; gap: 2px; }
.lfo-btn { flex: 1; height: 20px; border: 1px solid var(--border); border-radius: 3px; background: var(--panel-alt); font-size: 9px; font-weight: 600; cursor: pointer; }
.lfo-btn.active { background: #3498db; color: #fff; }

/* Unison group */
.unison-group { flex: 1; }
.unison-params { display: flex; gap: 6px; }
.uni-param { display: flex; align-items: center; gap: 3px; flex: 1; }
.uni-param span { font-size: 9px; color: var(--text-light); }
.uni-param span:first-child { width: 40px; }
.uni-param input { flex: 1; height: 6px; }
.uni-param span:last-child { width: 16px; font-size: 9px; }

.wave-btns { display: flex; gap: 2px; }
.wave-btn { flex: 1; height: 24px; border: 1px solid var(--border); border-radius: 3px; background: var(--panel-alt); font-size: 10px; font-weight: 600; cursor: pointer; }
.wave-btn.active { background: var(--accent); color: #fff; }

/* ADSR */
.adsr-row { display: flex; gap: 4px; margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(0,0,0,0.1); }
.adsr-param { display: flex; flex-direction: column; align-items: center; flex: 1; }
.adsr-param span { font-size: 10px; color: var(--text-light); font-weight: 600; }
.adsr-param input { width: 100%; height: 6px; margin: 2px 0; }

/* SCENES */
.scenes-panel { }
.scene-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 6px; flex: 1; }
.scene-btn { flex: 1; height: 56px; border: 2px solid var(--border); border-radius: 6px; background: var(--panel-alt); font-size: 20px; font-weight: 700; cursor: pointer; }
.scene-btn.active { background: var(--accent); color: #fff; }
.scene-row { display: flex; gap: 6px; margin-bottom: 8px; }
.xfade-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.xfade-row span { font-size: 14px; font-weight: 600; }
.xfader { flex: 1; height: 12px; }
.scene-actions { display: flex; gap: 6px; }
.scene-actions button { flex: 1; height: 38px; border: 2px solid var(--green); border-radius: 4px; background: var(--green); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.scene-actions select { flex: 1; height: 30px; font-size: 13px; border: 2px solid var(--border); border-radius: 4px; }

/* FX */
.fx-panel { }
.fx-header { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.fx-preset-btns { display: flex; gap: 3px; flex: 1; flex-wrap: wrap; }
.fx-preset-btn { padding: 6px 10px; font-size: 12px; font-weight: 600; border: 2px solid var(--border); border-radius: 4px; background: var(--panel-alt); cursor: pointer; min-width: 36px; }
.fx-preset-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.fx-header button { width: 30px; height: 30px; border: 2px solid var(--border); border-radius: 4px; background: var(--panel-alt); font-size: 16px; cursor: pointer; }
.fx-params { margin-bottom: 6px; }
.fx-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.fx-row span { font-size: 12px; width: 32px; color: var(--text-light); font-weight: 600; }
.fx-row input { flex: 1; height: 8px; }
.punch-fx { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.punch-btn { height: 30px; border: 2px solid var(--border); border-radius: 4px; background: var(--panel-alt); font-size: 12px; font-weight: 600; cursor: pointer; }
.punch-btn:active, .punch-btn.active { background: var(--accent); color: #fff; }

/* ===== MODAL ===== */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-content { background: var(--cream); border: 2px solid var(--border); border-radius: 8px; padding: 12px; min-width: 280px; max-height: 80vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 12px; font-weight: 700; color: var(--accent); }
.modal-close { width: 24px; height: 24px; border: none; background: none; font-size: 18px; cursor: pointer; }
.settings-section { margin-bottom: 12px; }
.settings-title { font-size: 10px; font-weight: 600; color: var(--text-light); margin-bottom: 6px; }
.kit-list, .synth-presets { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.kit-item, .preset-item { padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 10px; cursor: pointer; }
.kit-item.active, .preset-item.active { background: var(--accent); color: #fff; }
.settings-btn { height: 26px; padding: 0 12px; border: 1px solid var(--border); border-radius: 4px; background: var(--panel-alt); font-size: 10px; cursor: pointer; }
.theme-options { display: flex; gap: 6px; }
.theme-btn { flex: 1; height: 28px; border: 1px solid var(--border); border-radius: 4px; background: var(--panel-alt); font-size: 9px; cursor: pointer; }
.theme-btn.active { background: var(--accent); color: #fff; }

/* ===== DEBUG PANEL ===== */
.debug-panel {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 150px;
    background: #000 !important;
    border-top: 3px solid #f00 !important;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
}

.debug-panel.hidden {
    display: none !important;
}

.debug-header {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    background: var(--accent);
    gap: 8px;
}

.debug-title {
    flex: 1;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.debug-btn {
    padding: 2px 8px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 3px;
    color: #fff;
    font-size: 10px;
    cursor: pointer;
}

.debug-btn:hover {
    background: rgba(255,255,255,0.3);
}

.debug-log {
    flex: 1;
    overflow-y: auto;
    padding: 6px 8px;
    font-size: 10px;
    line-height: 1.4;
    color: #0f0;
}

.debug-log .log-entry {
    margin-bottom: 2px;
    word-wrap: break-word;
}

.debug-log .log-entry.error {
    color: #f55;
}

.debug-log .log-entry.warn {
    color: #ff0;
}

.debug-log .log-entry .timestamp {
    color: #888;
    margin-right: 6px;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    html, body {
        overflow: auto;
        height: auto;
        min-height: 100%;
        background: transparent;
    }

    .map-bg {
        position: fixed;
        z-index: -1;
    }

    #app {
        width: 100%;
        height: auto;
        min-height: 100%;
        max-height: none;
        border-radius: 0;
        border: none;
        overflow: visible;
    }

    .top-bar {
        flex-wrap: wrap;
        height: auto;
        padding: 6px;
        gap: 6px;
    }

    .device {
        display: flex;
        flex-direction: column;
        overflow: visible;
        padding: 4px;
        gap: 8px;
    }

    .col {
        overflow: visible;
        min-height: auto;
    }

    .col-mixer,
    .col-seq,
    .col-mid,
    .col-right,
    .pads-section {
        width: 100%;
    }

    .col-mixer {
        order: 5;
    }

    .col-seq {
        order: 1;
    }

    .col-mid {
        order: 2;
    }

    .col-right {
        order: 3;
    }

    .pads-section {
        order: 4;
        padding: 8px;
    }

    .mixer-panel {
        flex-direction: row;
    }

    .mixer-channels {
        flex-direction: row;
        height: 80px;
    }

    .v-fader {
        writing-mode: horizontal-tb;
        direction: ltr;
        height: 20px;
        width: 100%;
    }

    .pads-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .pad {
        aspect-ratio: 1;
        min-height: 50px;
        font-size: 14px;
    }

    .panel {
        padding: 8px;
    }

    .panel-title {
        font-size: 11px;
    }

    .knobs-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .knob {
        width: 50px;
        height: 50px;
        touch-action: none;
        cursor: pointer;
    }

    .seq-btn, .vibe-btn, .scene-btn, .wave-btn {
        height: 32px;
        font-size: 10px;
    }

    .oct-track {
        height: 28px;
    }

    .oct-step {
        min-width: 12px;
    }
}

@media (max-width: 480px) {
    .pads-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }

    .pad {
        min-height: 40px;
        font-size: 12px;
    }

    .knobs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .seq-controls {
        flex-wrap: wrap;
    }
}

/* ===== HELP MODAL ===== */
.help-modal .modal-content {
    min-width: 320px;
    max-width: 400px;
}
.help-section {
    margin-bottom: 12px;
}
.help-section-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.shortcut-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.shortcut-key {
    display: inline-block;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    font-family: monospace;
    min-width: 24px;
    text-align: center;
}
.shortcut-desc {
    font-size: 10px;
    color: var(--text-light);
}

/* ===== APP LAYOUT (sidebar + content) ===== */
.app-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    flex: 1;
    overflow: hidden;
}

.app-sidebar {
    background: #ffffff;
    border-right: 1px solid var(--border);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}
.sidebar-title {
    font-weight: 800;
    font-size: 18px;
    color: var(--accent);
}
.sidebar-tagline {
    font-size: 12px;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 8px;
}
.sidebar-section {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}
.sidebar-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.sidebar-transport {
    display: flex;
    gap: 6px;
}
.sidebar-transport .tr-btn {
    width: 48px;
    height: 48px;
    font-size: 20px;
}
.sidebar-tempo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}
.sidebar-tempo input[type="range"] {
    width: 100%;
    height: 18px;
}
.sidebar-tempo .tap-btn {
    width: 48px;
    height: 32px;
    font-size: 12px;
}
.sidebar-actions {
    display: flex;
    gap: 8px;
}
.sidebar-version {
    margin-top: auto;
    font-size: 11px;
    color: var(--text-light);
}
.sidebar-files {
    max-height: 120px;
    overflow-y: auto;
}
.sidebar-files .file-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    font-size: 11px;
    cursor: pointer;
    border-radius: 3px;
}
.sidebar-files .file-item:hover {
    background: #f0f0f0;
}
.sidebar-files .file-item .file-play {
    color: var(--green);
    font-size: 10px;
}
.sidebar-files .file-item .file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-files .file-item .file-dur {
    color: var(--text-light);
    font-size: 10px;
}
.sidebar-files .file-empty {
    font-size: 11px;
    color: var(--text-light);
    font-style: italic;
    padding: 4px 0;
}

/* ===== PANEL TAB BAR (embedded mode only) ===== */
.panel-tabs {
    display: none;
    align-items: center;
    gap: 0;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    grid-column: 1 / -1;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.panel-tabs::-webkit-scrollbar { display: none; }

.panel-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #777;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.panel-tab:hover {
    color: #bbb;
    background: rgba(255,255,255,0.03);
}
.panel-tab.active {
    color: #fff;
    border-bottom-color: var(--green);
    background: rgba(26, 161, 103, 0.08);
}

/* ===== INLINE TRANSPORT (embedded mode only) ===== */
.transport-panel {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    grid-column: 1 / -1;
    font-size: 12px;
}
.transport-inline {
    display: flex;
    gap: 4px;
}
.transport-inline .tr-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
}
.tempo-inline {
    display: flex;
    align-items: center;
    gap: 6px;
}
.tempo-inline input[type="range"] {
    width: 80px;
    height: 16px;
}
.tempo-inline span {
    font-size: 14px;
    font-weight: 600;
    width: 32px;
}
.tempo-inline .tap-btn {
    width: 36px;
    height: 28px;
    font-size: 11px;
}
.gps-inline {
    font-size: 11px;
    color: var(--text-light);
}
.time-inline {
    font-size: 14px;
    font-weight: 600;
    color: var(--green);
}
.transport-panel .help-btn,
.transport-panel .admin-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
}

/* ===== EMBEDDED MODE ===== */
body.embedded-mode .page-header,
body.embedded-mode .page-footer,
body.embedded-mode .app-sidebar {
    display: none !important;
}
body.embedded-mode .app-layout {
    grid-template-columns: 1fr;
}
body.embedded-mode .transport-panel {
    display: flex !important;
    flex-shrink: 0;
}
body.embedded-mode .panel-tabs {
    display: flex !important;
    flex-shrink: 0;
}
body.embedded-mode #app {
    background: transparent;
}
body.embedded-mode .map-bg {
    display: none;
}
body.embedded-mode .debug-panel {
    display: none !important;
}

/* Single-panel display: flex column, one panel at a time */
body.embedded-mode .device {
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    max-height: 100vh;
    gap: 0;
    padding: 0;
}

/* Hide ALL panels by default in embedded mode */
body.embedded-mode .device > .panel {
    display: none !important;
    min-height: 0;
}

/* Show the active panel — takes all remaining space */
body.embedded-mode .device > .panel.panel-visible {
    display: flex !important;
    flex: 1;
    flex-direction: column;
    overflow-y: auto;
    padding: 6px 8px;
    border-radius: 0;
    border: none;
    border-left: none !important;
}

/* Always hide pads and knobs (they exist as physical controls on the mockup) */
body.embedded-mode .device > .pads-panel,
body.embedded-mode .device > .knobs-panel {
    display: none !important;
}

/* Panel-specific tweaks for embedded full-height display */
body.embedded-mode .device > .seq-panel.panel-visible {
    min-height: 0;
}
body.embedded-mode .device > .seq-panel.panel-visible .oct-tracks {
    flex: 1;
    min-height: 100px;
}

body.embedded-mode .device > .mixer-panel.panel-visible .mixer-channels {
    flex: 1;
    height: auto;
}
body.embedded-mode .device > .mixer-panel.panel-visible .v-fader {
    min-height: 80px;
}
body.embedded-mode .device > .mixer-panel.panel-visible .vu-meter {
    height: 60px;
}

body.embedded-mode .device > .ai-panel.panel-visible .ai-sense-readout {
    flex: 1;
}
body.embedded-mode .device > .ai-panel.panel-visible .ai-action-btns {
    gap: 10px;
}

body.embedded-mode .device > .eq-panel.panel-visible .eq-sliders {
    flex: 1;
}
body.embedded-mode .device > .eq-panel.panel-visible .eq-slider {
    min-height: 80px;
}

body.embedded-mode .device > .fx-panel.panel-visible .fx-params {
    flex: 1;
}

body.embedded-mode .device > .radio-panel.panel-visible .station-list {
    flex: 1;
    max-height: none;
}

/* ===== PAGE FOOTER ===== */
.page-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-light);
    flex-shrink: 0;
}
.page-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.page-footer a:hover {
    text-decoration: underline;
}

/* ===== LANDMARK INDICATOR ===== */
.landmark-indicator {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(233, 69, 96, 0.95);
    border-radius: 8px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: landmark-slide-in 0.3s ease-out;
}

@keyframes landmark-slide-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.landmark-indicator .landmark-icon {
    font-size: 24px;
}

.landmark-indicator .landmark-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

.landmark-indicator .landmark-location {
    font-size: 11px;
    color: rgba(255,255,255,0.8);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .landmark-indicator {
        padding: 10px 16px;
    }
}
