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

:root {
    --bg:           #f4f4f5;
    --surface:      #ffffff;
    --border:       #e4e4e7;
    --text:         #18181b;
    --text-muted:   #71717a;
    --accent:       #2563eb;
    --accent-hover: #1d4ed8;
    --highlight-bg: #18181b;
    --highlight-fg: #ffffff;
    --radius:       0.5rem;
    --shadow:       0 1px 3px rgba(0, 0, 0, 0.07);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg:           #0f0f0f;
        --surface:      #1c1c1e;
        --border:       #2c2c2e;
        --text:         #f2f2f7;
        --text-muted:   #8e8e93;
        --accent:       #3b82f6;
        --accent-hover: #60a5fa;
        --highlight-bg: #f2f2f7;
        --highlight-fg: #0f0f0f;
    }
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

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

/* ── Header ── */

header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

h1 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* ── Controls ── */

#controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

button {
    cursor: pointer;
    border: none;
    border-radius: var(--radius);
    padding: 0.4rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    background: var(--accent);
    color: #fff;
    transition: background 0.12s, color 0.12s;
}

button:hover {
    background: var(--accent-hover);
}

#transport {
    cursor: pointer;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
    padding: 0.4rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

#monitor-information {
    margin-left: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

#split-metrics-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
}

#split-metrics-label input {
    cursor: pointer;
}

/* ── Main ── */

main {
    padding: 1.25rem;
}

/* ── Notification grid ── */

#notifications {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 0.75rem;
}

/* ── Cards ── */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-title {
    padding: 0.45rem 0.75rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

/* ── Fields ── */

.field {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    transition: background 0.1s;
}

.field:hover {
    background: var(--border);
}

.field-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.field-value {
    font-size: 0.9rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* ── Highlight ── */

.highlight {
    background: var(--highlight-bg) !important;
}

.highlight .field-label,
.highlight .field-value {
    color: var(--highlight-fg);
}

/* ── Responsive ── */

@media (max-width: 600px) {
    header {
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    #notifications {
        grid-template-columns: 1fr;
    }
}
