:root {
    --bg: #faf8f6;
    --surface: #ffffff;
    --text: #1d1b1a;
    --muted: #5f5a56;
    --border: #e3ddd8;
    --accent: #7a1f2b;
    --accent-hover: #5e1520;
    --accent-text: #ffffff;
    --alert-bg: #fdecea;
    --alert-text: #7a1f2b;
    --focus: #2563eb;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #161413;
        --surface: #211e1c;
        --text: #f1ece8;
        --muted: #b3aba5;
        --border: #3a3431;
        --accent: #e0707e;
        --accent-hover: #ee8f9a;
        --accent-text: #1b0d10;
        --alert-bg: #3a1b1f;
        --alert-text: #f6c1c7;
        --focus: #7aa2ff;
    }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.6;
}

.wrap {
    max-width: 46rem;
    margin: 0 auto;
    padding: 0 1rem;
}

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

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

h1, h2, h3 { line-height: 1.2; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin: 0 0 1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.4rem; margin: 0 0 1rem; }
h3 { font-size: 1.15rem; margin: 1.25rem 0 0.5rem; }

.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.site-header .wrap { padding-top: 0.9rem; padding-bottom: 0.9rem; }
.brand {
    font-weight: 800;
    font-size: 1.2rem;
    text-decoration: none;
    color: var(--accent);
}

main { padding-top: 2rem; padding-bottom: 2rem; }

.hero { margin-bottom: 2rem; }
.lede { font-size: 1.2rem; }

.panel, .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}
.panel { margin-bottom: 2rem; }

.lookup { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.35rem; min-width: 0; }
.field-row { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; }
label { font-weight: 600; }
.optional { font-weight: 400; color: var(--muted); font-size: 0.9rem; }

input, textarea {
    width: 100%;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
}
textarea { font-size: 0.95rem; resize: vertical; }

.button {
    display: inline-block;
    font: inherit;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    color: var(--accent);
    background: transparent;
    border: 2px solid var(--accent);
    border-radius: 999px;
    padding: 0.55rem 1.1rem;
    cursor: pointer;
}
.button:hover { color: var(--accent-hover); border-color: var(--accent-hover); }
.button.primary { background: var(--accent); color: var(--accent-text); }
.button.primary:hover { background: var(--accent-hover); color: var(--accent-text); }
.lookup .button { justify-self: start; }

.alert {
    background: var(--alert-bg);
    color: var(--alert-text);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 1rem 0 0;
}

.muted { color: var(--muted); }

.cards { display: grid; gap: 1rem; margin-bottom: 2rem; }
.card h3 { margin-top: 0.25rem; }
.card-role {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}
.card-detail { margin-top: 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0; }

details summary { cursor: pointer; color: var(--muted); }
details[open] summary { margin-bottom: 0.75rem; }
.copy-label { margin: 0.25rem 0; font-size: 0.95rem; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, Consolas, monospace; }

.site-footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
    padding: 1.5rem 0 1.5rem;
}

@media (max-width: 480px) {
    .field-row { grid-template-columns: 1fr; }
    .actions .button { flex: 1 1 100%; }
    .lookup .button { justify-self: stretch; }
}

.hint { margin: 0.25rem 0 0; font-size: 0.9rem; color: var(--muted); }
details.street summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details.street[open] summary { margin-bottom: 0.75rem; }
.note {
    background: var(--bg);
    border-left: 4px solid var(--accent);
    border-radius: 4px;
    padding: 0.6rem 0.9rem;
    margin: 0;
}
.law-links { padding-left: 1.2rem; margin: 0.5rem 0 1rem; }
.law-links li { margin-bottom: 0.35rem; overflow-wrap: anywhere; }
details.state { border-top: 1px solid var(--border); padding: 0.6rem 0; }
details.state summary { cursor: pointer; font-weight: 600; }

.site-footer h2 { font-size: 1rem; margin: 1.5rem 0 0.75rem; color: var(--text); }

.disclaimers { margin: 0; }
.disclaimers dt { font-weight: 600; color: var(--text); margin-top: 0.75rem; }
.disclaimers dd { margin: 0.2rem 0 0; }

.help {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
}
.help h2 { font-size: 1.3rem; }
.help h3 { font-size: 1rem; margin: 0 0 0.4rem; }
.help ul { padding-left: 1.1rem; margin: 0; }
.help li { margin-bottom: 0.4rem; }
.help-emergency { font-weight: 600; }
.hotline {
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin: 1rem 0 1.5rem;
}
.hotline p { margin: 0.25rem 0; }
.hotline-name { font-weight: 700; }
.hotline-number { font-size: 1.6rem; font-weight: 800; }
.hotline-number a { text-decoration: none; }
.resource-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.site-contact {
    border-top: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 0.9rem;
    padding: 1rem 0 1.5rem;
}
.site-contact p { margin: 0; }
.site-contact a { overflow-wrap: anywhere; }
