:root {
  color-scheme: light;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  --paper: #f7f7f2; --white: #fff; --ink: #22332d; --muted: #56655d; --border: #e0e5dc;
  --green: #285c45; --green-bg: #e7f2e9; --amber: #82520a; --amber-bg: #fff1d2;
  --red: #9b372f; --red-bg: #fce9e5; --grey: #56615b; --grey-bg: #ecf0ec;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; }
button, .manage-link, .button { cursor: pointer; }
button { color: inherit; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid #347955; outline-offset: 3px; }
.site-shell { width: min(100% - 56px, 1390px); margin-inline: auto; }
.site-header { background: var(--white); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 70px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 21px; font-weight: 770; letter-spacing: -.035em; text-decoration: none; white-space: nowrap; }
.brand-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #285c45; color: #fff; }
.brand-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.manage-link { display: inline-flex; gap: 9px; align-items: center; font-size: 13px; color: var(--green); font-weight: 680; text-decoration: none; }
.manage-link:hover { text-decoration: underline; }
.intro { display: flex; justify-content: space-between; align-items: end; gap: 15px; margin: 25px 0 17px; }
.kicker { color: var(--green); font-size: 10px; font-weight: 770; letter-spacing: .15em; display: flex; align-items: center; gap: 7px; }
.kicker > span { width: 7px; height: 7px; background: #48845e; border-radius: 50%; }
h1 { font-size: clamp(33px, 4.5vw, 48px); line-height: 1.08; letter-spacing: -.055em; margin: 6px 0 8px; font-weight: 770; }
.lead { color: var(--muted); font-size: 15px; }
.demo-badge { font-weight: 700; font-size: 11px; display: inline-flex; align-items: center; border-radius: 100px; white-space: nowrap; }
.demo-badge { padding: 7px 11px; background: #f5ebd3; color: #715318; border: 1px solid #e9d9b4; }
.surface { background: var(--white); border: 1px solid var(--border); border-radius: 14px; min-width: 0; box-shadow: 0 2px 6px #263b2b06; }
.filter-bar { display: grid; grid-template-columns: minmax(150px,1.55fr) 1fr .85fr 1fr auto; gap: 10px; align-items: end; border: 1px solid var(--border); background: var(--white); border-radius: 13px; padding: 11px; margin-bottom: 17px; }
label { display: grid; gap: 4px; color: #42544a; font-size: 12px; font-weight: 680; }
input:not([type=checkbox]), select { width: 100%; min-width: 0; min-height: 39px; padding: 7px 9px; border: 1px solid #dce3d9; border-radius: 7px; background: #fafbf8; color: var(--ink); font-weight: 520; }
input::placeholder { color: #657369; }
.input-icon { position: relative; }
.input-icon input { padding-left: 32px; }
.input-icon svg { position: absolute; inset: 10px auto auto 9px; width: 18px; height: 18px; stroke: #52685b; fill: none; stroke-width: 1.7; stroke-linecap: round; }
.check-field { display: flex; align-items: center; gap: 5px; min-height: 39px; padding-inline: 2px; white-space: nowrap; }
input[type=checkbox] { accent-color: var(--green); width: 15px; height: 15px; flex: 0 0 auto; }
.discovery { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 15px; }
.panel-head, .results-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 15px; }
h2 { font-size: 18px; line-height: 1.25; letter-spacing: -.02em; }
.panel-head p, .result-count { color: var(--muted); font-size: 12px; margin-top: 3px; }
.map-panel { overflow: hidden; }
.map-body { position: relative; background: #ebe8dc; width: 100%; height: clamp(350px, calc(100dvh - 355px), 610px); }
.marker { --tone: var(--grey); position: absolute; transform: translate(-50%, -55%); display: grid; place-items: center; min-width: 47px; min-height: 34px; padding: 4px 7px; border-radius: 9px; background: var(--tone); color: #fff; border: 2px solid #fff; box-shadow: 0 2px 6px #182e2b55; z-index: 1; font-weight: 770; font-variant-numeric: tabular-nums; }
.marker::after { content: ""; position: absolute; bottom: -5px; left: calc(50% - 4px); width: 8px; height: 8px; transform: rotate(45deg); background: var(--tone); border-right: 2px solid white; border-bottom: 2px solid white; }
.marker:hover, .marker.selected { z-index: 2; box-shadow: 0 0 0 3px #ffffffa6, 0 0 0 5px #274a39b0, 0 4px 7px #16262266; }
.marker.low { --tone: #307150; }
.marker.medium { --tone: #94610f; }
.marker.high { --tone: #a24036; }
.map-legend, .table-legend { display: flex; flex-wrap: wrap; gap: 7px 13px; padding: 11px 14px; color: var(--muted); font-size: 11px; }
.map-legend span, .table-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend i, .table-legend i { width: 9px; height: 9px; border-radius: 50%; }
.map-legend .low, .table-legend .free i { background: #438a60; }
.map-legend .medium { background: #b98224; }
.map-legend .high, .table-legend .occupied i { background: #bd5649; }
.table-legend .unknown i { background: #737e76; }
.table-legend .disabled i { background: #bdc4bc; }
.map-selection { padding: 11px 14px; border-top: 1px solid var(--border); }
.map-selection:empty { display: none; }
.results-head { padding: 1px 3px 9px; }
#results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 8px; }
.result-card { border-radius: 11px; border: 1px solid var(--border); background: #fff; padding: 11px 12px; min-width: 0; }
.result-card.selected { border-color: #80a88e; box-shadow: inset 3px 0 #4c875f; }
.result-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.venue-kind { font-size: 11px; color: var(--green); font-weight: 660; }
.venue-name { border: 0; background: none; padding: 0; text-align: left; color: var(--ink); font-size: 17px; line-height: 1.2; font-weight: 760; margin-block: 2px 3px; }
.venue-name:hover { text-decoration: underline; }
.address, .age, .status-text { color: var(--muted); font-size: 12px; }
.load-chip { padding: 5px 7px; min-width: 45px; border-radius: 7px; text-align: center; font-size: 15px; font-weight: 770; font-variant-numeric: tabular-nums; }
.load-chip.low, .detail-number.low, .table-tile.free { color: var(--green); background: var(--green-bg); }
.load-chip.medium, .detail-number.medium { color: var(--amber); background: var(--amber-bg); }
.load-chip.high, .detail-number.high, .table-tile.occupied { color: var(--red); background: var(--red-bg); }
.load-chip.unknown, .detail-number.unknown, .table-tile.unknown { color: var(--grey); background: var(--grey-bg); }
.card-facts { margin: 8px 0 5px; }
.free-text { font-size: 13px; font-weight: 680; }
.result-foot { align-items: center; }
.subtle, .accent, .button, .close { display: inline-flex; justify-content: center; align-items: center; border: 1px solid var(--border); border-radius: 7px; min-height: 34px; padding: 5px 9px; font-weight: 690; font-size: 12px; background: #fff; color: var(--green); text-decoration: none; white-space: nowrap; }
.subtle:hover, .button:hover { background: #f0f6ee; border-color: #b5cabc; }
.accent { background: var(--green); color: #fff; border-color: var(--green); }
.accent:hover { background: #214c39; }
.notice, .empty { padding: 10px 12px; border: 1px solid #e8d9b5; border-radius: 8px; color: #654c20; background: #fff9e9; margin-block: 8px; font-size: 13px; }
.map-panel .notice { margin-inline: 14px; }
.empty { color: var(--muted); background: #fff; border-color: var(--border); }
.site-footer { padding: 21px 0 25px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px; color: var(--muted); font-size: 11px; }
.occupancy-disclosure {
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  text-align: center;
}
.venue-dialog .occupancy-disclosure { position: sticky; bottom: 0; z-index: 4; }
.venue-dialog { padding: 0; border: 1px solid var(--border); border-radius: 14px; width: min(93vw, 640px); max-height: 91dvh; background: #fff; color: var(--ink); }
.venue-dialog::backdrop { background: #16261dad; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; padding: 15px 17px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { font-size: 26px; margin-block: 4px; overflow-wrap: anywhere; }
.dialog-head p:last-child { color: var(--muted); font-size: 13px; }
.close { font-size: 22px; line-height: 1; width: 35px; }
#detail-content { padding: 13px 17px 16px; }
.detail-summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.detail-number { min-width: 75px; padding: 5px 9px; text-align: center; font-size: 25px; border-radius: 9px; }
.detail-summary p, .explanation, .floor-head span, .table-tip { color: var(--muted); font-size: 12px; }
.explanation { margin-block: 10px 13px; }
.floor-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; }
.floor-plan { position: relative; min-height: 170px; aspect-ratio: 2.65; border: 1px solid #dce4d9; border-radius: 8px; overflow: hidden; background: repeating-linear-gradient(0deg, #f7f8f4, #f7f8f4 22px, #ecefe8 23px); }
.floor-empty { margin: 12px; color: var(--muted); }
.demo-floor { min-height: 225px; }
.table-tile { position: absolute; transform: translate(-50%, -50%); padding: 4px 5px; min-width: 55px; max-width: 100px; min-height: 40px; display: grid; justify-items: center; align-content: center; gap: 1px; border: 1px solid currentColor; border-radius: 8px; font-size: 11px; line-height: 1.15; }
.table-tile strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-tile.disabled { color: #626a62; background: #f3f3ef; border-style: dashed; }
.table-tile[aria-pressed=true] { outline: 2px solid #224e39; outline-offset: 2px; z-index: 1; }
.table-legend { padding-inline: 0; }
.table-tip { min-height: 20px; }
.admin-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.12fr); align-items: start; gap: 14px; }
.admin-stack { display: grid; gap: 13px; }
.admin-body { padding: 12px 14px; border-top: 1px solid var(--border); display: grid; gap: 9px; }
.admin-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.admin-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.admin-help { font-size: 12px; color: var(--muted); }
.admin-data { display: grid; gap: 5px; }
.admin-row { display: flex; justify-content: space-between; gap: 6px; align-items: center; border-bottom: 1px solid var(--border); padding: 6px 0; font-size: 13px; }
.admin-row:last-child { border-bottom: 0; }
.admin-row small { display: block; color: var(--muted); }
.admin-status { color: var(--green); font-size: 13px; }
.history-panel { margin-top: 14px; }
.table-scroll { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.history-table th, .history-table td { padding: 7px 9px; border-bottom: 1px solid var(--border); }
@media (max-width: 950px) {
  .site-shell { width: calc(100% - 32px); }
  .filter-bar { grid-template-columns: minmax(120px,1.3fr) 1fr 1fr 1fr; }
  .check-field { min-height: 24px; }
}
@media (max-width: 780px) {
  .intro { margin: 21px 0 14px; flex-wrap: wrap; align-items: start; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .discovery, .admin-layout { grid-template-columns: minmax(0,1fr); }
  .map-body { height: clamp(280px, 76vw, 470px); }
  .subtle, .accent, .button { min-height: 38px; }
}
@media (max-width: 390px) {
  .site-shell { width: calc(100% - 20px); }
  .brand { font-size: 18px; gap: 6px; }
  .brand-icon { width: 32px; height: 32px; }
  .manage-link { font-size: 12px; }
}
.main-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; }
.main-nav a { color: var(--green); font-size: 13px; font-weight: 700; text-decoration: none; }
.main-nav a[aria-current=page], .main-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.business-shell { max-width: 1080px; }
.business-hero { margin: 24px 0 14px; padding: clamp(16px, 4vw, 39px); background: #edf4e9; }
.business-hero h1 { max-width: 800px; }
.business-hero .lead { max-width: 720px; margin: 12px 0; }
.business-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.business-block { padding: 17px; }
.business-block ul, .business-block ol { padding-left: 22px; margin: 9px 0 0; }
.business-block li + li { margin-top: 5px; }
.benefits { margin: 14px 0; }
#application-mode { margin-top: 7px; }
#application-form { display: grid; gap: 9px; margin-top: 11px; }
#application-form button { justify-self: start; }
textarea { width: 100%; resize: vertical; padding: 8px; border: 1px solid var(--border); border-radius: 7px; background: #fafbf8; color: var(--ink); font: inherit; }
.faq details { padding: 9px 0; border-bottom: 1px solid var(--border); }
.faq details:last-child { border: 0; }
.faq summary { cursor: pointer; font-weight: 650; }
.faq p { margin-top: 5px; color: var(--muted); }
@media (max-width: 700px) { .business-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 430px) { .header-inner { flex-wrap: wrap; padding-block: 9px; } }
.filter-checks { display: grid; gap: 3px; padding-bottom: 2px; }
.filter-checks .check-field { min-height: 18px; }
.location-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 6px 10px; margin-bottom: 6px; }
.location-bar label { display: flex; align-items: center; gap: 8px; }
.location-bar select { width: auto; min-height: 34px; }
.location-bar .admin-help { align-self: center; }
.privacy-note { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.privacy-note p { max-width: 780px; padding: 5px 0; }
.privacy-note summary { cursor: pointer; }
#mapgl { position: absolute; inset: 0; visibility: hidden; }
#mapgl.active { visibility: visible; }
.marker.provider-marker { position: relative; }
.map-status { font-size: 12px; color: var(--muted); padding: 8px 14px 0; }
.map-status:empty, #directory-status:empty { display: none; }
.directory-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 2px 7px; }
#directory-status { margin: 0 2px 8px; }
.venue-info { display: grid; gap: 6px; margin-bottom: 12px; font-size: 13px; }
.venue-info ul { margin: 0; padding-left: 20px; }
.distance { color: var(--green); font-weight: 650; }
.map-body { overflow: hidden; }

/* Discovery controls */
.filter-bar { grid-template-columns: minmax(145px, 1.45fr) minmax(85px, .7fr) 1fr .85fr 1fr auto; }
.filter-checks button { min-height: 25px; justify-self: start; }
.mobile-filters { display: none; }
.area-search { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); z-index: 3; }
.map-cluster { display: grid; place-items: center; min-width: 34px; min-height: 34px; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid white; background: #243b49; color: white; box-shadow: 0 2px 6px #182e2b55; font-weight: 750; }
.result-card { cursor: pointer; }
.result-card .address { margin-top: 3px; }
.result-foot .load-chip { font-size: 13px; min-width: 39px; }
.result-foot .load-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-width: 0; }
.match-text { color: var(--green); font-size: 13px; font-weight: 700; }
.empty-results .subtle { margin-top: 7px; }
.dialog-head { position: sticky; top: 0; z-index: 2; background: #fff; }
.venue-info a { overflow-wrap: anywhere; }
@media (max-width: 1050px) {
  .filter-bar { grid-template-columns: minmax(130px, 1.4fr) minmax(80px, .65fr) 1fr 1fr 1fr; }
  .filter-checks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 5px 13px; }
}
@media (max-width: 780px) {
  .filter-bar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .filter-bar[data-open=false] { display: none; }
  .mobile-filters { display: inline-flex; margin-bottom: 8px; }
  .map-body { height: clamp(225px, 58dvh, 410px); }
  .result-foot { flex-wrap: wrap; }
}
.detail-summary .match-text { color: var(--green); }
.result-card h3, .result-card .address { overflow-wrap: anywhere; }

/* Application form feedback */
#application-form [aria-invalid="true"] { border-color: #a03630; }
.application-field-error { color: #912d27; font-size: 12px; }
@media (max-width: 480px) {
  #application-form .admin-fields { grid-template-columns: minmax(0, 1fr); }
}
