/* "How far are we from you?" page. Uses site.css tokens only. */

.nm-hero { padding: 48px 0 64px; overflow: hidden; }
.nm-hero::after {
  /* soft route-line motif, purely decorative */
  content: ''; position: absolute; inset: auto -10% -40% auto; width: 520px; height: 520px;
  border: 1.5px dashed rgba(219,171,58,0.35); border-radius: 50%; pointer-events: none;
}
.nm-hero-grid { display: grid; gap: 28px; align-items: center; position: relative; z-index: 1; }
@media (min-width: 900px) { .nm-hero-grid { grid-template-columns: 1fr 440px; gap: 56px; } }
.nm-hero-copy p { max-width: 520px; }
.nm-hero-points { list-style: none; margin-top: 20px; display: grid; gap: 8px; }
.nm-hero-points li { color: rgba(255,255,255,0.92); font-size: 0.95rem; display: flex; gap: 10px; align-items: center; }
.nm-hero-points li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-bright); flex-shrink: 0; }
/* on phones put the tool right under the H1 */
@media (max-width: 899px) {
  .nm-hero { padding: 28px 0 40px; }
  .nm-hero-copy p, .nm-hero-points { display: none; }
}

/* Tool card */
.nm-tool {
  background: var(--white); border-radius: 14px; padding: 26px 24px 24px;
  box-shadow: 0 18px 50px rgba(70,33,112,0.35);
  border-top: 4px solid var(--gold); color: var(--charcoal);
}
.page-hero .nm-tool-title { font-size: 1.35rem; margin-bottom: 16px; color: var(--charcoal); }
.page-hero .nm-tool p { max-width: none; margin-top: 4px; font-size: 0.85rem; color: var(--slate); }
.page-hero .nm-tool .nm-error, .page-hero .nm-tool .nm-confirm { font-size: 0.92rem; color: var(--charcoal); }
.nm-field { margin-bottom: 16px; }
.nm-field label { display: block; font-weight: 700; font-size: 0.9rem; color: var(--charcoal); margin-bottom: 6px; }
.nm-opt { font-weight: 500; color: var(--slate); }
.nm-field input {
  width: 100%; min-height: 48px; padding: 12px 14px; font: inherit; font-size: 1rem; color: var(--charcoal);
  background: var(--cream); border: 1.5px solid var(--purple-mist); border-radius: 8px;
  transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.nm-field input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(91,44,142,0.18); background: var(--white); }
.nm-field input[aria-invalid="true"] { border-color: var(--purple-deep); }
.nm-geo {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 6px; padding: 0 4px;
  background: none; border: none; font: inherit; font-weight: 700; font-size: 0.9rem; color: var(--purple); cursor: pointer;
}
.nm-geo svg { width: 18px; height: 18px; }
.nm-geo:hover span { text-decoration: underline; }
.nm-note, .nm-hint { font-size: 0.85rem; color: var(--slate); line-height: 1.5; margin-top: 4px; }
.nm-note:empty { display: none; }
.nm-go { width: 100%; min-height: 52px; position: relative; }
.nm-spin { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: nm-rot 0.8s linear infinite; }
.nm-go[aria-busy="true"] .nm-spin { display: inline-block; }
.nm-go[aria-busy="true"] { opacity: 0.85; cursor: progress; }
@keyframes nm-rot { to { transform: rotate(360deg); } }
.nm-error { margin-top: 14px; padding: 12px 14px; border-radius: 8px; background: var(--gold-wash); border-left: 3px solid var(--gold); font-size: 0.92rem; color: var(--charcoal); line-height: 1.55; }
.nm-error a { color: var(--purple); font-weight: 700; text-decoration: underline; }

/* School confirm (inside the tool) */
.nm-confirm { margin-top: 14px; padding: 14px; border-radius: 8px; background: var(--purple-wash); border: 1px solid var(--purple-mist); font-size: 0.92rem; }
.nm-confirm strong { display: block; color: var(--charcoal); margin: 4px 0 10px; }
.nm-confirm .nm-row { display: flex; gap: 10px; flex-wrap: wrap; }
.nm-confirm .btn { padding: 10px 18px; min-height: 44px; }

/* Results */
.nm-results-wrap { background: var(--cream); border-bottom: 1px solid var(--purple-mist); padding: 56px 0; }
#nmResultsTitle:focus { outline: none; }
.nm-est { font-size: 0.92rem; margin-top: 4px; }
.nm-far { margin-top: 12px; padding: 12px 14px; border-radius: 8px; background: var(--gold-wash); border-left: 3px solid var(--gold); color: var(--charcoal); }
.nm-layout { display: grid; gap: 24px; margin-top: 24px; }
@media (min-width: 960px) { .nm-layout { grid-template-columns: 1fr 1fr; align-items: start; } .nm-mapcol { position: sticky; top: 84px; } }
.nm-cards { display: grid; gap: 16px; }

.nm-card {
  background: var(--white); border: 1px solid var(--purple-mist); border-radius: 14px; padding: 20px;
  box-shadow: 0 2px 12px rgba(91,44,142,0.08); cursor: pointer;
  transition: box-shadow 0.25s var(--ease-out), transform 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}
.nm-card:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(91,44,142,0.16); }
.nm-card.is-selected { border-color: var(--purple); box-shadow: 0 12px 40px rgba(91,44,142,0.18); }
.nm-card.is-nearest { border-top: 4px solid var(--gold); }
.nm-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.nm-card h3 { font-size: 1.2rem; }
.nm-addr { font-size: 0.92rem; color: var(--slate); margin-top: 2px; }
.nm-badge { display: inline-block; margin-bottom: 8px; padding: 4px 12px; border-radius: 20px; background: var(--gold); color: var(--charcoal); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.nm-pin { flex-shrink: 0; width: 34px; height: 34px; }
.nm-stats { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 16px 0 8px; }
.nm-stat { display: flex; align-items: baseline; gap: 6px; color: var(--slate); font-size: 0.92rem; }
.nm-stat b { font-family: var(--font-display); font-size: 1.7rem; color: var(--purple); line-height: 1; }
.nm-stat .nm-sub { color: var(--slate); }
.nm-hours { font-size: 0.92rem; color: var(--charcoal); margin-bottom: 14px; }
.nm-hours strong { color: var(--purple); }
.nm-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.nm-actions .btn { min-height: 44px; padding: 11px 20px; }
.nm-actions .btn-call { background: none; color: var(--purple); padding: 11px 8px; text-decoration: underline; text-underline-offset: 3px; }
.nm-small { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; }
.nm-link { display: inline-flex; align-items: center; min-height: 44px; background: none; border: none; padding: 0; font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--purple); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.nm-select { margin-left: auto; }

/* Route map: Leaflet canvas + floating ETA card, origin toggle and replay (all inside one 16px frame) */
.nm-map { position: relative; height: 320px; border-radius: 16px; overflow: hidden; background: var(--purple-wash); box-shadow: 0 18px 50px rgba(91,44,142,0.16); isolation: isolate; }
.nm-map::after { content: ''; position: absolute; inset: 0; border: 1px solid rgba(91,44,142,0.16); border-radius: 16px; pointer-events: none; z-index: 3; }
@media (min-width: 960px) { .nm-map { height: 520px; } }
.nm-canvas { position: absolute; inset: 0; z-index: 0; background: #eee9de; }
.nm-canvas .leaflet-container, .nm-canvas.leaflet-container { font-family: var(--font-body); }
.nm-canvas .leaflet-tile-pane { filter: saturate(.65) sepia(.12) brightness(1.03); }
.nm-canvas .leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,0.9); }
.nm-canvas .leaflet-top.leaflet-right { top: 4px; right: 4px; }
.nm-canvas .leaflet-control-zoom a, .nm-canvas.leaflet-touch .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; color: var(--purple-deep); }

.nm-topbar { position: absolute; z-index: 2; top: 12px; left: 12px; right: 64px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; pointer-events: none; }
.nm-topbar > * { pointer-events: auto; }
.nm-origin { display: inline-flex; padding: 3px; gap: 2px; border-radius: 8px; background: var(--white); box-shadow: 0 5px 18px rgba(91,44,142,0.15); }
.nm-origin[hidden] { display: none; }
.nm-origin button, .nm-replay { min-height: 44px; border: none; border-radius: 8px; background: none; font: inherit; font-weight: 700; font-size: 0.82rem; color: var(--purple-deep); cursor: pointer; padding: 0 12px; transition: background 0.25s var(--ease-out), color 0.25s var(--ease-out); }
.nm-origin button[aria-pressed="true"] { background: var(--purple); color: var(--white); }
.nm-replay { background: var(--white); border: 1px solid rgba(91,44,142,0.16); box-shadow: 0 5px 18px rgba(91,44,142,0.15); }

.nm-eta { position: absolute; z-index: 2; left: 12px; right: 12px; bottom: 26px; background: var(--white); border: 1px solid rgba(91,44,142,0.12); border-radius: 14px; box-shadow: 0 10px 30px rgba(91,44,142,0.17); padding: 10px 12px; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; }
@media (min-width: 960px) { .nm-eta { right: auto; width: 300px; bottom: 30px; left: 16px; grid-template-columns: 1fr; padding: 14px 16px; } }
.nm-modes { display: inline-flex; padding: 3px; gap: 2px; border-radius: 8px; background: var(--purple-wash); grid-row: span 2; justify-self: start; }
@media (min-width: 960px) { .nm-modes { grid-row: auto; margin-bottom: 8px; } }
.nm-mode { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; min-width: 44px; padding: 0 10px; border: none; border-radius: 8px; background: none; font: inherit; font-weight: 700; font-size: 0.82rem; color: var(--slate); cursor: pointer; transition: background 0.25s var(--ease-out), color 0.25s var(--ease-out); }
@media (max-width: 959px) { .nm-mode-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
.nm-mode svg { width: 18px; height: 18px; flex-shrink: 0; }
.nm-mode[aria-pressed="true"] { background: var(--white); color: var(--purple); box-shadow: 0 2px 8px rgba(91,44,142,0.12); }
.nm-mode[hidden] { display: none; }
.nm-mode:disabled { opacity: 0.45; cursor: not-allowed; }
.nm-results-wrap .nm-eta-num { font-family: var(--font-body); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; color: var(--charcoal); line-height: 1.2; margin: 0; }
.nm-results-wrap .nm-eta-dest { font-size: 0.8rem; color: var(--slate); line-height: 1.35; margin: 2px 0 0; }
@media (min-width: 960px) { .nm-results-wrap .nm-eta-num { font-size: 1.55rem; } }

/* Map failed: hide the canvas, keep the ETA + toggles as a normal card */
.nm-map.is-failed { height: auto; box-shadow: none; overflow: visible; background: none; }
.nm-map.is-failed::after, .nm-map.is-failed .nm-canvas, .nm-map.is-failed .nm-replay { display: none; }
.nm-map.is-failed .nm-topbar, .nm-map.is-failed .nm-eta { position: static; width: auto; margin-bottom: 8px; }

/* Markers */
.nm-mk { background: none; border: none; }
.nm-mk-you, .nm-mk-school, .nm-mk-trav { display: grid; place-items: center; border-radius: 50%; }
.nm-mk-you { width: 22px; height: 22px; background: #3B82C4; border: 4px solid #fff; box-shadow: 0 0 0 8px rgba(59,130,196,0.18), 0 3px 10px rgba(91,44,142,0.25); }
.nm-mk-school { width: 30px; height: 30px; background: var(--gold-bright); border: 3px solid #fff; color: var(--purple-deep); box-shadow: 0 3px 10px rgba(91,44,142,0.25); }
.nm-mk-school svg { width: 16px; height: 16px; }
.nm-mk-trav { width: 16px; height: 16px; background: #3B82C4; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(91,44,142,0.3); }
.nm-mk-label { position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); padding: 3px 8px; white-space: nowrap; border-radius: 20px; background: #fff; color: var(--purple-deep); font-size: 10px; font-weight: 700; box-shadow: 0 3px 10px rgba(91,44,142,0.16); }
.nm-mk-pin { position: relative; display: block; width: 36px; height: 36px; transform-origin: 50% 120%; }
.nm-mk-pin.is-other { opacity: 0.7; transform: scale(0.8); }
.nm-mk-pin.is-sel { animation: nm-arrive 0.45s cubic-bezier(0.16,1,0.3,1) both; }
.nm-mk-head { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--purple); border: 3px solid #fff; box-shadow: 0 4px 12px rgba(91,44,142,0.3); }
.nm-mk-head b { transform: rotate(45deg); color: #fff; font-size: 10px; }
.nm-mk-chip { position: absolute; left: 44px; top: -4px; background: #fff; border-radius: 8px; padding: 6px 9px; width: max-content; max-width: 170px; color: var(--purple-deep); box-shadow: 0 4px 12px rgba(91,44,142,0.18); font-size: 10px; line-height: 1.35; text-align: center; }
.nm-mk-chip b { display: block; }
/* .is-left: chip to the left of the pin */
.nm-mk-chip.is-left { left: auto; right: 44px; }
@keyframes nm-arrive { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: scale(1); } }

.nm-steps { margin-top: 14px; background: var(--white); border: 1px solid var(--purple-mist); border-radius: 14px; }
.nm-steps summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; padding: 0 18px; font-weight: 700; color: var(--purple); }
.nm-steps ol { margin: 0 18px 16px 40px; color: var(--slate); font-size: 0.92rem; line-height: 1.7; }

/* School block */
.nm-school { margin-top: 20px; padding: 20px; border-radius: 14px; background: var(--purple-wash); border: 1px solid var(--purple-mist); }
.nm-school h3 { font-size: 1.15rem; margin-bottom: 4px; }
.nm-school ul { list-style: none; margin: 12px 0; display: grid; gap: 8px; }
.nm-school li { font-size: 0.95rem; color: var(--charcoal); }
.nm-school p { font-size: 0.92rem; }

.nm-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nm-measure { padding-bottom: 40px; }
.cta-band .nm-on-purple { color: var(--white); border-color: var(--white); }

/* Focus rings everywhere on this page */
.nm-tool :focus-visible, .nm-results-wrap :focus-visible, .cta-band :focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 2px; }
.nm-card:focus-within { border-color: var(--purple); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nm-card, .nm-field input, .nm-mode, .nm-origin button, .nm-replay, .btn { transition: none !important; }
  .nm-mk-pin.is-sel { animation: none; }
  .nm-card:hover, .btn:hover { transform: none !important; }
  .nm-spin { animation-duration: 2.4s; }
}

/* Neighborhood table (static, crawlable) */
.nm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nm-table { width: 100%; margin-top: 24px; border-collapse: separate; border-spacing: 0; background: var(--white); border: 1px solid var(--purple-mist); border-radius: 14px; overflow: hidden; box-shadow: 0 2px 12px rgba(91,44,142,0.10); font-size: 0.95rem; }
.nm-table th, .nm-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--purple-mist); vertical-align: top; color: var(--slate); }
.nm-table thead th { background: var(--purple-wash); color: var(--purple); font-weight: 700; font-size: 0.85rem; }
.nm-table tbody th { color: var(--charcoal); font-weight: 700; }
.nm-table tbody tr:last-child th, .nm-table tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 600px) {
  .nm-table { font-size: 0.85rem; }
  .nm-table th, .nm-table td { padding: 10px 8px; }
}

/* Storefront photo at the top of each center card */
.nm-card { position: relative; overflow: hidden; }
.nm-photo { margin: -20px -20px 16px; aspect-ratio: 16 / 9; background: var(--purple-wash); }
.nm-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nm-card .nm-badge { position: absolute; top: 12px; left: 12px; z-index: 1; box-shadow: 0 2px 12px rgba(91,44,142,0.28); }
@media (max-width: 600px) { .nm-photo { aspect-ratio: 2 / 1; } }
