.nh-admin, .nh-selector {
    --nh-ink: #1d2d28;
    --nh-muted: #52635c;
    --nh-border: #d9e3dd;
    --nh-accent: #245843;
    --nh-accent-dark: #163e30;
    --nh-surface: #f1f6f3;
    --nh-white: #fff;
    --nh-radius: .9rem;
    --nh-shadow: 0 2px 6px #203b2910;
    color: var(--nh-ink);
    min-width: 0;
    overflow-wrap: anywhere;
}

.nh-admin { max-width: 76rem; padding: 0 0 2rem; }

.nh-admin *, .nh-selector * { box-sizing: border-box; }
.nh-admin [hidden], .nh-selector [hidden] { display: none !important; }
.nh-admin :focus-visible, .nh-selector :focus-visible { outline: 3px solid #2667a0; outline-offset: 3px; }
.nh-admin a, .nh-selector a { color: var(--nh-accent); text-underline-offset: .16em; }
.nh-admin h2, .nh-selector h2 { color: var(--nh-ink); font-size: clamp(1.3rem, 3vw, 1.65rem); font-weight: 700; letter-spacing: -.025em; }
.nh-admin h3 { color: var(--nh-ink); font-size: 1.06rem; font-weight: 700; letter-spacing: -.015em; }
.nh-admin p, .nh-selector p { margin: .45rem 0 .7rem; }
.nh-admin .nh-muted { color: var(--nh-muted); font-size: .9rem; }
.nh-available { --nh-status: #25634b; --nh-soft: #e8f4ec; }
.nh-requested { --nh-status: #985016; --nh-soft: #fff0df; }
.nh-confirmed { --nh-status: #225783; --nh-soft: #e8f2fc; }
.nh-closed { --nh-status: #963b38; --nh-soft: #faece9; }
.nh-neutral { --nh-status: #465c51; --nh-soft: #e9f0eb; }

.nh-admin .nh-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 1.2rem;
    padding: clamp(1.05rem, 3.5vw, 2rem);
    border: 1px solid #ccded4;
    border-radius: 1.2rem;
    background: linear-gradient(120deg, #e7f1ea, #f6faf7 75%);
}
.nh-hero h1 { margin: 0 0 .6rem; font-size: clamp(2rem, 4.5vw, 3.35rem); font-weight: 750; letter-spacing: -.057em; line-height: 1.08; }
.nh-hero .nh-project { color: var(--nh-accent); margin: 0 0 .4rem; font-weight: 650; font-size: .9rem; }
.nh-event-state { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .85rem; color: var(--nh-muted); }
.nh-admin .nh-event-picker { min-width: min(100%, 9.75rem); margin: 0; }
.nh-badge {
    background: var(--nh-soft); color: var(--nh-status); font-size: .78rem; font-weight: 700;
    line-height: 1.3; border-radius: 2rem; display: inline-flex; align-items: center; gap: .35rem;
    padding: .35rem .63rem; flex: none;
}
.nh-badge::before { content: ''; width: .38rem; height: .38rem; border-radius: 50%; background: currentColor; }

.nh-admin .nh-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin: .85rem 0 1.3rem; padding: .32rem; border: 1px solid var(--nh-border); background: var(--nh-white); border-radius: var(--nh-radius); }
.nh-admin .nh-tabs a, .nh-admin .nh-more-menu summary {
    display: inline-flex; align-items: center; min-height: 44px; padding: .48rem .68rem; border-radius: .6rem;
    font-weight: 650; color: var(--nh-muted); text-decoration: none; white-space: normal;
}
.nh-admin .nh-tabs [aria-current="page"] { background: var(--nh-surface); color: var(--nh-accent-dark); }
.nh-admin .nh-tabs a:hover, .nh-admin .nh-more-menu summary:hover { background: var(--nh-surface); color: var(--nh-accent-dark); }
.nh-admin .nh-more-menu { position: relative; margin-left: auto; }
.nh-admin .nh-more-menu summary::after { content: '▾'; margin-left: .42rem; }
.nh-admin .nh-more-menu > div {
    position: absolute; right: 0; z-index: 5; top: calc(100% + .3rem); max-width: 79vw; width: 13rem;
    display: grid; background: var(--nh-white); box-shadow: 0 10px 30px #162e2724;
    border: 1px solid var(--nh-border); border-radius: var(--nh-radius); padding: .3rem;
}

.nh-card { border: 1px solid var(--nh-border); border-radius: var(--nh-radius); background: var(--nh-white); box-shadow: var(--nh-shadow); }
.nh-panel { margin: .65rem 0 1rem; padding: clamp(.9rem, 2.8vw, 1.4rem); }
.nh-admin summary { cursor: pointer; font-weight: 650; min-height: 44px; padding: .6rem 0; }
.nh-admin h2 { margin: 0 0 .72rem; }
.nh-admin h3 { margin: 0 0 .35rem; }
.nh-admin form { margin: .6rem 0 0; }
.nh-admin .nh-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin: 0 0 1.35rem; }
.nh-counts > div { display: flex; flex-direction: column-reverse; align-items: start; gap: .35rem; background: var(--nh-white); border: 1px solid var(--nh-border); border-radius: var(--nh-radius); box-shadow: var(--nh-shadow); padding: .85rem 1rem; }
.nh-counts dt { margin: 0; font-size: .85rem; color: var(--nh-muted); font-weight: 650; }
.nh-counts dd { margin: 0; font-size: clamp(1.65rem, 3.5vw, 2.3rem); line-height: 1; font-weight: 750; color: var(--nh-status); font-variant-numeric: tabular-nums; }
.nh-section-title { display: flex; flex-wrap: wrap; gap: .4rem .75rem; align-items: baseline; justify-content: space-between; margin: .5rem 0 .6rem; }
.nh-section-title h2, .nh-section-title h3 { margin: 0; }
.nh-section-title > a { font-size: .9rem; font-weight: 650; }
.nh-total { display: inline-block; padding: .2rem .52rem; font-size: .8rem; vertical-align: middle; color: var(--nh-accent); background: #e6efe9; border-radius: 1rem; }
.nh-request-list { display: grid; gap: .7rem; margin: .7rem 0; }
.nh-request { padding: clamp(.85rem, 2.4vw, 1.25rem); }
.nh-request:target { border-color: #659482; }
.nh-request-title { display: flex; justify-content: space-between; align-items: start; gap: .55rem; }
.nh-request-title h3 { font-size: clamp(1rem, 2vw, 1.18rem); }
.nh-request-title p { color: var(--nh-muted); margin: .2rem 0 .7rem; }
.nh-request-facts { display: flex; flex-wrap: wrap; gap: .65rem 1.4rem; padding: .7rem 0; margin: 0; border-top: 1px solid var(--nh-border); }
.nh-request-facts dt { color: var(--nh-muted); font-size: .76rem; font-weight: 600; }
.nh-request-facts dd { margin: .1rem 0 0; color: var(--nh-ink); font-weight: 650; }
.nh-conflicts { padding: .55rem .7rem .55rem 1.55rem; border-radius: .55rem; margin: 0 0 .5rem; background: #fff4e8; color: #743c17; font-size: .86rem; }
p.nh-conflicts { padding-left: .7rem; }
.nh-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .75rem; margin-top: .35rem; }
.nh-admin .nh-actions form { margin: 0; }
.nh-actions > a:not(.nh-button) { display: inline-flex; align-items: center; min-height: 44px; font-size: .9rem; font-weight: 600; }
.nh-inset { padding: 0 .75rem; border: 1px solid var(--nh-border); border-radius: .65rem; margin-top: .65rem; }
.nh-inset[open] { padding-bottom: .75rem; background: #fafcfb; }
.nh-search { max-width: 24rem; margin: .8rem 0; }
.nh-history-list { padding: 0; list-style: none; }
.nh-history-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .7rem; padding: .42rem 0; border-bottom: 1px solid var(--nh-border); }
.nh-review-steps { padding-left: 1.3rem; }
.nh-review-steps li { margin: .42rem 0; }
.nh-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr)); gap: .65rem .85rem; }
.nh-admin label, .nh-selector label { display: block; margin: 0 0 .45rem; font-size: .88rem; font-weight: 650; min-width: 0; }
.nh-admin input:not([type="checkbox"], [type="hidden"]), .nh-admin select, .nh-selector input {
    display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 44px; margin-top: .25rem;
    font: inherit; font-weight: 400; color: var(--nh-ink); border: 1px solid #9eaea5; border-radius: .55rem;
    padding: .45rem .65rem; background: var(--nh-white);
}
.nh-admin .nh-check { display: flex; gap: .5rem; align-items: center; min-height: 44px; }
.nh-check input { width: 1.1rem; height: 1.1rem; flex: none; }
.nh-admin button, .nh-admin .nh-button, .nh-map-controls button {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px;
    border: 1px solid var(--nh-accent); padding: .42rem .73rem; border-radius: .58rem;
    background: var(--nh-accent); color: white; font: inherit; font-size: .88rem; font-weight: 650;
    cursor: pointer; text-decoration: none; text-align: center;
}
.nh-admin button:hover, .nh-admin .nh-button:hover { background: var(--nh-accent-dark); color: white; }
.nh-admin .nh-secondary, .nh-map-controls button { color: var(--nh-accent-dark); background: var(--nh-white); border-color: #b9ccc1; }
.nh-admin .nh-secondary:hover, .nh-map-controls button:hover { background: var(--nh-surface); color: var(--nh-accent-dark); }
.nh-admin .nh-danger { color: #8c312e; background: #fff5f2; border-color: #dfb1a8; }
.nh-admin .nh-danger:hover { color: white; background: #8c312e; }
.nh-admin .nh-notice { padding: .8rem .95rem; border: 1px solid #a9ceb8; background: #eaf6ee; border-radius: .65rem; }
.nh-admin .nh-error { border-color: #deb6ae; background: #fff0ed; }
.nh-stations-layout { display: grid; gap: .85rem; }
.nh-admin-map, .nh-station-detail { margin: 0; min-width: 0; }
.nh-station-inspector { min-width: 0; }
.nh-station-detail summary .nh-badge { margin-left: .35rem; }

.nh-selector-intro { margin-bottom: 1rem; }
.nh-selector-intro [role="status"] { color: var(--nh-accent-dark); font-weight: 750; margin: 0 0 .3rem; }
.nh-selector-intro > p + p { color: var(--nh-muted); }
.nh-map-shell { --nh-view-height: min(34rem, 53vh); }
.nh-legend { display: flex; flex-wrap: wrap; gap: .45rem .8rem; padding: 0; margin: 0 0 .6rem; list-style: none; }
.nh-legend li { display: flex; align-items: center; gap: .35rem; color: var(--nh-muted); font-size: .8rem; font-weight: 650; }
.nh-marker {
    display: inline-grid; place-items: center; flex: none; width: 2rem; height: 2.05rem; padding-bottom: .2rem;
    background: var(--nh-status); color: #fff; clip-path: polygon(0 0, 100% 0, 100% 66%, 50% 100%, 0 66%);
    font: 750 .74rem/1 system-ui, sans-serif;
}
.nh-legend .nh-marker { width: .85rem; height: .9rem; }
.nh-map-frame {
    position: relative; overflow: hidden; overflow: clip; isolation: isolate;
    width: min(100%, calc(var(--nh-view-height) * var(--nh-map-ratio, 1)));
    aspect-ratio: var(--nh-map-ratio, 1); margin: 0 auto; border-radius: .7rem;
    background: #eaf0ec; box-shadow: 0 0 0 1px var(--nh-border);
}
.nh-map-frame { -webkit-user-select: none; user-select: none; }
.nh-map-frame.nh-zoomed { touch-action: none; cursor: grab; }
.nh-map-frame.nh-zoomed:active { cursor: grabbing; }
.nh-map-canvas { position: absolute; inset: 0; }
.nh-map-canvas { display: block; width: 100%; height: 100%; touch-action: inherit; }
.nh-pin { cursor: pointer; }
.nh-pin:focus-visible polygon, .nh-pin[aria-expanded="true"] polygon, .nh-pin[aria-pressed="true"] polygon {
    filter: drop-shadow(0 0 2px #183c31);
}
.nh-map-controls, .nh-zoom-controls, .nh-pan-controls { display: flex; flex-wrap: wrap; gap: .35rem; }
.nh-map-controls { justify-content: space-between; margin: .65rem 0 .75rem; }
.nh-map-controls button { margin: 0; }
.nh-map-controls button:disabled { opacity: .45; cursor: default; }
.nh-map-shell:has(.nh-map-frame.nh-zoomed) .nh-map-controls .nh-pan-controls { display: flex; }
.nh-map-controls .nh-pan-controls { display: none; }
.nh-map-shell:not([hidden]) + .nh-map-fallback { display: none; }
.nh-site-callout, .nh-station { display: flex; align-items: center; gap: .6rem; padding: .6rem .72rem; border: 1px solid var(--nh-border); border-radius: .64rem; background: var(--nh-white); }
.nh-site-selection-text, .nh-station > div { min-width: 0; flex: 1; }
.nh-site-selection-text span, .nh-station > div span { display: block; color: var(--nh-muted); font-size: .88rem; }
.nh-site-callout a, .nh-station a { min-height: 44px; display: inline-flex; align-items: center; white-space: nowrap; font-size: .85rem; font-weight: 650; }
.nh-finder { margin-top: 1.4rem; padding: 0; }
.nh-finder label { max-width: 26rem; }
.nh-station-list { list-style: none; padding: 0; display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); }

@media (min-width: 680px) {
    .nh-admin .nh-counts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .nh-stations-layout { grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr); }
}
@media (max-width: 550px) {
    .nh-admin .nh-more-menu { margin-left: 0; }
    .nh-admin .nh-more-menu > div { left: 0; right: auto; }
    .nh-map-shell { --nh-view-height: 46vh; }
}
@media (max-width: 390px) {
    .nh-admin .nh-hero { gap: .75rem; }
    .nh-event-state { gap: .4rem .55rem; }
    .nh-counts > div { padding: .7rem; }
}

.nh-map-shell { position: relative; }
.nh-marker {
    position: relative;
    isolation: isolate;
    clip-path: none;
    background: transparent;
    color: #172620;
    padding-bottom: 0;
}
.nh-marker svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.nh-popup {
    position: absolute; z-index: 4; width: min(20rem, 100%); max-height: min(24rem, 55vh);
    overflow: auto; overscroll-behavior: contain; padding: .7rem .85rem;
    border: 1px solid var(--nh-border); border-radius: .7rem; background: white; box-shadow: 0 6px 22px #163e3033;
}
.nh-popup-title { display: flex; align-items: center; gap: .4rem; }
.nh-popup-title button {
    margin-left: auto; width: 44px; height: 44px; flex: none; border: none; border-radius: .5rem;
    background: var(--nh-surface); color: var(--nh-ink); font-size: 1.25rem; cursor: pointer;
}
.nh-popup ul, .nh-station ul { list-style: none; padding: 0; margin: .45rem 0; }
.nh-popup li, .nh-station li { border-top: 1px solid var(--nh-border); padding: .35rem 0; }
.nh-popup li > *, .nh-station li > * { display: block; }
.nh-popup a { display: inline-flex; min-height: 44px; align-items: center; font-weight: 700; }

.nh-admin .nh-match { margin: .35rem 0; }
.nh-admin .nh-match > summary { display: inline-flex; list-style: none; }
.nh-admin .nh-match > summary::-webkit-details-marker { display: none; }
.nh-admin .nh-match > summary::after { content: ' ▾'; padding-inline-start: .4rem; }
.nh-admin .nh-match[open] > summary { margin-bottom: .55rem; }
.nh-admin .nh-match form { margin: .3rem 0; }
.nh-admin .nh-group-suggestions { margin: 0 0 .55rem; padding: 0; list-style: none; }
.nh-admin .nh-group-suggestions li {
    display: flex; align-items: center; justify-content: space-between; gap: .6rem;
    padding: .2rem 0;
}
.nh-admin .nh-group-suggestions button { border-radius: 2rem; }
.nh-admin .nh-group-suggestions small { display: block; color: var(--nh-muted); }
.nh-admin .nh-group-picker { position: relative; }
.nh-admin .nh-group-picker input { border-radius: 2rem; padding-inline: .9rem; }
.nh-admin .nh-group-picker ul {
    position: absolute; inset-inline: 0; z-index: 2; max-height: 12rem; overflow-y: auto;
    margin: .2rem 0 0; padding: .2rem; list-style: none;
    background: var(--nh-white); border: 1px solid var(--nh-border);
    border-radius: .65rem; box-shadow: var(--nh-shadow);
}
.nh-admin .nh-group-picker li { display: flex; align-items: center; min-height: 44px; padding: .35rem .7rem; cursor: pointer; }
.nh-admin .nh-group-picker li:hover, .nh-admin .nh-group-picker li[aria-selected="true"] { background: var(--nh-surface); }
.nh-admin .nh-cancel-match { background: none; color: var(--nh-muted); border-color: transparent; }
.nh-admin .nh-cancel-match:hover { background: var(--nh-surface); color: var(--nh-ink); }
.nh-admin [data-nh-history-candidate] select { width: 100%; }

.nh-admin .nh-hero { position: relative; }
.nh-admin .nh-version { position: absolute; inset-block-start: .65rem; inset-inline-end: .85rem; color: var(--nh-muted); font-size: .75rem; }
.nh-admin .nh-event-state .nh-badge { font-size: .91rem; font-weight: 750; }
.nh-admin .nh-event-state .nh-badge::before { width: .52rem; height: .52rem; }
.nh-admin .nh-stations-layout { align-items: start; }
.nh-admin .nh-admin-map .nh-map-frame { width: 100%; }
.nh-admin .nh-setting-toggle { display: flex; align-items: center; gap: .35rem; }
.nh-admin .nh-setting-toggle label { margin: 0; }
.nh-admin .nh-info {
    min-width: 1.6rem; min-height: 1.6rem; padding: 0; flex: none; border-radius: 50%;
    background: transparent; color: var(--nh-muted); border-color: var(--nh-border); font-size: .75rem;
}
.nh-admin .nh-tooltip {
    position: fixed; inset: auto; margin: 0; border: 0; z-index: 10; pointer-events: none; width: min(20rem, calc(100vw - 16px));
    padding: .55rem .7rem; background: var(--nh-ink); color: var(--nh-white);
    border-radius: .4rem; font-size: .84rem; box-shadow: var(--nh-shadow);
}
.nh-admin .nh-station-fields { margin-top: .55rem; padding-top: .65rem; border-top: 1px solid var(--nh-border); }
.nh-admin .nh-station-fields .nh-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.nh-selector {
    width: 100%; max-width: none; margin: 0; padding: 0 0 32px;
    font-size: 16px; line-height: 1.5; container: nh-selector / inline-size;
}
.nh-selector,
.nh-selector .nh-map-controls button,
.nh-selector label,
.nh-selector .nh-finder input { font-size: 16px; }
.nh-selector h2 { font-size: 23px; }
.nh-selector p { margin: 7px 0 11px; }
.nh-selector .nh-selector-intro { margin-bottom: 16px; }
.nh-selector .nh-selector-intro [role="status"] { font-size: 17px; margin-bottom: 5px; }
.nh-selector .nh-legend { gap: 7px 13px; margin: 0 0 10px; }
.nh-selector .nh-legend li { gap: 7px; font-size: 16px; }
.nh-selector .nh-marker { width: 32px; height: 33px; font-size: 12px; }
.nh-selector .nh-legend .nh-marker { width: 21px; height: 22px; }
.nh-selector .nh-map-controls, .nh-selector .nh-zoom-controls, .nh-selector .nh-pan-controls { gap: 6px; }
.nh-selector .nh-map-controls { margin: 10px 0 12px; }
.nh-selector .nh-map-controls button { padding: 7px 12px; border-radius: 9px; }
.nh-selector .nh-map-frame { border-radius: 11px; }
.nh-selector .nh-finder label { max-width: none; margin-bottom: 7px; }
.nh-selector .nh-finder input { margin-top: 4px; padding: 7px 10px; border-radius: 9px; }
.nh-selector .nh-station { gap: 10px; padding: 10px 12px; border-radius: 10px; }
.nh-selector .nh-station > div span, .nh-selector .nh-station a { font-size: 14px; }
.nh-selector .nh-popup {
    font-size: 15px; width: min(320px, 100%); max-height: min(384px, 55vh);
    padding: 11px 14px; border-radius: 11px;
}
.nh-selector .nh-popup-title { gap: 6px; }
.nh-selector .nh-popup-title button { border-radius: 8px; font-size: 20px; }
.nh-selector .nh-popup ul, .nh-selector .nh-station ul { margin: 7px 0; }
.nh-selector .nh-popup li, .nh-selector .nh-station li { padding: 6px 0; }
:is(.page-content, .entry-content, .post-content):has(.nh-selector) {
    float: none; width: 100%; max-width: none; min-width: 0; margin-inline: 0;
}
.nh-selector-layout { display: grid; align-items: start; gap: 16px; }
.nh-selector-layout > * { min-width: 0; }
.nh-selector .nh-map-frame {
    width: min(100%, calc(var(--nh-fit-height, 100svh) * var(--nh-map-ratio, 1)));
    margin-inline: 0;
}
.nh-selector .nh-finder { margin: 0; }
.nh-selector .nh-station-list { gap: 8px; grid-template-columns: minmax(0, 1fr); }
.nh-selector .nh-station { flex-wrap: wrap; }
@container nh-selector (min-width: 760px) {
    .nh-selector-layout { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
    .nh-selector .nh-map-shell { display: grid; }
    .nh-selector .nh-map-controls { grid-row: 2; margin: 0 0 10px; }
    .nh-selector .nh-map-frame { width: var(--nh-desktop-map-size, 80%); margin-inline: auto; }
}


.nh-admin .nh-save-actions { margin-top: 16px; }
.nh-admin .nh-warning { color: #704a1d; background: #fff5e8; border-color: #ead1ad; }
.nh-admin .nh-checklist { padding-left: 20px; }
.nh-admin .nh-checklist li { margin-block: 4px; }
.nh-admin .nh-check-passed { color: #25634b; }
.nh-admin .nh-check-failed { color: #963b38; }
.nh-admin .nh-occupancy-assignment { display: flex; align-items: center; gap: 8px; min-height: 36px; margin: 0; }
.nh-occupancy-assignment small { display: block; color: var(--nh-muted); }
.nh-admin textarea[name="selector_intro"] {
    display: block; width: 100%; margin-top: 4px; font: inherit; font-weight: 400;
    color: var(--nh-ink); border: 1px solid #9eaea5; border-radius: 9px; padding: 7px 10px; resize: vertical;
}
