:root {
    --primary: #0f172a;
    --accent: #3b82f6;
    --success: #10b981;
    --danger: #ef4444;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.5;
    padding: 20px;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.025em;
}

.logo span {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 400;
    margin-left: 4px;
}

.status-pill {
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pill.offline { background: #fee2e2; color: #991b1b; }
.status-pill.online { background: #dcfce7; color: #166534; }
.status-pill.connecting { background: #fef9c3; color: #854d0e; }

.card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card-header {
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.card-header p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.pairing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 600px) {
    .pairing-grid { grid-template-columns: 1fr; }
}

label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.display-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    text-align: center;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 4px;
}

#qr-code {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

#qr-code img {
    max-width: 120px;
    height: auto;
}

input[type="text"], input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 12px;
}

.btn-primary, .btn-success {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary { background: var(--accent); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-primary:hover, .btn-success:hover { opacity: 0.9; transform: translateY(-1px); }

.hidden { display: none; }

.log-viewer {
    background: #0f172a;
    color: #f8fafc;
    font-family: monospace;
    font-size: 0.75rem;
    padding: 12px;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.log-entry {
    margin-bottom: 4px;
    border-left: 2px solid var(--accent);
    padding-left: 8px;
}

.queue-container {
    margin-top: 20px;
}

.queue-item {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s ease;
}

footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 40px;
}
