:root {
    color-scheme: light dark;
    --text: light-dark(#182026, #e5edf3);
    --page: light-dark(#f7f8f9, #111820);
    --surface: light-dark(white, #1b2632);
    --brand: light-dark(#0f172a, #f1f5f9);
    --muted: light-dark(#52606d, #b3c1ce);
    --link: light-dark(#075985, #7dd3fc);
    --accent: light-dark(#0f766e, #5eead4);
    --button: light-dark(#0f766e, #5eead4);
    --button-text: light-dark(white, #102a29);
    --button-hover: light-dark(#115e59, #99f6e4);
    --border: light-dark(#cbd5e1, #516478);
    --footer-border: light-dark(#d8dee4, #516478);
    --input-border: light-dark(#84919e, #8296aa);
    --focus: light-dark(#a85b00, #fbbf24);
    --danger: light-dark(#b91c1c, #fca5a5);
    --danger-text: light-dark(white, #450a0a);
    --danger-hover: light-dark(#991b1b, #fecaca);
    --danger-surface: light-dark(#fff7f7, #361d25);
    --error: light-dark(#9f1239, #fda4af);
    --notice-border: light-dark(#99d5cf, #438f87);
    --notice-surface: light-dark(#f0fdfa, #15342f);
    --warning-border: light-dark(#f59e0b, #fbbf24);
    --warning-surface: light-dark(#fffbeb, #382e18);
    --distance-surface: light-dark(#e0f2fe, #16374b);
    --status-surface: light-dark(#ecfdf5, #193c2b);
    --status-text: light-dark(#166534, #86efac);
    --tag-surface: light-dark(#e2e8f0, #334155);
    color: var(--text);
    background: var(--page);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

:root[data-theme="light"] {
    color-scheme: light;
}

:root[data-theme="dark"] {
    color-scheme: dark;
}

.danger-button {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: .5rem;
    background: var(--danger);
    color: var(--danger-text);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: .65rem 1rem;
}

.danger-button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

* {
    box-sizing: border-box;
}

.danger-zone {
    display: grid;
    gap: 1rem;
    border: 2px solid var(--danger);
    border-radius: .75rem;
    background: var(--danger-surface);
    padding: 1rem;
}

.read-only-summary {
    margin: 0;
}

.read-only-summary div {
    display: grid;
    gap: .2rem;
}

.read-only-summary dt {
    font-weight: 700;
}

.read-only-summary dd {
    margin: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    margin: 0;
}

a {
    color: var(--link);
}

a:hover {
    text-decoration: underline;
}

.site-header,
.site-footer,
.page-shell {
    width: min(100% - 2rem, 68rem);
    margin-inline: auto;
}

.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 1.25rem;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem 1.25rem;
}

.theme-control:not([hidden]) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .5rem;
}

.theme-control select {
    width: auto;
}

#theme-status {
    flex-basis: 100%;
    max-width: 22rem;
}

.brand-block,
.site-nav,
.button-row,
.listing-card-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
}

.site-nav {
    font-weight: 700;
}

.brand {
    color: var(--brand);
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
}

.tagline,
.fine-print,
small {
    color: var(--muted);
}

.page-shell {
    padding-block: 1.5rem 3rem;
}

.site-footer {
    border-top: 1px solid var(--footer-border);
    color: var(--muted);
    font-size: .9rem;
    padding-block: 1.5rem 2.5rem;
}

.hero,
.stack,
.form-stack,
.listing-detail {
    display: grid;
    gap: 1.25rem;
}

.hero {
    padding-block: 2rem;
}

.narrow,
.form-stack {
    max-width: 42rem;
}

h1,
h2,
p {
    margin-block: 0;
}

h1 {
    font-size: clamp(2rem, 8vw, 3.5rem);
    line-height: 1.08;
}

h2 {
    font-size: 1.35rem;
}

.eyebrow {
    color: var(--accent);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.button {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    min-height: 2.75rem;
    align-items: center;
    border: 0;
    border-radius: .5rem;
    background: var(--button);
    color: var(--button-text);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: .75rem 1rem;
    text-decoration: none;
}

.secondary-button {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent);
    border-radius: .5rem;
    color: var(--accent);
    font-weight: 700;
    padding: .65rem 1rem;
    text-decoration: none;
}

.button:hover {
    background: var(--button-hover);
    text-decoration: none;
}

.secondary-button:hover {
    background: var(--notice-surface);
}

.danger-button:hover:not(:disabled) {
    background: var(--danger-hover);
}

.button:focus-visible,
.secondary-button:focus-visible,
.danger-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: .2rem solid var(--focus);
    outline-offset: .15rem;
}

.choice-grid {
    display: grid;
    gap: 1rem;
}

.choice-card,
fieldset,
.notice,
.warning,
.save-link,
.filter-panel,
.listing-card,
.interest-panel,
.empty-state {
    border: 1px solid var(--border);
    border-radius: .75rem;
    background: var(--surface);
    padding: 1rem;
}

.choice-card {
    display: grid;
    gap: 1rem;
}

fieldset {
    display: grid;
    gap: 1rem;
    margin: 0;
}

legend {
    font-weight: 800;
    padding-inline: .25rem;
}

.nested-fieldset {
    border: 0;
    padding: 0;
}

.field {
    display: grid;
    gap: .35rem;
}

.bot-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

label {
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 2.75rem;
    border: 1px solid var(--input-border);
    border-radius: .4rem;
    background: var(--surface);
    color: inherit;
    font: inherit;
    padding: .65rem .75rem;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: 1;
}

option {
    background: var(--surface);
    color: var(--text);
}

input[type="checkbox"] {
    accent-color: var(--accent);
}

textarea {
    resize: vertical;
}

.checkbox-field {
    display: grid;
    grid-template-columns: 1.5rem 1fr;
    align-items: start;
    gap: .6rem;
}

.checkbox-field input {
    width: 1.25rem;
    min-height: 1.25rem;
    margin-top: .15rem;
}

.optional {
    color: var(--muted);
    font-weight: 400;
}

.validation-summary,
.field-validation-error {
    color: var(--error);
    font-weight: 700;
}

.validation-summary:empty,
.field-validation-valid {
    display: none;
}

.notice {
    border-color: var(--notice-border);
    background: var(--notice-surface);
}

.warning {
    border-color: var(--warning-border);
    background: var(--warning-surface);
}

.save-link {
    display: grid;
    gap: .75rem;
    border-width: 2px;
    border-color: var(--accent);
}

.management-link {
    overflow-wrap: anywhere;
}

.filter-panel,
.listing-grid,
.filter-grid,
.detail-layout {
    display: grid;
    gap: 1rem;
}

.listing-card {
    display: grid;
    gap: .85rem;
}

.listing-card-heading {
    align-items: start;
    justify-content: space-between;
}

.distance-badge,
.status-label {
    width: fit-content;
    border-radius: 999px;
    background: var(--distance-surface);
    color: var(--link);
    font-size: .9rem;
    font-weight: 800;
    padding: .3rem .65rem;
}

.status-label {
    background: var(--status-surface);
    color: var(--status-text);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tag-list li {
    border-radius: 999px;
    background: var(--tag-surface);
    padding: .25rem .65rem;
}

.text-link {
    font-weight: 700;
}

.preserve-lines {
    white-space: pre-line;
}

@media (min-width: 42rem) {
    .choice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-grid,
    .listing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .button {
        width: fit-content;
    }
}

@media (min-width: 56rem) {
    .detail-layout {
        grid-template-columns: minmax(0, 1.25fr) minmax(20rem, .75fr);
        align-items: start;
    }

    .interest-panel {
        position: sticky;
        top: 1rem;
    }
}

@media (max-width: 35rem) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-actions {
        justify-content: flex-start;
    }
}
