:root {
  --ink: #17231d;
  --muted: #66736c;
  --paper: #f7f4ec;
  --panel: rgba(255, 253, 247, 0.96);
  --red: #c92f3c;
  --red-dark: #8f1e2a;
  --green: #1f5c45;
  --gold: #d8a83e;
  --line: #d8d7cf;
  --shadow: 0 16px 50px rgba(18, 31, 24, 0.18);
}

* { box-sizing: border-box; }
html, body, .app-shell, .map-wrap, #map { height: 100%; margin: 0; }
body {
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell { display: grid; grid-template-columns: 390px minmax(0, 1fr); }
.sidebar {
  position: relative;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 24px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow-y: auto;
}
.brand {
  position: relative;
  display: flex;
  min-height: 88px;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding: 14px 108px 14px 14px;
  overflow: hidden;
  border-radius: 17px;
  color: white;
  background: #c8102e;
  box-shadow: inset 0 -4px 0 rgba(84,0,12,.22), 0 7px 20px rgba(84,0,12,.16);
}
.brand-about-button {
  position: absolute;
  z-index: 4;
  inset: 0;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}
.brand-about-button:hover { background: rgba(255,255,255,.05); }
.brand-about-button:focus-visible { outline: 3px solid white; outline-offset: -5px; }
.brand-title { position: relative; z-index: 2; }
.brand h1 { font-size: 24px; line-height: 1.05; }
.brand-shield-slice {
  position: absolute;
  z-index: 1;
  top: -24px;
  right: -24px;
  width: 126px;
  height: 150px;
  object-fit: contain;
  filter: drop-shadow(-5px 0 3px rgba(56,0,8,.24));
}
.account-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: -10px 0 14px; color: var(--muted); font-size: 12px; }
.account-bar > span { min-width: 0; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 750; }
.account-button { min-height: 30px; padding: 4px 8px; color: var(--ink); background: white; border-color: var(--line); font-size: 11px; }
.brand-mark {
  position: relative;
  z-index: 2;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 17px;
  border: 2px solid rgba(255,255,255,.72);
  background: #f5ead0;
  box-shadow: 0 3px 10px rgba(56,0,8,.3);
  font-size: 30px;
}
.brand-mark img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
h1 { margin: 1px 0 0; font-family: Georgia, serif; font-size: 30px; letter-spacing: -1px; }
h2 { font-family: Georgia, serif; }
.eyebrow {
  margin: 0;
  color: var(--red-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.view-switch { display: grid; grid-template-columns: 1fr 1fr auto; gap: 7px; margin-bottom: 15px; }
.view-switch button { min-height: 37px; color: var(--ink); background: white; border-color: var(--line); }
.view-switch button.active { color: white; background: var(--green); border-color: var(--green); }
.view-switch .add-button { color: var(--red-dark); }

.search-panel { display: grid; gap: 8px; }
.beaver-search-controls { display: grid; gap: 6px; }
.beaver-search-controls label { align-self: end; }
label { margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 750; }
.keyword-search { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.keyword-search label { margin: 0; line-height: 1.15; }
input, select, button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  font: inherit;
}
input, select { width: 100%; padding: 9px 11px; color: var(--ink); background: #fff; }
input:focus, select:focus { outline: 3px solid rgba(201,47,60,.15); border-color: var(--red); }
button {
  padding: 8px 13px;
  color: white;
  background: var(--green);
  border-color: var(--green);
  cursor: pointer;
  font-weight: 750;
}
button:hover { filter: brightness(.93); }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(201,47,60,.28);
  outline-offset: 2px;
}
.find-intro { margin: -4px 0 14px; }
.find-intro h2 { margin: 0 0 5px; font-size: 22px; line-height: 1.12; }
.find-intro p { margin: 0; color: var(--muted); font-size: 13px; }
.nearby-search { width: 100%; background: var(--red); border-color: var(--red); }
.location-fallback { margin-top: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.range-controls, .town-controls { display: grid; gap: 6px; }
.range-heading { display: flex; align-items: center; justify-content: space-between; }
.range-heading label { margin: 0; }
.range-heading output { color: var(--red-dark); font-size: 13px; font-weight: 850; }
input[type="range"] { min-height: 26px; padding: 0; accent-color: var(--red); border: 0; }
.field-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.search-radius-note { margin: 2px; color: var(--muted); font-size: 12px; }

.status-card {
  display: grid;
  gap: 3px;
  margin: 16px 0 10px;
  padding: 12px 14px;
  border-radius: 12px;
  color: white;
  background: var(--green);
}
#visible-count { font-weight: 850; }
#zoom-hint { color: rgba(255,255,255,.72); font-size: 12px; }
.results { display: grid; gap: 7px; }
.search-results-heading { margin: 5px 2px 1px; }
.result {
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  color: var(--ink);
  background: white;
  border-color: var(--line);
}
.result strong, .result span { display: block; }
.result span { margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 500; }
.result:hover { border-color: var(--red); background: #fff9f8; filter: none; }

.details {
  width: min(860px, 100%);
  padding: clamp(22px, 4vw, 46px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: 0 14px 45px rgba(18,31,24,.1);
}
.details h2 { margin: 7px 0 8px; font-family: Georgia, serif; font-size: clamp(30px, 4vw, 46px); line-height: 1.04; }
.details p { margin: 6px 0; }
.detail-category { color: var(--green); font-size: 13px; font-weight: 800; }
.detail-meta { color: var(--muted); font-size: 13px; }
.details a { color: var(--red-dark); overflow-wrap: anywhere; }
.detail-actions { display: flex; gap: 8px; margin: 14px 0; }
.detail-actions button { min-width: 145px; }
.detail-beaver-score { margin: 10px 0; }
.beaver-score, .golden-beaver {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--green);
  background: #e9f1ec;
  font-size: 11px;
  font-weight: 850;
}
.beaver-score.unassessed { color: var(--muted); background: #efefeb; }
.public-beaver-summary { margin: 8px 0; }
.public-beaver-summary .beaver-score,
.public-beaver-summary .golden-beaver { font-size: 12px; }
.golden-beaver {
  color: #664400;
  background: linear-gradient(135deg, #fff2b8, #e4b73f);
  border: 1px solid #c9971e;
  box-shadow: 0 2px 9px rgba(157,109,0,.18);
}
.source-note { padding-top: 8px; border-top: 1px solid var(--line); font-size: 11px !important; }
footer { display: grid; gap: 3px; margin-top: auto; padding-top: 20px; color: var(--muted); font-size: 11px; }

.map-wrap { position: relative; min-width: 0; }
.map-search-panel {
  position: absolute;
  z-index: 800;
  top: 14px;
  left: 14px;
  display: grid;
  width: min(370px, calc(100% - 28px));
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 247, .97);
  box-shadow: 0 8px 28px rgba(18,31,24,.18);
}
.map-search-panel label { margin: 0; }
.map-keyword-search { display: grid; grid-column: 1 / -1; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 7px; }
.map-keyword-search label { line-height: 1.15; }
.map-search-panel input, .map-search-panel select, .map-search-panel button { min-height: 38px; }
.map-actions { position: absolute; z-index: 800; right: 14px; bottom: 14px; display: flex; max-width: calc(100% - 28px); flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.map-actions button { min-height: 36px; padding: 6px 10px; color: var(--ink); background: white; border-color: var(--line); box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.loading { position: absolute; z-index: 800; left: 50%; bottom: 25px; transform: translateX(-50%); padding: 9px 14px; border-radius: 999px; color: white; background: rgba(23,35,29,.88); font-size: 12px; font-weight: 750; }
.hidden { display: none; }
.location-loading {
  position: fixed;
  z-index: 5000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23,35,29,.46);
  backdrop-filter: blur(2px);
}
.location-loading.hidden { display: none; }
.location-loading-card {
  display: grid;
  min-width: 210px;
  justify-items: center;
  gap: 7px;
  padding: 24px;
  border-radius: 16px;
  color: var(--ink);
  background: white;
  box-shadow: var(--shadow);
}
.location-loading-card strong { font-family: Georgia, serif; font-size: 20px; }
.location-loading-card small { color: var(--muted); }
.location-spinner { width: 34px; height: 34px; border: 4px solid #e4e8e5; border-top-color: var(--red); border-radius: 50%; animation: location-spin .8s linear infinite; }
@keyframes location-spin { to { transform: rotate(360deg); } }

.cluster-marker {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 3px solid rgba(255,255,255,.9);
  border-radius: 50%;
  color: white;
  background: var(--red);
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
  font-size: 11px;
  font-weight: 900;
}
.cluster-marker.large { width: 54px; height: 54px; background: var(--red-dark); }
.leaflet-control-zoom a { color: var(--ink) !important; }
.business-map-popup .leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: 0 12px 38px rgba(18,31,24,.24); }
.business-map-popup .leaflet-popup-content { margin: 15px; }
.business-map-card { display: grid; gap: 5px; min-width: 220px; color: var(--ink); }
.business-map-card strong { font-family: Georgia, serif; font-size: 19px; line-height: 1.1; }
.business-map-card span { color: var(--muted); font-size: 11px; line-height: 1.35; }
.business-map-card button { min-height: 34px; margin-top: 6px; padding: 6px 10px; }

.list-pane, .admin-pane, .research-pane {
  min-width: 0;
  height: 100%;
  padding: 32px clamp(22px, 4vw, 58px);
  overflow-y: auto;
  background: #ece9df;
}
.detail-pane {
  min-width: 0;
  height: 100%;
  padding: 28px clamp(20px, 5vw, 70px) 50px;
  overflow-y: auto;
  background: #ece9df;
}
.detail-back { margin-bottom: 14px; color: var(--ink); background: white; border-color: var(--line); }
.list-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; margin-bottom: 20px; }
.list-header h2 { margin: 4px 0 0; font-size: 30px; }
.list-back { color: var(--ink); background: white; border-color: var(--line); }
.list-sort { display: grid; grid-template-columns: auto minmax(120px, auto); align-items: center; gap: 5px 8px; }
.list-sort label { margin: 0; }
.list-sort #list-count { grid-column: 1 / -1; justify-self: end; }
#list-count { color: var(--muted); font-size: 13px; font-weight: 750; }
.business-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.business-card {
  min-height: 150px;
  padding: 17px;
  text-align: left;
  color: var(--ink);
  background: white;
  border-color: var(--line);
  box-shadow: 0 6px 22px rgba(18,31,24,.06);
}
.business-card h3 { margin: 0 0 6px; font-family: Georgia, serif; font-size: 20px; line-height: 1.12; }
.business-card .beaver-score, .business-card .golden-beaver { margin-bottom: 4px; }
.business-card p { margin: 5px 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.business-card .distance { color: var(--red-dark); font-weight: 850; }
.dimension-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.dimension-rating { display: grid; min-width: 0; gap: 4px; padding: 12px; border: 1px solid #cbd9d0; border-radius: 12px; background: #f4f8f5; }
.dimension-rating b { color: var(--muted); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.dimension-rating > span { display: flex; min-height: 22px; align-items: center; gap: 3px; color: var(--green); font-size: 17px; font-weight: 900; white-space: nowrap; }
.beaver-icon { display: inline-block; width: 21px; height: 21px; border-radius: 50%; object-fit: cover; }
.dimension-rating small { color: var(--ink); font-size: 11px; font-weight: 750; }
.dimension-rating.unknown { border-style: dashed; background: #f3f2ed; }
.dimension-rating.unknown > span { color: var(--muted); font-size: 13px; }
.dimension-grid.compact { gap: 5px; margin: 9px 0; }
.dimension-grid.compact .dimension-rating { gap: 2px; padding: 7px; }
.dimension-grid.compact .dimension-rating > span { overflow: hidden; font-size: 12px; text-overflow: ellipsis; }
.participation-section { margin-top: 20px; padding: clamp(16px, 3vw, 24px); border-radius: 16px; background: #f4f7f4; }
.participation-section h3 { margin: 5px 0 0; font-family: Georgia, serif; font-size: 22px; }
.quick-rating-editor { display: grid; gap: 15px; margin-top: 18px; padding-top: 18px; border-top: 1px solid #cbd9d0; }
.quick-rating-editor > section { display: grid; gap: 8px; }
.rating-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rating-heading small { color: var(--muted); font-size: 10px; text-align: right; }
.rating-choices { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.rating-choice { display: flex; min-width: 0; min-height: 48px; padding: 7px 5px; align-items: center; justify-content: center; flex-wrap: wrap; gap: 3px; color: var(--ink); background: white; border-color: var(--line); font-size: 11px; }
.rating-choice .beaver-icon { width: 18px; height: 18px; }
.rating-choice > span { flex-basis: 100%; }
.rating-choice.selected { color: white; background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 2px white; }
.rating-choice:disabled { cursor: wait; opacity: .6; }
.new-business-rating { display: grid; gap: 7px; }
.new-business-rating > strong { font-size: 13px; }
.duplicate-warning { display: grid; gap: 7px; margin-top: 10px; }
.duplicate-warning button { width: 100%; text-align: left; }
.empty-list { grid-column: 1 / -1; padding: 35px; text-align: center; color: var(--muted); background: white; border-radius: 15px; }

.canadian-profile { display: grid; gap: 13px; margin-top: 22px; padding: 18px; border-radius: 14px; background: #f4f7f4; }
.canadian-profile strong { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.tier-control { display: grid; grid-template-columns: minmax(100px, .7fr) minmax(220px, 1.3fr); align-items: center; gap: 12px; margin: 0; }
.tier-control > span { color: var(--ink); font-size: 14px; font-weight: 800; }
.tier-control small { grid-column: 2; margin-top: -8px; color: var(--muted); font-size: 11px; font-weight: 500; }
.ownership-control-row { display: flex; align-items: center; gap: 12px; }
.ownership-control-row select { flex: 1 1 220px; }
.crest-kin-control { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; color: var(--ink); font-size: 12px; font-weight: 800; white-space: nowrap; }
.crest-kin-control[hidden], .crest-kin-help[hidden] { display: none; }
.crest-kin-control input { width: 18px; min-height: 18px; margin: 0; }
.tier-control .crest-kin-help { margin-top: -5px; }
.profile-status { min-height: 17px; }
.brand-research { display: grid; gap: 7px; margin-top: 18px; padding: 18px; border: 1px solid #cbd9d0; border-radius: 14px; background: #f8fbf8; }
.brand-research p { margin: 0; }
.brand-research a { display: block; width: fit-content; font-size: 12px; font-weight: 750; }
.heritage-profile { display: grid; gap: 7px; margin-top: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #f7f6f1; }
.heritage-profile.qualified { border-color: #d5b257; background: #fff9e7; }
.heritage-profile p { margin: 0; }
.business-notes { display: grid; gap: 12px; margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fbfaf6; }
.business-notes .eyebrow { margin: 0; }
#business-note-list { display: grid; gap: 10px; }
.business-note { display: grid; gap: 8px; padding: 12px; border-left: 3px solid #bdcbbf; border-radius: 0 10px 10px 0; background: white; }
.business-note p { margin: 0; white-space: pre-wrap; }
.business-note-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.note-thread-status, .note-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.note-status-badge { padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.note-status-badge.open { color: #725000; background: #fff0bd; }
.note-status-badge.resolved { color: var(--green); background: #e4f2e8; }
.business-note.note-thread-resolved { border-left-color: #71977d; background: #f8fbf8; }
.note-reply-button { width: fit-content; min-height: 32px; padding: 4px 9px; font-size: 11px; }
.note-status-button { width: fit-content; min-height: 32px; padding: 4px 9px; font-size: 11px; }
.note-replies { display: grid; gap: 9px; margin-top: 4px; padding-left: 14px; }
.business-note-form { display: grid; gap: 8px; }
.business-note-form label { display: grid; gap: 6px; margin: 0; color: var(--ink); font-size: 12px; font-weight: 800; }
.business-note-form textarea { width: 100%; min-height: 82px; padding: 10px; resize: vertical; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; font: inherit; }
.note-form-actions { display: flex; align-items: center; gap: 10px; }
.note-form-actions button { min-height: 36px; padding: 6px 11px; }

dialog { width: min(680px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 24px 80px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(12,22,17,.6); backdrop-filter: blur(2px); }
#add-business-form { padding: 24px; overflow-y: auto; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; margin-bottom: 8px; }
.dialog-heading h2 { margin: 3px 0 0; font-size: 28px; }
.contribute-shell { display: grid; gap: 13px; padding: 24px; }
.contribute-results { display: grid; max-height: min(48vh, 430px); gap: 8px; overflow-y: auto; }
.contribute-results .business-card { min-height: 0; }
.mobile-nav { display: none; }
.icon-button { min-width: 42px; padding: 4px; color: var(--ink); background: white; border-color: var(--line); font-size: 25px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 16px; }
.form-grid label { display: grid; gap: 5px; margin: 0; }
.form-grid .wide { grid-column: 1 / -1; }
.add-location-control { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #f6f3ea; }
.canadian-fieldset { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 17px 0 10px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.canadian-fieldset legend { color: var(--green); font-size: 12px; font-weight: 850; }
.canadian-fieldset label { display: grid; gap: 5px; margin: 0; color: var(--ink); }
.canadian-fieldset textarea { width: 100%; padding: 10px; resize: vertical; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.add-review { padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: #f8faf7; }
.add-review h3 { margin: 7px 0; font-family: Georgia, serif; font-size: 25px; }
.add-review p { line-height: 1.45; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }
.secondary-button { color: var(--ink); background: white; border-color: var(--line); }
.invitation-dialog { display: grid; gap: 14px; padding: 24px; }
.new-invitation { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; }
.new-invitation label { display: grid; gap: 5px; }
.invitation-list { display: grid; gap: 7px; max-height: 260px; overflow-y: auto; }
.invitation-item { display: flex; justify-content: space-between; gap: 14px; padding: 10px; border-radius: 10px; background: #f3f4ef; color: var(--muted); font-size: 12px; }
.admin-pane { min-width: 0; height: 100%; padding: 28px clamp(20px, 4vw, 56px); overflow-y: auto; background: #ece9df; }
.admin-header { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.admin-header h2 { margin: 4px 0 0; font-size: 34px; }
.admin-workspace { display: grid; grid-template-columns: minmax(230px, .7fr) minmax(420px, 1.5fr); gap: 16px; margin: 20px 0; align-items: start; }
.admin-users-column, .user-detail { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.admin-users-column h3 { margin: 0 0 12px; font-family: Georgia, serif; font-size: 23px; }
.user-list { display: grid; gap: 8px; max-height: calc(100vh - 245px); overflow-y: auto; }
.user-item { display: block; width: 100%; padding: 13px; text-align: left; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; background: #f8f8f4; }
.user-item.selected { border-color: var(--green); background: #edf4ef; box-shadow: inset 4px 0 var(--green); }
.user-item h3 { margin: 0; font-family: Georgia, serif; font-size: 18px; }
.user-item p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.user-detail { min-height: 420px; }
.user-detail-back { min-height: 34px; margin-bottom: 12px; padding: 5px 10px; font-size: 11px; }
.user-detail-empty { display: grid; min-height: 380px; place-items: center; text-align: center; color: var(--muted); }
.user-detail-heading { display: flex; align-items: start; justify-content: space-between; gap: 15px; }
.user-detail-heading h2 { margin: 4px 0 0; font-size: 30px; }
.user-detail-heading p { margin: 3px 0; color: var(--muted); }
.role-badge { padding: 6px 10px; border-radius: 999px; color: var(--green); background: #e9f1ec; font-size: 11px; font-weight: 850; }
.user-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 17px 0; }
.user-facts div { padding: 10px; border-radius: 10px; background: #f5f5f0; }
.user-facts dt { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.user-facts dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 12px; }
.user-permission-editor { display: grid; grid-template-columns: minmax(160px, 1fr) auto auto auto; align-items: end; gap: 8px; }
.user-name-editor { grid-column: 1 / -1; }
.invite-check { display: flex; align-items: center; gap: 6px; min-height: 42px; margin: 0; }
.invite-check input { width: auto; min-height: auto; }
.user-permission-editor button { min-height: 42px; padding: 7px 10px; font-size: 11px; }
.reset-link-panel { display: grid; gap: 8px; margin-top: 14px; padding: 14px; border: 1px solid #d5b257; border-radius: 12px; background: #fff9e7; }
.reset-link-panel p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.reset-link-panel label { display: grid; gap: 5px; }
.reset-link-panel > div { display: flex; gap: 8px; }
.button-link { display: inline-flex; min-height: 42px; align-items: center; padding: 8px 13px; border: 1px solid var(--green); border-radius: 11px; color: white; background: var(--green); font-size: 12px; font-weight: 750; text-decoration: none; }
.user-subsection { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.user-subsection h3 { margin: 0 0 10px; font-family: Georgia, serif; font-size: 20px; }
.invitation-tree, .created-invitations { margin: 0; padding-left: 20px; color: var(--muted); font-size: 12px; }
.invitation-tree li, .created-invitations li { margin: 6px 0; }
.invitation-tree strong, .invitation-tree span { display: block; color: var(--ink); }
.invitation-tree span { color: var(--muted); font-size: 11px; }
.created-invitations li { display: flex; justify-content: space-between; gap: 10px; }
.user-change-list { display: grid; gap: 7px; max-height: 360px; overflow-y: auto; }
.danger-button { color: white !important; background: var(--red) !important; border-color: var(--red) !important; }
.business-lock { margin: 14px 0; padding: 13px; border: 1px solid #b98b20; border-radius: 12px; color: #614200; background: #fff4cf; }
.business-lock p { margin: 3px 0; }
.change-admin { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.change-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.change-heading h3 { margin: 3px 0 0; font-family: Georgia, serif; font-size: 22px; }
.change-heading label { width: min(260px, 45%); }
.change-list { display: grid; gap: 7px; max-height: 320px; margin-top: 12px; overflow-y: auto; }
.change-item { display: grid; grid-template-columns: minmax(170px, 1fr) auto; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #f3f4ef; }
.change-item strong, .change-item span { display: block; }
.change-item span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.change-item time { color: var(--muted); font-size: 11px; white-space: nowrap; }

.research-pane { min-width: 0; height: 100%; padding: 28px clamp(20px, 4vw, 56px); overflow-y: auto; background: #ece9df; }
.research-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-top: 18px; }
.research-toolbar label { width: min(300px, 48%); }
.research-runs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-top: 12px; }
.research-runs article { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8f8f4; }
.research-runs span, .research-runs time { color: var(--muted); font-size: 10px; }
.research-workspace { display: grid; grid-template-columns: minmax(230px, .7fr) minmax(420px, 1.5fr); gap: 16px; margin-top: 14px; align-items: start; }
.research-list-column, .research-detail { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.research-list { display: grid; gap: 8px; max-height: calc(100vh - 245px); overflow-y: auto; }
.research-item { display: grid; gap: 3px; width: 100%; padding: 13px; text-align: left; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; background: #f8f8f4; }
.research-item.selected { border-color: var(--green); background: #edf4ef; box-shadow: inset 4px 0 var(--green); }
.research-item span, .research-item small { overflow-wrap: anywhere; color: var(--muted); font-size: 11px; }
.research-detail { min-height: 420px; }
.research-detail-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.research-detail-heading h2 { margin: 4px 0 0; font-size: 30px; }
.research-subsection { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.research-subsection h3 { margin: 0 0 10px; font-family: Georgia, serif; font-size: 20px; }
.research-businesses, .research-claims { display: grid; gap: 8px; }
.research-business-link { padding: 9px 11px; text-align: left; color: var(--ink); border-color: var(--line); background: #f3f4ef; font-size: 11px; }
.research-claim { padding: 12px; border-left: 4px solid var(--green); border-radius: 9px; background: #f3f4ef; }
.research-claim > div { display: flex; justify-content: space-between; gap: 10px; }
.research-claim span, .research-claim a { color: var(--muted); font-size: 10px; }
.research-claim p { margin: 8px 0; font-size: 12px; line-height: 1.45; }
.research-notes { display: grid; gap: 8px; }
.research-note { padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #f8f8f4; }
.research-note.reply { margin-left: 18px; border-left: 4px solid #b6c8bb; }
.research-note > div:first-child { display: flex; justify-content: space-between; gap: 10px; }
.research-note strong span, .research-note time { color: var(--muted); font-size: 10px; }
.research-note p { margin: 8px 0; font-size: 12px; line-height: 1.45; }
.research-note-actions { display: flex; align-items: center; gap: 7px; }
.research-note-actions button { min-height: 30px; padding: 4px 8px; font-size: 10px; }
.research-note-form { display: grid; gap: 8px; margin-top: 10px; }
.research-note-form label { display: grid; gap: 5px; }
.research-note-form textarea { min-height: 86px; padding: 10px; resize: vertical; border: 1px solid var(--line); border-radius: 9px; font: inherit; }
.research-note-form > div { display: flex; align-items: center; gap: 8px; }
.research-review-form { display: grid; gap: 10px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.research-review-form label { display: grid; gap: 5px; }
.research-review-form textarea { min-height: 90px; padding: 10px; resize: vertical; border: 1px solid var(--line); border-radius: 9px; font: inherit; }
.research-review-form > div { display: flex; align-items: center; gap: 10px; }
.tier0-create-form { margin-top: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.tier0-create-form textarea { min-height: 84px; padding: 10px; resize: vertical; border: 1px solid var(--line); border-radius: 9px; font: inherit; }
.tier0-impact { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 16px 0; }
.tier0-impact div { padding: 10px; border-radius: 10px; background: #f3f4ef; }
.tier0-impact dt { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.tier0-impact dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 12px; }
.tier0-decision-actions { display: flex; align-items: center; gap: 9px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

.onboarding-dialog { width: min(920px, calc(100vw - 28px)); overflow: hidden; background: #fbfaf5; }
.onboarding-shell { display: grid; grid-template-rows: auto 4px minmax(430px, auto) auto; min-height: min(650px, calc(100dvh - 28px)); }
.onboarding-header, .onboarding-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 24px; }
.onboarding-header { border-bottom: 1px solid #e6e2d8; }
.onboarding-brand { display: flex; align-items: center; gap: 9px; font-family: Georgia, serif; font-size: 18px; }
.onboarding-brand span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--red); }
.onboarding-brand img { width: 34px; height: 34px; border: 1px solid #d1b985; border-radius: 10px; object-fit: cover; }
.onboarding-skip { min-height: 34px; padding: 5px 10px; color: var(--muted); background: transparent; border-color: transparent; font-size: 11px; }
.onboarding-progress { overflow: hidden; background: #e4e1d8; }
.onboarding-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--red), var(--gold)); transition: width .35s ease; }
.onboarding-stage { display: grid; grid-template-columns: minmax(0, .92fr) minmax(330px, 1.08fr); align-items: center; gap: clamp(24px, 5vw, 62px); padding: clamp(30px, 6vw, 70px); }
.onboarding-stage.onboarding-enter .onboarding-copy { animation: onboarding-copy-in .42s ease both; }
.onboarding-stage.onboarding-enter .onboarding-visual { animation: onboarding-visual-in .52s .05s cubic-bezier(.2,.8,.2,1) both; }
.onboarding-copy h2 { margin: 8px 0 15px; font-size: clamp(32px, 4.4vw, 50px); line-height: 1.02; letter-spacing: -.035em; }
.onboarding-copy > p:last-child { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.onboarding-copy .about-note { margin-top: 16px; padding: 11px 13px; border-left: 3px solid var(--gold); color: var(--muted); background: #f1eee5; font-size: 11px; line-height: 1.5; }
.about-note a { color: var(--green); font-weight: 800; }
.onboarding-visual { display: grid; min-height: 290px; place-items: center; }
.onboarding-actions { border-top: 1px solid #e6e2d8; }
.onboarding-actions > div { display: flex; gap: 8px; }
.onboarding-actions button { min-width: 94px; }
.onboarding-actions button:disabled { cursor: default; opacity: .35; }

.dam-scene { position: relative; width: min(360px, 100%); height: 260px; overflow: hidden; border-radius: 28px; background: linear-gradient(#dceee7 0 62%, #8dc5cf 62%); box-shadow: 0 22px 45px rgba(31,92,69,.18); }
.dam-beaver { position: absolute; z-index: 3; top: 59px; left: 50%; translate: -50% 0; font-size: 88px; animation: beaver-bob 2.2s ease-in-out infinite; }
.dam-sticks { position: absolute; z-index: 2; right: 34px; bottom: 30px; left: 34px; height: 86px; }
.dam-sticks i { position: absolute; right: 0; bottom: 18px; left: 0; height: 18px; border: 3px solid #6e442d; border-radius: 999px; background: #9b6341; transform-origin: center; }
.dam-sticks i:nth-child(1) { rotate: 5deg; }.dam-sticks i:nth-child(2) { rotate: -8deg; }.dam-sticks i:nth-child(3) { rotate: 14deg; }.dam-sticks i:nth-child(4) { rotate: -17deg; }.dam-sticks i:nth-child(5) { rotate: 23deg; }
.dam-water { position: absolute; right: 0; bottom: 0; left: 0; height: 55px; background: repeating-radial-gradient(ellipse at 50% 0, transparent 0 18px, rgba(255,255,255,.28) 19px 21px, transparent 22px 40px); animation: water-shift 4s linear infinite; }
.about-poster { display: grid; width: min(310px, 100%); margin: 0; padding: 7px; place-items: center; overflow: hidden; border-radius: 20px; background: #f4ead1; box-shadow: 0 22px 45px rgba(23,35,29,.2); }
.about-poster img { display: block; width: auto; max-width: 100%; height: auto; max-height: min(430px, 52dvh); object-fit: contain; }
.about-share-visual { position: relative; width: min(350px, 100%); height: 300px; overflow: hidden; border-radius: 50%; background: radial-gradient(circle, #fffdf7 0 26%, #e6efe9 27% 57%, #d6e7de 58%); box-shadow: inset 0 0 0 12px #f4f1e8, 0 20px 42px rgba(31,92,69,.16); }
.share-beaver { position: absolute; z-index: 3; top: 78px; left: 50%; width: 92px; height: 92px; overflow: hidden; border: 6px solid white; border-radius: 50%; translate: -50% 0; box-shadow: 0 10px 24px rgba(23,35,29,.2); }
.share-beaver img { width: 100%; height: 100%; object-fit: cover; }
.share-person { position: absolute; z-index: 2; display: grid; width: 42px; height: 42px; place-items: center; border: 4px solid white; border-radius: 50%; color: white; background: var(--green); font-size: 0; box-shadow: 0 8px 18px rgba(23,35,29,.18); }
.share-person::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: currentColor; box-shadow: 0 13px 0 5px currentColor; }
.person-one { top: 35px; left: 45px; }.person-two { top: 34px; right: 42px; }.person-three { bottom: 64px; left: 32px; }.person-four { right: 28px; bottom: 66px; }
.share-line { position: absolute; top: 144px; left: 50%; width: 215px; height: 2px; background: #8eb49f; transform-origin: center; translate: -50% 0; }
.line-one { rotate: 27deg; }.line-two { rotate: -29deg; }.line-three { rotate: 90deg; }
.about-share-visual strong { position: absolute; right: 0; bottom: 25px; left: 0; color: var(--green); font-family: Georgia, serif; font-size: 16px; line-height: 1.15; text-align: center; }
.founding-people-visual { display: flex; width: min(360px, 100%); min-height: 260px; align-items: center; justify-content: center; gap: 14px; border-radius: 50% 45% 52% 42%; background: #e7efe9; box-shadow: inset 0 0 0 18px #f2f5ef; }
.founding-people-visual span { display: grid; width: 78px; height: 78px; place-items: center; border-radius: 24px; background: white; box-shadow: 0 12px 30px rgba(31,92,69,.12); font-size: 39px; animation: symbol-rise .55s ease both; }
.founding-people-visual span:nth-child(2) { animation-delay: .08s; }.founding-people-visual span:nth-child(3) { animation-delay: .16s; }
.crest-community-visual { position: relative; display: grid; width: min(370px, 100%); min-height: 300px; place-items: center; }
.crest-community-visual img { width: 205px; max-height: 250px; object-fit: contain; filter: drop-shadow(0 14px 18px rgba(23,35,29,.18)); }
.crest-beaver { position: absolute; display: grid; width: 76px; height: 76px; place-items: center; border: 6px solid #fbfaf5; border-radius: 50%; background: var(--red); box-shadow: 0 10px 24px rgba(23,35,29,.22); font-size: 43px; }
.crest-labels { position: absolute; inset: 0; pointer-events: none; }
.crest-labels span { position: absolute; padding: 5px 8px; border-radius: 999px; color: var(--green); background: #e7efe9; font-size: 10px; font-weight: 850; }
.crest-labels span:nth-child(1) { top: 28px; left: 0; }.crest-labels span:nth-child(2) { top: 28px; right: 0; }.crest-labels span:nth-child(3) { bottom: 28px; left: 0; }.crest-labels span:nth-child(4) { right: 0; bottom: 28px; }
.founding-symbols-visual { display: grid; width: min(390px, 100%); grid-template-columns: 1fr 1fr 1.22fr 1fr 1fr; align-items: center; gap: 8px; padding: 18px; border-radius: 26px; background: #ece8dc; box-shadow: 0 18px 38px rgba(23,35,29,.12); }
.crest-crop { position: relative; display: block; width: 100%; aspect-ratio: 1.36; overflow: hidden; border: 3px solid #fbfaf5; border-radius: 12px; background: white; box-shadow: 0 7px 15px rgba(23,35,29,.12); }
.crest-crop img { position: absolute; width: 200%; max-width: none; height: auto; }
.crest-england img { top: 0; left: 0; }.crest-scotland img { top: 0; left: -100%; }.crest-ireland img { top: -100%; left: 0; }.crest-france img { top: -100%; left: -100%; }
.nickel-beaver { z-index: 2; display: block; overflow: hidden; width: 100%; aspect-ratio: 1; border: 5px solid #fbfaf5; border-radius: 50%; background: #f5edda; box-shadow: 0 10px 22px rgba(23,35,29,.2); }
.nickel-beaver img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tutorial-metrics { display: grid; width: min(380px, 100%); gap: 9px; }
.tutorial-metrics article { display: grid; grid-template-columns: 42px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 13px; border: 1px solid #dddcd3; border-radius: 14px; background: white; box-shadow: 0 9px 22px rgba(23,35,29,.07); }
.tutorial-metrics article > span { grid-row: 1 / 3; display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: white; background: var(--red); font-family: Georgia, serif; font-size: 21px; font-weight: 900; }
.tutorial-metrics article strong { font-family: Georgia, serif; font-size: 18px; }.tutorial-metrics article p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }

.tutorial-shop { position: relative; width: min(350px, 100%); height: 245px; padding-top: 40px; border-radius: 18px 18px 6px 6px; background: #e8dfce; box-shadow: 0 20px 40px rgba(23,35,29,.2); text-align: center; }
.shop-awning { position: absolute; top: 0; right: 0; left: 0; height: 42px; border-radius: 17px 17px 8px 8px; background: repeating-linear-gradient(90deg, #9f2030 0 42px, #f8eee0 42px 84px); }
.shop-sign { display: inline-block; margin-top: 18px; padding: 8px 17px; border-radius: 999px; color: white; background: #8f1e2a; font-family: Georgia, serif; font-weight: 900; letter-spacing: .07em; }
.shop-window { width: 125px; height: 83px; margin: 15px auto 0; padding-top: 14px; border: 8px solid #684d3c; border-bottom: 0; background: #b8d9df; font-size: 40px; }
.tutorial-score { display: inline-flex; align-items: center; justify-content: center; margin-top: 10px; padding: 7px 11px; border-radius: 999px; font-size: 11px; font-weight: 900; letter-spacing: .03em; }
.tutorial-shop .tutorial-score { position: absolute; right: 14px; bottom: 13px; }
.tutorial-score.zero { color: #8f1e2a; background: #ffe6e6; }.tutorial-score.two { color: #6b4b00; background: #ffefbd; }.tutorial-score.three { color: #15503a; background: #dff1e5; }
.tutorial-comparison { display: grid; width: 100%; grid-template-columns: 1fr 1fr; gap: 12px; }
.tutorial-comparison article { display: flex; min-height: 285px; flex-direction: column; align-items: flex-start; padding: 15px; border: 1px solid #dddcd3; border-radius: 16px; background: white; box-shadow: 0 12px 28px rgba(23,35,29,.08); }
.tutorial-comparison article strong { margin-top: 12px; font-family: Georgia, serif; font-size: 17px; line-height: 1.15; }
.tutorial-comparison article p { flex: 1; margin: 7px 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.mini-storefront { position: relative; display: grid; width: 100%; min-height: 82px; grid-template-columns: 1fr 42px; grid-template-rows: 32px 1fr; overflow: hidden; border-radius: 11px 11px 4px 4px; color: white; background: #e8dfce; box-shadow: 0 6px 13px rgba(23,35,29,.14); }
.mini-storefront i { position: absolute; z-index: 2; top: 0; right: 0; left: 0; height: 21px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.92) 0 22px, transparent 22px 44px); }
.mini-storefront > strong { z-index: 3; grid-column: 1 / -1; margin: 0 !important; padding-top: 23px; color: white; font-family: inherit !important; font-size: 10px !important; letter-spacing: .08em; text-align: center; }
.mini-storefront b { display: grid; grid-column: 2; grid-row: 2; margin: 5px; place-items: center; border: 4px solid #765747; background: #b8d9df; font-size: 20px; }
.mini-storefront.red { background: #9f2030; }.mini-storefront.blue { background: #316a91; }
.tutorial-editor { display: grid; width: min(380px, 100%); gap: 8px; padding: 18px; border: 1px solid #d8d7cf; border-radius: 18px; background: white; box-shadow: 0 20px 40px rgba(23,35,29,.12); }
.tutorial-editor > div { display: grid; grid-template-columns: 1fr 1.25fr; align-items: center; padding: 10px 12px; border-radius: 10px; background: #f4f4ef; }
.tutorial-editor span { color: var(--muted); font-size: 11px; font-weight: 800; }.tutorial-editor strong { font-size: 12px; }
.tutorial-editor p { margin: 5px 0 0; padding: 12px; border: 1px dashed #8cab97; border-radius: 10px; color: var(--green); font-size: 12px; font-weight: 800; }
.tutorial-finish { display: grid; min-height: 230px; place-items: center; }
.tutorial-finish > span { z-index: 2; font-size: 100px; animation: beaver-bob 2.2s ease-in-out infinite; }
.tutorial-finish div { display: flex; gap: 3px; margin-top: -44px; }.tutorial-finish i { width: 95px; height: 18px; border: 3px solid #6e442d; border-radius: 999px; background: #9b6341; }.tutorial-finish i:nth-child(1) { rotate: 10deg; }.tutorial-finish i:nth-child(3) { rotate: -10deg; }
.proud-beaver { width: min(350px, 100%); margin: 0; overflow: hidden; border-radius: 26px; background: #f6e5bd; box-shadow: 0 20px 42px rgba(23,35,29,.18); }
.proud-beaver img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.replay-onboarding { margin-top: -20px; }

@keyframes onboarding-copy-in { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes onboarding-visual-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes beaver-bob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }
@keyframes water-shift { to { transform: translateX(40px); } }
@keyframes symbol-rise { from { opacity: 0; transform: translateY(18px) rotate(-5deg); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  html, body, .app-shell { width: 100%; height: 100%; min-height: 100dvh; overflow: hidden; }
  .app-shell { display: block; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .sidebar, .map-wrap, .list-pane, .detail-pane, .admin-pane, .research-pane {
    position: fixed;
    inset: 0 0 calc(68px + env(safe-area-inset-bottom));
    width: 100%;
    height: auto;
  }
  .sidebar { padding: max(14px, env(safe-area-inset-top)) 15px 22px; background: #fffdf7; border: 0; box-shadow: none; }
  .sidebar.view-hidden { display: none; }
  .brand { min-height: 72px; margin-bottom: 10px; padding: 10px 88px 10px 10px; border-radius: 14px; }
  .brand-shield-slice { top: -20px; right: -25px; width: 108px; height: 130px; }
  .brand-mark { width: 43px; height: 43px; border-radius: 13px; font-size: 24px; }
  h1 { font-size: 25px; }
  .sidebar > footer { display: none; }
  .find-intro h2 { font-size: 20px; }
  .view-switch { display: none; }
  .status-card { display: none; }
  .keyword-search { grid-template-columns: auto minmax(0, 1fr) auto; }
  .keyword-search button { padding-inline: 12px; }
  input, select, button { min-height: 46px; }
  .results { padding-bottom: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .list-pane { padding: max(18px, env(safe-area-inset-top)) 15px 24px; }
  .detail-pane { padding: max(15px, env(safe-area-inset-top)) 12px 24px; }
  .details { padding: 19px 15px; border-radius: 14px; }
  .list-header { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 10px; margin-bottom: 14px; }
  .list-heading { grid-column: 1 / -1; grid-row: 2; }
  .list-sort { grid-column: 2; grid-row: 1; justify-self: end; }
  .list-header h2 { font-size: 23px; }
  .business-list { grid-template-columns: 1fr; }
  .business-card { min-height: 0; padding: 15px; }
  .dimension-grid { grid-template-columns: 1fr; }
  .dimension-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rating-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rating-choice:last-child { grid-column: 1 / -1; }
  .rating-heading { align-items: start; flex-direction: column; gap: 3px; }
  .rating-heading small { text-align: left; }
  .detail-actions { flex-wrap: wrap; }
  .mobile-nav {
    position: fixed;
    z-index: 3000;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    min-height: calc(68px + env(safe-area-inset-bottom));
    padding: 6px 8px max(6px, env(safe-area-inset-bottom));
    align-items: stretch;
    gap: 3px;
    background: rgba(255,253,247,.98);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 26px rgba(18,31,24,.1);
  }
  .mobile-nav button { display: grid; flex: 1 1 0; min-width: 0; min-height: 54px; padding: 4px; place-items: center; align-content: center; color: var(--muted); background: transparent; border-color: transparent; border-radius: 10px; font-size: 12px; }
  .mobile-nav button.active { color: var(--green); background: #e9f1ec; }
  .mobile-nav button.hidden { display: none; }
  .contribute-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 32px); margin: auto; }
  .contribute-shell { padding: 18px 14px; }
  #add-business-dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 20px); }
  #add-business-form { padding: 18px 14px; }
  .admin-pane { order: 1; padding: 15px; }
  .research-pane { order: 1; padding: 15px; }
  .admin-workspace { grid-template-columns: 1fr; }
  .research-workspace { grid-template-columns: 1fr; }
  .tier0-impact { grid-template-columns: 1fr; }
  .admin-workspace:not(.user-selected) .user-detail { display: none; }
  .admin-workspace.user-selected .admin-users-column { display: none; }
  .user-list { max-height: 260px; }
  .user-permission-editor { grid-template-columns: 1fr; }
  .user-facts { grid-template-columns: 1fr; }
  .tier-control { grid-template-columns: 1fr; }
  .tier-control small { grid-column: 1; margin-top: -5px; }
  .ownership-control-row { align-items: stretch; flex-direction: column; }
  .ownership-control-row select { flex-basis: auto; }
  .note-replies { padding-left: 8px; }
  .canadian-fieldset { grid-template-columns: 1fr; }
  .beaver-search-controls { grid-template-columns: 1fr; }
  .onboarding-dialog {
    position: fixed;
    inset: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    margin: 0;
  }
  .onboarding-shell {
    grid-template-rows: auto 4px minmax(0, 1fr) auto;
    width: 100%;
    height: 100%;
    min-height: 0;
  }
  .onboarding-header, .onboarding-actions { padding: 12px 15px; }
  .onboarding-stage {
    display: flex;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    padding: 24px 18px;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .onboarding-copy, .onboarding-visual { position: relative; flex: 0 0 auto; min-width: 0; }
  .onboarding-copy { z-index: 2; background: #fbfaf5; }
  .onboarding-copy h2 { font-size: 32px; }
  .onboarding-visual { z-index: 1; min-height: 0; }
  .tutorial-comparison { align-items: stretch; }
  .tutorial-comparison article { min-height: 260px; padding: 10px; }
  .tutorial-comparison article strong { font-size: 14px; }
  .proud-beaver { width: min(250px, 74vw); }
  .replay-onboarding { margin-top: 8px; }
  .dam-scene, .founding-people-visual { height: 230px; min-height: 230px; }
  .about-poster { width: min(240px, 72vw); }
  .about-poster img { max-height: none; }
  .about-share-visual { width: min(270px, 78vw); height: 270px; margin: auto; }
}

@media (min-width: 360px) and (max-width: 760px) {
  .brand h1 { font-size: 22px; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .onboarding-progress span { transition: none; }
  .onboarding-stage.onboarding-enter .onboarding-copy,
  .onboarding-stage.onboarding-enter .onboarding-visual,
  .dam-beaver, .dam-water, .founding-people-visual span, .tutorial-finish > span { animation: none; }
}
