:root {
    color-scheme: light;
    --bni-red: #cf2030;
    --bni-red-dark: #a51524;
    --anthracite: #26272a;
    --ink: #202124;
    --muted: #667085;
    --paper: #ffffff;
    --canvas: #f5f5f4;
    --soft: #f8f8f7;
    --border: #dedede;
    --success: #19724b;
    --success-bg: #eaf7f0;
    --danger: #b42318;
    --danger-bg: #fef0ee;
    --shadow: 0 14px 40px rgb(28 29 31 / 8%);
    font-family: Arial, Helvetica, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
.shell { width: min(1480px, calc(100% - 3rem)); margin-inline: auto; }

.topbar { min-height: 34px; color: #d9d9da; background: #1f2022; font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; }
.topbar-inner { display: flex; justify-content: flex-end; align-items: center; gap: 1.5rem; min-height: 34px; }
.topbar strong { color: white; }
.main-header { background: white; border-bottom: 1px solid #e8e8e8; }
.header-inner { display: flex; justify-content: space-between; align-items: stretch; min-height: 104px; }
.wordmark { position: relative; display: grid; align-content: center; color: var(--ink); text-decoration: none; }
.wordmark::before { position: absolute; left: -1rem; top: 24px; bottom: 24px; width: 5px; content: ""; background: var(--bni-red); }
.wordmark-main { color: var(--bni-red); font-size: 1.75rem; font-weight: 900; letter-spacing: -.055em; }
.wordmark-sub { align-self: end; padding-bottom: .2rem; color: var(--anthracite); font-size: .83rem; font-weight: 900; letter-spacing: .18em; }
.wordmark-tagline { color: #707174; font-size: .72rem; letter-spacing: .045em; }
.header-navigation { display: flex; align-items: stretch; gap: 1.4rem; }
nav { display: flex; align-items: stretch; }
nav a, .nav-disabled { position: relative; display: flex; align-items: center; padding: 0 1.15rem; color: #38393c; font-size: .88rem; font-weight: 700; text-decoration: none; }
nav a:hover { color: var(--bni-red); }
nav a.active::after { position: absolute; right: 1.15rem; bottom: 0; left: 1.15rem; height: 4px; content: ""; background: var(--bni-red); }
.nav-disabled { color: #aaa; cursor: not-allowed; }
.nav-disabled small { margin-left: .4rem; padding: .18rem .35rem; border-radius: 3px; background: #efefef; font-size: .57rem; text-transform: uppercase; }
.account-actions { display: flex; align-items: center; gap: .5rem; padding-left: 1rem; border-left: 1px solid #ececec; }
.account-user { max-width: 220px; color: var(--anthracite); font-size: .78rem; font-weight: 800; }
.account-menu { position: relative; }
.account-menu-trigger { display: inline-flex; align-items: center; gap: .35rem; min-height: 38px; padding: .45rem .55rem; border-color: transparent; color: var(--anthracite); background: transparent; font-size: .78rem; line-height: 1.3; }
.account-menu-trigger:hover, .account-menu-trigger[aria-expanded="true"] { color: var(--bni-red-dark); border-color: #ddd; background: #f7f7f7; }
.account-menu-trigger span { font-size: .56rem; }
.account-dropdown { position: absolute; top: calc(100% + .25rem); right: 0; z-index: 20; min-width: 190px; padding: .35rem; border: 1px solid #ddd; border-radius: 3px; background: white; box-shadow: 0 12px 30px rgb(20 20 22 / 18%); font-family: inherit; font-size: .78rem; font-weight: 800; line-height: 1.3; }
.account-dropdown[hidden] { display: none; }
.account-dropdown button, .account-dropdown a { width: 100%; min-height: 42px; padding: .6rem .75rem; border: 0; color: var(--anthracite); background: white; font: inherit; line-height: inherit; text-align: left; }
.account-dropdown button:hover, .account-dropdown button:focus-visible { color: var(--bni-red-dark); background: #fff1f2; }
.header-button, .account-admin { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: .55rem .85rem; border: 1px solid var(--bni-red); border-radius: 3px; color: white; background: var(--bni-red); font-size: .76rem; font-weight: 800; text-decoration: none; }
.header-button:hover { color: white; border-color: var(--bni-red-dark); background: var(--bni-red-dark); }
.header-button.secondary { color: #38393c; border-color: #aaa; background: white; }
.button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: .6rem 1rem; border: 1px solid var(--bni-red); border-radius: 3px; color: white; background: var(--bni-red); font-weight: 800; text-decoration: none; }
.button-link:hover, .button-link:focus-visible { color: white; background: var(--bni-red-dark); }
.representation-access-hint { display: grid; justify-items: start; gap: .8rem; }
.representation-access-hint p { margin: 0; }
.account-admin { color: var(--bni-red-dark); border-color: transparent; background: transparent; }

.page-hero { position: relative; overflow: hidden; padding: 3.4rem 0 5.2rem; color: white; background: linear-gradient(112deg, #27282b 0%, #35363a 65%, #4a252b 100%); }
.page-hero::after { position: absolute; top: -90px; right: 5%; width: 330px; height: 330px; border: 55px solid rgb(207 32 48 / 22%); border-radius: 50%; content: ""; }
.page-hero h1 { position: relative; z-index: 1; margin: .35rem 0 .65rem; font-size: clamp(2.1rem, 4.5vw, 4.15rem); line-height: 1; letter-spacing: -.045em; }
.page-hero p:not(.eyebrow) { position: relative; z-index: 1; max-width: 680px; margin: 0; color: #e5e5e6; font-size: 1.05rem; line-height: 1.55; }
.eyebrow, .section-kicker { margin: 0; color: #ee9ca5; font-size: .7rem; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }

.content { position: relative; z-index: 2; margin-top: -2rem; padding-bottom: 4rem; }
.no-hero-content { margin-top: 0; padding-top: 1.5rem; }
.page-intro-title { margin: 0 0 .75rem; color: var(--anthracite); font-family: inherit; font-size: clamp(1rem, 2vw, 1.25rem); font-weight: 700; line-height: 1.25; letter-spacing: 0; }
.page-meta { margin: -.15rem 0 .9rem; color: var(--muted); font-family: inherit; font-size: .82rem; line-height: 1.45; overflow-wrap: anywhere; }
.panel, .table-panel { border: 1px solid var(--border); border-radius: 4px; background: var(--paper); box-shadow: var(--shadow); }
.panel { padding: 1.5rem; }
.source-panel { display: grid; grid-template-columns: minmax(250px, .65fr) minmax(420px, 1.35fr); gap: 1.5rem 3rem; align-items: end; border-top: 5px solid var(--bni-red); }
.admin-local-heading { border-top: 5px solid var(--bni-red); }
.admin-local-heading .message { margin-top: .8rem; }
.admin-update-panel { margin-top: 1.5rem; }
.representation-content { display: grid; gap: 1rem; }
.representation-dates, .representation-filters { border-top: 5px solid var(--bni-red); }
.date-add-row { display: flex; flex-wrap: wrap; align-items: end; gap: .8rem; margin-top: 1rem; }
.date-add-row .cross-date-picker { flex: 0 1 360px; }
.all-dates-option { display: flex; grid-auto-flow: column; align-items: center; min-height: 42px; padding: .55rem .8rem; border: 1px solid var(--border); border-radius: 3px; background: var(--soft); }
.all-dates-option input { width: 18px; height: 18px; }
.date-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.date-chip { display: inline-flex; align-items: center; gap: .55rem; padding: .4rem .45rem .4rem .7rem; border: 1px solid #e4a4aa; border-radius: 999px; color: var(--bni-red-dark); background: #fff5f6; font-size: .76rem; font-weight: 800; }
.date-chip.disabled { color: #888; border-color: #ccc; background: #eee; opacity: .72; }
.date-chip button { min-width: 28px; min-height: 28px; padding: 0; border-radius: 50%; }
.date-chip button:disabled { color: #888; border-color: #bbb; background: #ddd; }
.cross-date-picker { position: relative; display: grid; gap: .4rem; width: min(100%, 360px); margin-top: 1rem; }
.cross-date-picker > label { font-weight: 700; }
.cross-date-picker-input { display: grid; grid-template-columns: minmax(0, 1fr) 44px; }
.cross-date-picker-input input { min-width: 0; height: 44px; border-radius: 3px 0 0 3px; }
.cross-date-picker-trigger { width: 44px; min-width: 44px; height: 44px; padding: 0; border-left: 0; border-radius: 0 3px 3px 0; font-size: 1.15rem; }
.cross-date-picker input[aria-invalid="true"] { border-color: #b00020; box-shadow: 0 0 0 1px #b00020; }
.cross-date-picker .field-error { margin: 0; color: #b00020; font-size: .78rem; font-weight: 700; }
.cross-date-picker-calendar { box-sizing: border-box; position: absolute; z-index: 30; top: 100%; left: 0; width: min(360px, 100%); padding: .75rem; border: 1px solid #d4d4d4; border-top: 3px solid var(--bni-red); border-radius: 4px; background: #fff; box-shadow: 0 12px 32px rgb(0 0 0 / 20%); }
.cross-date-picker-nav { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; gap: .5rem; margin-bottom: .5rem; text-align: center; }
.cross-date-picker-nav button { min-width: 42px; min-height: 42px; padding: .35rem; }
.cross-date-picker-calendar table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: .2rem; }
.cross-date-picker-calendar th { padding: .35rem .1rem; border: 0; color: #666; font-size: .72rem; text-align: center; }
.cross-date-picker-calendar td { height: 40px; padding: 0; border: 0; text-align: center; }
.cross-date-picker-calendar td button { width: 100%; min-width: 36px; min-height: 38px; padding: .3rem; border-radius: 3px; }
.cross-date-picker-calendar td button:disabled { cursor: not-allowed; color: #aaa; border-color: transparent; background: #f2f2f2; opacity: .75; }
.cross-date-picker-calendar td button:not(:disabled) { background: var(--bni-red); color: #fff; }
.cross-date-picker-calendar td button:not(:disabled):hover { background: var(--bni-red-dark); }
.cross-date-picker-calendar td button:focus-visible, .cross-date-picker-nav button:focus-visible, .cross-date-picker-trigger:focus-visible { outline: 3px solid #111; outline-offset: 2px; }
.representation-filter-grid { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)) auto; gap: .8rem; align-items: end; margin-top: 1rem; }
.radius-input { display: flex; align-items: center; gap: .4rem; }
.radius-input input { min-width: 0; }
.representation-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.representation-actions strong { margin-left: auto; color: var(--muted); font-size: .78rem; }
.representation-login-hint { padding: .8rem 1rem; border-left: 4px solid var(--bni-red); background: #fff3f4; font-weight: 700; }
.representation-save-panel, .representation-own-panel { margin-top: 1.5rem; }
.representation-save-panel h2, .representation-own-panel h2 { margin-top: 0; }
.representation-offer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.representation-offer-card { display: grid; align-content: start; gap: .8rem; padding: 1rem; border: 1px solid var(--border); border-top: 4px solid var(--bni-red); background: white; }
.representation-offer-card h3 { margin: 0; font-size: 1rem; }
.representation-offer-card button { justify-self: start; }
.representation-offer-dates { display: flex; flex-wrap: wrap; gap: .4rem; }
.offer-meta { margin: 0; color: var(--muted); font-size: .75rem; }
.home-chapter-row { background: #f4f4f4; }
.home-chapter-badge { display: inline-block; padding: .15rem .35rem; border-radius: 2px; color: white; background: var(--anthracite); font-size: .6rem; white-space: nowrap; }
.verified-badge { display: inline-block; width: fit-content; padding: .15rem .4rem; border-radius: 2px; color: #fff; background: #247a43; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.delete-representation-summary { display: grid; gap: .65rem; margin: 1rem 0; padding: .8rem; background: var(--surface); border-left: 3px solid var(--bni-red); }
.representation-list-panel { overflow: hidden; }
.representation-list-panel td:nth-child(2) { min-width: 180px; font-weight: 800; }
.empty-database { display: grid; gap: .65rem; margin-bottom: 1rem; border-left: 5px solid var(--bni-red); }
.empty-database[hidden] { display: none; }
.empty-database a { width: max-content; color: var(--bni-red-dark); font-size: .82rem; font-weight: 800; }
h2 { margin: 0 0 .4rem; font-size: 1.15rem; letter-spacing: -.015em; }
.panel p { margin: 0; color: var(--muted); line-height: 1.5; }
label { display: grid; gap: .42rem; color: #3c3d40; font-size: .76rem; font-weight: 800; letter-spacing: .025em; }
.input-row { display: flex; gap: .65rem; }
input, select, button { min-height: 42px; border-radius: 3px; font: inherit; }
input, select { width: 100%; padding: .65rem .75rem; border: 1px solid #c9c9c9; color: var(--ink); background: white; }
input:hover, select:hover { border-color: #999; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgb(207 32 48 / 25%); outline-offset: 2px; }
button { padding: .65rem 1.1rem; border: 1px solid var(--bni-red); color: white; background: var(--bni-red); font-weight: 800; cursor: pointer; }
button:hover { border-color: var(--bni-red-dark); background: var(--bni-red-dark); }
button:disabled { cursor: wait; opacity: .55; }
button.secondary { border-color: #a9aaac; color: #343538; background: white; }
button.secondary:hover { border-color: #68696b; background: #f2f2f2; }
.message { grid-column: 1 / -1; min-height: 1.25rem; font-size: .88rem; font-weight: 700; }
.message.error { color: var(--danger); }
.message.success { color: var(--success); }

.results { margin-top: 1rem; }
.stats { display: grid; grid-template-columns: repeat(8, minmax(105px, 1fr)); gap: .65rem; margin-bottom: 1rem; }
.stat { position: relative; min-height: 92px; padding: 1rem; border: 1px solid var(--border); border-radius: 3px; background: white; box-shadow: 0 6px 22px rgb(28 29 31 / 5%); }
.stat::after { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; content: ""; background: #d5d5d5; }
.stat-primary::after { background: var(--bni-red); }
.stat strong { display: block; color: var(--anthracite); font-size: 1.75rem; line-height: 1; }
.stat span { display: block; margin-top: .65rem; color: var(--muted); font-size: .68rem; font-weight: 700; text-transform: uppercase; }

.controls { margin-bottom: 1rem; }
.section-heading, .list-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.section-heading { margin-bottom: 1.1rem; }
.section-kicker { margin-bottom: .3rem; color: var(--bni-red); }
.section-heading h2, .list-heading h2 { margin-bottom: 0; }
#selection-count { padding: .4rem .7rem; border-radius: 999px; color: #4d4e51; background: #efefef; font-size: .78rem; font-weight: 700; }
.filter-grid { display: grid; grid-template-columns: .65fr .75fr .85fr 1.75fr; gap: .8rem; }
.reload-option { display: flex; grid-template-columns: auto 1fr; justify-content: start; align-items: center; width: max-content; max-width: 100%; margin-top: 1rem; font-weight: 600; letter-spacing: 0; }
.reload-option input, td input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--bni-red); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #ececec; }
.progress { min-height: 1.3rem; margin-top: .75rem; color: var(--muted); font-size: .82rem; font-weight: 700; }
.batch-panel { margin-bottom: 1rem; border-top: 5px solid var(--bni-red); }
.batch-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; margin-bottom: 1.2rem; }
.batch-stats > div { padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 3px; background: var(--soft); }
.batch-stats strong { display: block; font-size: 1.35rem; }
.batch-stats span { display: block; margin-top: .35rem; color: var(--muted); font-size: .68rem; font-weight: 700; text-transform: uppercase; }
.batch-controls { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; }
.batch-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.batch-progress { min-height: 1.3rem; margin-top: 1rem; color: var(--muted); font-size: .82rem; font-weight: 700; }
.batch-panel .message { margin-top: .35rem; }
.batch-rate-hint { margin-top: .8rem !important; padding-top: .75rem; border-top: 1px solid #ececec; font-size: .72rem; }
.automation-panel { margin-top: 1rem; border-top: 1px solid #dedede; }
.automation-panel summary { padding: 1rem 0 0; color: var(--bni-red-dark); font-size: .86rem; font-weight: 800; cursor: pointer; }
.automation-content { display: grid; gap: 1.2rem; margin-top: 1rem; }
#automation-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.automation-daily-limit { grid-column: 1 / -1; }
.automation-daily-limit input { width: min(180px, 100%); margin-top: .45rem; }
.automation-setting { display: grid; align-content: start; gap: .9rem; padding: 1rem; border: 1px solid var(--border); border-radius: 3px; background: var(--soft); }
.automation-setting h3, .automation-statistics h3 { margin: 0 0 .35rem; font-size: .95rem; }
.automation-setting p { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.5; }
.switch-label { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: .65rem; cursor: pointer; }
.switch-label input { position: relative; flex: 0 0 auto; width: 44px; min-height: 24px; margin: 0; border: 0; border-radius: 999px; background: #aaa; appearance: none; cursor: pointer; }
.switch-label input::after { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; content: ""; transition: transform .15s ease; }
.switch-label input:checked { background: var(--bni-red); }
.switch-label input:checked::after { transform: translateX(20px); }
.days-input { display: flex; align-items: center; gap: .45rem; font-weight: 500; }
.days-input input { width: 90px; }
.automation-hint { padding-top: .65rem; border-top: 1px solid #ddd; }
#save-automation { justify-self: start; }
#automation-form > .message { align-self: center; }
.automation-statistics { padding-top: 1rem; border-top: 1px solid var(--border); }
.automation-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; margin-top: .9rem; }
.automation-stats > div { display: grid; gap: .3rem; padding: .75rem; border: 1px solid var(--border); border-radius: 3px; background: white; }
.automation-stats span { color: var(--muted); font-size: .65rem; font-weight: 700; text-transform: uppercase; }
.automation-stats strong { font-size: .85rem; }
.daily-limit-warning { grid-column: 1 / -1; margin: 0; padding: .7rem; border-left: 4px solid var(--bni-red); color: var(--bni-red-dark); background: #fff1f2; font-weight: 800; }

.table-panel { overflow: hidden; }
.list-heading { padding: 1.3rem 1.5rem 1.1rem; border-bottom: 1px solid var(--border); }
.visible-count { margin: 0; color: var(--muted); font-size: .8rem; }
.table-scroll { max-height: 70vh; overflow: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: white; }
th { position: sticky; top: 0; z-index: 2; padding: .72rem .65rem; border-bottom: 1px solid #111; color: white; background: var(--anthracite); font-size: .66rem; text-align: left; letter-spacing: .055em; text-transform: uppercase; white-space: nowrap; }
.sort-button { display: inline-flex; align-items: center; justify-content: space-between; width: 100%; min-height: 30px; margin: -.35rem -.4rem; padding: .35rem .4rem; border: 0; color: inherit; background: transparent; font: inherit; letter-spacing: inherit; text-align: left; text-transform: inherit; white-space: nowrap; }
.sort-button:hover { color: white; background: rgb(255 255 255 / 12%); }
.sort-button:focus-visible { outline-color: rgb(255 255 255 / 75%); }
.sort-indicator { min-width: 1em; margin-left: .35rem; color: #fff; }
th[aria-sort="ascending"], th[aria-sort="descending"] { background: #161719; }
td { padding: .68rem .65rem; border-bottom: 1px solid #e9e9e9; font-size: .8rem; vertical-align: middle; }
tr.organization { transition: background .15s ease; }
tr.organization:hover { background: #faf7f7; }
.select-column { width: 42px; text-align: center; }
.toggle-column { width: 38px; text-align: center; }
.chapter-name { min-width: 165px; font-weight: 800; }
.numeric { color: var(--muted); font-variant-numeric: tabular-nums; }
.updated-at { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.row-toggle { width: 30px; min-height: 30px; padding: 0; border: 1px solid transparent; border-radius: 50%; color: var(--bni-red); background: transparent; font-size: .7rem; line-height: 1; }
.row-toggle:hover { border-color: #efc4c9; color: var(--bni-red-dark); background: #fff1f3; }
.status-badge { display: inline-flex; align-items: center; min-height: 24px; padding: .25rem .5rem; border-radius: 999px; color: #555; background: #efefef; font-size: .67rem; font-weight: 800; white-space: nowrap; }
.status-loaded { color: var(--success); background: var(--success-bg); }
.status-error { color: var(--danger); background: var(--danger-bg); }
.status-loading { color: #7a5800; background: #fff4d5; }

.detail-row td { padding: 0; border-bottom: 2px solid #d9d9d9; background: #f2f2f2; }
.detail-panel { padding: 1.25rem 1.5rem 1.5rem 5rem; border-left: 4px solid var(--bni-red); }
.detail-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.detail-group { min-width: 0; padding: 1rem; border: 1px solid #ddd; border-radius: 3px; background: white; }
.detail-group h3 { margin: 0 0 .8rem; padding-bottom: .55rem; border-bottom: 2px solid var(--bni-red); color: var(--anthracite); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.detail-group dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1rem; margin: 0; }
.detail-group dl div { min-width: 0; }
.detail-group dt { color: #77787a; font-size: .62rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.detail-group dd { margin: .2rem 0 0; color: #28292c; font-size: .8rem; line-height: 1.4; overflow-wrap: anywhere; }
.detail-group a { color: var(--bni-red-dark); font-weight: 800; text-decoration: none; }
.detail-group a:hover { text-decoration: underline; }
.description-group { margin-top: .85rem; }
.description-group dl { grid-template-columns: 1fr; }
.description-group dd { max-width: 1050px; line-height: 1.6; }
.empty-detail { padding: 1.25rem; border: 1px dashed #c3c3c3; border-radius: 3px; background: white; }
.empty-detail strong { display: block; color: #343538; }
.empty-detail p { margin: .35rem 0 0; color: var(--muted); font-size: .82rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Public CrossChAPP search */
.search-hero { overflow: hidden; color: white; background: linear-gradient(115deg, #242528 0%, #343539 68%, #5d222b 100%); }
.search-hero-inner { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 300px; padding-block: 3rem 4.5rem; }
.search-hero h1 { margin: .3rem 0 .55rem; font-size: clamp(3.4rem, 8vw, 6.7rem); line-height: .9; letter-spacing: -.065em; }
.search-hero p:not(.eyebrow) { margin: 0; color: #ededee; font-size: 1.12rem; }
.search-accent { position: absolute; right: 2%; color: rgb(207 32 48 / 22%); font-size: 20rem; font-weight: 900; line-height: 1; transform: rotate(-8deg); user-select: none; }
.public-content { position: relative; z-index: 2; margin-top: -2.2rem; padding-bottom: 5rem; }
.content.no-hero-content, .public-content.no-hero-content { margin-top: 0; padding-top: 1.5rem; }
.search-panel { padding: 2rem; border-top: 5px solid var(--bni-red); border-radius: 4px; background: white; box-shadow: var(--shadow); }
.search-panel-heading { margin-bottom: 1.4rem; }
.search-panel-heading h2 { margin-top: .35rem; font-size: 1.6rem; }
#chapter-search-form { display: grid; gap: 1.3rem; }
.location-field { font-size: .78rem; text-transform: uppercase; }
.location-field input { min-height: 58px; padding: .8rem 1rem; border-width: 2px; font-size: 1.15rem; text-transform: none; }
.field-examples { color: var(--muted); font-size: .68rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
.choice-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.choice-group legend { margin-bottom: .65rem; color: #3c3d40; font-size: .76rem; font-weight: 800; letter-spacing: .025em; }
.choice-group legend span { margin-left: .35rem; color: var(--muted); font-size: .65rem; font-weight: 500; }
.choice-group > p { margin: .5rem 0 0; color: var(--muted); font-size: .69rem; }
.day-options { display: grid; grid-template-columns: repeat(7, 1fr); gap: .45rem; }
.day-options label, .segmented-options label { display: block; cursor: pointer; }
.day-options input, .segmented-options input { position: absolute; width: 1px; min-height: 1px; opacity: 0; }
.day-options span, .segmented-options span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: .55rem; border: 1px solid #bbb; border-radius: 3px; color: #444; background: white; font-size: .74rem; font-weight: 700; }
.day-options input:checked + span, .segmented-options input:checked + span { color: white; border-color: var(--bni-red); background: var(--bni-red); }
.day-options input:focus-visible + span, .segmented-options input:focus-visible + span { outline: 3px solid rgb(207 32 48 / 25%); outline-offset: 2px; }
.search-options-row { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(320px, .8fr); gap: 1.2rem; align-items: end; }
.segmented-options { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 440px; }
.segmented-options label + label span { border-left: 0; }
.sort-field { align-self: start; }
.search-selects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.result-limit-options, .batch-size-options { display: flex; flex-wrap: wrap; }
.result-limit-options button, .batch-size-options button { min-width: 42px; min-height: 42px; padding: .5rem .7rem; border-color: var(--bni-red); border-radius: 0; color: var(--bni-red-dark); background: white; font-size: .76rem; }
.result-limit-options button:first-child, .batch-size-options button:first-child { border-radius: 3px 0 0 3px; }
.result-limit-options button:last-child, .batch-size-options button:last-child { border-radius: 0 3px 3px 0; }
.result-limit-options button + button, .batch-size-options button + button { margin-left: -1px; }
.result-limit-options button:hover, .batch-size-options button:hover { position: relative; z-index: 1; color: white; border-color: var(--bni-red-dark); background: var(--bni-red-dark); }
.result-limit-options button[aria-pressed="true"], .batch-size-options button[aria-pressed="true"] { position: relative; z-index: 2; color: white; border-color: var(--bni-red); background: var(--bni-red); }
.search-submit { min-height: 52px; justify-self: start; padding-inline: 2.1rem; font-size: .95rem; }
.data-basis { margin: 1.3rem 0 0; padding-top: 1rem; border-top: 1px solid #eee; color: var(--muted); font-size: .74rem; }
.search-panel .message { margin-top: .65rem; }
.search-results { margin-top: 1.2rem; }
.results-summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.35rem 1.5rem; border-left: 5px solid var(--bni-red); background: white; box-shadow: 0 6px 22px rgb(28 29 31 / 5%); }
.results-summary h2 { margin-top: .25rem; }
.results-summary p:last-child { margin: 0; color: var(--muted); font-size: .82rem; }
.results-summary button { flex: 0 0 auto; }
.results-map-panel { margin-top: .85rem; padding: .6rem; border: 1px solid var(--border); border-radius: 4px; background: white; box-shadow: 0 7px 24px rgb(28 29 31 / 5%); }
.results-map-panel[hidden] { display: none; }
#results-map { width: 100%; height: clamp(400px, 45vh, 500px); border-radius: 3px; }
.result-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; margin-top: .85rem; }
.result-card { padding: 1.25rem; border: 1px solid var(--border); border-radius: 4px; background: white; box-shadow: 0 7px 24px rgb(28 29 31 / 5%); }
.result-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-bottom: .9rem; border-bottom: 2px solid #eee; }
.result-card h3 { margin: 0; color: var(--anthracite); font-size: 1.05rem; }
.distance { flex: 0 0 auto; color: var(--bni-red); font-size: 1.05rem; }
.result-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin: 1rem 0 0; }
.result-facts div { min-width: 0; }
.result-facts dt { color: var(--muted); font-size: .6rem; font-weight: 800; text-transform: uppercase; }
.result-facts dd { margin: .2rem 0 0; font-size: .8rem; overflow-wrap: anywhere; }
.result-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #eee; }
.result-detail-toggle { min-height: 38px; font-size: .72rem; }
.result-refresh-status { min-height: 1rem; margin: .55rem 0 0; color: var(--muted); font-size: .68rem; font-weight: 700; }
.result-detail-panel { margin: 1rem -1.25rem -1.25rem; padding: 1rem 1.25rem 1.25rem; border-top: 1px solid #dedede; background: #f2f2f2; }
.result-detail-panel[hidden] { display: none; }
.result-detail-panel .detail-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chapter-popup p { margin: .45rem 0 .65rem; }
.chapter-popup button { min-height: 32px; padding: .35rem .55rem; font-size: .7rem; }
.result-link { display: inline-flex; min-height: 38px; align-items: center; padding: .5rem .75rem; border: 1px solid var(--bni-red); border-radius: 3px; font-size: .72rem; font-weight: 800; text-decoration: none; }
.result-link.primary { color: white; background: var(--bni-red); }
.result-link.secondary { color: var(--bni-red-dark); background: white; }

/* Authentication */
.auth-content { max-width: 580px; }
.login-panel { border-top: 5px solid var(--bni-red); }
.login-panel h2 { margin-top: .35rem; font-size: 1.55rem; }
#login-form, #register-form, #forgot-password-form, #reset-password-form { display: grid; gap: 1rem; margin-top: 1.2rem; }
#login-form button, #register-form > button, #forgot-password-form button, #reset-password-form button { justify-self: start; min-width: 130px; }
.login-panel .message { margin-top: .8rem; }
.auth-links { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.auth-links a, .login-panel > a:not(.header-button) { color: var(--bni-red-dark); font-size: .78rem; font-weight: 800; }
.registration-panel { max-width: 920px; }
.auth-name-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 1rem; }
#register-form .auth-name-row label { min-width: 0; align-content: start; }
#register-form .auth-name-row input { width: 100%; height: 42px; min-height: 42px; box-sizing: border-box; }
.account-dialog { width: min(680px, calc(100% - 2rem)); max-width: none; padding: 0; border: 0; border-radius: 4px; background: transparent; }
.account-dialog::backdrop { background: rgb(20 21 23 / 58%); }
.account-dialog-card { position: relative; padding: 1.5rem; border-top: 5px solid var(--bni-red); border-radius: 4px; background: white; box-shadow: 0 20px 60px rgb(0 0 0 / 30%); }
.account-dialog-card h2 { margin: 0 2.5rem 1.2rem 0; font-size: 1.55rem; }
.dialog-close { position: absolute; top: .7rem; right: .7rem; width: 36px; min-height: 36px; padding: 0; border-color: transparent; color: var(--anthracite); background: transparent; font-size: 1.4rem; }
.dialog-close:hover { color: white; }
#change-password-form { display: grid; gap: 1rem; }
.password-change-fields label { min-width: 0; align-content: start; }
.password-change-fields input { width: 100%; height: 42px; min-height: 42px; box-sizing: border-box; }
.password-change-success { margin: .25rem 2.5rem .25rem 0; color: var(--success); font-size: 1.05rem; font-weight: 800; }
.account-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 0 0 1.25rem; }
.account-details div { min-width: 0; padding: .8rem; border: 1px solid var(--border); background: #fafafa; }
.account-details dt { margin-bottom: .25rem; color: var(--muted); font-size: .7rem; font-weight: 800; }
.account-details dd { overflow-wrap: anywhere; margin: 0; font-weight: 800; }
button.danger { border-color: var(--bni-red-dark); color: white; background: var(--bni-red-dark); }
button.danger:hover { border-color: #8f101d; background: #8f101d; }
.registration-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.registration-confirmation { color: var(--anthracite) !important; font-size: 1.05rem; font-weight: 800; }
.verification-panel { display: grid; justify-items: start; gap: 1rem; }
.verification-success { color: var(--success) !important; font-weight: 800; }
.verification-error { color: var(--danger) !important; font-weight: 800; }
.registration-panel input.field-invalid { border-color: var(--bni-red); box-shadow: 0 0 0 1px var(--bni-red); }
.field-error { color: var(--bni-red-dark); font-size: .7rem; font-weight: 700; }
.field-error[hidden] { display: none; }
.chapter-picker { display: grid; gap: .8rem; padding: 1rem; border: 1px solid var(--border); }
.chapter-picker legend span { color: var(--muted); font-size: .7rem; }
.chapter-picker-filters { display: grid; grid-template-columns: .7fr 1.3fr 1fr; gap: .65rem; }
.chapter-picker-selected { margin: 0; }
.chapter-picker-guidance { margin: 0; color: var(--muted); font-size: .75rem; }
.chapter-picker-list { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-flow: row; max-height: 330px; overflow: auto; border: 1px solid var(--border); }
.chapter-picker-list[hidden] { display: none; }
.chapter-picker-item { box-sizing: border-box; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; width: 100%; min-width: 0; padding: .65rem; border-bottom: 1px solid #eee; cursor: pointer; }
.chapter-picker-item input { width: 18px; height: 18px; }
.chapter-picker-copy { display: grid; min-width: 0; gap: .2rem; }
.chapter-picker-copy strong, .chapter-picker-meta { display: block; overflow-wrap: anywhere; }
.chapter-picker-meta { color: var(--muted); font-weight: 400; }
.misc-panel { margin-top: 1.5rem; }
.misc-panel > summary { color: var(--bni-red-dark); font-weight: 800; cursor: pointer; }
.misc-content { display: grid; gap: 2rem; margin-top: 1.2rem; }
.misc-content section + section { padding-top: 1.4rem; border-top: 1px solid var(--border); }
.mail-settings-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-top: 1rem; }
.mail-settings-grid button { align-self: end; }
.test-mail-row { display: flex; align-items: end; gap: .8rem; margin-top: 1rem; }
#email-templates-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
#email-templates-form fieldset { display: grid; gap: .7rem; }
#email-templates-form textarea { resize: vertical; }
#email-templates-form p { font-size: .7rem; overflow-wrap: anywhere; }
#email-templates-form .email-template-actions { grid-column: 1 / -1; display: flex; justify-content: flex-start; }
#email-templates-form .email-template-actions button { width: auto; justify-self: start; }
.invitation-form { display: grid; gap: 1rem; max-width: 920px; }
.invitation-form > button { width: fit-content; }
.invitation-account-data { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; }
.invitation-account-data dt { font-weight: 800; }
.invitation-account-data dd { margin: 0; }
.users-filter-grid { display: grid; grid-template-columns: 2fr repeat(3, minmax(130px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
#admin-users-table td:nth-child(2) { font-weight: 800; }
#admin-users-table .users-number { text-align: center; }
.users-select-column, .users-select-cell { width: 42px; text-align: center; }
.users-select-cell input { width: 18px; height: 18px; }
#admin-users-table tr.is-selected { background: #fff1f2; }
.users-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .65rem; margin-top: 1rem; }
.users-actions p { flex-basis: 100%; margin: 0; color: var(--muted); text-align: center; font-size: .72rem; }
.mail-preview-fixed { white-space: pre-wrap; padding: .85rem; background: #f6f6f6; border-left: 3px solid var(--bni-red); margin: .75rem 0; line-height: 1.5; }
.mail-preview-subject { font-weight: 700; }
.request-contact-identity { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem 1rem; margin-bottom: 1rem; }
.request-contact-identity[hidden] { display: none; }
.request-contact-identity label:last-of-type { grid-column: 1 / -1; }
.request-contact-identity .field-error { min-height: 1.1em; }
.result-representation-requests { margin: .9rem 0; padding: .8rem; background: #fff6f7; border-left: 4px solid var(--bni-red); }
.result-representation-requests h4 { margin: 0 0 .55rem; text-transform: uppercase; color: var(--bni-red-dark); font-size: .85rem; }
.result-representation-request { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .35rem 0; }
#representation-contact-date-options div { display: grid; gap: .45rem; }
#representation-contact-date-options label { display: flex; align-items: center; gap: .5rem; }
.representation-date-group + .representation-date-group { margin-top: 1.5rem; }
.representation-provider-card { display: flex; align-items: center; gap: .75rem; padding: 1rem; border: 1px solid var(--line, #ddd); border-radius: .5rem; background: #fff; }
.representation-provider-card .contact-provider { margin-left: auto; }

@media (max-width: 1180px) {
    .stats { grid-template-columns: repeat(4, 1fr); }
    .column-orgid { display: none; }
    .detail-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .representation-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mail-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .shell { width: min(100% - 2rem, 1480px); }
    .header-inner { min-height: 88px; }
    nav a, .nav-disabled { padding-inline: .7rem; font-size: .78rem; }
    .header-navigation { gap: .5rem; }
    .account-actions { padding-left: .5rem; }
    nav a.active::after { right: .7rem; left: .7rem; }
    .source-panel { grid-template-columns: 1fr; gap: 1rem; }
    .filter-grid { grid-template-columns: repeat(2, 1fr); }
    .batch-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .automation-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .column-country, .column-type, .column-day, .column-time { display: none; }
    .detail-panel { padding-left: 1.25rem; }
    .day-options { grid-template-columns: repeat(4, 1fr); }
    .result-list { grid-template-columns: 1fr; }
    .representation-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .representation-offer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .users-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .users-column-contacts, .users-column-created { display: none; }
}

@media (max-width: 640px) {
    .account-details { grid-template-columns: 1fr; }
    .request-contact-identity { grid-template-columns: 1fr; }
    .request-contact-identity label:last-of-type { grid-column: auto; }
    .shell { width: min(100% - 1rem, 1480px); }
    .topbar-inner { justify-content: space-between; }
    .header-inner { display: block; padding-top: .8rem; }
    .wordmark { width: max-content; margin-left: 1rem; }
    .wordmark::before { top: 0; bottom: 0; }
    .header-navigation { flex-wrap: wrap; justify-content: space-between; margin-top: .7rem; }
    nav { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-start; }
    nav a, .nav-disabled { min-height: 44px; padding-inline: .4rem; }
    nav a.active::after { right: .4rem; left: .4rem; }
    .page-hero { padding: 2.4rem 0 4.3rem; }
    .page-hero::after { display: none; }
    .page-hero h1 { font-size: 2.25rem; }
    .panel { padding: 1rem; }
    .input-row { flex-direction: column; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .filter-grid { grid-template-columns: 1fr; }
    .batch-stats { grid-template-columns: 1fr; }
    .batch-actions button { width: 100%; }
    #automation-form { grid-template-columns: 1fr; }
    .automation-stats { grid-template-columns: 1fr; }
    .section-heading { align-items: flex-start; }
    .actions button { width: 100%; }
    .list-heading { align-items: flex-start; padding: 1rem; }
    .column-updated { display: none; }
    .chapter-name { min-width: 130px; }
    th, td { padding-inline: .45rem; }
    .detail-groups { grid-template-columns: 1fr; }
    .detail-panel { padding: .85rem; }
    .detail-group dl { grid-template-columns: 1fr; }
    .account-actions { border-left: 0; }
    .account-admin { display: none; }
    .search-hero-inner { min-height: 240px; padding-block: 2.5rem 4rem; }
    .search-hero h1 { font-size: 3.6rem; }
    .search-accent { display: none; }
    .search-panel { padding: 1.2rem; }
    .day-options { grid-template-columns: repeat(2, 1fr); }
    .search-options-row { grid-template-columns: 1fr; }
    .results-summary { align-items: flex-start; }
    .sort-field { width: 100%; }
    .search-submit { width: 100%; }
    .result-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .result-detail-panel .detail-groups { grid-template-columns: 1fr; }
    #results-map { height: 320px; }
    .representation-filter-grid { grid-template-columns: 1fr; }
    .auth-name-row, .chapter-picker-filters, .mail-settings-grid, #email-templates-form, .users-filter-grid { grid-template-columns: 1fr; }
    .users-column-verified, .users-column-number { display: none; }
    .users-actions button { flex: 1 1 180px; }
    .registration-actions { display: grid; grid-template-columns: 1fr; }
    .registration-actions button { width: 100%; }
    .auth-links, .test-mail-row { flex-direction: column; align-items: stretch; }
    .date-add-row { align-items: stretch; }
    .date-add-row > * { width: 100%; }
    .cross-date-picker-calendar { position: fixed; top: 50%; left: 50%; width: min(360px, calc(100vw - 2rem)); transform: translate(-50%, -50%); }
    .representation-actions > button { width: 100%; }
    .representation-actions strong { width: 100%; margin-left: 0; }
    .representation-offer-grid { grid-template-columns: 1fr; }
}
