/* ── Tokens ───────────────────────────────────────────────── */
:root {
    --bg:           #f5f5f5;
    --surface:      #ffffff;
    --border:       #e0e0e0;
    --text:         #212121;
    --text-muted:   #757575;
    --accent:       #1a73e8;
    --code-bg:      #f1f3f4;
    --status-dot:   #34a853;
    --radius:       12px;
    --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 8px rgba(0,0,0,.05);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg:           #121212;
        --surface:      #1e1e1e;
        --border:       #2e2e2e;
        --text:         #e3e3e3;
        --text-muted:   #9e9e9e;
        --accent:       #8ab4f8;
        --code-bg:      #2a2a2a;
        --shadow:       0 1px 3px rgba(0,0,0,.4), 0 1px 8px rgba(0,0,0,.3);
    }
}

/* ── Reset / Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── Header ───────────────────────────────────────────────── */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 14px 20px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
    color: var(--text);
}

.header-title svg { color: var(--accent); flex-shrink: 0; }

/* ── Main ─────────────────────────────────────────────────── */
main {
    max-width: 720px;
    margin: 32px auto;
    padding: 0 20px 48px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Card ─────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.card p { color: var(--text); }

code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px;
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent);
}

/* ── Debug form ───────────────────────────────────────────── */
.card label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
    margin-top: 16px;
}

.card label:first-of-type { margin-top: 0; }

select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23757575' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

select:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: transparent; }

.card form button[type="submit"] {
    margin-top: 16px;
    padding: 9px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.card form button[type="submit"]:hover { opacity: .88; }

/* ── Notice card ──────────────────────────────────────────── */
.notice {
    border-color: #f9ab00;
    background: color-mix(in srgb, #f9ab00 8%, var(--surface));
}

.notice[hidden] { display: none; }

/* ── Status card ──────────────────────────────────────────── */
.status {
    display: flex;
    align-items: center;
    gap: 12px;
    border-color: var(--status-dot);
    background: color-mix(in srgb, var(--status-dot) 8%, var(--surface));
}

.status[hidden] { display: none; }

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--status-dot);
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .4; }
}

.status a { color: var(--accent); }
