:root {
  --mvp: #2f8cff;
  --rd: #a97cff;
  --mlsa: #23c483;
  --new: #ffc83d;
  --ink: #f3f6fb;
  --ink-2: #b7c2d3;
  --ink-3: #8090a8;
  --glass: rgba(14, 20, 32, .9);
  --glass-line: rgba(255, 255, 255, .09);
  --field: rgba(255, 255, 255, .06);
  --field-line: rgba(255, 255, 255, .12);
  --accent: #2f8cff;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --radius: 18px;
  --pl-background: #10151f;
  --pl-control-bg: rgba(14, 20, 32, .86);
  --pl-control-hover: rgba(30, 40, 60, .95);
  --pl-control-fg: #f3f6fb;
  --pl-attribution-bg: rgba(14, 20, 32, .7);
  --pl-attribution-fg: #b7c2d3;
  color-scheme: dark;
}

.app[data-style="road"] {
  --pl-background: #e9edf1;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #10151f;
  color: var(--ink);
  font: 14px/1.45 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }
h1, h2, p { margin: 0; }

.app { position: fixed; inset: 0; }
.map { position: absolute; inset: 0; }

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px) saturate(1.3);
  -webkit-backdrop-filter: blur(28px) saturate(1.3);
}

/* ------------------------------------------------------------------ markers */
.pin {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 3px;
  background: var(--c);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
  transition: transform .15s ease;
}
.pl-marker:hover .pin, .pin[data-selected="true"] { transform: scale(1.18); }
.pin[data-selected="true"] { box-shadow: 0 0 0 4px rgba(255, 255, 255, .85), 0 6px 18px rgba(0, 0, 0, .5); }
.pin-initials, .pin-photo {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
}
.pin-initials {
  display: grid;
  place-items: center;
  background: #1b2433;
  font-weight: 650;
  font-size: 13px;
  letter-spacing: .02em;
}
.pin-photo { background: var(--photo) center / cover no-repeat; }
.pin-new, .bubble-new {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--new);
  border: 2px solid #10151f;
}

.bubble {
  position: relative;
  width: var(--sz);
  height: var(--sz);
  border-radius: 50%;
  background: var(--ring);
  padding: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
  transition: transform .15s ease;
}
.bubble::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: var(--ring);
  opacity: .22;
  z-index: -1;
}
.pl-marker:hover .bubble { transform: scale(1.08); }
.bubble span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #121a28;
  font-weight: 700;
  font-size: calc(var(--sz) * .27);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ side panel */
.panel {
  position: absolute;
  z-index: 20;
  left: 16px;
  top: 16px;
  bottom: 16px;
  width: 372px;
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  scrollbar-width: thin;
}
.panel-grip { display: none; }

.brand { display: flex; gap: 14px; align-items: flex-start; }
.brand h1 { font-size: 22px; line-height: 1.1; font-weight: 750; letter-spacing: -.02em; }
.brand .tagline { margin-top: 2px; color: var(--ink); font-weight: 600; font-size: 13.5px; }
.brand p { margin-top: 4px; color: var(--ink-2); font-size: 13px; }
.brand-mark {
  flex: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  width: 34px;
  height: 34px;
  margin-top: 2px;
}
.brand-mark i:nth-child(1) { background: #f25022; }
.brand-mark i:nth-child(2) { background: #7fba00; }
.brand-mark i:nth-child(3) { background: #00a4ef; }
.brand-mark i:nth-child(4) { background: #ffb900; }

.demo-flag {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 200, 61, .14);
  color: var(--new);
  font-size: 12px;
  font-weight: 600;
}

.programs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.program {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 10px 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--field-line);
  background: var(--field);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: opacity .15s, border-color .15s, background .15s;
}
.program::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--c);
}
.program strong { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.program span { font-size: 11.5px; color: var(--ink-2); line-height: 1.2; }
.program em {
  position: absolute;
  top: 8px;
  right: 8px;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--new);
}
.program[aria-pressed="false"] { opacity: .42; }
.program[aria-pressed="true"] { border-color: color-mix(in srgb, var(--c) 55%, transparent); }
.program:hover { background: rgba(255, 255, 255, .1); }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--field);
  border: 1px solid var(--field-line);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 140, 255, .25); }
.search svg { width: 18px; height: 18px; fill: var(--ink-3); flex: none; }
.search input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.selects { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.selects select {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid var(--field-line);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.selects option { background: #182131; }

.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; color: var(--ink-2); font-size: 13px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track {
  flex: none;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .16);
  padding: 2px;
  transition: background .15s;
}
.toggle-track span {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s;
}
.toggle input:checked + .toggle-track { background: var(--new); }
.toggle input:checked + .toggle-track span { transform: translateX(16px); }
.toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px rgba(47, 140, 255, .4); }

.summary { color: var(--ink-2); font-size: 13px; }
.summary strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.link {
  border: 0;
  background: none;
  padding: 0;
  margin-left: 6px;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
}

.results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.results .empty { color: var(--ink-3); padding: 8px 0; }
.results button, .row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  background: none;
  cursor: pointer;
  text-align: left;
}
.results button:hover, .row:hover { background: rgba(255, 255, 255, .07); }
.results b, .row b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results small, .row small {
  display: block;
  color: var(--ink-3);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.results button > span:last-child, .row > span:last-child { min-width: 0; }

.panel-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-line);
  color: var(--ink-3);
  font-size: 11.5px;
}

/* ------------------------------------------------------------------ avatar */
.avatar {
  position: relative;
  flex: none;
  width: var(--sz);
  height: var(--sz);
  border-radius: 50%;
  padding: 2px;
  background: var(--c);
}
.avatar-initials, .avatar img {
  position: absolute;
  inset: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  border-radius: 50%;
}
.avatar-initials {
  display: grid;
  place-items: center;
  background: #1b2433;
  font-weight: 650;
  font-size: calc(var(--sz) * .34);
}
.avatar img { object-fit: cover; }

/* ------------------------------------------------------------------ toolbar */
.toolbar {
  position: absolute;
  z-index: 20;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 14px;
}
.toolbar button {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.toolbar button:hover { color: var(--ink); background: rgba(255, 255, 255, .07); }
.toolbar button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.toolbar .lang { border-left: 1px solid var(--glass-line); border-radius: 0 10px 10px 0; }

/* ------------------------------------------------------------------ drawer */
.drawer {
  position: absolute;
  z-index: 25;
  top: 66px;
  right: 16px;
  max-height: calc(100% - 170px);
  width: 380px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  padding: 22px 20px 20px;
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  pointer-events: none;
  transition: transform .32s cubic-bezier(.2, .8, .2, 1), opacity .2s;
}
.drawer[data-open="true"] { transform: none; opacity: 1; pointer-events: auto; }
.drawer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.drawer-close:hover { background: rgba(255, 255, 255, .16); }
.drawer-head { padding-right: 36px; margin-bottom: 12px; }
.drawer-head h2 { font-size: 18px; }
.drawer-head p { color: var(--ink-2); }
.drawer-list { flex: 1 1 auto; min-height: 0; max-height: calc(100vh - 280px); overflow: auto; margin: 0 -8px; padding: 0 8px; scrollbar-width: thin; }
.row { height: 66px; }
.dot-new { display: inline-block; width: 8px; height: 8px; margin-left: 4px; border-radius: 50%; background: var(--new); vertical-align: middle; }
.back { margin: 0 0 14px; align-self: flex-start; }

.card { display: flex; flex-direction: column; gap: 16px; overflow: auto; padding-right: 4px; }
.card-head { display: flex; gap: 16px; align-items: center; padding-right: 30px; }
.card-head h2 { font-size: 20px; line-height: 1.2; margin-top: 6px; }
.card-headline { margin-top: 4px; color: var(--ink-2); font-size: 13px; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff;
  background: var(--c);
}
.badge + .badge { margin-left: 4px; }
.badge-new { background: var(--new); color: #1b1b1b; }
.card-facts { display: grid; grid-template-columns: 22px 1fr; gap: 8px 6px; margin: 0; }
.card-facts dt { color: var(--ink-3); }
.card-facts dd { margin: 0; }
.card-facts small { display: block; color: var(--ink-3); font-size: 12px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li.chip-strong { background: rgba(47, 140, 255, .18); border-color: rgba(47, 140, 255, .45); font-weight: 600; }
.chips li { padding: 4px 10px; border-radius: 999px; background: var(--field); border: 1px solid var(--field-line); font-size: 12px; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.1); }

/* ------------------------------------------------------------------ loading */
.veil {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: rgba(10, 14, 22, .72);
  backdrop-filter: blur(6px);
  text-align: center;
  padding: 16px;
}
.veil code { color: var(--ink-3); font-size: 12px; max-width: 520px; }
.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .15);
  border-top-color: var(--accent);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-progress { position: fixed; inset: 0; margin: auto; width: 64px; height: 64px; }
.loading-progress circle { fill: none; stroke: rgba(255, 255, 255, .12); stroke-width: 6px; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child {
  stroke: var(--accent);
  stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
  transition: stroke-dasharray .05s ease-in-out;
}

#blazor-error-ui {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 16px;
  background: #5a1d1d;
  color: #fff;
}
#blazor-error-ui .dismiss { cursor: pointer; float: right; }
#blazor-error-ui .reload { color: #fff; }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 760px) {
  .panel {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    max-height: 78vh;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 6px 16px 16px;
    transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  }
  .panel[data-open="false"] { transform: translateY(calc(100% - 92px)); overflow: hidden; }
  .panel-grip {
    display: grid;
    place-items: center;
    height: 22px;
    border: 0;
    background: none;
    cursor: pointer;
  }
  .panel-grip span { width: 44px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .3); }
  .brand p { display: none; }
  .brand h1 { font-size: 16px; }
  .toolbar { top: 12px; right: 12px; left: 12px; justify-content: space-between; }
  .toolbar button { padding: 0 10px; }
  .drawer { top: 64px; left: 12px; right: 12px; width: auto; max-height: calc(100% - 180px); }
  .pl-zoom-control { display: none; }
}
