/* =========================================
   SIDE MENU - Workspace Section
   ========================================= */
.workspace-section {
    padding: 16px;
}

.workspace-prompt {
    font-size: 13px;
    color: var(--color-text-secondary, #b8b8be);
    margin: 0 0 12px;
    text-align: center;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.workspace-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: var(--color-surface-container, #242428);
    border: 1px solid var(--color-border, #333);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    color: inherit;
}

.workspace-btn:hover {
    border-color: var(--color-primary, #ff9329);
    background: rgba(255, 147, 41, 0.08);
}

.workspace-btn .workspace-icon { font-size: 20px; line-height: 1; }
.workspace-btn .workspace-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--color-text-secondary, #b8b8be);
    text-align: center;
    line-height: 1.2;
}

/* =========================================
   APP STATE MACHINE
   idle → prompted → active
   ========================================= */
#app {
    display: flex !important;
    align-items: stretch;
    justify-content: center;
    height: calc(100vh - 36px);
    width: 100%;
    margin-top: 36px;
    padding: 12px;
    gap: 12px;
    position: relative;
    z-index: 100;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* IDLE: orb centered, panels hidden */
#app.app-idle .workspace-panel,
#app.app-idle .output-panel {
    display: none !important;
}

#app.app-idle .orb-wrapper {
    flex: 0 0 auto;
    width: 100%;
    height: 100%;
}

/* PROMPTED: orb shrinks, panels slide in */
#app.app-prompted {
    grid-template-columns: 260px 1fr 460px;
}

#app.app-prompted .orb-wrapper {
    transform: scale(0.7);
    opacity: 0.6;
    pointer-events: auto;
}

#app.app-prompted .workspace-panel,
#app.app-prompted .output-panel {
    opacity: 1;
    transform: translateX(0);
}

/* ACTIVE: panels fully visible, orb small */
#app.app-active .orb-wrapper {
    transform: scale(0.5);
    opacity: 0.4;
}

/* =========================================
   PLANNING BACKGROUND
   Faded behind orb until prompted
   ========================================= */
.planning-bg {
    position: fixed;
    top: 36px;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px;
    overflow-y: auto;
    z-index: 0;
    opacity: 0;
    filter: blur(2px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

body.idle .planning-bg {
    opacity: 0;
}

#app.app-prompted .planning-bg,
#app.app-active .planning-bg {
    opacity: 0;
    filter: blur(8px);
    transform: scale(0.95);
}

/* =========================================
   PANELS
   ========================================= */
.workspace-panel,.output-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.workspace-panel {
    width: 260px;
    min-width: 260px;
    opacity: 0;
    transform: translateX(-20px);
}

.output-panel {
    width: 460px;
    min-width: 460px;
    opacity: 0;
    transform: translateX(20px);
}

.workspace-panel,.output-panel {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#app.app-prompted .workspace-panel,
#app.app-prompted .output-panel {
    opacity: 1;
    transform: translateX(0);
}

.workspace-panel.active::after,
.output-panel.active::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 9px;
    padding: 1px;
    background: linear-gradient(135deg, var(--color-primary, #ff9329), transparent, var(--color-primary, #ff9329));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: borderFlow 3s linear infinite;
}

.output-panel.response-glow::after {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light), var(--color-primary));
    box-shadow: 0 0 30px var(--color-primary-glow);
}

@keyframes borderFlow {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 200%; }
}

.workspace-panel[hidden],
.output-panel[hidden] {
    display: none !important;
}

/* =========================================
   ORB
   ========================================= */
.orb-wrapper {
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 100%;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.orb-wrapper.listening .wave-spectrum { display: flex !important; }
.orb-wrapper.processing .core { animation: corePulse 1s ease-in-out infinite; }

@keyframes corePulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
}

.orb-wrapper.processing .ring { animation: ringSpin 3s linear infinite; }

@keyframes ringSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.orb-wrapper.listening .ring { animation: ringPulse 1.5s ease-in-out infinite; }

@keyframes ringPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* State message */
.state-message {
    position: absolute;
    top: 15%;
    text-align: center;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 14px;
    color: var(--color-text-secondary, #b8b8be);
}

.voice-lyrics {
    position: absolute;
    top: 10%;
    width: 80%;
    text-align: center;
}

.voice-lyrics.hidden { display: none; }
.voice-lyrics-prompt { font-size: 16px; color: var(--color-primary, #ff9329); margin-bottom: 8px; }
.voice-lyrics-stream { font-size: 14px; color: var(--color-text-secondary, #b8b8be); }

/* Wave spectrum */
.wave-spectrum {
    position: absolute;
    bottom: 20%;
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 40px;
}

.wave-spectrum.hidden { display: none; }

.spectrum-bar {
    width: 4px;
    background: var(--color-primary, #ff9329);
    border-radius: 2px;
    animation: wave 0.8s ease-in-out infinite alternate;
}

.spectrum-bar:nth-child(1) { height: 10px; animation-delay: 0s; }
.spectrum-bar:nth-child(2) { height: 20px; animation-delay: 0.1s; }
.spectrum-bar:nth-child(3) { height: 30px; animation-delay: 0.2s; }
.spectrum-bar:nth-child(4) { height: 25px; animation-delay: 0.3s; }
.spectrum-bar:nth-child(5) { height: 35px; animation-delay: 0.4s; }
.spectrum-bar:nth-child(6) { height: 20px; animation-delay: 0.5s; }
.spectrum-bar:nth-child(7) { height: 30px; animation-delay: 0.6s; }
.spectrum-bar:nth-child(8) { height: 15px; animation-delay: 0.7s; }
.spectrum-bar:nth-child(9) { height: 25px; animation-delay: 0.8s; }
.spectrum-bar:nth-child(10) { height: 35px; animation-delay: 0.9s; }
.spectrum-bar:nth-child(11) { height: 20px; animation-delay: 1.0s; }
.spectrum-bar:nth-child(12) { height: 10px; animation-delay: 1.1s; }

@keyframes wave {
    from { transform: scaleY(0.5); }
    to { transform: scaleY(1.2); }
}

/* Status HUD */
.status-hud {
    position: absolute;
    bottom: 15%;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono, monospace);
    font-size: 12px;
    color: var(--color-text-secondary, #b8b8be);
}

.hud-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-text-muted, #6e6e74);
}

.hud-dot.idle { background: var(--color-text-muted, #6e6e74); }
.hud-dot.listening { background: var(--color-info, #40c4ff); box-shadow: 0 0 8px var(--color-info, #40c4ff); }
.hud-dot.processing { background: var(--color-warning, #ffab40); box-shadow: 0 0 8px var(--color-warning, #ffab40); }
.hud-dot.speaking { background: var(--color-success, #00e676); box-shadow: 0 0 8px var(--color-success, #00e676); }

/* Orb instructions */
.orb-instructions {
    position: absolute;
    bottom: 8%;
    font-size: 12px;
    color: var(--color-text-muted, #6e6e74);
    display: flex;
    align-items: center;
    gap: 4px;
}

.orb-instructions kbd {
    background: var(--color-surface-container, #242428);
    border: 1px solid var(--color-border, #333);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: var(--font-mono, monospace);
    font-size: 11px;
}

.orb-instructions .divider { margin: 0 4px; }

/* =========================================
    FLOATING RESPONSE ACCORDION
    Dynamically scales near the orb
    Mirrors TUI state machine: thought → tool_call → token → done
    ========================================= */
.response-accordion {
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: min(680px, 85vw);
    max-height: 70vh;
    background: rgba(12, 12, 12, 0.92);
    border: 1px solid rgba(255, 147, 41, 0.12);
    border-radius: 12px;
    backdrop-filter: blur(24px);
    z-index: 20;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: accordionSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 147, 41, 0.06);
}

.response-accordion.hidden { display: none; }

@keyframes accordionSlideIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-12px) scale(0.97); }
    to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* Telemetry bar (mirrors TUI sys stage) */
.accordion-telemetry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255, 147, 41, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 11px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.tele-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-text-muted, #6e6e74);
    transition: all 0.3s;
}

.tele-dot.thinking { background: var(--color-warning, #ffab40); box-shadow: 0 0 6px var(--color-warning, #ffab40); animation: telePulse 1.2s ease-in-out infinite; }
.tele-dot.tooling { background: var(--color-info, #40c4ff); box-shadow: 0 0 6px var(--color-info, #40c4ff); animation: telePulse 0.8s ease-in-out infinite; }
.tele-dot.responding { background: var(--color-primary, #ff9329); box-shadow: 0 0 6px var(--color-primary, #ff9329); animation: telePulse 0.6s ease-in-out infinite; }
.tele-dot.done { background: var(--color-success, #00e676); box-shadow: 0 0 6px var(--color-success, #00e676); }
.tele-dot.error { background: var(--color-error, #ff5252); box-shadow: 0 0 6px var(--color-error, #ff5252); }

@keyframes telePulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

.tele-stage { color: var(--color-text-secondary, #b8b8be); text-transform: uppercase; }

/* Accordion body - scrollable */
.accordion-body {
    overflow-y: auto;
    padding: 8px 0;
    flex: 1;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 147, 41, 0.2) transparent;
}

.accordion-body::-webkit-scrollbar { width: 4px; }
.accordion-body::-webkit-scrollbar-track { background: transparent; }
.accordion-body::-webkit-scrollbar-thumb { background: rgba(255, 147, 41, 0.2); border-radius: 2px; }

/* Thought sections */
.thought-sections { display: flex; flex-direction: column; }

.thought-block {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s;
}

.thought-block:last-child { border-bottom: none; }

.thought-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.thought-header:hover { background: rgba(255, 255, 255, 0.02); }

.thought-icon { font-size: 14px; opacity: 0.7; }
.thought-label {
    flex: 1;
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    color: var(--color-text-secondary, #b8b8be);
    letter-spacing: 0.3px;
}
.thought-chevron {
    font-size: 12px;
    color: var(--color-text-muted, #6e6e74);
    transition: transform 0.2s;
}

.thought-block.collapsed .thought-chevron { transform: rotate(-90deg); }
.thought-block.collapsed .thought-content { display: none; }

.thought-content {
    padding: 0 14px 10px 36px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text-muted, #6e6e74);
    font-style: italic;
}

.thought-stream { display: inline; }

/* Tool call sections */
.tool-sections { display: flex; flex-direction: column; }

.tool-block {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s;
}

.tool-block:last-child { border-bottom: none; }

.tool-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.tool-header:hover { background: rgba(255, 255, 255, 0.02); }

.tool-icon { font-size: 14px; }
.tool-name {
    flex: 1;
    font-family: var(--font-mono, monospace);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-info, #40c4ff);
}

.tool-status {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.3s;
}

.tool-status.running { background: rgba(64, 196, 255, 0.15); color: var(--color-info, #40c4ff); }
.tool-status.done { background: rgba(0, 230, 118, 0.15); color: var(--color-success, #00e676); }

.tool-chevron {
    font-size: 12px;
    color: var(--color-text-muted, #6e6e74);
    transition: transform 0.2s;
}

.tool-block.collapsed .tool-chevron { transform: rotate(-90deg); }
.tool-block.collapsed .tool-content { display: none; }

.tool-content {
    padding: 0 14px 10px 36px;
}

.tool-args { margin-bottom: 6px; }
.tool-args-label, .tool-result-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted, #6e6e74);
    display: block;
    margin-bottom: 4px;
}

.tool-content pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    padding: 8px 10px;
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    line-height: 1.4;
    color: var(--color-text-secondary, #b8b8be);
    overflow-x: auto;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.tool-result { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.04); }
.tool-result pre { border-color: rgba(0, 230, 118, 0.1); }

/* Response section */
.response-section {
    border-top: 1px solid rgba(255, 147, 41, 0.15);
}

.response-section.hidden { display: none; }

.response-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.response-section-header:hover { background: rgba(255, 147, 41, 0.04); }

.response-section-icon { font-size: 16px; }
.response-section-title {
    flex: 1;
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text-primary, #f0f0f2);
}
.response-section-chevron {
    font-size: 12px;
    color: var(--color-text-muted, #6e6e74);
    transition: transform 0.2s;
}

.response-section.collapsed .response-section-chevron { transform: rotate(-90deg); }
.response-section.collapsed .response-section-content { display: none; }

.response-section-content {
    padding: 0 14px 14px;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-primary, #f0f0f2);
}

.response-section-content p { margin: 0 0 10px 0; }
.response-section-content p:last-child { margin-bottom: 0; }

.response-section-content code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono, monospace);
    font-size: 12px;
}

.response-section-content pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 10px 0;
}

.response-section-content pre code { background: none; padding: 0; }

.no-response {
    color: var(--color-text-muted, #6e6e74);
    font-style: italic;
    font-size: 13px;
}

/* =========================================
   LOADING OVERLAY
   ========================================= */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--color-bg-primary, #111113);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    transition: opacity 0.5s ease;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    text-align: center;
}

/* Animated loader ring */
.loader-ring {
    position: relative;
    width: 64px;
    height: 64px;
}

.loader-ring::before,
.loader-ring::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
}

.loader-ring::before {
    border-top-color: var(--color-primary, #ff9329);
    animation: spin 1s linear infinite;
}

.loader-ring::after {
    border-bottom-color: var(--color-accent, #00ddff);
    animation: spin 1.5s linear infinite reverse;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loader-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

.loading-content h2 {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary, #f0f0f2);
    margin: 0;
    letter-spacing: 0.05em;
}

/* Boot steps */
.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 280px;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--color-text-secondary, #b8b8be);
    transition: all 0.3s ease;
    background: transparent;
}

.step-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.step-text {
    flex: 1;
    text-align: left;
}

/* Step states */
.step.pending {
    opacity: 0.5;
}

.step.pending .step-icon {
    opacity: 0.5;
}

.step.active {
    opacity: 1;
    background: rgba(255, 147, 41, 0.08);
    color: var(--color-text-primary, #f0f0f2);
}

.step.active .step-icon {
    animation: iconSpin 1s linear infinite;
}

@keyframes iconSpin { to { transform: rotate(360deg); } }

.step.done {
    opacity: 1;
    background: rgba(0, 255, 127, 0.06);
    color: #00ff7f;
}

.step.done .step-icon {
    animation: none;
}

.step.warn {
    opacity: 1;
    background: rgba(255, 170, 0, 0.08);
    color: #ffaa00;
}

.step.error {
    opacity: 1;
    background: rgba(255, 82, 82, 0.08);
    color: #ff5252;
}

/* Staggered step appearance */
.loading-steps .step:nth-child(1) { animation: stepFadeIn 0.3s ease 0.1s both; }
.loading-steps .step:nth-child(2) { animation: stepFadeIn 0.3s ease 0.2s both; }
.loading-steps .step:nth-child(3) { animation: stepFadeIn 0.3s ease 0.3s both; }

@keyframes stepFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   INFO MODAL
   ========================================= */
.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.info-modal.open { display: flex; }

.info-modal-content {
    background: var(--color-bg-elevated, #1a1a1e);
    border: 1px solid var(--color-border, #333);
    border-radius: 12px;
    width: 360px;
    max-width: 90vw;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

.info-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border, #333);
}

.info-modal-header h3 {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-primary, #f0f0f2);
}

.info-modal-close {
    background: none;
    border: none;
    color: var(--color-text-muted, #6e6e74);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.info-modal-close:hover { color: var(--color-text-primary, #f0f0f2); }

.info-modal-body { padding: 16px; }

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 12px;
}

.info-row span:first-child { color: var(--color-text-muted, #6e6e74); }
.info-row span:last-child { color: var(--color-text-primary, #f0f0f2); }

.status-text.online { color: var(--color-success, #00e676); }
.status-text.offline { color: var(--color-error, #ff5252); }

.install-hint {
    font-size: 12px;
    color: var(--color-text-secondary, #b8b8be);
    margin: 0 0 12px 0;
}

.install-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--color-surface-container, #242428);
    border: 1px solid var(--color-border, #333);
    border-radius: 6px;
    color: var(--color-text-primary, #f0f0f2);
    font-size: 12px;
    font-family: var(--font-mono, monospace);
    outline: none;
    margin-bottom: 12px;
}

.install-input:focus { border-color: var(--color-primary, #ff9329); }

.install-submit-btn {
    width: 100%;
    padding: 8px;
    background: var(--color-primary, #ff9329);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.install-submit-btn:hover { opacity: 0.85; }

.install-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--color-text-secondary, #b8b8be);
}

.install-success { font-size: 12px; color: var(--color-success, #00e676); margin: 0; }
.install-error { font-size: 12px; color: var(--color-error, #ff5252); margin: 0; }

/* =========================================
   TOOLBAR
   ========================================= */
.service-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    background: rgba(17, 17, 19, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border, #333);
    z-index: 1000;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.toolbar-icon-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary, #b8b8be);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s, background 0.15s;
}

.toolbar-icon-btn:hover {
    color: var(--color-text-primary, #f0f0f2);
    background: var(--color-surface-hover, rgba(255,255,255,0.05));
}

body.menu-open .service-toolbar { left: 280px; }
body.menu-open #app { transform: translateX(280px); }

/* Mini Player */
.mini-player {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: none;
    border: none;
}

.mini-player .player-btn {
    background: none;
    border: none;
    color: var(--color-text-primary, #f0f0f2);
    cursor: pointer;
    padding: 2px;
    font-size: 16px;
    line-height: 1;
    transition: color 0.15s;
}

.mini-player .player-btn:hover { color: var(--color-primary, #ff9329); }

.mini-player .player-track-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mini-player .player-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-primary, #f0f0f2);
}

.mini-player .player-subtitle {
    font-size: 10px;
    color: var(--color-text-muted, #6e6e74);
}

.speed-buttons {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 4px;
}

.speed-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 1px 3px;
    font-size: 10px;
    line-height: 1;
    border-radius: 3px;
    color: var(--color-text-muted, #6e6e74);
    transition: all 0.15s;
}

.speed-btn:hover { background: var(--color-surface-hover, rgba(255,255,255,0.05)); }
.speed-btn.active { color: var(--color-primary, #ff9329); }
.speed-btn[data-speed="smacked"].active { color: #ff6482; }
.speed-btn[data-speed="spanked"].active { color: var(--color-primary, #ff9329); }

/* Split Selector */
.split-selector { position: relative; }

.selector-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--color-surface-container, #242428);
    border: 1px solid var(--color-border, #333);
    border-radius: 6px;
    padding: 4px 10px;
    color: var(--color-text-primary, #f0f0f2);
    font-size: 12px;
    font-family: var(--font-sans, sans-serif);
    cursor: pointer;
    transition: border-color 0.15s;
}

.selector-trigger:hover { border-color: var(--color-primary, #ff9329); }
.selector-arrow { transition: transform 0.2s; }
.split-dropdown.open .selector-arrow { transform: rotate(180deg); }

.split-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 320px;
    background: var(--color-bg-elevated, #1a1a1e);
    border: 1px solid var(--color-border, #333);
    border-radius: 8px;
    z-index: 1001;
    display: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    overflow: hidden;
}

.split-dropdown.open { display: block; }

.selector-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border, #333);
}

.selector-tab {
    flex: 1;
    padding: 8px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-muted, #6e6e74);
    font-size: 12px;
    font-family: var(--font-sans, sans-serif);
    cursor: pointer;
    transition: all 0.15s;
}

.selector-tab.active {
    color: var(--color-primary, #ff9329);
    border-bottom-color: var(--color-primary, #ff9329);
}

.selector-search {
    width: 100%;
    padding: 6px 10px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--color-border, #333);
    color: var(--color-text-primary, #f0f0f2);
    font-size: 12px;
    font-family: var(--font-sans, sans-serif);
    outline: none;
}

.selector-panels {
    position: relative;
    max-height: 280px;
    overflow-y: auto;
}

.selector-panel { display: none; }
.selector-panel.active { display: block; }

.selector-list { padding: 4px 0; }

.glove-section-label {
    padding: 6px 10px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--color-text-muted, #6e6e74);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    margin-bottom: 2px;
}

.selector-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
    transition: background 0.1s;
}

.selector-item:hover { background: var(--color-surface-hover, rgba(255,255,255,0.05)); }
.selector-item .selector-icon { font-size: 14px; width: 20px; text-align: center; }
.selector-item .selector-name { flex: 1; font-size: 12px; color: var(--color-text-primary, #f0f0f2); }
.selector-item .selector-meta { font-size: 10px; color: var(--color-text-muted, #6e6e74); }

.selector-item .item-status {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.selector-item .item-status.loaded { color: var(--color-success, #00e676); }
.selector-item .item-status:not(.loaded) { color: var(--color-text-muted, #6e6e74); }

.selector-item .selector-action {
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.1s;
}

.selector-item .selector-action:hover { background: var(--color-surface-hover, rgba(255,255,255,0.1)); }

.install-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--color-border, #333);
    border-top-color: var(--color-primary, #ff9329);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.status-orb {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-orb.green { background: var(--color-success, #00e676); box-shadow: 0 0 4px var(--color-success, #00e676); }
.status-orb.red { background: var(--color-error, #ff5252); box-shadow: 0 0 4px var(--color-error, #ff5252); }

.selector-add-btn {
    width: 100%;
    padding: 8px;
    background: none;
    border: none;
    border-top: 1px solid var(--color-border, #333);
    color: var(--color-text-muted, #6e6e74);
    font-size: 12px;
    cursor: pointer;
    transition: color 0.15s;
}

.selector-add-btn:hover { color: var(--color-primary, #ff9329); }

/* ── API Mode Toggle ── */
.api-mode-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 12px;
  cursor: pointer; user-select: none;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  transition: all 0.15s;
  margin-left: 6px;
  border: 1px solid transparent;
}
.api-mode-toggle:hover { opacity: 0.8; }
.api-mode-toggle .mode-dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.api-mode-toggle .mode-dot.live {
  background: #00e676; box-shadow: 0 0 6px rgba(0,230,118,0.5);
}
.api-mode-toggle .mode-dot.mock {
  background: #4f46e5; box-shadow: 0 0 6px rgba(79,70,229,0.5);
  animation: dotPulse 1.5s ease-in-out infinite;
}
.api-mode-toggle .mode-label { line-height: 1; }
.api-mode-toggle {
  background: rgba(0,230,118,0.08);
  border-color: rgba(0,230,118,0.15);
  color: #00e676;
}
.api-mode-toggle.mock {
  background: rgba(79,70,229,0.12);
  border-color: rgba(79,70,229,0.2);
  color: #4f46e5;
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}
