:root {
    color-scheme: light;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    --ink: #182e34;
    --muted: #3e555d;
    --accent: #0c6967;
    --accent-dark: #08494d;
    --warm: #b66a32;
    --page: #f8f6f0;
    --paper: #fffdf8;
    --action-surface: #f2eee5;
    --tint: #e1f2ed;
    --line: #d8ddd8;
    --control-line: #7b8580;
    --disabled: #eeece5;
    --warning: #704214;
    --warning-tint: #fff3e4;
    --danger: #8d2923;
    --danger-tint: #fff1ef;
    --zero: #a84d08;
    --few: #145fc6;
    --many: #187d44;
    --unknown: #657381;
    --school: #5e4584;
    --cluster: #17494d;
    --marker-ink: #fff;
    --map-surface: #e4efee;
    --control-shadow: 0 3px 15px #19393920;
    --marker-shadow: 0 2px 6px #13252555;
    color: var(--ink);
    background: var(--page);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
h1, h2, h3, p, dl { margin: 0; }
a { color: var(--accent-dark); }
button, input, select { font: inherit; }
button, summary { cursor: pointer; }
button:disabled, :is(input, select):disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 2px; box-shadow: 0 0 0 2px var(--paper); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px clamp(18px, 3.3vw, 60px);
    border-bottom: 1px solid var(--line);
    background: var(--paper);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand strong { display: block; font-size: 17px; letter-spacing: -.02em; }
.brand small { display: block; font-size: 12px; color: var(--accent); font-weight: 800; letter-spacing: .08em; }
.brand small span { margin: 0 2px; color: var(--muted); }
.account, .actions, .edit-tabs, .admin-tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account { justify-content: flex-end; }
.button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ink);
    background: var(--paper);
}
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.button.primary:is(:hover, :active):not(:disabled, [aria-pressed="true"]) { background: var(--accent-dark); }
.button:is(.secondary, .quiet) { color: var(--accent-dark); background: var(--page); }
.button.secondary { border-color: var(--control-line); }
.button:is(.secondary, .quiet, .text-button):hover:not(:disabled, [aria-pressed="true"]) { background: var(--action-surface); border-color: var(--accent); }
.button[aria-pressed="true"] {
    background: var(--tint);
    color: var(--accent-dark);
    border-color: var(--accent);
    box-shadow: inset 0 -2px var(--accent);
}
.button:is(.secondary, .quiet, .text-button):active:not(:disabled) { background: var(--tint); border-color: var(--accent-dark); }
.button:disabled, .button[aria-pressed="true"]:disabled {
    background: var(--disabled);
    border: 1px dashed var(--control-line);
    color: var(--muted);
    box-shadow: none;
}
.text-button { color: var(--accent-dark); }
.text-button { padding-inline: 7px; }
.text-button:hover { text-decoration: underline; }

.workspace, .admin-workspace { margin: auto; max-width: 1800px; padding: 0 clamp(18px, 3.3vw, 60px) 14px; }
.intro { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; padding: 23px 0 22px; }
.eyebrow { color: var(--accent-dark); font-size: 13px; font-weight: 700; letter-spacing: .05em; line-height: 1.4; }
.intro .eyebrow { display: flex; align-items: center; gap: 8px; }
.intro .eyebrow::before { content: ''; width: 14px; height: 2px; border-radius: 1px; background: var(--warm); }
h1 { margin-top: 5px; font-size: clamp(27px, 3.05vw, 44px); letter-spacing: -.045em; line-height: 1.1; }
.intro-copy { color: var(--muted); font-size: 15px; line-height: 1.5; margin-top: 8px; }
.metrics { display: flex; flex-shrink: 0; gap: 2px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.metrics div { display: flex; min-width: 99px; flex-direction: column-reverse; padding: 8px 12px; }
.metrics div + div { border-left: 1px solid var(--line); }
.metrics dt { color: var(--muted); font-size: 13px; }
.metrics dd { margin: 0; font-size: 25px; font-weight: 760; line-height: 1.2; font-variant-numeric: tabular-nums; }
.map-layout {
    display: grid;
    grid-template-columns: minmax(285px, 352px) minmax(0, 1fr);
    height: max(470px, calc(100dvh - 242px));
    border: 1px solid var(--line);
    border-radius: 15px;
    overflow: hidden;
    background: var(--paper);
}
.directory { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--line); background: var(--paper); }
.directory-content { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.sheet-bar { display: none; }
.filters-expander summary {
    min-height: 40px;
    padding: 8px 9px;
    border: 1px solid var(--control-line);
    border-radius: 8px;
    color: var(--accent-dark);
    background: var(--page);
    font-weight: 650;
}
.filters-expander summary:hover, .legend summary:hover { background: var(--action-surface); }
.legend[open] summary { background: var(--tint); }
.filters-expander:is([open], :has(select option:checked:not([value=""]))) > summary {
    background: var(--tint);
    border-color: var(--accent);
    box-shadow: inset 2px 0 var(--accent);
}
.filters-expander[open] .form-grid { padding-top: 8px; }
.directory-filters {
    flex: 0 0 auto;
    max-height: min(72%, calc(100% - 170px));
    overflow-y: auto;
    padding: 12px 16px;
    display: grid;
    gap: 10px;
}
.directory-filters .form-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 8px; }
.directory-error { margin: 8px 12px; }
.retry-catalogue { align-self: start; margin: 8px 12px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h2 { font-size: 20px; font-weight: 700; line-height: 1.3; letter-spacing: -.02em; }
label { display: grid; gap: 5px; min-width: 0; color: var(--ink); font-size: 14px; font-weight: 600; }
input:not([type="checkbox"]), select {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 7px 9px;
    border: 1px solid var(--control-line);
    border-radius: 8px;
    color: var(--ink);
    background-color: var(--paper);
    font-size: 15px;
    font-weight: 400;
}
:is(input:not([type="checkbox"]), select):hover:not(:disabled) { border-color: var(--accent); }
:is(input:not([type="checkbox"]), select):disabled { background: var(--disabled); color: var(--muted); border-style: dashed; }
input::placeholder { color: var(--muted); opacity: 1; }
input[type="search"] { padding-left: 32px; background-image: url("search.svg"); background-position: 9px center; background-repeat: no-repeat; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); }
.check { display: flex; flex-direction: row; align-items: center; gap: 7px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.full { grid-column: 1 / -1; }
.result-count {
    background: var(--page);
    border-block: 1px solid var(--line);
    color: var(--ink);
    padding: 9px 16px;
    font-weight: 650;
    font-size: 14px;
}
.results { overflow: auto; min-height: 0; overscroll-behavior: contain; scroll-padding: 4px; }
.result {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    min-height: 66px;
    padding: 10px 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--ink);
    text-align: left;
}
.result:hover { background: var(--action-surface); }
.result:active, .result[aria-pressed="true"] { background: var(--tint); }
.result[aria-pressed="true"] { box-shadow: inset 3px 0 var(--accent); }
.result:focus-visible { outline-offset: -3px; }
.result-number {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 37px;
    min-height: 36px;
    padding: 3px;
    border-radius: 8px;
    background: var(--action-surface);
    color: var(--accent-dark);
    font-size: 14px;
    font-weight: 800;
    overflow-wrap: anywhere;
}
.result-number.school { color: var(--school); }
.result[aria-pressed="true"] .result-number { background: var(--tint); }
.result[aria-pressed="true"] .result-number::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid currentColor;
    border-radius: inherit;
}
.result-copy { display: grid; min-width: 0; gap: 2px; line-height: 1.45; overflow-wrap: anywhere; }
.result-copy strong { font-size: 16px; font-weight: 650; line-height: 1.35; }
.result-copy small { color: var(--muted); font-size: 14px; }
.result-copy .result-vacancy { color: var(--accent-dark); font-weight: 700; }
.result-copy .coord-note { color: var(--warning); font-size: 13px; font-weight: 600; }
.result-copy .result-distance { color: var(--accent-dark); font-weight: 700; }
.nearby-controls { display: grid; gap: 6px; padding-block: 2px 4px; }
.nearby-controls .actions { justify-content: start; }
.nearby-controls .button, .origin-picker .button { min-height: 44px; }
.nearby-order { max-width: 220px; }
.origin-marker {
    z-index: 1;
    width: 21px;
    height: 21px;
    border: 3px solid var(--marker-ink);
    border-radius: 50%;
    background: #005baf;
    box-shadow: 0 0 0 2px #06345c, 0 0 0 8px #2b78c950;
    pointer-events: none;
}
#map[data-origin-picking="true"] .maplibregl-canvas-container { cursor: crosshair; }
#map[data-origin-picking="true"] :is(.place-marker, .map-cluster) { pointer-events: none; }
.origin-picker {
    position: absolute;
    z-index: 3;
    bottom: 25px;
    left: 8px;
    right: 8px;
    max-width: 340px;
    padding: 8px;
    background: var(--paper);
    border: 1px solid var(--control-line);
    border-radius: 8px;
    box-shadow: var(--control-shadow);
}
.origin-picker .actions { justify-content: start; margin-top: 5px; }
.route-options { margin-top: 9px; }
.route-modes { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.empty { padding: 16px; color: var(--muted); }
.map-panel { position: relative; isolation: isolate; min-width: 0; min-height: 0; background: var(--map-surface); }
#map { position: relative; width: 100%; height: 100%; z-index: 0; }
#map:focus-visible, .maplibregl-canvas:focus-visible { outline-offset: -4px; }
.maplibregl-ctrl-group { border: 1px solid var(--control-line); background: var(--paper); }
.maplibregl-ctrl-group button { width: 40px; height: 40px; }
.maplibregl-ctrl-group button + button { border-top-color: var(--control-line); }
.maplibregl-ctrl-group button:not(:disabled):hover { background: var(--page); }
.maplibregl-ctrl-group button:not(:disabled):active { background: var(--tint); }
.maplibregl-ctrl-group button:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: -3px; box-shadow: none; }
.maplibregl-ctrl-group button:disabled { background: var(--disabled); }
:is(#map, #edit-map) .maplibregl-ctrl-attrib { font-size: 12px; line-height: 20px; background: var(--paper); }
:is(#map, #edit-map) .maplibregl-ctrl-attrib a { color: var(--accent-dark); }
.directory-mode { margin: 0 0 9px; padding: 9px 13px; color: var(--accent-dark); background: var(--tint); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.no-map .map-tools { display: none; }
.no-map #map { display: none; }
.no-map .place-card { position: relative; inset: auto; margin: 12px; max-height: calc(100% - 24px); }
.map-overview { display: flex; flex-direction: column; height: 100%; margin: 0; }
.map-overview img { display: block; min-height: 0; width: 100%; height: auto; object-fit: contain; object-position: top; }
.map-overview figcaption { padding: 6px 12px; background: var(--paper); font-size: 13px; }
.no-map .map-panel:has(.place-card:not([hidden])) .map-overview { display: none; }
#map[data-context-lost="true"] { visibility: hidden; }
#map[data-context-lost="true"] ~ .map-tools { display: none; }
#map[data-context-lost="true"] ~ .map-overview { position: absolute; inset: 0; }
.map-tools {
    position: absolute;
    right: 13px;
    top: 13px;
    max-width: calc(100% - 64px);
    display: grid;
    justify-items: end;
    gap: 7px;
    z-index: 1;
    pointer-events: none;
}
.map-tools :is(.map-actions > button, .map-styles, .legend) { pointer-events: auto; }
.map-actions { display: flex; justify-content: end; flex-wrap: wrap; gap: 5px; }
.map-actions > .button, .map-styles > summary { white-space: nowrap; }
.map-tools:has(.map-styles[open]) { z-index: 3; }
.legend, .map-message, .map-actions > button, .map-styles > summary, .map-style-options { box-shadow: var(--control-shadow); }
.map-actions > button:focus-visible, .map-styles > summary:focus-visible { box-shadow: 0 0 0 2px var(--paper); }
.map-styles { position: relative; }
.map-styles[open] { z-index: 2; }
.map-styles > summary { list-style: none; gap: 5px; }
.map-styles > summary::-webkit-details-marker { display: none; }
.map-styles > summary::after { content: '▾'; }
.map-styles[open] > summary { background: var(--tint); border-color: var(--accent); }
.map-styles[open] > summary::after { transform: rotate(180deg); }
.map-style-options {
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    display: grid;
    gap: 4px;
    min-width: max-content;
    padding: 5px;
    border: 1px solid var(--control-line);
    border-radius: 9px;
    background: var(--paper);
}
.map-style-options > .button { justify-content: start; }
.map-style-options > [aria-pressed="true"]:not(:disabled) { color: var(--accent-dark); }
.map-style-options > [aria-pressed="true"]::after { content: '✓'; margin-left: auto; }
.legend { border: 1px solid var(--control-line); border-radius: 9px; background: var(--paper); font-size: 13px; }
.legend summary { min-height: 40px; padding: 10px; border-radius: 8px; color: var(--accent-dark); font-weight: 800; }
.legend-short { display: none; }
.legend ul { display: grid; max-width: 248px; max-height: min(240px, 28dvh); overflow: auto; gap: 6px; padding: 7px 10px 10px; margin: 0; list-style: none; }
.legend li { display: flex; align-items: center; gap: 8px; line-height: 1.35; }
.swatch { display: block; flex: 0 0 15px; width: 15px; height: 15px; background: var(--status-color, var(--unknown)); border-radius: 50%; }
.swatch.cluster { background: var(--cluster); border: 3px double var(--marker-ink); box-shadow: 0 0 0 1px var(--cluster); }
.swatch.school { background: var(--school); border-radius: 3px; }
.swatch.preliminary { background: var(--unknown); border: 2px dashed var(--marker-ink); box-shadow: 0 0 0 1px var(--unknown); }
.swatch.zero, :is(.pin, .vacancy-summary)[data-status="zero"] { --status-color: var(--zero); }
.swatch.few, :is(.pin, .vacancy-summary)[data-status="few"] { --status-color: var(--few); }
.swatch.many, :is(.pin, .vacancy-summary)[data-status="many"] { --status-color: var(--many); }
.pin[data-status="school"] { --status-color: var(--school); }
.map-message {
    position: absolute;
    left: 12px;
    bottom: 25px;
    max-width: min(360px, calc(100% - 24px));
    z-index: 1;
    padding: 9px 11px;
    background: var(--paper);
    border: 1px solid var(--control-line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 13px;
}
.pin {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    padding: 4px;
    border: 2px solid var(--marker-ink);
    border-radius: 50%;
    background: var(--status-color, var(--unknown));
    color: var(--marker-ink);
    font-weight: 850;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    overflow-wrap: anywhere;
    box-shadow: var(--marker-shadow);
}
.pin.school { border-radius: 6px; }
.pin.preliminary::after {
    content: '';
    position: absolute;
    inset: 2px;
    border: 1px dashed var(--marker-ink);
    border-radius: inherit;
    pointer-events: none;
}
.place-marker:not(.selected):hover .pin { box-shadow: 0 0 0 2px var(--ink), var(--marker-shadow); }
.place-marker.selected { z-index: 2; }
.place-marker.selected .pin { box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px var(--marker-ink), var(--marker-shadow); }
.place-marker { display: block; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; }
.place-marker:has(.school) { border-radius: 6px; }
.place-marker:focus-visible, .map-cluster:focus-visible { outline-offset: 6px; box-shadow: 0 0 0 6px var(--marker-ink); }
.map-cluster {
    --cluster-size: 46px;
    display: grid;
    place-items: center;
    width: var(--cluster-size);
    height: var(--cluster-size);
    padding: 0;
    border: 5px double var(--marker-ink);
    border-radius: 50%;
    color: var(--marker-ink);
    background: var(--cluster);
    font-size: 16px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 0 0 1px var(--cluster), var(--marker-shadow);
}
.map-cluster[data-size="medium"] { --cluster-size: 52px; }
.map-cluster[data-size="large"] { --cluster-size: 59px; }
.map-cluster[data-size="largest"] { --cluster-size: 66px; }
.map-cluster:hover, .map-cluster:active { background: var(--ink); }
.edit-pin {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 3px solid var(--marker-ink);
    border-radius: 50%;
    background: var(--accent);
    color: var(--marker-ink);
    font-size: 20px;
    font-weight: 800;
    box-shadow: var(--marker-shadow);
    cursor: grab;
}
.edit-pin:active { cursor: grabbing; }
.place-card {
    position: absolute;
    right: 13px;
    bottom: 25px;
    z-index: 2;
    max-height: min(75%, calc(100% - 80px));
    width: min(368px, calc(100% - 26px));
    overflow: auto;
    padding: 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-inline-start: 3px solid var(--accent);
    border-radius: 12px;
    box-shadow: 0 7px 24px #122f303b;
}
.place-card h2 { padding-right: 36px; margin: 5px 0 10px; overflow-wrap: anywhere; }
.place-card > .eyebrow { padding-right: 36px; }
.place-card h2:focus-visible { outline-offset: 0; }
.close { position: absolute; right: 10px; top: 10px; border: 1px solid var(--control-line); border-radius: 7px; background: var(--paper); color: var(--ink); width: 40px; height: 40px; padding: 0; font-size: 23px; }
.close:hover { background: var(--page); border-color: var(--accent); }
.close:active { background: var(--tint); }
.card-details { display: grid; grid-template-columns: 75px minmax(0, 1fr); gap: 5px 8px; font-size: 14px; line-height: 1.4; }
.card-details dt { color: var(--muted); font-weight: 600; }
.card-details dd { margin: 0; overflow-wrap: anywhere; }
.place-photo, .photo-preview { display: block; width: 100%; max-height: 150px; object-fit: cover; border-radius: 7px; margin-bottom: 10px; }
.photo-preview { max-height: 240px; }
.vacancy-summary { margin: 10px 0; padding: 8px 10px; background: var(--page); border-inline-start: 2px solid var(--status-color, var(--unknown)); border-radius: 7px; font-size: 14px; }
.vacancy-summary ul { padding-left: 16px; margin: 6px 0 0; }
.vacancy-context { color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.card-groups { margin-top: 4px; }
.card-groups summary { min-height: 32px; padding-block: 5px; color: var(--accent-dark); }
.admission-note { margin-top: 6px; }
.position-warning { margin-top: 9px; padding: 6px 8px; border-inline-start: 2px dashed var(--warm); border-radius: 4px; background: var(--warning-tint); color: var(--warning); font-size: 13px; font-weight: 600; line-height: 1.45; }
.copy-feedback:not(:empty), .manual-copy { margin-top: 7px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.45; }
#age-help, .admin-panel .hint { font-size: 14px; }
.place-card > .hint { margin-top: 9px; }
.card-links { display: flex; gap: 8px 13px; flex-wrap: wrap; font-size: 13px; }
.card-links, .place-card .actions { margin-top: 9px; }
.public-footnote { padding: 10px 0 2px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.mobile-switch { display: none; }

dialog { position: fixed; width: min(420px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--control-line); border-radius: 14px; color: var(--ink); background: var(--paper); box-shadow: 0 18px 65px #18363855; }
dialog.wide { width: min(680px, calc(100% - 24px)); }
dialog::backdrop { background: #13323172; }
.dialog-body { position: relative; padding: 19px; }
#login-form { display: grid; gap: 12px; }
.dialog-body > h2 { padding-right: 42px; }
.dialog-body > .edit-tabs { margin: 12px 0; }
.form-message, .map-message.is-error { border: 1px solid var(--control-line); border-radius: 8px; padding: 9px 11px; background: var(--tint); color: var(--accent-dark); font-size: 13px; }
.form-message.is-error, .map-message.is-error { color: var(--danger); background: var(--danger-tint); border-color: var(--danger); }
.dialog-body > .form-message { margin: 8px 0; }
#edit-map { height: 215px; border: 1px solid var(--control-line); border-radius: 9px; overflow: hidden; background: var(--map-surface); }
.group-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, 100px) auto; gap: 6px; margin-bottom: 7px; }
#groups-total { font-size: 13px; }

.admin-workspace { max-width: 1200px; }
.admin-tabs { padding: 0 0 13px; }
.admin-panel { padding: 18px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.admin-panel > p, .admin-panel > form { margin-top: 12px; }
.admin-filters { display: grid; grid-template-columns: 2fr repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.admin-list { margin-top: 12px; }
.admin-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.admin-row h3 { font-size: 16px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.admin-row p + p { margin-top: 3px; }
.admin-row .actions { justify-content: flex-end; }
.admin-workspace > .form-message { margin-bottom: 12px; }
.history-item { border-top: 1px solid var(--line); padding: 10px 3px; }
.history-item summary { font-size: 13px; font-weight: 650; }
.history-item pre { margin: 7px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; background: var(--page); padding: 8px; border-radius: 7px; }
.quick-vacancy { margin-top: 6px; }
.quick-vacancy summary { color: var(--accent-dark); font-weight: 650; font-size: 13px; }
.quick-vacancy-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; padding: 8px 0; }
.quick-vacancy-form label { max-width: 160px; }
.quick-vacancy-form .form-message { flex-basis: 100%; }
.change-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.change-table th, .change-table td { padding: 6px; text-align: left; vertical-align: top; overflow-wrap: anywhere; white-space: pre-line; border-bottom: 1px solid var(--line); }
.change-table thead { background: var(--tint); }
#vacancy-import-form { margin-top: 10px; }
.export-links { margin-top: 18px; }
fieldset { border: 1px solid var(--control-line); border-radius: 8px; min-width: 0; }
.assignment-list { display: grid; gap: 5px; max-height: 215px; overflow: auto; }
.freshness-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.freshness-metrics div { display: grid; align-content: start; gap: 2px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--page); }
.freshness-metrics dt { color: var(--muted); font-size: 13px; }
.freshness-metrics dd { margin: 0; font-weight: 800; font-size: 19px; }
.freshness-state { display: inline-block; color: var(--accent-dark); font-weight: 650; font-size: 13px; margin: 3px 0; }
.freshness-state[data-state="review"], .freshness-state[data-state="stale"] { color: var(--warning); }

@media (max-width: 970px) {
    .intro { align-items: flex-start; flex-direction: column; gap: 12px; padding-block: 16px; }
    .map-layout { height: max(450px, calc(100dvh - 282px)); }
    .metrics div { flex: 1; }
}
@media (max-width: 800px) {
    .masthead { padding: 9px 12px; }
    .brand img { width: 36px; height: 36px; }
    .brand strong { font-size: 14px; }
    .brand small { font-size: 10px; }
    .brand { gap: 7px; }
    .account .button { padding: 5px 9px; }
    .workspace, .admin-workspace { padding-inline: 12px; }
    .intro { gap: 9px; padding-block: 12px; }
    .intro-copy { margin-top: 5px; font-size: 14px; }
    .metrics { width: 100%; }
    .metrics div { min-width: 0; padding: 5px 8px; }
    .metrics dd { font-size: 21px; }
    .metrics dt { font-size: 12px; }
    .mobile-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 7px; }
    .map-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(160px, 1fr) var(--sheet-height, 55px);
        height: max(500px, calc(100dvh - 230px));
    }
    .workspace[data-sheet="half"] .map-layout { --sheet-height: 44%; }
    .workspace[data-sheet="expanded"] .map-layout { --sheet-height: 64%; }
    .workspace[data-sheet="peek"] .directory-content { display: none; }
    .directory { grid-row: 2; border-right: 0; border-top: 1px solid var(--line); }
    .map-panel { grid-row: 1; }
    .sheet-bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 5px 10px; min-height: 54px; }
    .sheet-bar span { color: var(--ink); font-size: 13px; font-weight: 700; }
    .button, .legend summary { min-height: 44px; }
    .close, .place-marker { width: 44px; height: 44px; }
    .directory-content { display: block; overflow: auto; overscroll-behavior: contain; scroll-padding: 6px; }
    .directory-filters { max-height: none; overflow-y: visible; }
    .results { overflow: visible; }
    .filters-expander summary { padding-block: 10px; min-height: 44px; }
    .directory-filters input, .directory-filters select { min-height: 44px; }
    .no-map .map-layout { height: auto; grid-template-rows: auto; }
    .no-map .directory, .no-map .map-panel { grid-row: 1; }
    .no-map .directory-content { max-height: 62dvh; }
    .no-map .map-overview { height: auto; }
    .no-map #sheet-toggle, .no-map[data-view="map"] .directory, .no-map[data-view="list"] .map-panel { display: none; }
    .map-tools { right: 8px; top: 8px; }
    :is(#map, #edit-map) .maplibregl-ctrl-group button { width: 44px; height: 44px; }
    .place-card { right: 8px; bottom: 24px; width: calc(100% - 16px); max-height: 66%; }
    #map[data-volume="true"] ~ .place-card { max-height: 55%; }
    .admin-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-row { align-items: flex-start; flex-direction: column; }
    .admin-row .actions { justify-content: flex-start; }
    .freshness-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .masthead { gap: 6px; }
    h1 { font-size: 25px; }
    .admin-panel { padding: 12px; }
    .admin-filters { grid-template-columns: minmax(0, 1fr); }
    .directory-filters { padding-inline: 12px; }
    .directory-filters .form-grid { grid-template-columns: minmax(0, 1fr); gap: 7px; }
    .map-tools { max-width: calc(100% - 64px); }
    .map-actions { flex-wrap: nowrap; gap: 4px; }
    .map-actions > .button, .map-styles > summary { padding-inline: 8px; font-size: 13px; }
    .map-actions > .button { min-width: 0; white-space: normal; line-height: 1.2; text-align: center; }
    .map-styles { flex: 0 0 auto; }
    .legend-label { display: none; }
    .legend-short { display: inline; }
    .place-card h2, .place-card > .eyebrow { padding-right: 44px; }
    .dialog-body { padding: 13px; }
    .group-row { grid-template-columns: minmax(0, 1fr) 63px auto; }
}
