/* Raymond store locator — styled to match the iAvatarZ report matrix tool */
:root {
  --navy: #2B354F;        /* app header */
  --navy-2: #20314A;      /* dark text */
  --navy-3: #3B4963;      /* menus on navy */
  --navy-hover: #43516F;
  --primary: #1E3A8A;     /* headings, numbers, step badges */
  --blue: #2563EB;        /* links, sign-in button */
  --panel: #E6F0F9;       /* KPI panel, table header */
  --panel-line: #DBEAFE;  /* blue-100 borders */
  --label: #5C728B;       /* uppercase metric labels */
  --accent: #0D9488;      /* teal-600: primary action ("Generate Report") */
  --accent-hover: #0F766E;
  --accent-bright: #14B8A6; /* teal-500: active nav item */
  --danger: #DC2626;
  --ink: #111827;
  --text: #374151;
  --muted: #6B7280;
  --line: #E5E7EB;
  --bg: #FFFFFF;
  --soft: #F9FAFB;
  --shadow: 0 4px 12px rgba(17, 24, 39, .10);
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .06);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
svg { fill: currentColor; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }

/* small uppercase label, as used for IMPRESSIONS / CLICKS in the report tool */
.mono-label {
  margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--label);
}

/* ================= Login (mirrors the report matrix tool) ================= */
.login {
  position: fixed; inset: 0; z-index: 60; overflow: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px; background: #F3F4F6; color: var(--ink);
}
.login-card {
  width: 100%; max-width: 448px; padding: 32px; background: #fff;
  border-radius: 4px; box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
}
.login-logo { display: flex; justify-content: center; margin-bottom: 24px; }
.login-logo img { height: 80px; width: auto; }
.login-card h2 { margin: 0 0 24px; text-align: center; font-size: 24px; line-height: 1.3; font-weight: 700; color: #111827; }
.login-error { margin-bottom: 20px; padding: 12px; border-radius: 4px; background: #FEE2E2; color: #EF4444; font-size: 14px; }
#loginForm { display: flex; flex-direction: column; gap: 24px; }
.field { position: relative; display: block; }
.field svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: #9CA3AF; fill: none; pointer-events: none; }
.field input {
  width: 100%; height: 42px; padding: 8px 16px 8px 40px;
  font: inherit; font-size: 16px; color: #111827;
  border: 1px solid #D1D5DB; border-radius: 4px; outline: none; background: #fff;
}
.field input:focus { border-color: transparent; box-shadow: 0 0 0 2px #3B82F6; }
.login-btn { height: 42px; width: 100%; border: 0; border-radius: 4px; background: var(--blue); color: #fff; font-weight: 700; font-size: 16px; }
.login-btn:hover { background: #1D4ED8; }

/* ================= Explorer ================= */
.explorer { position: fixed; inset: 0; z-index: 55; display: flex; flex-direction: column; background: var(--bg); }

.tool-header {
  flex: none; display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px 16px;
  padding: calc(var(--safe-t) + 12px) 16px 12px; background: var(--navy); color: #fff;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.15); z-index: 3;
}
.tool-logo { height: 28px; width: auto; align-self: center; }
.hdr-fields { order: 3; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hf { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hf > span, .hf > label { font-size: 12px; color: #D1D5DB; }
.hf select, .search-box input {
  height: 38px; width: 100%; border: 0; border-radius: 4px; background: #fff; color: var(--ink);
  font: inherit; font-size: 14px; padding: 0 10px; outline: none;
}
.hf select:focus, .search-box input:focus { box-shadow: 0 0 0 2px var(--accent-bright); }
.hf-search { grid-column: 1 / -1; }
.search-box { position: relative; }
.search-results {
  position: absolute; left: 0; right: 0; top: 42px; z-index: 20; max-height: 60vh; overflow-y: auto;
  background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow);
}
.sr-group { padding: 8px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--label); background: var(--soft); border-top: 1px solid var(--line); }
.sr-group:first-child { border-top: 0; }
.sr-item { display: block; width: 100%; padding: 9px 12px; border: 0; background: #fff; text-align: left; border-top: 1px solid #F3F4F6; }
.sr-item:hover, .sr-item[aria-selected="true"] { background: #F3F4F6; }
.sr-item strong { display: block; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-item span { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-empty { padding: 14px 12px; font-size: 14px; color: var(--muted); }

.user-menu { position: relative; margin-left: auto; align-self: center; }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; background: #D1D5DB; color: var(--ink); font-weight: 700; font-size: 12px; }
.avatar:hover { border-color: #fff; }
.user-pop {
  position: absolute; right: 0; top: 40px; width: 200px; padding: 4px 0; z-index: 30;
  background: #fff; color: var(--ink); border: 1px solid #F3F4F6; border-radius: 6px; box-shadow: var(--shadow);
}
.user-id { padding: 8px 16px; border-bottom: 1px solid #F3F4F6; }
.user-id strong { display: block; font-size: 14px; }
.user-id span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.user-pop button { display: block; width: 100%; padding: 8px 16px; border: 0; background: #fff; text-align: left; font-size: 14px; color: #030712; }
.user-pop button:hover { background: #F3F4F6; }

.ex-shell { flex: 1; min-height: 0; display: flex; }
.ex-side { display: none; }
.ex-main { flex: 1; min-width: 0; overflow-y: auto; padding: 18px 16px calc(var(--safe-b) + 28px); background: #fff; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.page-title { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: var(--primary); }
.step-badge { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.data-note {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--label);
  background: #fff; border: 1px solid var(--line); padding: 5px 12px; border-radius: 4px; box-shadow: var(--shadow-sm);
}
.data-note b { color: var(--primary); }

/* KPI panel: one light-blue box split into columns, as in the report tool */
.kpi {
  display: grid; grid-template-columns: repeat(2, 1fr);
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 4px; box-shadow: var(--shadow-sm); overflow: hidden;
}
.kpi div { padding: 14px 10px; text-align: center; border-right: 1px solid var(--panel-line); border-bottom: 1px solid var(--panel-line); }
.kpi div:nth-child(2n) { border-right: 0; }
.kpi .k { display: block; font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--label); margin-bottom: 6px; }
.kpi .v { display: block; font-size: 20px; font-weight: 600; color: var(--primary); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 12px; padding-bottom: 12px; border-bottom: 1px solid #F3F4F6; }
.toolbar-text { font-size: 13px; color: var(--muted); }
.btn-teal {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 0; border-radius: 4px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; box-shadow: var(--shadow-sm); white-space: nowrap;
}
.btn-teal:hover { background: var(--accent-hover); }

/* data table, as the report tool's device / creative tables */
.table-wrap { border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow-sm); overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table thead tr { background: var(--panel); }
.data-table th {
  padding: 12px 14px; text-align: left; white-space: nowrap;
  font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--primary);
}
.data-table th[data-sort] { cursor: pointer; user-select: none; }
.data-table th[data-sort]:hover { color: var(--navy); }
.data-table th .arrow { margin-left: 4px; font-size: 9px; color: var(--label); }
.data-table td { padding: 12px 14px; border-top: 1px solid var(--line); color: var(--ink); vertical-align: top; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: var(--soft); }
.data-table .num { text-align: right; }
.data-table td.num { font-variant-numeric: tabular-nums; }
.data-table .city-link { font-weight: 700; color: var(--primary); }
.data-table .sub { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.data-table .muted { color: var(--muted); font-size: 13px; }
.data-table .empty { text-align: center; color: var(--muted); padding: 28px 14px; cursor: default; }
.codes { display: flex; flex-wrap: wrap; gap: 4px; }
.code {
  display: inline-block; padding: 2px 6px; border-radius: 3px; font-size: 11px; font-weight: 700; letter-spacing: .3px;
  background: #F3F4F6; color: var(--navy-2); border: 1px solid var(--line); white-space: nowrap;
}
.store-list { margin: 0; padding: 0; list-style: none; font-size: 13px; line-height: 1.5; }
.store-list b { color: var(--navy-2); }
.type-text { font-size: 13px; color: var(--text); }

.crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.crumb-link { border: 0; background: none; padding: 0; color: var(--blue); font-size: 13px; }
.crumb-link:hover { text-decoration: underline; }
.crumb-sep { color: #9CA3AF; }

/* tabs, as on the report tool's summary page */
.tabs { display: flex; margin: 18px 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none; padding: 12px 16px; border: 0; border-bottom: 2px solid transparent; background: none;
  font-size: 14px; font-weight: 600; color: #9CA3AF;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ================= Map screen ================= */
.app { position: fixed; inset: 0; background: var(--soft); }
.map-wrap { position: absolute; inset: 0; overflow: hidden; background: #F1F5F9; }
#map { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
#map.dragging { cursor: grabbing; }
#viewport { transition: opacity .2s ease; }
#viewport.swap-up, #viewport.swap-down { opacity: 0; }

.slab .fa { fill: #C3CDDA; }
.slab .fb { fill: #D7DFE9; }
.slab-top { fill: #F8FAFC; stroke: #CBD5E1; stroke-width: 1.5; }
.corridor { fill: #FFFFFF; }
.atrium { fill: var(--panel); stroke: #BFDBFE; stroke-width: 1.5; }
.atrium-label { font-size: 10px; fill: var(--label); font-weight: 700; letter-spacing: 1px; }
.escalator .top { fill: #94A3B8; }
.escalator .fa, .escalator .fb { fill: #64748B; }
.esc-step { stroke: #DCE8EF; stroke-width: 2; fill: none; }
.door { stroke: #fff; stroke-width: 4; stroke-linecap: round; fill: none; }
.door.raymond-door { stroke: var(--accent-bright); }

.unit { cursor: pointer; }
.unit .top { fill: #F1F5F9; stroke: rgba(30, 58, 138, .08); stroke-width: 1; }
.unit .fa { fill: #CBD5E1; }
.unit .fb { fill: #E2E8F0; }
.unit.anchor .top { fill: #E9EEF4; }
.unit.anchor .fa { fill: #BCC7D4; }
.unit text { font-size: 10px; fill: #64748B; pointer-events: none; }
/* Raymond-group stores: raised navy blocks; the selected one is outlined in teal */
.unit.raymond .top { fill: var(--navy); stroke: #4B5A78; stroke-width: 1.5; }
.unit.raymond .fa { fill: #1A2236; }
.unit.raymond .fb { fill: var(--navy-3); }
.unit.raymond .brand { font-family: "Playfair Display", Georgia, serif; font-size: 15px; font-weight: 700; fill: #fff; }
.unit.raymond .tag { font-size: 8px; fill: #C7D2E0; letter-spacing: .8px; font-weight: 700; }
.unit.raymond.active .top { fill: var(--primary); stroke: var(--accent-bright); stroke-width: 3; }

.amenity circle { fill: #fff; stroke: #9AA6B6; stroke-width: 1.5; }
.amenity text { font-size: 9px; font-weight: 700; fill: #4A5668; text-anchor: middle; dominant-baseline: central; }
.amenity.entry circle { fill: #059669; stroke: #fff; stroke-width: 2; }
.amenity.entry text { fill: #fff; }
.amenity-label { font-size: 9px; font-weight: 700; fill: var(--label); text-anchor: middle; letter-spacing: .5px; }

.pin { cursor: pointer; }
.pin .pulse { fill: var(--accent); opacity: .3; transform-box: fill-box; transform-origin: center; animation: pulse 1.8s ease-out infinite; }
.pin .head { fill: var(--accent); stroke: #fff; stroke-width: 2.5; }
.pin .r { font-weight: 700; font-size: 10.5px; fill: #fff; text-anchor: middle; dominant-baseline: central; }
.pin .badge { fill: #fff; stroke: var(--accent); stroke-width: 2; }
.pin .num { font-size: 10px; font-weight: 700; fill: var(--accent); text-anchor: middle; dominant-baseline: central; }
@keyframes pulse { 0% { transform: scale(.4); opacity: .5; } 100% { transform: scale(2.2); opacity: 0; } }

.route-line { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2 12; animation: march .8s linear infinite; }
.route-glow { fill: none; stroke: rgba(13, 148, 136, .18); stroke-width: 16; stroke-linecap: round; stroke-linejoin: round; }
@keyframes march { to { stroke-dashoffset: -14; } }
.route-start { fill: var(--blue); stroke: #fff; stroke-width: 3; }
.route-start-halo { fill: rgba(37, 99, 235, .18); }
.route-callout rect { fill: var(--navy); }
.route-callout text { fill: #fff; font-size: 10.5px; font-weight: 600; text-anchor: middle; dominant-baseline: central; }

/* markets / high streets */
.market .slab-top { fill: #E2E8F0; stroke: #CBD5E1; }
.market .slab .fa { fill: #B8C3D1; }
.market .slab .fb { fill: #CBD5E1; }
.market .corridor { fill: #94A3B8; }
.market .lane { stroke: #F8FAFC; stroke-width: 2; stroke-dasharray: 10 10; fill: none; }
.market .atrium { fill: #D1FAE5; stroke: #A7F3D0; }
.market .atrium-label { fill: #047857; }

/* top row (phone): back + store list */
.top-row {
  position: absolute; left: 0; right: 0; top: 0; z-index: 6;
  display: flex; align-items: center; gap: 8px;
  padding: calc(var(--safe-t) + 10px) 0 10px 12px;
  background: linear-gradient(180deg, rgba(241, 245, 249, .97) 65%, rgba(241, 245, 249, 0));
  transition: transform .3s ease, opacity .3s;
}
.app.routing .top-row { transform: translateY(-110%); opacity: 0; pointer-events: none; }
.round-btn { flex: none; width: 38px; height: 38px; border-radius: 4px; border: 0; background: var(--navy); display: grid; place-items: center; box-shadow: var(--shadow); }
.round-btn svg { width: 20px; height: 20px; fill: #fff; }
.side-head { display: none; }

.store-strip {
  flex: 1; min-width: 0; display: flex; gap: 8px; padding: 2px 12px 4px 0; overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.store-strip::-webkit-scrollbar { display: none; }
.store-card {
  flex: 0 0 72%; display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 9px 12px;
  scroll-snap-align: start; border: 1px solid var(--line); border-left: 4px solid transparent; border-radius: 4px;
  background: #fff; text-align: left; box-shadow: var(--shadow-sm);
}
.store-strip.single .store-card { flex-basis: 100%; }
.store-card:hover { background: var(--soft); }
.store-card.current { border-left-color: var(--accent-bright); background: #F3F4F6; }
.sc-mark {
  width: 34px; height: 34px; flex: none; border-radius: 4px; display: grid; place-items: center;
  background: var(--navy); color: #fff; font-size: 11px; font-weight: 700;
}
.sc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sc-info .mono-label { font-size: 10px; }
.sc-info strong { font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-info span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.floor-picker {
  position: absolute; right: 12px; top: calc(var(--safe-t) + 92px); z-index: 5;
  display: flex; flex-direction: column; gap: 2px;
  background: #fff; padding: 4px; border-radius: 4px; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.floor-picker.single { display: none; }
.floor-picker button { position: relative; width: 38px; height: 32px; border-radius: 3px; border: 0; background: transparent; font-weight: 700; font-size: 12px; color: var(--muted); }
.floor-picker button:hover { background: #F3F4F6; }
.floor-picker button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.floor-picker button.has-store::after { content: ""; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-bright); }
.app.routing .floor-picker { top: calc(var(--safe-t) + 12px); opacity: 0; pointer-events: none; }

.zoom-ctrl { position: absolute; right: 12px; bottom: calc(var(--safe-b) + 16px); z-index: 5; display: flex; flex-direction: column; background: #fff; border-radius: 4px; border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.zoom-ctrl button { width: 42px; height: 40px; border: 0; background: #fff; font-size: 20px; display: grid; place-items: center; }
.zoom-ctrl button:hover { background: #F3F4F6; }
.zoom-ctrl button + button { border-top: 1px solid var(--line); }
.zoom-ctrl svg { width: 18px; height: 18px; fill: var(--ink); }
.zoom-ctrl .mode-btn { font-size: 12px; font-weight: 700; color: var(--primary); background: var(--panel); }

.toast {
  position: absolute; left: 50%; top: calc(var(--safe-t) + 92px); z-index: 7;
  transform: translate(-50%, -8px); opacity: 0; pointer-events: none;
  background: var(--navy); color: #fff; font-size: 13px;
  padding: 8px 14px; border-radius: 4px; white-space: nowrap; max-width: calc(100% - 120px); overflow: hidden; text-overflow: ellipsis;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.app.routing .toast { top: auto; bottom: calc(var(--safe-b) + 20px); }

.route-fab {
  position: absolute; left: 12px; bottom: calc(var(--safe-b) + 16px); z-index: 6;
  display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 80px);
  height: 44px; padding: 0 16px 0 12px; border: 0; border-radius: 4px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; box-shadow: var(--shadow);
  transition: transform .3s ease, opacity .3s;
}
.route-fab:hover { background: var(--accent-hover); }
.route-fab svg { width: 20px; height: 20px; fill: #fff; flex: none; }
.route-fab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app.routing .route-fab { transform: translateY(160%); opacity: 0; pointer-events: none; }

/* route card */
.route-card {
  position: absolute; left: 12px; right: 12px; top: calc(var(--safe-t) + 12px); z-index: 6;
  background: #fff; border-radius: 4px; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 12px 12px 6px;
}
.route-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.route-head strong { display: block; margin-top: 2px; font-size: 15px; color: var(--primary); }
.route-head span { font-size: 12px; color: var(--muted); }
.route-progress { height: 4px; margin: 10px 0 2px; border-radius: 2px; background: var(--panel); overflow: hidden; }
.route-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }
.steps { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 8px 8px 8px 34px; font-size: 13px; line-height: 1.35; border-radius: 4px; cursor: pointer; color: var(--muted); }
.steps li::before {
  content: counter(s); position: absolute; left: 6px; top: 7px;
  width: 20px; height: 20px; border-radius: 50%; background: var(--line); color: var(--ink);
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.steps li.active { background: var(--panel); color: var(--ink); font-weight: 600; }
.steps li.active::before { background: var(--primary); color: #fff; }
.steps li:not(.active) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 5px; padding-bottom: 5px; }
.steps li:not(.active)::before { top: 4px; }
.steps li.done { color: #9CA3AF; }
.steps li.done::before { content: "✓"; background: #CCFBF1; color: var(--accent); }
.route-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; padding: 6px 0; }
.route-nav .btn { height: 42px; font-size: 14px; }
.route-nav .btn:disabled { opacity: .4; }

.icon-btn { width: 30px; height: 30px; border-radius: 4px; border: 0; flex: none; background: #F3F4F6; font-size: 20px; line-height: 1; display: grid; place-items: center; }
.icon-btn:hover { background: #E5E7EB; }

/* ================= Details sheet ================= */
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(17, 24, 39, .45); opacity: 0; transition: opacity .25s; }
.scrim.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; max-width: 560px; margin: 0 auto;
  background: #fff; border-radius: 12px 12px 0 0; box-shadow: 0 -8px 30px rgba(17, 24, 39, .2);
  padding: 0 16px calc(18px + var(--safe-b));
  transform: translateY(105%); transition: transform .3s ease; max-height: 90dvh; overflow: auto;
}
.sheet.open { transform: translateY(0); }
.sheet.dragging { transition: none; }
.sheet-grab { padding: 10px 0 8px; display: flex; justify-content: center; touch-action: none; }
.sheet-grab span { width: 40px; height: 4px; border-radius: 2px; background: #D1D5DB; }
.sheet-close { position: absolute; right: 14px; top: 14px; z-index: 2; }
.sheet-body { padding-top: 6px; }
.sheet-brand { display: flex; align-items: flex-start; gap: 12px; padding-right: 40px; }
.brand-mark {
  width: 44px; height: 44px; flex: none; border-radius: 4px; display: grid; place-items: center;
  background: var(--navy); color: #fff; font-weight: 700; font-size: 13px;
}
.sheet h2 { margin: 3px 0 0; font-size: 20px; line-height: 1.3; font-weight: 700; color: var(--primary); }
.sheet-sub { margin: 3px 0 0; color: var(--muted); font-size: 14px; }

/* details as a KPI-style panel */
.meta {
  display: grid; grid-template-columns: repeat(2, 1fr); margin: 16px 0 12px;
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 4px; overflow: hidden;
}
.meta div { padding: 10px 12px; min-width: 0; border-bottom: 1px solid var(--panel-line); }
.meta div:nth-child(odd):not(.meta-wide) { border-right: 1px solid var(--panel-line); }
.meta div:last-child { border-bottom: 0; }
.meta dt { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--label); margin-bottom: 4px; }
.meta dd { margin: 0; font-size: 14px; font-weight: 600; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta .meta-wide { grid-column: 1 / -1; }
.meta dd a { color: var(--blue); text-decoration: none; }
.meta dd a:hover { text-decoration: underline; }

.addr-card { display: flex; align-items: flex-start; gap: 10px; padding: 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.addr-text { flex: 1; min-width: 0; }
#sheetAddr { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.addr-coords { margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13px; }
.addr-coords .mono-label { margin-right: 6px; }
.addr-coords a { color: var(--blue); font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; }
.addr-coords a:hover { text-decoration: underline; }
.copy-btn {
  flex: none; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border-radius: 4px;
  border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 12px; font-weight: 700;
}
.copy-btn:hover { background: #F3F4F6; }
.copy-btn svg { width: 14px; height: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; border-radius: 4px; border: 1px solid #D1D5DB; background: #fff; color: var(--primary);
  font-weight: 700; font-size: 14px; text-decoration: none;
}
.btn:hover { background: var(--soft); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover, .route-cta:hover { background: var(--accent-hover); }
.btn.full { width: 100%; }
.route-cta {
  height: auto; min-height: 54px; padding: 8px 14px; margin-bottom: 10px;
  background: var(--accent); border-color: var(--accent); color: #fff; justify-content: flex-start; gap: 12px;
}
.route-cta svg { width: 22px; height: 22px; fill: #fff; flex: none; }
.cta-text { display: flex; flex-direction: column; text-align: left; line-height: 1.3; }
.cta-text strong { font-size: 14.5px; }
.cta-text span { font-size: 12px; opacity: .9; font-weight: 400; }

.sv-block { margin-top: 18px; }
.sv-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.sv-head a { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--blue); text-decoration: none; }
.sv-head a:hover { text-decoration: underline; }
.sv-head a svg { width: 14px; height: 14px; }
.sv-frame { position: relative; border-radius: 4px; overflow: hidden; aspect-ratio: 4 / 3; background: #E5E7EB; border: 1px solid var(--line); }
.sv-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.others { margin-top: 18px; }
.others .mono-label { margin-bottom: 8px; }
.other {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; margin-bottom: 6px;
}
.other:hover { background: var(--soft); }
.sc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sc-text strong { font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-text span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.other svg { width: 18px; height: 18px; fill: #9CA3AF; flex: none; }

/* ================= Responsive ================= */
@media (max-width: 639px) {
  .hide-sm { display: none; }
}
@media (max-width: 899px) {
  .hide-md { display: none; }
}
@media (min-width: 640px) {
  .hdr-fields { grid-template-columns: 1fr 1fr 2fr; }
  .hf-search { grid-column: auto; }
  .kpi { grid-template-columns: repeat(4, 1fr); }
  .kpi div { border-bottom: 0; }
  .kpi div:nth-child(2n) { border-right: 1px solid var(--panel-line); }
  .kpi div:last-child { border-right: 0; }
}

@media (min-width: 900px) {
  :root { --side: 380px; }

  /* explorer: header filters inline, sidebar on the left (report tool layout) */
  .tool-header { flex-wrap: nowrap; align-items: flex-end; gap: 32px; padding: 16px 24px; }
  .tool-logo { height: 32px; }
  .hdr-fields { order: 0; width: auto; display: flex; align-items: flex-end; gap: 24px; }
  .hf { width: 190px; }
  .hf-zone { display: none; }
  .hf-search { width: 340px; }
  .ex-side { display: flex; flex-direction: column; width: 256px; flex: none; padding-top: 24px; overflow-y: auto; background: #fff; border-right: 1px solid var(--line); }
  .side-caption { padding: 0 24px; margin-bottom: 20px; font-size: 14px; font-weight: 700; color: #1F2937; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; padding: 0 12px; }
  .side-nav button {
    display: flex; justify-content: space-between; align-items: center; width: 100%;
    padding: 10px 12px; border: 0; border-left: 4px solid transparent; border-radius: 6px; background: #fff;
    font-size: 14px; font-weight: 500; color: var(--ink); text-align: left;
  }
  .side-nav button:hover { background: var(--soft); }
  .side-nav button[aria-current="true"] { background: #F3F4F6; border-left-color: var(--accent-bright); }
  .side-nav .cnt { font-size: 12px; color: var(--muted); }
  .ex-main { padding: 24px; }
  #viewCities, #viewCity { max-width: 1280px; }
  .page-title { font-size: 22px; }
  .kpi .v { font-size: 22px; }

  /* map screen: sidebar + map */
  #map { position: absolute; top: 0; bottom: 0; left: var(--side); width: calc(100% - var(--side)); height: 100%; }
  .top-row {
    left: 0; right: auto; top: 0; bottom: 0; width: var(--side);
    flex-direction: column; align-items: stretch; gap: 0; padding: 0;
    background: #fff; border-right: 1px solid var(--line);
  }
  .top-row .round-btn { position: absolute; left: 16px; top: 18px; z-index: 2; width: 32px; height: 32px; background: var(--navy-3); box-shadow: none; }
  .top-row .round-btn:hover { background: var(--navy-hover); }
  .side-head { display: flex; flex-direction: column; gap: 3px; padding: 16px 20px 16px 60px; background: var(--navy); color: #fff; }
  .side-kicker { font-size: 12px; color: #D1D5DB; }
  .side-head strong { font-size: 18px; line-height: 1.3; }
  .side-head span:last-child { font-size: 13px; color: #D1D5DB; }
  .store-strip { flex-direction: column; gap: 4px; padding: 16px 12px; overflow-x: hidden; overflow-y: auto; scroll-snap-type: none; }
  .store-card, .store-strip.single .store-card { flex: none; width: 100%; min-height: 64px; box-shadow: none; border-color: transparent; border-left: 4px solid transparent; border-radius: 6px; }
  .store-card:hover { background: var(--soft); }
  .store-card.current { background: #F3F4F6; border-left-color: var(--accent-bright); }

  .floor-picker { top: 16px; }
  .app.routing .floor-picker { top: 16px; opacity: 1; pointer-events: auto; }
  .zoom-ctrl { right: 16px; bottom: 20px; }
  .route-fab { left: calc(var(--side) + 20px); bottom: 20px; max-width: 460px; }
  .toast, .app.routing .toast { top: 18px; bottom: auto; left: calc(50% + var(--side) / 2); max-width: 520px; }

  .route-card, .app .route-card {
    left: 0; right: auto; top: 0; bottom: 0; width: var(--side); border-radius: 0; border: 0;
    border-right: 1px solid var(--line); padding: 20px; overflow-y: auto; box-shadow: none;
  }
  .route-head strong { font-size: 18px; }
  .route-head span { font-size: 13px; }
  .steps li { font-size: 14px; padding-top: 10px; padding-bottom: 10px; }
  .steps li:not(.active) { white-space: normal; }

  .scrim { display: none !important; }
  .sheet {
    left: 0; right: auto; top: 0; bottom: 0; width: var(--side); max-width: none; max-height: none;
    margin: 0; border-radius: 0; padding: 20px; transform: translateX(-102%); box-shadow: 4px 0 16px rgba(17, 24, 39, .08);
    border-right: 1px solid var(--line);
  }
  .sheet.open { transform: translateX(0); }
  .sheet-grab { display: none; }
  .sheet-close { top: 18px; right: 18px; }
}

@media (min-width: 1400px) {
  :root { --side: 400px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* the state under the city name stands in for the State column on phones */
.data-table .sub.hide-sm-inv { display: none; }
@media (max-width: 639px) { .data-table .sub.hide-sm-inv { display: block; } }
.sr-all { display: block; margin-top: 8px; padding: 0; border: 0; background: none; color: var(--blue); font-size: 14px; font-weight: 700; }
.sr-all:hover { text-decoration: underline; }

/* ================= Client brand (set in js/data.js) — kept quiet next to the iAvatarZ logo ================= */
.client-mark { font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; font-weight: 700; letter-spacing: .3px; }
.client-mark img { display: block; height: 100%; width: auto; }
.client-tag {
  display: flex; align-items: center; gap: 6px; align-self: center; min-width: 0;
  padding-left: 12px; border-left: 1px solid rgba(255,255,255,.25);
  font-size: 12px; color: #9CA3AF; white-space: nowrap;
}
.client-tag .client-mark { font-size: 14px; color: #D1D5DB; height: 16px; line-height: 16px; }
.side-head .client-mark { font-size: 12px; color: #9CA3AF; height: 14px; line-height: 14px; margin-bottom: 4px; }
.store-card.more-brands { border-style: dashed; background: transparent; }
.store-card.more-brands strong { color: var(--primary, #1E3A8A); }
@media (min-width: 900px) {
  .store-card.more-brands { border: 1px dashed var(--line); border-left: 4px solid transparent; }
}

/* ================= Real surroundings (OpenStreetMap) ================= */
.site .ground { fill: #E9EDF2; }
.site .road-edge { fill: none; stroke: #CBD3DD; stroke-linecap: round; stroke-linejoin: round; }
.site .nbr { fill: #E2E6EB; stroke: #D3D9E0; stroke-width: .8; }
.site .parking { fill: #DCE6F2; stroke: #B9CBE0; stroke-width: 1; stroke-dasharray: 4 3; }
.site .parking-label { font: 700 15px Arial, sans-serif; fill: #5C728B; text-anchor: middle; dominant-baseline: central; }
.site .road { fill: none; stroke: #FFFFFF; stroke-linecap: round; stroke-linejoin: round; }
.site .road.minor { stroke: #F8FAFC; }
.site .road-label { font: 600 10px Arial, sans-serif; fill: #6B7280; text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.compass {
  position: absolute; right: 12px; bottom: calc(var(--safe-b) + 196px); z-index: 5; width: 42px; height: 42px;
  display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 50%; box-shadow: var(--shadow);
}
.compass svg { width: 40px; height: 40px; fill: #CBD5E1; overflow: visible; transform: rotate(var(--north, 0deg)); transition: transform .3s; }
.compass .tip { fill: var(--danger); }
.compass text { font: 700 7px Arial, sans-serif; fill: var(--navy); text-anchor: middle; dominant-baseline: central; }
.osm-credit { position: absolute; right: 64px; bottom: calc(var(--safe-b) + 4px); z-index: 4; font-size: 10px; color: var(--muted); text-decoration: none; background: rgba(255,255,255,.8); padding: 1px 4px; border-radius: 2px; }
@media (min-width: 900px) { .compass { right: 16px; bottom: 200px; } .osm-credit { right: 68px; } }
