/* Canada Near Me / Atlas — local visual proposal.
   Presentation only. No changes to content, data, map sources or app handlers. */
:root {
  --red: #b51f2e;
  --red-dark: #901925;
  --ink: #183037;
  --blue: #183940;
  --muted: #536a72;
  --paper: #f0f4f3;
  --white: #FBFAFC;
  --line: #dce5e3;
  --green: #26734a;
  --shadow: 0 24px 80px rgba(17, 45, 48, .17);
  --atlas-sans: "Segoe UI Variable Text", "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
  --atlas-display: "Segoe UI Variable Display", "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
  font-family: var(--atlas-sans);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { background: var(--paper); }
button, input, textarea, select { font-family: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }
:where(a, button, select, input, textarea):focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 4px;
}
[hidden] { display: none !important; }

/* The emblem and wordmark remain the recognisable brand, not a new logo. */
.topbar {
  height: 76px;
  padding: 0 28px;
  background: #FBFAFC;
  border-bottom-color: var(--line);
}
.brand.brand-png { gap: 8px; min-height: 44px; }
.brand-emblem-image { width: 52px; flex-basis: 52px; }
.brand-title { font-size: 25px; letter-spacing: -.025em; color: var(--ink); }
.brand-tagline { font-family: var(--atlas-sans); font-size: 11px; color: var(--muted); }
.topbar-actions { margin-left: 28px; }
.social-follow { gap: 22px; }
.social-follow-title { font-size: 10px; letter-spacing: .15em; color: var(--muted); font-weight: 700; }
.social-chip {
  min-height: 40px;
  gap: 9px;
  padding: 5px 13px 5px 6px;
  border-radius: 12px;
  border-color: var(--line);
  font-size: 13px;
  font-weight: 650;
  transition: background .16s ease, border-color .16s ease;
}
.social-chip:hover { border-color: #b4c6c3; background: #f6f9f8; }
.social-icon { width: 27px; height: 27px; flex-basis: 27px; border-radius: 7px; }
.social-chip > span:last-child:not(.social-icon) { top: 0; }

.sidebar-shell { background: var(--paper); }
.sidebar-links { color: #415b62; font-family: var(--atlas-sans); font-weight: 550; }
.sidebar-links > span { color: #95a6a4; }
.sidebar-links a:hover, .sidebar-links button:hover { color: var(--red); }
.stats-ribbon { background: var(--paper); border-bottom: 0; }
#liveStats { color: #38575e; font-size: 12px; font-weight: 650; }
#liveStatsMeta { color: var(--muted); font-size: 11px; }

/* Calm introductory typography, with more room reserved for actual discovery. */
.sidebar .intro { padding-top: 0; padding-bottom: 0; }
.sidebar .intro .eyebrow,
.sidebar .intro .eyebrow.eyebrow-balanced {
  height: auto;
  padding: 0 0 0 10px;
  margin: 0 0 12px;
  border-left: 2px solid var(--red);
  color: var(--red);
  font: 700 10px/1.75 var(--atlas-sans);
  letter-spacing: .075em;
  text-wrap: pretty;
}
.sidebar .intro h1 {
  height: auto;
  padding: 0;
  margin: 0 0 14px;
  color: var(--ink);
  font-family: var(--atlas-display);
  font-size: clamp(30px, 2.8vw, 45px);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -.055em;
}
.sidebar .intro > p:not(.eyebrow) {
  max-width: 48ch;
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}
.primary-action, .secondary-action {
  border-radius: 10px;
  font-weight: 650;
  min-height: 42px;
  padding-top: 0;
  padding-bottom: 0;
  transition: background .16s ease, border-color .16s ease;
}
.primary-action { background: var(--red); box-shadow: 0 3px 8px rgba(130, 22, 35, .10); }
.primary-action:hover { background: var(--red-dark); }
.secondary-action { background: #FBFAFC; border-color: var(--line); }

.sidebar .search label, .sidebar .filters legend,
.discovery-selects label {
  font-family: var(--atlas-sans);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 650;
  color: var(--ink);
}
.sidebar .search-field,
.compact-desktop-search #searchForm .search-field {
  min-height: 48px;
  grid-template-columns: 23px minmax(0, 1fr) auto;
  gap: 4px;
  padding: 4px 5px 4px 12px;
  border: 1px solid #cbd9d6;
  border-radius: 13px;
  background: #FBFAFC;
  box-shadow: 0 4px 12px rgba(23, 55, 59, .035);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.search-field:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(181, 31, 46, .10);
}
.sidebar .search-field input,
.compact-desktop-search #searchForm .search-field > input {
  height: 38px;
  font-size: 14px;
  color: var(--ink);
}
.search-field input::placeholder { color: #5d7379; opacity: 1; }
.sidebar .search-field button,
.compact-desktop-search #searchForm .search-field > button[type="submit"] {
  height: 38px;
  padding: 0 15px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
}
.sidebar .filters { margin: 18px 0; }
.sidebar .filters legend { margin-bottom: 8px; }
.sidebar .filter-row { gap: 7px; }
#categoryFilters .filter-chip {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 9px;
  border-color: var(--line);
  background: #f5f8f7;
  color: #425d64;
  transition: background .16s ease, border-color .16s ease;
}
#categoryFilters .filter-chip:hover { background: #FBFAFC; border-color: #b8c9c6; color: var(--ink); }
#categoryFilters .filter-chip.active { background: var(--blue); border-color: var(--blue); color: #FBFAFC; }
.discovery-tools { margin-bottom: 22px; }
.discovery-selects { gap: 10px; }
.discovery-selects label { gap: 7px; }
.discovery-selects select {
  height: 44px;
  padding: 8px 10px;
  border-radius: 10px;
  border-color: #cbd9d6;
  background-color: #FBFAFC;
  color: var(--ink);
  font-size: 12px;
  font-weight: 550;
}
.discovery-filter-summary { margin-top: 10px; font-size: 12px; line-height: 1.5; }
.discovery-filter-summary button { font-size: 12px; text-underline-offset: 3px; }
.results-heading { padding-top: 20px; gap: 12px; border-color: var(--line); }
.results-heading h2 { font: 650 19px/1.25 var(--atlas-display); letter-spacing: -.025em; }
.results-heading span { flex: 0 0 auto; font-size: 12px; }
.results { gap: 10px; margin-top: 16px; }
.result-card {
  position: relative;
  padding: 18px;
  border-color: var(--line);
  border-radius: 14px;
  background: #FBFAFC;
  box-shadow: 0 2px 4px rgba(23, 55, 59, .015);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.result-card:hover, .result-card:focus-visible {
  transform: none;
  border-color: #99b4af;
  background: #fbfdfc;
  box-shadow: 0 4px 12px rgba(23, 55, 59, .055);
}
.result-card:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.discovery-brand-card.selected { background: #fff7f7; border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.result-card h3 { font-size: 16px; font-weight: 650; letter-spacing: -.012em; }
.result-card p { font-size: 12px; }
.product-line { font-size: 12px; font-weight: 650; margin-top: 13px; }
.product-line::before { width: 6px; height: 6px; background: var(--product-category-color, var(--muted)); }
.meta-row { margin-top: 12px; }
.meta-chip { background: #f7f9f8; border-radius: 6px; padding: 4px 7px; font-size: 10px; font-weight: 600; }
.empty-state, .no-reviews { border-color: #c2d2ce; background: #f8fbfa; }

/* Map tiles, marker locations, cluster geometry and map interaction stay intact. */
.map-panel { background: #dce9e8; }
.map-key {
  left: 18px;
  bottom: 32px;
  gap: 9px;
  padding: 11px 14px;
  border: 1px solid rgba(251, 250, 252, .8);
  border-radius: 11px;
  background: rgba(251, 250, 252, .96);
  color: var(--ink);
  box-shadow: 0 3px 18px rgba(23, 55, 59, .10);
  font-size: 12px;
  font-weight: 650;
}
.map-attribution-note { right: 10px; bottom: 4px; font-size: 10px; border-radius: 4px; }
.leaflet-control-zoom { border: 1px solid #d3dfdc !important; border-radius: 10px !important; box-shadow: 0 3px 12px rgba(23, 55, 59, .09) !important; overflow: hidden; }
.leaflet-control-zoom a { color: var(--ink); background: #FBFAFC; }
.canada-cluster { background: rgba(181, 31, 46, .14); }
.canada-cluster span { box-shadow: 0 3px 10px rgba(105, 24, 35, .22); font-weight: 700; }

/* All existing dialogs receive the same quieter visual language. */
dialog { border: 1px solid #e0e9e6; border-radius: 22px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(15, 34, 39, .48); backdrop-filter: blur(5px); }
.dialog-close { background: #f0f5f3; color: var(--ink); border: 1px solid #e0e9e6; }
.dialog-close:hover { background: #e3eeea; }
.detail-hero { border-color: var(--line); }
.detail-hero h2, .about-dialog h2 { font-family: var(--atlas-display); font-weight: 650; line-height: 1.12; letter-spacing: -.035em; }
.detail-hero h2 { font-size: 30px; }
.detail-hero p { font-size: 14px; }
.detail-product { background: #fafcfb; border-color: var(--line); border-radius: 15px; }
.detail-product h3 { font-weight: 650; line-height: 1.4; letter-spacing: -.01em; }
.detail-product p { line-height: 1.5; }
.detail-product-image { border-radius: 12px; }
#detailContent .location-brands-summary { background: #f3f7f5; border-color: var(--line); border-left: 3px solid var(--red); border-radius: 12px; }
#detailContent .location-brand-chip { border-color: #d2e1db; border-radius: 7px; font-weight: 600; }
.category-pill { border-radius: 6px; padding: 6px 9px; }
.navigate-link, .inline-link-button { border-radius: 10px; font-weight: 650; padding: 12px 16px; }
.availability-note { background: #eef5f4; border-left-color: #9bbcb4; color: #3b5c5e; border-radius: 0 10px 10px 0; }
.community-form input, .community-form select, .community-form textarea { border-color: #cbd9d6; border-radius: 10px; background: #fbfdfc; }
.community-form label { color: var(--ink); font-weight: 600; }
.community-form :where(input, select, textarea):focus-visible { background: #FBFAFC; }

/* About, Contact and Privacy retain all their content and deep-link anchors. */
.about-page { background: var(--paper); color: var(--ink); font: 16px/1.75 var(--atlas-sans); }
.about-page-header { padding: 16px 28px; border-color: var(--line); }
.about-page-brand img { width: 52px; flex-basis: 52px; }
.about-page-name { font-size: 25px; letter-spacing: -.025em; }
.about-page-tagline { color: var(--muted); font: 11px/1.4 var(--atlas-sans); }
.about-page-back { border-color: #cbd9d6; border-radius: 10px; font-size: 13px; font-weight: 600; background: #FBFAFC; }
.about-page main {
  width: min(100% - 48px, 880px);
  margin: 36px auto;
  padding: clamp(24px, 5vw, 64px);
  background: #FBFAFC;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(23, 55, 59, .035);
}
.about-page h1 { font: 700 11px/1.5 var(--atlas-sans); letter-spacing: .12em; color: var(--red); margin-bottom: 18px; }
.about-page .about-mission { font: 650 clamp(34px, 4vw, 52px)/1.07 var(--atlas-display); letter-spacing: -.05em; margin-bottom: 24px; }
.about-page h2:not(.about-mission) { font: 650 24px/1.25 var(--atlas-display); letter-spacing: -.03em; margin: 34px 0 14px; }
.about-page p { color: var(--muted); }
.about-page .about-lead { font-size: 18px; line-height: 1.65; color: #34555c; }
.about-page .about-availability { background: #f0f6f3; border-left-color: #a7c6b8; border-radius: 0 10px 10px 0; }
.about-page .about-invitation { border-color: var(--line); color: var(--ink); }
.about-page .about-contact { margin-top: 30px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 14px; background: #f5f9f7; }
.about-page .about-contact h2 { margin-top: 0; }
.about-page .about-contact p { margin-bottom: 0; }
.about-page #analytics { scroll-margin-top: 24px; }
.about-page-footer { border-color: var(--line); font: 13px/1.6 var(--atlas-sans); }

@media (min-width: 861px) {
  @supports (grid-template-rows: subgrid) {
    .app-shell { grid-template-columns: clamp(390px, 36vw, 560px) minmax(0, 1fr); }
    /* Match the map's right inset, then center the complete statistics group. */
    .app-shell > .stats-ribbon { width: auto; margin-right: 16px; justify-content: center; }
  }
  /* Include the former 12px panel gap in the utility row so its text is
     centered between header and panels. The panels themselves do not move. */
  .sidebar-links-desktop { min-height: 52px; padding: 0 26px; border-bottom: 0; gap: 0 9px; font-size: 13px; line-height: 20px; }
  .sidebar-links-desktop > a, .sidebar-links-desktop > button { padding-top: 0; padding-bottom: 0; }
  .stats-ribbon { min-height: 52px; padding-top: 0; padding-bottom: 0; }
  #liveStats, #liveStatsMeta { line-height: 20px; }
  #liveStatsMeta { display: inline-flex; align-items: center; gap: 14px; }
  #liveStatsMeta::before { display: block; flex: 0 0 1px; margin: 0; vertical-align: baseline; }
  .sidebar-shell { border-right: 0; }
  .sidebar-shell > .sidebar {
    margin: 0 12px 12px;
    padding: 24px 22px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #FBFAFC;
    box-shadow: 0 4px 20px rgba(23, 55, 59, .025);
    scrollbar-gutter: stable;
  }
  .workspace > .map-panel { margin: 0 16px 12px 0; border: 1px solid #ceddd7; border-radius: 20px; overflow: hidden; }
  .compact-desktop-search #searchForm .search-header { gap: 10px; margin-bottom: 8px; }
  .compact-desktop-search #searchForm .search-header > label { font-size: 13px; line-height: 1.3; }
  .compact-desktop-search #searchForm .search-header #heroSuggestButton { min-height: 34px; height: 34px; font-size: 11px; padding: 0 11px; border-radius: 9px; }
}

/* Short laptop screens: preserve useful controls rather than oversize decoration. */
@media (min-width: 861px) and (max-height: 740px) {
  .topbar { height: 64px; }
  .sidebar-links-desktop, .stats-ribbon { min-height: 44px; }
  .sidebar-links-desktop > a, .sidebar-links-desktop > button { min-height: 36px; }
  .sidebar-shell > .sidebar { margin: 0 12px 8px; padding: 16px 18px; }
  .workspace > .map-panel { margin-top: 0; margin-bottom: 8px; }
  .sidebar .intro .eyebrow, .sidebar .intro .eyebrow.eyebrow-balanced { margin-bottom: 5.4px; font-size: 9px; line-height: 1.65; }
  .sidebar .intro h1 { font-size: clamp(28px, 2.6vw, 38px); line-height: 1.08; margin-bottom: 10px; }
  .sidebar .intro > p:not(.eyebrow) { margin-bottom: 12px; font-size: 13px; line-height: 1.5; }
  .compact-desktop-search .sidebar .intro { padding-bottom: 0; }
  .compact-desktop-search .sidebar .intro > p:not(.eyebrow) { margin-bottom: 10px; }
  .compact-desktop-search #searchForm .search-field { min-height: 44px; }
  .compact-desktop-search #searchForm .search-field > input,
  .compact-desktop-search #searchForm .search-field > button[type="submit"] { height: 34px; }
  .sidebar .filters { margin: 10px 0; }
  #categoryFilters .filter-chip { min-height: 30px; padding: 6px 10px; font-size: 11px; }
  .discovery-selects label { gap: 5px; }
  .discovery-selects select { height: 38px; }
}

@media (max-width: 860px) {
  .topbar { height: 70px; padding: 0 16px; }
  .brand-emblem-image { width: 42px; flex-basis: 42px; }
  .brand-title { font-size: 19px; }
  .brand-tagline { font-size: 9px; }
  .social-chip { width: 44px; min-height: 44px; padding: 6px; border-radius: 12px; }
  .social-icon { width: 28px; height: 28px; flex-basis: 28px; }
  .sidebar-shell { background: #FBFAFC; }
  .sidebar-shell > .sidebar { padding: 24px 18px 32px; background: #FBFAFC; }
  .sidebar .intro h1 { font-size: clamp(31px, 7.5vw, 44px); }
  .sidebar .intro > p:not(.eyebrow) { font-size: 15px; }
  .sidebar .intro .eyebrow { max-width: 48ch; }
  .sidebar .cta-row { margin: 18px 0; }
  .sidebar-links-mobile { margin: 0 0 18px; font-size: 12px; gap: 0 8px; }
  .sidebar-links-mobile a, .sidebar-links-mobile button { min-height: 44px; }
  .sidebar .search label { margin-bottom: 8px; font-size: 14px; }
  .sidebar .search-field input { font-size: 16px; }
  #categoryFilters .filter-chip { min-height: 40px; padding: 9px 12px; font-size: 12px; }
  .discovery-selects select { height: 46px; font-size: 14px; }
  .sidebar > .map-panel { width: 100%; margin: 4px 0 24px; border: 1px solid #ceddd7; border-radius: 16px; overflow: hidden; }
  .map-key { left: 12px; bottom: 30px; padding: 9px 11px; font-size: 11px; }
  .results-heading h2 { font-size: 20px; }
  .results { gap: 10px; }
  .result-card { padding: 18px; }
  .detail-dialog, .about-dialog { border-radius: 22px 22px 16px 16px; }
  .detail-hero h2 { font-size: 27px; }
  .about-page-header { padding: 14px 18px; }
  .about-page-brand img { width: 42px; flex-basis: 42px; }
  .about-page-name { font-size: 19px; }
  .about-page-tagline { font-size: 9px; }
  .about-page main { width: calc(100% - 28px); padding: 28px 22px; margin: 20px auto; border-radius: 18px; }
  .about-page .about-contact { padding: 18px; }
}
@media (max-width: 380px) {
  .topbar { padding: 0 12px; }
  .brand-title { font-size: 17px; }
  .brand-tagline { font-size: 8px; }
  .brand-emblem-image { width: 36px; flex-basis: 36px; }
  .sidebar-shell > .sidebar { padding-left: 16px; padding-right: 16px; }
  .sidebar .intro h1 { font-size: 30px; }
  .discovery-selects { gap: 8px; }
  .discovery-selects select { font-size: 13px; padding-left: 7px; }
  .detail-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .filter-chip.active, .discovery-brand-card.selected { outline: 2px solid Highlight; }
  .search-field:focus-within { outline: 2px solid Highlight; }
}

/* Match native dialog surfaces to this local color study. */
dialog { background-color: #FBFAFC; }

/* Keep the three discovery control interiors white on the soft-white panels. */
.sidebar .search-field,
.compact-desktop-search #searchForm .search-field,
.discovery-selects select {
  background-color: #FFFFFF;
}

/* Match pointer and keyboard feedback, without hiding a selected state. */
#categoryFilters .filter-chip:not(.active):is(:hover, :focus-visible),
.result-card:not(.selected):is(:hover, :focus-visible),
.detail-product:is(:hover, :focus-within) {
  background-color: #FFFFFF;
}
