*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    background: #0a0e14;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #c5c8c6;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: #131920;
    border-bottom: 1px solid #1e2630;
    font-size: 13px;
    flex-shrink: 0;
}

#status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
    transition: background 0.3s;
}

#status-indicator.connected {
    background: #50c878;
}

#status-indicator.error {
    background: #e74c3c;
}

#status-text {
    color: #8a919a;
}

#serial-controls {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

#serial-btn {
    background: #1a2230;
    color: #8abeb7;
    border: 1px solid #2a3545;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

#serial-btn:hover {
    background: #222e3c;
    border-color: #8abeb7;
}

#serial-btn.active {
    color: #cc6666;
    border-color: #cc6666;
}

#serial-btn.active:hover {
    background: #2a1a1a;
}

#terminal-container {
    flex: 1;
    padding: 4px;
    overflow: hidden;
}

.xterm {
    height: 100%;
}

#overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 14, 20, 0.85);
    z-index: 100;
    transition: opacity 0.3s;
}

#overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #1e2630;
    border-top-color: #50c878;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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