:root {
    --bg: #0e1116;
    --panel: #161b22;
    --panel-2: #1f242c;
    --border: #2d333b;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #2f81f7;
    --accent-hover: #1f6feb;
    --danger: #f85149;
    --danger-hover: #da3633;
    --success: #3fb950;
    --warn: #d29922;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}

h1 {
    margin: 0 0 8px 0;
    font-size: 28px;
    letter-spacing: -0.02em;
}

h2 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: var(--muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.subtitle { color: var(--muted); margin: 0 0 24px 0; }

label {
    display: block;
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 6px;
}

input[type="password"], select {
    width: 100%;
    padding: 12px 14px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 16px;
    margin-bottom: 12px;
}

input[type="password"]:focus, select:focus {
    outline: none;
    border-color: var(--accent);
}

button {
    width: 100%;
    padding: 12px 18px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}
button:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button.danger { background: var(--danger); }
button.danger:hover { background: var(--danger-hover); }

button.secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
}
button.secondary:hover {
    background: var(--panel-2);
    color: var(--text);
}

.error {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--muted);
    box-shadow: 0 0 0 0 rgba(63, 185, 80, 0);
}
.status-dot.armed {
    background: var(--success);
    animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.5); }
    100% { box-shadow: 0 0 0 12px rgba(63, 185, 80, 0); }
}

.meter-container {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
}

.meter-track {
    position: relative;
    width: 100%;
    height: 28px;
    background: #0a0d11;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.meter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(
        to right,
        #3fb950 0%,
        #3fb950 60%,
        #d29922 75%,
        #f85149 95%
    );
    transition: width 0.05s linear;
}

.meter-peak {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--text);
    transition: left 0.5s ease-out;
    opacity: 0.7;
}

.meter-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
    font-variant-numeric: tabular-nums;
}

.button-row {
    display: flex;
    gap: 8px;
}
.button-row > button { flex: 1; }

.muted { color: var(--muted); font-size: 14px; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }

.device-meta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}
