:root {
    --bg-primary: #0b1020;
    --bg-secondary: #121a30;
    --bg-elevated: #1a2442;
    --border-subtle: rgba(148, 163, 184, 0.2);
    --text-primary: #f1f5f9;
    --text-muted: #94a3b8;
    --accent-primary: #38bdf8;
    --accent-secondary: #a855f7;
    --accent-success: #22c55e;
    --accent-warn: #f59e0b;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    font-size: 14px;
}

.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.header-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    min-height: 46px;
}

.header-left, .header-center, .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
}

.header-pill {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.header-route-readout {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: var(--text-muted);
}

.mode-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
}

.mode-playground {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-warn);
    border-color: rgba(245, 158, 11, 0.4);
}

.mode-local {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-success);
    border-color: rgba(34, 197, 94, 0.4);
}

.shell-icon-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
}

.shell-icon-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.playground-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 12px;
    background: rgba(245, 158, 11, 0.12);
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
    font-size: 12px;
    color: #fde68a;
}

.playground-cta-btn {
    background: var(--accent-warn);
    color: #0b1020;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.workspace-shell {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.activity-bar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 60px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    padding: 8px 4px;
    flex-shrink: 0;
}

.activity-bar-top, .activity-bar-bottom {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.activity-bar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 11px;
}

.activity-bar-btn:hover {
    color: var(--text-primary);
    background: rgba(148, 163, 184, 0.1);
}

.activity-bar-btn.active {
    color: var(--accent-primary);
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.35);
}

.activity-icon {
    font-size: 16px;
}

.side-panel {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.right-panel {
    border-right: none;
    border-left: 1px solid var(--border-subtle);
}

.side-panel.collapsed {
    display: none;
}

.side-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 600;
    font-size: 12px;
}

.side-panel-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
}

.side-panel-content {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.inspector-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.inspector-value {
    font-size: 12px;
    word-break: break-word;
}

.center-panel {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 16px;
}

.center-panel-content {
    max-width: 960px;
    margin: 0 auto;
}

.boot-placeholder {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
}

.footer-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    font-size: 12px;
    color: var(--text-muted);
}

.footer-left, .footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-status-dot.status-booting {
    color: var(--accent-warn);
}

.footer-status-dot.status-ready {
    color: var(--accent-success);
}

.footer-status-dot.status-error {
    color: #ef4444;
}

.footer-link-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 0;
}

.footer-link-btn:hover {
    color: var(--accent-primary);
}

.fullscreen-dialog {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 16px;
    max-width: 440px;
    width: 90%;
}

.fullscreen-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.dialog-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
}

.dialog-btn-primary {
    background: var(--accent-primary);
    color: #0b1020;
    border-color: var(--accent-primary);
    font-weight: 600;
}

.dialog-btn-secondary {
    background: transparent;
    color: var(--text-primary);
}

/* Narrow Side Panel / Mobile Responsive Layout */
@media (max-width: 600px) {
    .header-center, .mode-badge, #footer-target-badge, #footer-version {
        display: none;
    }
    .activity-bar {
        width: 48px;
    }
    .activity-label {
        display: none;
    }
    .center-panel {
        padding: 10px;
    }
    .playground-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}
