:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --surface: #fff;
  --surface-soft: #f8fafc;
  --canvas: #f8fafc;
  --blue: #2f8ccc;
  --blue-dark: #0369a1;
  --route: #5d89ed;
  --amber: #b45309;
  --shadow: 0 10px 28px rgba(15, 23, 42, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
html { background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: var(--accessibility-font-size, 14px); line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #075985;
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: #fff;
  background: #0f172a;
  border-radius: 8px;
  transform: translateY(-160%);
}
.skip-link-search { left: 205px; }
.skip-link:focus { transform: translateY(0); }

/* Building list mirrors the public landing page. */
.home-view { min-height: 100vh; background: #f8fafc; }
.home-content { width: min(1216px, calc(100% - 32px)); margin: 0 auto; padding: 62px 0 48px; }
.home-heading { margin-bottom: 26px; }
.home-heading h1 { margin: 0; font-size: clamp(36px, 4vw, 48px); line-height: 1.1; letter-spacing: -.035em; }
.home-heading p { margin: 14px 0 0; color: #5b6472; font-size: clamp(18px, 2vw, 24px); }
.building-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.building-card {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  background: #fff;
  border-radius: 9px;
  box-shadow: 0 4px 15px rgba(15, 23, 42, .11);
  text-decoration: none;
  transition: box-shadow .18s, transform .18s;
}
.building-card:hover { box-shadow: 0 10px 28px rgba(15, 23, 42, .16); transform: translateY(-2px); }
.building-card-main { display: block; color: inherit; text-decoration: none; }
.building-card-main[aria-disabled="true"] { cursor: not-allowed; opacity: .72; }
.building-card-preview { height: 288px; display: grid; place-items: center; overflow: hidden; background: #fbfdff; border-bottom: 1px solid #f1f5f9; }
.building-card-preview svg, .building-card-preview img { width: 112%; height: 112%; max-width: none; object-fit: contain; pointer-events: none; }
.building-card-preview .objects > *, .building-card-preview .nodes > *, .building-card-preview .edges > *, .building-card-preview .labels { pointer-events: none !important; }
.building-card-body { padding: 21px 24px 24px; }
.building-card-body h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.building-card-code { margin: 5px 0 18px; color: #6b7280; font-size: 14px; }
.building-card-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.building-card-meta span { display: grid; gap: 2px; color: #334155; font-weight: 650; }
.building-card-meta small { color: #64748b; font-size: 12px; font-weight: 450; }
.building-card-footer { padding: 0 24px 24px; }
.card-offline-button {
  width: 100%; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 14px; color: #475569; background: #fff; border: 1px solid #dce3eb; border-radius: 9px;
  cursor: pointer; font-size: 13px; font-weight: 700;
}
.card-offline-button:hover { color: #0369a1; background: #f0f9ff; border-color: #7dd3fc; }
.card-offline-button:disabled { cursor: default; opacity: .76; }
.card-offline-button.is-installed { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.card-offline-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.building-card-offline-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.card-offline-delete {
  min-width: 42px; min-height: 40px; display: grid; place-items: center; padding: 8px 11px; color: #9f1239;
  background: #fff; border: 1px solid #fecdd3; border-radius: 9px; cursor: pointer;
}
.card-offline-delete:hover { color: #881337; background: #fff1f2; border-color: #fda4af; }
.card-offline-delete svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Public authentication shells are intentionally local-only until an authorized backend is connected. */
.auth-view { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: linear-gradient(145deg, #f8fafc, #e0f2fe); }
.auth-logo { position: fixed; top: 20px; left: 24px; }
.auth-logo img { width: 64px; height: 72px; object-fit: contain; }
.auth-card { width: min(430px, 100%); padding: 30px; background: #fff; border: 1px solid #dbe2ea; border-radius: 16px; box-shadow: 0 18px 46px rgba(15,23,42,.14); }
.auth-card h1 { margin: 0; font-size: 30px; }
.auth-card > p { color: #475569; }
.auth-form { display: grid; gap: 9px; margin-top: 22px; }
.auth-form label { color: #334155; font-weight: 700; }
.auth-form input:not([type="checkbox"]) { min-height: 44px; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 8px; }
.auth-form button { min-height: 44px; margin-top: 10px; color: #fff; background: var(--blue-dark); border: 0; border-radius: 8px; cursor: pointer; font-weight: 800; }
.auth-form button:disabled { cursor: wait; opacity: .65; }
.auth-form small { color: #64748b; }
.auth-check { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.auth-check input { width: 18px; height: 18px; accent-color: var(--blue-dark); }
.auth-switch { text-align: center; }
.auth-switch a { color: #075985; font-weight: 700; }
.auth-status { min-height: 22px; margin-bottom: 0; padding: 8px 10px; color: #92400e !important; background: #fffbeb; border-radius: 8px; }
.auth-status.is-success { color: #166534 !important; background: #f0fdf4; }
.auth-status.is-error { color: #991b1b !important; background: #fef2f2; }

/* Live-style map shell. */
.map-app { min-height: 100vh; overflow: hidden; background: #fff; }
.live-header {
  position: relative; z-index: 30; height: 121px; display: grid;
  grid-template-columns: 120px minmax(320px, 1fr) 72px; align-items: center; gap: 24px;
  padding: 0 24px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 6px rgba(15,23,42,.08); backdrop-filter: blur(12px);
}
.live-logo { width: 80px; display: flex; align-items: center; gap: 4px; color: #1f2937; text-decoration: none; }
.live-logo img { width: 70px; height: 80px; object-fit: contain; }
.live-logo span { position: absolute; width: 1px; height: 1px; overflow: hidden; }
.global-search-wrap { position: relative; width: min(674px, 100%); justify-self: center; }
.global-search-wrap > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.search-field { position: relative; display: flex; align-items: center; min-height: 52px; background: #fff; border: 1px solid #dbe2e8; border-radius: 999px; box-shadow: 0 2px 7px rgba(15,23,42,.1); }
.search-field:focus-within { border-color: #38bdf8; box-shadow: 0 0 0 2px #38bdf8, 0 2px 7px rgba(15,23,42,.1); }
.search-field > svg, .mobile-route-field > svg, .route-field > svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: #94a3b8; stroke-width: 1.8; stroke-linecap: round; margin-left: 20px; }
.search-field input { width: 100%; height: 50px; min-width: 0; padding: 0 44px 0 13px; color: #1f2937; background: transparent; border: 0; outline: 0; font-size: 16px; }
.search-field input::placeholder { color: #a1aab6; }
input[type="search"]::-webkit-search-cancel-button { display: none; -webkit-appearance: none; appearance: none; }
input[type="search"]::-ms-clear { display: none; width: 0; height: 0; }
.search-clear { position: absolute; right: 14px; width: 28px; height: 28px; padding: 0; color: #64748b; background: transparent; border: 0; cursor: pointer; font-size: 23px; line-height: 1; }
.menu-button { width: 46px; height: 46px; display: grid; place-items: center; justify-self: end; padding: 0; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 2px 7px rgba(15,23,42,.1); cursor: pointer; }
.menu-button:hover { color: var(--blue-dark); background: #f0f9ff; border-color: #bae6fd; }
.menu-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.mobile-route-bar { display: none; }
.live-map-shell { position: relative; height: calc(100vh - 121px); min-height: 420px; overflow: hidden; }
.map-workspace, .map-stage { position: absolute; inset: 0; }
.map-stage { background: #fff; }
.map-view { position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: none; }
.map-view.is-dragging { cursor: grabbing; }
.map-canvas { position: absolute; inset: 0; display: grid; place-items: center; }
.map-canvas { transform: rotate(var(--map-rotation, 0deg)); transform-origin: center; transition: transform .18s ease; }
.map-canvas > svg { width: 100%; height: 100%; max-width: none; max-height: none; overflow: visible; user-select: none; }
.map-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: #64748b; background: rgba(248,250,252,.88); backdrop-filter: blur(3px); }
.spinner { width: 19px; height: 19px; border: 2px solid #bae6fd; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.map-toolbar { position: absolute; z-index: 10; top: 16px; left: 16px; display: flex; overflow: hidden; background: #fff; border: 1px solid #d8dee7; border-radius: 9px; box-shadow: 0 2px 8px rgba(15,23,42,.1); }
.map-toolbar button { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; color: #1f2937; background: #fff; border: 0; border-right: 1px solid #d8dee7; cursor: pointer; font-size: 20px; }
.map-toolbar button:last-child { border-right: 0; }
.map-toolbar button:hover { color: #fff; background: var(--blue); }
.map-toolbar svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.floor-toolbar { position: absolute; z-index: 10; top: 16px; right: 16px; max-width: calc(100% - 180px); overflow-x: auto; padding: 4px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 2px 8px rgba(15,23,42,.1); }
.floor-tabs { display: flex; gap: 5px; }
.floor-tabs button { min-width: 36px; height: 36px; padding: 0 9px; color: #374151; background: #fff; border: 1px solid #e5e7eb; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 700; }
.floor-tabs button[aria-selected="true"] { color: #fff; background: var(--blue-dark); border-color: var(--blue-dark); box-shadow: 0 2px 5px rgba(2,132,199,.24); }
.floor-tabs button.has-route { box-shadow: inset 0 -3px #93c5fd; }
.floor-tabs button.has-route[aria-selected="true"] { box-shadow: inset 0 -3px #dbeafe; }
.map-hint { position: absolute; z-index: 5; left: 50%; bottom: 9px; transform: translateX(-50%); padding: 5px 10px; color: #64748b; background: rgba(255,255,255,.92); border: 1px solid rgba(226,232,240,.95); border-radius: 999px; font-size: 10px; white-space: nowrap; }
.compass-indicator { position: absolute; z-index: 11; top: 72px; left: 18px; width: 48px; height: 55px; display: grid; place-items: center; color: #075985; background: rgba(255,255,255,.96); border: 1px solid #cbd5e1; border-radius: 10px; box-shadow: 0 2px 8px rgba(15,23,42,.12); }
.compass-indicator svg { width: 34px; height: 34px; fill: #94a3b8; stroke: #334155; stroke-width: 1; transform: rotate(var(--compass-heading, 0deg)); transition: transform .12s linear; }
.compass-indicator .compass-north { fill: #e11d48; }
.compass-indicator span { position: absolute; top: 1px; font-size: 9px; font-weight: 900; }

.map-canvas .objects > * { opacity: 0 !important; pointer-events: all; cursor: pointer; transition: opacity .12s; }
.map-canvas .objects > *:hover, .map-canvas .objects > *:focus, .map-canvas .objects > .selected, .map-canvas .objects > [aria-pressed="true"] { fill: #93c5fd !important; opacity: .42 !important; }
.map-canvas .objects > [aria-disabled="true"] { cursor: not-allowed; }
.map-canvas .objects > [aria-disabled="true"]:hover { fill: #f59e0b !important; opacity: .3 !important; }
.map-canvas .edges > line { opacity: 0 !important; pointer-events: none; }
.map-canvas .edges > line.active { stroke: var(--route) !important; stroke-width: 4 !important; stroke-linecap: round; opacity: 1 !important; filter: drop-shadow(0 0 2px rgba(93,137,237,.22)); }
.map-canvas .nodes > circle { opacity: 0 !important; pointer-events: none; }
.map-canvas .nodes > circle.current { fill: #5d89ed !important; stroke: #dbeafe !important; stroke-width: 4 !important; opacity: 1 !important; }
.map-canvas .labels { pointer-events: none; }

/* Search popovers */
.search-popover { position: absolute; z-index: 80; top: calc(100% + 8px); left: 0; right: 0; max-height: min(420px, 60vh); overflow: auto; padding: 5px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 12px 34px rgba(15,23,42,.16); }
.live-search-popover { border-radius: 13px; }
.search-result { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; text-align: left; color: inherit; background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.search-result:hover, .search-result[aria-selected="true"] { background: #f0f9ff; }
.search-result strong { font-size: 14px; }
.search-result .result-name { grid-column: 1; color: #475569; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result .result-place { grid-column: 2; grid-row: 1 / 3; align-self: center; color: #0284c7; font-size: 11px; font-weight: 700; }
.search-result.is-unavailable { opacity: .62; }
.empty-results { padding: 14px; color: #64748b; text-align: center; font-size: 12px; }

/* Route detail drawer augments the live shell without covering the map by default. */
.route-panel { position: fixed; z-index: 24; top: 137px; right: 16px; width: min(370px, calc(100vw - 32px)); max-height: calc(100vh - 153px); overflow: auto; padding: 18px; background: rgba(255,255,255,.97); border: 1px solid #dce3eb; border-radius: 14px; box-shadow: 0 18px 48px rgba(15,23,42,.2); backdrop-filter: blur(9px); }
.route-panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.route-panel-heading h2 { margin: 2px 0 0; font-size: 18px; }
.route-panel-heading-actions { display: flex; align-items: center; gap: 7px; }
.eyebrow { display: block; color: #64748b; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; color: #64748b; background: #fff; border: 1px solid #e2e8f0; border-radius: 9px; cursor: pointer; font-size: 22px; line-height: 1; }
.icon-button:hover { color: #0369a1; background: #f0f9ff; }
.distance-chip { padding: 5px 8px; color: #075985; background: #e0f2fe; border-radius: 999px; font-size: 10px; font-weight: 750; }
.route-summary { margin-top: 13px; padding: 10px 11px; color: #475569; background: #f8fafc; border: 1px solid #edf2f7; border-radius: 9px; font-size: 11px; }
.route-summary.is-success { color: #075985; background: #f0f9ff; border-color: #bae6fd; }
.route-summary.is-error { color: #9a3412; background: #fff7ed; border-color: #fed7aa; }
.route-warning { margin-top: 10px; padding: 11px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; font-size: 11px; }
.guidance-panel { margin-top: 10px; padding: 11px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; }
.guidance-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.guidance-heading h3 { margin: 0; font-size: 14px; }
.guidance-heading span { color: #075985; font-size: 11px; font-weight: 800; }
.guidance-panel p { margin: 6px 0 10px; color: #475569; font-size: 11px; }
.guidance-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.guidance-controls button { min-height: 34px; padding: 5px; background: #fff; border: 1px solid #bfdbfe; border-radius: 7px; cursor: pointer; font-size: 10px; font-weight: 700; }
.route-steps > li.is-guidance-current { margin-left: -5px; padding-top: 7px; padding-right: 7px; background: #dbeafe; border-radius: 8px; }
.route-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.route-steps { list-style: none; margin: 15px 0 0; padding: 0; counter-reset: steps; }
.route-steps > li:not(.empty-state) { position: relative; padding: 0 0 17px 31px; color: #334155; font-size: 12px; }
.route-steps > li:not(.empty-state)::before { counter-increment: steps; content: counter(steps); position: absolute; left: 0; top: -2px; width: 21px; height: 21px; display: grid; place-items: center; color: #075985; background: #e0f2fe; border-radius: 50%; font-size: 10px; font-weight: 800; }
.route-steps > li:not(.empty-state)::after { content: ""; position: absolute; left: 10px; top: 21px; bottom: 1px; width: 1px; background: #dbe4ee; }
.route-steps > li:last-child::after { display: none; }
.route-steps li.step-vertical { color: #075985; font-weight: 700; }
.route-steps li.step-vertical::before { color: #fff; background: #0284c7; }
.route-steps small { display: block; margin-top: 4px; color: var(--amber); font-weight: 500; }
.empty-state { padding: 22px 12px; text-align: center; color: #64748b; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 11px; }
.empty-state > span { width: 34px; height: 34px; display: grid; place-items: center; margin: 0 auto 8px; color: #075985; background: #e0f2fe; border-radius: 10px; font-size: 20px; }
.empty-state strong { display: block; color: #334155; }
.empty-state p { margin: 5px 0 0; font-size: 11px; }
.room-card { margin-top: 13px; padding: 12px; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 11px; }
.room-card h3 { margin: 0; font-size: 15px; }
.room-card p { margin: 4px 0 0; color: #475569; font-size: 11px; }
.room-card .room-place { display: inline-block; margin-top: 8px; padding: 3px 7px; color: #075985; background: #fff; border-radius: 999px; font-size: 10px; font-weight: 750; }
.room-card .room-unavailable { color: #9a3412; }
.room-card .room-data-note { color: #075985; }
.room-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.room-actions button[aria-pressed="true"] { color: #854d0e; background: #fefce8; border-color: #fde68a; }
.data-note { margin-top: 14px; padding: 11px; color: #475569; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 10px; }
.data-note p { margin: 4px 0 0; }

/* Hamburger menu matching the current public shell. */
dialog { color: var(--ink); }
.menu-dialog { width: min(448px, calc(100vw - 32px)); max-height: calc(100vh - 34px); padding: 0; background: #fff; border: 1px solid #dbe2ea; border-radius: 16px; box-shadow: 0 24px 70px rgba(15,23,42,.3); overflow: hidden; }
.menu-dialog::backdrop, .profile-dialog::backdrop, .accessibility-dialog::backdrop, .compact-dialog::backdrop, .welcome-dialog::backdrop { background: rgba(15,23,42,.42); backdrop-filter: blur(2px); }
.dialog-heading { position: sticky; z-index: 3; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 72px; padding: 16px 24px; background: rgba(255,255,255,.98); border-bottom: 1px solid #e2e8f0; }
.dialog-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.menu-dialog-body { max-height: calc(100vh - 106px); overflow: auto; padding: 0 24px 20px; }
.menu-section { padding: 16px 0 0; }
.menu-section + .menu-section { margin-top: 2px; }
.menu-section h3 { margin: 0 0 9px; color: #475569; font-size: 13px; }
.menu-route-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.route-field { position: relative; display: flex; align-items: center; min-width: 0; }
.route-field > svg { position: absolute; z-index: 2; width: 16px; height: 16px; margin: 0; left: 12px; }
.route-field input { width: 100%; height: 37px; min-width: 0; padding: 0 34px 0 35px; color: #334155; background: #fff; border: 1px solid #dbe2ea; border-radius: 8px; outline: 0; box-shadow: 0 1px 4px rgba(15,23,42,.08); }
.route-field input:focus { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(14,165,233,.12); }
.clear-field { position: absolute; z-index: 3; right: 7px; width: 24px; height: 24px; padding: 0; color: #64748b; background: transparent; border: 0; cursor: pointer; font-size: 19px; }
.route-popover { top: calc(100% + 5px); }
.menu-primary-button { width: 100%; min-height: 41px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; padding: 9px 14px; color: #fff; background: var(--blue-dark); border: 1px solid var(--blue-dark); border-radius: 8px; box-shadow: 0 3px 8px rgba(2,132,199,.22); cursor: pointer; font-weight: 700; }
.menu-primary-button:hover { background: #0284c7; }
.menu-primary-button svg, .menu-row-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.menu-building-list { display: grid; gap: 7px; }
.menu-building-list button { width: 100%; min-height: 39px; display: flex; align-items: center; gap: 9px; padding: 8px 12px; text-align: left; color: #475569; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; cursor: pointer; font-weight: 650; }
.menu-building-list button::before { content: "▥"; color: #94a3b8; font-size: 16px; }
.menu-building-list button[aria-selected="true"] { color: #0369a1; background: #f0f9ff; border-color: #7dd3fc; }
.menu-building-list button[aria-selected="true"]::after { content: "Activă"; margin-left: auto; font-size: 11px; font-weight: 600; }
.menu-destination-summary { min-height: 20px; color: #64748b; font-size: 12px; }
.menu-destination-summary.is-active { padding: 9px 11px; color: #075985; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px; }
.menu-row-button { width: 100%; min-height: 39px; display: inline-flex; align-items: center; gap: 9px; padding: 8px 13px; text-align: left; color: #475569; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; cursor: pointer; font-weight: 650; }
.menu-row-button:hover { color: #0369a1; background: #f0f9ff; }
.menu-row-button.is-installed { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.offline-delete-button { margin-top: 7px; color: #9f1239; border-color: #fecdd3; }
.offline-delete-button:hover { color: #881337; background: #fff1f2; border-color: #fda4af; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; color: #475569; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i { position: relative; width: 44px; height: 25px; background: #e2e8f0; border-radius: 999px; transition: background .16s; }
.switch-row i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(15,23,42,.2); transition: transform .16s; }
.switch-row input:checked + i { background: var(--blue); }
.switch-row input:checked + i::after { transform: translateX(19px); }
.switch-row input:focus-visible + i { outline: 3px solid rgba(14,165,233,.35); outline-offset: 2px; }
.download-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 8px; }
.secondary-button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 10px; color: #475569; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; cursor: pointer; font-size: 11px; font-weight: 700; }
.secondary-button:hover { color: #0369a1; background: #f8fafc; border-color: #bae6fd; }
.fine-print { margin: 7px 0 0; color: #64748b; font-size: 10px; }
.contact-section { display: grid; gap: 6px; padding-top: 18px; border-top: 1px solid #e2e8f0; }
.contact-section a { width: max-content; color: #475569; text-decoration: none; }
.contact-section a:hover { color: #0369a1; text-decoration: underline; }
.account-section { padding-top: 16px; }
.account-links, .account-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.account-actions { margin-top: 8px; }
.account-links button, .account-actions button { min-height: 36px; padding: 7px 9px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; cursor: pointer; font-size: 11px; font-weight: 650; }
.profile-count { min-width: 20px; margin-left: 5px; padding: 1px 6px; color: #fff; background: #075985; border-radius: 999px; }
.account-links button:hover, .account-actions button:hover { color: #0369a1; background: #f0f9ff; }
.menu-proof-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 14px; color: #64748b; border-top: 1px solid #e2e8f0; font-size: 10px; }
.connection-status { display: inline-flex; align-items: center; gap: 7px; color: #166534; font-size: 10px; font-weight: 750; }
.status-dot { width: 7px; height: 7px; background: #22c55e; border-radius: 50%; box-shadow: 0 0 0 3px #dcfce7; }
.connection-status.is-offline { color: #9a3412; }
.connection-status.is-offline .status-dot { background: #f97316; box-shadow: 0 0 0 3px #ffedd5; }

/* Dialogs and accessibility control. */
.profile-dialog, .accessibility-dialog, .compact-dialog, .welcome-dialog { width: min(520px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 0; background: #fff; border: 1px solid #dbe2ea; border-radius: 17px; box-shadow: 0 24px 70px rgba(15,23,42,.3); overflow: auto; }
.accessibility-dialog { width: min(760px, calc(100vw - 28px)); }
.dialog-heading-actions { display: flex; align-items: center; gap: 8px; }
.accessibility-body { display: grid; gap: 18px; padding: 18px 22px 24px; }
.accessibility-body h3 { margin: 0 0 10px; font-size: 15px; }
.accessibility-language { display: grid; grid-template-columns: 1fr minmax(180px, .7fr); align-items: center; gap: 12px; font-weight: 750; }
.accessibility-language select, .preferences-fieldset select { min-height: 39px; padding: 7px 9px; background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; }
.accessibility-profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.accessibility-profile-button { min-height: 76px; display: grid; gap: 4px; padding: 11px; text-align: left; color: #334155; background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; cursor: pointer; }
.accessibility-profile-button strong { font-size: 12px; }
.accessibility-profile-button span { color: #64748b; font-size: 10px; }
.accessibility-profile-button[aria-pressed="true"] { color: #075985; background: #e0f2fe; border-color: #0284c7; box-shadow: inset 4px 0 #0284c7; }
.accessibility-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; padding: 13px; border: 1px solid #e2e8f0; border-radius: 11px; }
.accessibility-controls legend { padding: 0 6px; font-size: 13px; font-weight: 850; }
.accessibility-controls label { min-height: 35px; display: flex; align-items: center; gap: 9px; cursor: pointer; }
.accessibility-controls input { width: 18px; height: 18px; accent-color: var(--blue-dark); }
.font-scale-control { grid-column: 1 / -1; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; }
.font-scale-control button { min-height: 38px; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 8px; cursor: pointer; font-weight: 850; }
.font-scale-control output { text-align: center; font-weight: 850; }
.accessibility-note { margin: 0; padding: 10px 12px; color: #475569; background: #f8fafc; border-radius: 9px; font-size: 11px; }
.privacy-note { margin: 16px 20px 0; padding: 11px 12px; color: #475569; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 11px; }
.profile-section { margin: 18px 20px 0; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.section-heading.compact { align-items: center; }
.profile-section h3 { margin: 0; font-size: 15px; }
.muted { color: #64748b; font-size: 11px; }
.favorites-list { display: grid; gap: 7px; margin-top: 10px; }
.favorite-item { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 11px; text-align: left; color: inherit; background: #fff; border: 1px solid #e2e8f0; border-radius: 9px; cursor: pointer; }
.favorite-item:hover { background: #f0f9ff; border-color: #bae6fd; }
.favorite-item strong { font-size: 12px; }
.favorite-item span { grid-column: 1; color: #64748b; font-size: 10px; }
.favorite-item small { grid-column: 2; grid-row: 1 / 3; align-self: center; color: #075985; font-weight: 750; }
.favorites-empty { padding: 16px; color: #64748b; text-align: center; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 9px; font-size: 11px; }
.preferences-fieldset { display: grid; gap: 8px; padding: 13px; border: 1px solid #e2e8f0; border-radius: 11px; }
.preferences-fieldset legend { padding: 0 5px; font-size: 13px; font-weight: 800; }
.preferences-fieldset label { display: flex; align-items: center; gap: 9px; min-height: 31px; cursor: pointer; font-size: 12px; }
.preferences-fieldset input { width: 17px; height: 17px; accent-color: var(--blue); }
.preferences-fieldset p { margin: 2px 0 0; color: #64748b; font-size: 10px; }
.danger-button { width: calc(100% - 40px); min-height: 40px; margin: 18px 20px 20px; color: #991b1b; background: #fff; border: 1px solid #fecaca; border-radius: 9px; cursor: pointer; font-size: 11px; font-weight: 750; }
.danger-button:hover { background: #fef2f2; }
.compact-dialog-body { display: grid; gap: 9px; padding: 18px 22px 22px; }
.compact-dialog-body p { margin: 0 0 4px; color: #475569; font-size: 12px; }
.compact-dialog-body label { color: #334155; font-size: 11px; font-weight: 750; }
.compact-dialog-body input[type="text"], .compact-dialog-body select, .compact-dialog-body textarea { width: 100%; padding: 9px 10px; color: #1f2937; background: #fff; border: 1px solid #dbe2ea; border-radius: 8px; }
.compact-dialog-body textarea { resize: vertical; }
.compact-dialog-body .menu-primary-button { margin-top: 4px; }
.qr-dialog-body { gap: 12px; }
.qr-camera-view { position: relative; width: min(100%, 360px); aspect-ratio: 1; justify-self: center; overflow: hidden; background: #0f172a; border-radius: 14px; }
.qr-camera-view video { width: 100%; height: 100%; object-fit: cover; }
.qr-scan-corners { position: absolute; inset: 12%; border: 4px solid transparent; background: linear-gradient(#fb7185,#fb7185) left top/42px 4px no-repeat, linear-gradient(#fb7185,#fb7185) left top/4px 42px no-repeat, linear-gradient(#fb7185,#fb7185) right top/42px 4px no-repeat, linear-gradient(#fb7185,#fb7185) right top/4px 42px no-repeat, linear-gradient(#fb7185,#fb7185) left bottom/42px 4px no-repeat, linear-gradient(#fb7185,#fb7185) left bottom/4px 42px no-repeat, linear-gradient(#fb7185,#fb7185) right bottom/42px 4px no-repeat, linear-gradient(#fb7185,#fb7185) right bottom/4px 42px no-repeat; pointer-events: none; }
.qr-camera-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qr-camera-actions > * { margin: 0; }
.qr-scan-status { min-height: 38px; padding: 9px 10px; background: #f8fafc; border-radius: 8px; }
.compact-dialog-body input[type="file"] { width: 100%; padding: 8px; border: 1px dashed #94a3b8; border-radius: 8px; }
.dialog-separator { display: flex; align-items: center; gap: 10px; color: #64748b; font-size: 10px; text-transform: uppercase; }
.dialog-separator::before, .dialog-separator::after { content: ""; height: 1px; flex: 1; background: #e2e8f0; }
.report-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 8px; }
.report-actions > * { margin: 0 !important; }
.report-context-check { display: flex; align-items: center; gap: 8px; min-height: 32px; font-weight: 500 !important; }
.report-context-check input { width: 17px; height: 17px; accent-color: var(--blue); }
.welcome-dialog { width: min(520px, calc(100vw - 28px)); }
.welcome-body { padding: 18px 24px 24px; }
.welcome-body > p { margin: 0 0 15px; color: #475569; }
.welcome-body ol { display: grid; gap: 15px; margin: 0; padding: 0; list-style: none; counter-reset: welcome; }
.welcome-body li { position: relative; display: grid; gap: 3px; min-height: 34px; padding-left: 48px; counter-increment: welcome; }
.welcome-body li::before { content: counter(welcome); position: absolute; left: 0; top: 0; width: 33px; height: 33px; display: grid; place-items: center; color: #fff; background: #38a9e6; border-radius: 50%; }
.welcome-body li span { color: #64748b; font-size: 12px; }
.welcome-body hr { margin: 22px 0; border: 0; border-top: 1px solid #e2e8f0; }
.welcome-body h3 { margin: 0 0 8px; font-size: 17px; }
.accessibility-fab { position: fixed; z-index: 120; left: 16px; bottom: 16px; width: 67px; height: 67px; display: grid; place-items: center; padding: 0; color: #fff; background: #2563d8; border: 4px solid #fff; border-radius: 50%; box-shadow: 0 2px 9px rgba(15,23,42,.28), inset 0 0 0 2px #2563d8; cursor: pointer; }
.accessibility-fab svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.reading-guide { position: fixed; z-index: 115; left: 0; right: 0; top: var(--reading-guide-y, 50%); height: 54px; transform: translateY(-50%); border-top: 3px solid rgba(2,132,199,.72); border-bottom: 3px solid rgba(2,132,199,.72); background: rgba(186,230,253,.13); pointer-events: none; }
.toast { position: fixed; z-index: 200; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: min(520px, calc(100vw - 30px)); padding: 11px 15px; color: #fff; background: #0f172a; border-radius: 9px; box-shadow: var(--shadow); font-size: 12px; }

html[data-text-scale="large"] body { font-size: 16px; }
html[data-text-scale="large"] .menu-dialog { width: min(500px, calc(100vw - 28px)); }
html[data-text-scale="large"] .search-field input { font-size: 20px; }
html[data-text-scale="large"] .floor-tabs button { min-width: 42px; height: 42px; font-size: 16px; }
html[data-text-scale="large"] .map-hint { font-size: 13px; }
html[data-text-scale="large"] .search-result strong { font-size: 17px; }
html[data-text-scale="large"] .search-result .result-name { font-size: 15px; }
html[data-text-scale="large"] .search-result .result-place { font-size: 14px; }
html[data-text-scale="large"] .menu-section h3 { font-size: 16px; }
html[data-text-scale="large"] .route-field input,
html[data-text-scale="large"] .mobile-route-field input { min-height: 40px; font-size: 17px; }
html[data-text-scale="large"] .menu-primary-button,
html[data-text-scale="large"] .menu-row-button,
html[data-text-scale="large"] .menu-building-list button,
html[data-text-scale="large"] .account-links button,
html[data-text-scale="large"] .account-actions button { font-size: 15px; }
html[data-text-scale="large"] .fine-print,
html[data-text-scale="large"] .menu-proof-footer,
html[data-text-scale="large"] .connection-status { font-size: 13px; }
html[data-text-scale="large"] .route-panel-heading h2 { font-size: 21px; }
html[data-text-scale="large"] .route-summary,
html[data-text-scale="large"] .route-warning,
html[data-text-scale="large"] .route-steps > li:not(.empty-state) { font-size: 15px; }
html[data-text-scale="large"] .room-card h3 { font-size: 19px; }
html[data-text-scale="large"] .room-card p { font-size: 14px; }
html[data-text-scale="large"] .room-card .room-place,
html[data-text-scale="large"] .data-note { font-size: 13px; }
html[data-text-scale="large"] .preferences-fieldset label { font-size: 15px; }
html[data-contrast="high"] { --ink: #000; --muted: #1f2937; --line: #64748b; --line-strong: #334155; --blue: #005e91; --route: #003cff; }
html[data-contrast="high"] .map-canvas .edges > line.active { stroke-width: 5 !important; }
html[data-contrast="high"] button:focus-visible, html[data-contrast="high"] input:focus-visible, html[data-contrast="high"] select:focus-visible, html[data-contrast="high"] textarea:focus-visible, html[data-contrast="high"] a:focus-visible, html[data-contrast="high"] [tabindex]:focus-visible { outline-color: #000; outline-width: 4px; }
html[data-reduced-motion="true"] *, html[data-reduced-motion="true"] *::before, html[data-reduced-motion="true"] *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
html[data-font-weight="500"] body { font-weight: 500; }
html[data-font-weight="600"] body { font-weight: 600; }
html[data-font-weight="700"] body { font-weight: 700; }
html[data-line-height="1.75"] body { line-height: 1.75; }
html[data-line-height="2"] body { line-height: 2; }
html[data-letter-spacing="0.05"] body { letter-spacing: .05em; }
html[data-letter-spacing="0.1"] body { letter-spacing: .1em; }
html[data-letter-spacing="0.15"] body { letter-spacing: .15em; }
html[data-font-family="readable"] body { font-family: Verdana, Arial, sans-serif; }
html[data-font-family="dyslexia-friendly"] body { font-family: "Atkinson Hyperlegible", Verdana, "Comic Sans MS", sans-serif; }
html[data-highlight-links="true"] a { color: #000 !important; background: #fde047 !important; outline: 2px solid #000; text-decoration: underline !important; }
html[data-highlight-headings="true"] :is(h1,h2,h3,h4,h5,h6) { padding-inline: .15em; color: #000 !important; background: #fef08a; outline: 2px solid #a16207; }
html[data-super-focus="true"] :focus-visible { outline: 5px solid #e11d48 !important; outline-offset: 4px !important; box-shadow: 0 0 0 8px #fff !important; }
html[data-big-cursor="true"], html[data-big-cursor="true"] * { cursor: crosshair !important; }
html[data-color-mode="monochrome"] :is(.home-view,.map-app,.auth-view) { filter: grayscale(1); }
html[data-color-mode="low-saturation"] :is(.home-view,.map-app,.auth-view) { filter: saturate(.45); }
html[data-color-mode="high-saturation"] :is(.home-view,.map-app,.auth-view) { filter: saturate(1.7); }
html[data-contrast="light"] { --ink: #000; --muted: #1f2937; --canvas: #fff; --surface-soft: #fff; }
html[data-contrast="dark"] { --ink: #fff; --muted: #e2e8f0; --canvas: #111827; --surface-soft: #1f2937; }
html[data-contrast="dark"] :is(.home-view,.map-app,.auth-view) { color: #fff; background: #111827; }
html[data-hide-images="true"] :is(.building-card-preview img,.live-logo img,.auth-logo img) { visibility: hidden; }

@media (max-width: 980px) {
  .building-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .route-panel { top: auto; right: 12px; bottom: 12px; max-height: min(55vh, 560px); }
}

@media (max-width: 640px) {
  .home-content { width: calc(100% - 32px); padding-top: 58px; }
  .home-heading { margin-bottom: 26px; }
  .home-heading h1 { font-size: 42px; }
  .home-heading p { max-width: 100%; font-size: 19px; overflow-wrap: anywhere; }
  .building-card-grid { grid-template-columns: 1fr; gap: 24px; }
  .building-card-preview { height: 288px; }

  .live-header { height: 151px; grid-template-columns: 56px minmax(0, 205px) 42px; justify-content: space-between; gap: 11px; padding: 0 12px; }
  .live-logo { width: 48px; align-self: center; }
  .live-logo img { width: 46px; height: 55px; }
  .global-search-wrap { display: none; }
  .mobile-route-bar { width: 100%; display: grid; grid-template-rows: 41px 36px 36px; gap: 5px; align-self: center; }
  .mobile-qr-button { height: 41px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: #fff; background: var(--blue-dark); border: 0; border-radius: 10px; box-shadow: 0 2px 6px rgba(15,23,42,.16); cursor: pointer; font-weight: 700; }
  .mobile-qr-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
  .mobile-route-field { position: relative; display: flex; align-items: center; }
  .mobile-route-field > svg { position: absolute; z-index: 2; left: 12px; width: 16px; height: 16px; margin: 0; }
  .mobile-route-field input { width: 100%; height: 36px; padding: 0 10px 0 36px; color: #334155; background: #fff; border: 1px solid #dbe2ea; border-radius: 8px; outline: 0; box-shadow: 0 1px 4px rgba(15,23,42,.1); }
  .mobile-route-results { top: calc(100% + 4px); left: 0; right: 0; min-width: min(330px, calc(100vw - 30px)); }
  .menu-button { width: 39px; height: 39px; align-self: center; border-radius: 10px; }
  .menu-button svg { width: 21px; height: 21px; }
  .live-map-shell { height: calc(100vh - 151px); min-height: 420px; }
  .map-toolbar { top: 7px; left: 7px; }
  .map-toolbar button { width: 41px; height: 41px; }
  .floor-toolbar { top: 7px; right: 7px; max-width: calc(100% - 139px); }
  .floor-tabs { gap: 4px; }
  .floor-tabs button { min-width: 38px; height: 37px; padding: 0 8px; }
  .map-hint { display: none; }
  .route-panel { position: fixed; top: auto; right: 0; bottom: 0; left: 0; width: 100%; max-height: 58vh; padding: 16px; border-radius: 15px 15px 0 0; }
  .menu-dialog { width: calc(100vw - 32px); max-height: calc(100vh - 34px); }
  .dialog-heading { min-height: 72px; padding: 15px 24px; }
  .menu-dialog-body { padding: 0 24px 20px; }
  .menu-route-grid { grid-template-columns: 1fr; gap: 7px; }
  .accessibility-profile-grid, .accessibility-controls { grid-template-columns: 1fr; }
  .font-scale-control { grid-column: 1; }
  .guidance-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-card { padding: 24px 20px; }
  .accessibility-fab { width: 60px; height: 60px; left: 15px; bottom: 15px; }
  .accessibility-fab svg { width: 34px; height: 34px; }
  .toast { bottom: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
