:root {
    color-scheme: light;
    --blue: #075fd8;
    --blue-dark: #0649a5;
    --navy: #13233a;
    --surface: #ffffff;
    --background: #f4f7fb;
    --border: #c7d1df;
    --error: #a82020;
    --success: #176b3a;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--navy);
    background: var(--background);
}

* { box-sizing: border-box; }
.autofill-trap { position: fixed; left: -10000px; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
body { margin: 0; min-height: 100vh; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
a { color: var(--blue-dark); }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--surface); border-bottom: 1px solid var(--border); padding: 1rem clamp(1rem, 4vw, 3rem); }
.brand { color: var(--navy); font-size: 1.35rem; font-weight: 800; text-decoration: none; }
.header-action { font-weight: 700; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.page { width: min(100% - 2rem, 46rem); margin: 2rem auto; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; padding: clamp(1.25rem, 4vw, 2rem); box-shadow: 0 0.5rem 1.5rem rgb(19 35 58 / 8%); }
.auth-card { max-width: 36rem; margin-inline: auto; }
h1 { line-height: 1.15; margin-top: 0; }
h1 { font-size: clamp(1.65rem, 4vw, 2rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
.field { margin-block: 1.15rem; }
label { display: block; font-weight: 700; margin-bottom: 0.4rem; }
.field-label { display: block; font-weight: 700; margin-bottom: .4rem; }
input { width: 100%; min-height: 2.75rem; border: 1px solid #7e8b9e; border-radius: 0.5rem; padding: 0.65rem 0.75rem; font: inherit; }
textarea { width: 100%; min-height: 8rem; resize: vertical; border: 1px solid #7e8b9e; border-radius: .5rem; padding: .65rem .75rem; font: inherit; }
select { width: 100%; min-height: 2.75rem; border: 1px solid #7e8b9e; border-radius: .5rem; padding: .65rem .75rem; background: white; font: inherit; }
input:focus, select:focus, textarea:focus, button:focus, .button:focus, a:focus { outline: 3px solid #f3b800; outline-offset: 2px; }
button, .button { display: inline-block; min-height: 2.75rem; border: 0; border-radius: 0.5rem; background: var(--blue); color: white; padding: 0.7rem 1rem; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: var(--blue-dark); }
.help { color: #4b5b70; font-size: 0.925rem; margin: 0.25rem 0 0.5rem; }
.alert { border-left: 0.3rem solid; border-radius: 0.35rem; margin: 1rem 0; padding: 0.8rem 1rem; }
.alert-error { border-color: var(--error); background: #fff0f0; color: #741616; }
.alert-success { border-color: var(--success); background: #edfff4; color: #10552e; }

@media (max-width: 360px) { .page { width: min(100% - 1rem, 46rem); margin-block: 1rem; } }

.profile-card { display: grid; gap: 1.25rem; justify-items: center; text-align: center; }
.profile-avatar { width: 7rem; height: 7rem; border-radius: 50%; object-fit: cover; border: 3px solid white; box-shadow: 0 0 0 2px var(--blue); }
.profile-initial { display: grid; place-items: center; background: var(--blue); color: white; font-size: 2.5rem; font-weight: 800; }
.profile-logo { background: white; padding: .25rem; }
.eyebrow { color: #4b5b70; font-size: 0.85rem; font-weight: 800; letter-spacing: 0.08em; margin-bottom: 0.35rem; text-transform: uppercase; }
.profile-card h1 { margin-bottom: 0.25rem; }
.profile-coid { font-size: 1.1rem; margin-top: 0; }
.provider-links { display: grid; gap: .55rem; list-style: none; margin: .65rem 0 0; padding: 0; }
.provider-link { display: flex; align-items: center; gap: .8rem; width: 100%; max-width: 30rem; margin-inline: auto; border: 1px solid var(--border); border-radius: .65rem; padding: .75rem .9rem; color: var(--navy); text-align: left; text-decoration: none; }
.provider-link:hover { border-color: var(--blue); background: #eaf2ff; }
.provider-icon { width: 2rem; height: 2rem; flex: 0 0 2rem; }
.provider-address { color: #4b5b70; font-size: .875rem; font-weight: 400; overflow-wrap: anywhere; }
.page-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; margin-bottom: 1.5rem; }
.profile-card section { width: 100%; }
.profile-card section h2 { margin: 0 0 .5rem; }
.profile-qr { margin-top: -.35rem; }
.profile-qr img { display: block; max-width: 100%; height: auto; margin: .25rem auto; image-rendering: pixelated; }
.qr-enlarge { min-height: 0; margin: 0; padding: 0; border-radius: 0; background: transparent; color: inherit; }
.qr-enlarge:hover { background: transparent; }
.qr-hint { margin: .2rem 0 0; color: #4b5b70; font-size: .8rem; }
.qr-dialog { position: fixed; width: min(calc(100vw - 1rem), 36rem); max-width: none; margin: auto; border: 0; border-radius: .75rem; padding: .5rem; background: white; box-shadow: 0 1rem 3rem rgb(0 0 0 / 35%); }
.qr-dialog::backdrop { background: rgb(0 0 0 / 72%); }
.qr-dialog img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.qr-close { position: absolute; z-index: 1; top: .65rem; right: .65rem; display: grid; place-items: center; width: 2.75rem; min-height: 2.75rem; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: white; color: var(--navy); font-size: 1.7rem; line-height: 1; box-shadow: 0 .2rem .6rem rgb(0 0 0 / 20%); }
.qr-close:hover { background: #eaf2ff; }
.profile-actions { display: grid; gap: .6rem; justify-items: center; }
.hero { text-align: center; }
.hero > img { border-radius: 50%; }
.search-form > div { display: flex; gap: .5rem; }
.search-form input { flex: 1; }
.search-results { display: grid; gap: .75rem; list-style: none; padding: 0; }
.result-card a { display: flex; justify-content: space-between; gap: 1rem; border: 1px solid var(--border); border-radius: .65rem; padding: 1rem; text-decoration: none; }
.result-card span { color: #4b5b70; }
.invitation-card { display: grid; gap: .4rem; min-width: 0; overflow-wrap: anywhere; border: 1px solid var(--border); border-radius: .65rem; padding: 1rem; }
.invitation-revoke-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: .75rem; align-items: end; margin-top: .45rem; }
.invitation-revoke-form .field { min-width: 0; margin: 0; }
.pagination { display: flex; justify-content: space-between; gap: 1rem; }
.pagination { align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 1.25rem; }
.pagination .button { margin: 0; }
.featured-profile { margin-top: 1.5rem; }
.filter-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
.profile-details { display: grid; grid-template-columns: minmax(8rem, 1fr) 2fr; gap: .5rem 1rem; }
.profile-details dt { font-weight: 700; }
.profile-details dd { margin: 0; overflow-wrap: anywhere; }
.admin-destinations { display: grid; gap: .65rem; padding-left: 1.25rem; overflow-wrap: anywhere; }
.admin-history { display: grid; gap: .75rem; padding-left: 1.25rem; overflow-wrap: anywhere; }
@media (max-width: 420px) { .profile-details { grid-template-columns: 1fr; } .profile-details dd { margin-bottom: .5rem; } }
.search-filter-panel { margin-top: .55rem; }
.search-filter-panel > summary { color: var(--primary); cursor: pointer; font-weight: 800; list-style-position: inside; padding: .25rem 0; }
.search-filter-panel[open] > summary { margin-bottom: .4rem; }
.search-filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; border: 0; margin: 0; padding: 0; }
.search-filters legend { font-weight: 800; margin-bottom: .2rem; }
.filter-group { min-width: 0; border: 0; margin: 0; padding: 0; font-weight: 700; }
.search-results-heading { margin: .7rem 0 .45rem; }
.custom-select { position: relative; width: 100%; }
.custom-select summary { display: flex; align-items: center; justify-content: space-between; min-height: 2.75rem; border: 1px solid #7e8b9e; border-radius: .5rem; padding: .55rem .75rem; background: white; cursor: pointer; list-style: none; font-weight: 600; }
.custom-select summary::-webkit-details-marker { display: none; }
.custom-select summary::after { content: "▾"; margin-left: .5rem; }
.custom-select[open] summary::after { content: "▴"; }
.custom-options { position: absolute; z-index: 20; top: calc(100% + .25rem); left: 0; right: 0; display: grid; max-height: 16rem; overflow-y: auto; border: 1px solid #7e8b9e; border-radius: .5rem; background: white; box-shadow: 0 .5rem 1rem rgb(19 35 58 / 18%); }
.custom-options label { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0; padding: .65rem .75rem; font-weight: 500; cursor: pointer; }
.custom-options label:hover, .custom-options label:focus-within { background: #eaf2ff; }
.custom-options input[type="radio"] { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; opacity: 0; }
.custom-options label:has(input:checked) { background: #eaf2ff; color: var(--blue-dark); font-weight: 700; }
.custom-options label:has(input:checked)::after { content: "✓"; margin-left: .75rem; }
@media (max-width: 420px) { .search-form > div { display: grid; } .result-card a { display: grid; gap: .25rem; } }
@media (max-width: 620px) { .search-filters { grid-template-columns: 1fr; gap: .35rem; } }
@media (max-width: 620px) {
    body { font-size: .875rem; }
    .site-header { gap: .5rem; padding: .6rem .75rem; }
    .brand { font-size: 1rem; }
    .header-action { font-size: .82rem; }
    .header-actions { justify-content: flex-end; gap: .55rem; }
    .page { width: calc(100% - .75rem); margin-block: .5rem; }
    .card { border-radius: .7rem; padding: .8rem; box-shadow: 0 .25rem .75rem rgb(19 35 58 / 7%); }
    h1 { font-size: 1.35rem; line-height: 1.12; margin-bottom: .65rem; }
    h2 { font-size: 1.08rem; line-height: 1.2; }
    h3 { font-size: 1rem; }
    p { margin-block: .55rem; }
    .field { margin-block: .8rem; }
    label, .field-label { margin-bottom: .25rem; }
    input, select, button, .button, .custom-select summary { min-height: 44px; }
    input, select, textarea { padding: .5rem .6rem; }
    textarea { min-height: 6rem; }
    button, .button { padding: .55rem .75rem; }
    .help { font-size: .78rem; margin-block: .15rem .35rem; }
    .alert { margin: .65rem 0; padding: .6rem .7rem; font-size: .82rem; }
    .page-actions { gap: .45rem; margin-bottom: .8rem; font-size: .82rem; }
    .dashboard-actions { gap: .5rem; margin: .65rem 0; }
    .profile-card { gap: .55rem; padding: .75rem; }
    .profile-avatar { width: 4rem; height: 4rem; border-width: 2px; }
    .profile-initial { font-size: 1.65rem; }
    .profile-card h1 { font-size: 1.3rem; margin-bottom: .15rem; }
    .profile-card section h2 { font-size: 1.05rem; margin-bottom: .25rem; }
    .eyebrow { font-size: .64rem; letter-spacing: .065em; margin: .05rem 0 .15rem; }
    .profile-coid { font-size: .88rem; margin-bottom: .15rem; }
    .public-phone { font-size: .82rem; }
    .provider-links { gap: .3rem; margin-top: .25rem; }
    .provider-link { min-height: 44px; gap: .55rem; padding: .4rem .55rem; border-radius: .5rem; }
    .provider-icon { width: 1.35rem; height: 1.35rem; flex-basis: 1.35rem; }
    .provider-address { font-size: .7rem; line-height: 1.25; }
    .profile-qr { margin-top: 0; }
    .profile-qr img { width: 160px; height: 160px; }
    .qr-hint { font-size: .68rem; }
    .qr-dialog { width: calc(100vw - .5rem); padding: .25rem; }
    .qr-dialog img { width: 100%; height: auto; }
    .profile-actions { gap: .25rem; font-size: .78rem; line-height: 1.25; }
    .result-card a { padding: .65rem; }
    .invitation-card { padding: .65rem; }
    .invitation-revoke-form { grid-template-columns: 1fr; gap: .5rem; }
    .search-results { gap: .5rem; }
    .filter-actions { gap: .65rem; margin-top: .65rem; }
    .search-card h1 { margin-bottom: .45rem; }
    .search-card .search-form > label { margin-bottom: .2rem; }
    .search-card .search-form > div { gap: .4rem; }
    .search-filter-panel { margin-top: .35rem; }
    .search-filter-panel > summary { padding: .15rem 0; }
    .search-filter-panel[open] > summary { margin-bottom: .25rem; }
    .search-results-heading { margin: .5rem 0 .35rem; }
    .admin-history, .admin-destinations { gap: .45rem; padding-left: 1rem; }
    .claim-review { padding-block: .8rem; }
    .mfa-qr { width: min(100%, 190px); margin-block: .65rem; }
    .recovery-codes { gap: .35rem 1rem; }
}
.choice { display: flex; align-items: flex-start; gap: .55rem; font-weight: 500; }
.choice input[type="checkbox"] { width: auto; min-height: 0; margin-top: .2rem; accent-color: var(--blue); }
.dashboard-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 1rem 0; }
.dashboard-link-list { margin: 1rem 0; padding-left: 1.25rem; }
.dashboard-link-list li { margin: .55rem 0; }
.inline-link-form { display: inline; margin: 0; }
.link-button { display: inline; min-height: 0; border: 0; border-radius: 0; background: transparent; color: var(--blue); padding: 0; font: inherit; font-weight: 400; text-decoration: underline; cursor: pointer; }
.link-button:hover { background: transparent; color: var(--blue-dark); }
.admin-menu-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(15rem,1fr)); gap: 1rem; margin-top: 1rem; }
.admin-menu-group { border: 1px solid var(--border); border-radius: .65rem; padding: 1rem; }
.admin-menu-group h2 { margin-top: 0; font-size: 1.05rem; }
.admin-menu-group ul { margin: 0; padding-left: 1.15rem; }
.admin-menu-group li + li { margin-top: .55rem; }
.contact-search { display: grid; grid-template-columns: minmax(15rem,2fr) minmax(10rem,1fr); gap: .75rem; align-items: end; margin-bottom: 1rem; }
.contact-search .filter-actions { grid-column: 1 / -1; }
.public-phone { margin: .35rem 0 0; }
.claim-review { border-top: 1px solid var(--border); padding-block: 1.25rem; }
.claim-review:first-of-type { border-top: 0; }
.button-danger { background: var(--error); }
.button-danger:hover { background: #741616; }
.mfa-qr { display: block; width: min(100%, 240px); height: auto; margin: 1rem auto; }
.recovery-codes { display: grid; grid-template-columns: repeat(2,1fr); gap: .5rem 2rem; }
.site-footer { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem 1rem; padding: 1rem; color: #53647a; font-size: .8rem; }
.legal-page { max-width: 52rem; margin-inline: auto; }
.legal-page h2 { margin-top: 1.25rem; }
.legal-acceptance { margin: 1rem 0; }
.identifier-notice { border-top: 1px solid var(--border); margin-top: .75rem; padding-top: .65rem; color: #53647a; font-size: .75rem; line-height: 1.35; }
.about-page { text-align: left; }
.about-page .about-logo { display: block; margin: 0 auto .75rem; }
.about-page > h1, .about-page > .lead { text-align: center; }
.about-page .lead { color: #42536a; font-size: 1.1rem; }
.account-delete-link { margin-top: 1.25rem; font-size: .82rem; }
.account-delete-link a { color: var(--error); }
.danger-zone { border-color: #d9a5a5; }

/* Keep these compact overrides last so later component defaults cannot enlarge mobile pages. */
@media (max-width: 620px) {
    .choice { gap: .4rem; font-size: .82rem; }
    .dashboard-actions { gap: .5rem; margin: .65rem 0; }
    .contact-search { grid-template-columns: 1fr; }
    .public-phone { margin-top: .2rem; }
    .claim-review { padding-block: .8rem; }
    .mfa-qr { width: min(100%, 190px); margin-block: .65rem; }
    .recovery-codes { gap: .35rem 1rem; }
}
