:root {
  color-scheme: light;
  --bg: #f4efe7;
  --surface: rgba(255, 252, 247, 0.88);
  --surface-ink: #1d2a33;
  --muted: #617180;
  --line: rgba(29, 42, 51, 0.1);
  --shadow: 0 24px 60px rgba(21, 37, 43, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --space-2: clamp(0.6rem, 0.5rem + 0.3vw, 0.9rem);
  --space-3: clamp(0.9rem, 0.75rem + 0.45vw, 1.2rem);
  --space-4: clamp(1.1rem, 0.9rem + 0.7vw, 1.6rem);
  --space-5: clamp(1.4rem, 1rem + 1.2vw, 2.2rem);
  --green: #2f9d5d;
  --orange: #d48824;
  --red: #c54d43;
  --grey: #8b96a0;
  --blue: #2e78ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(107, 159, 169, 0.2), transparent 30%),
    radial-gradient(circle at bottom right, rgba(233, 174, 106, 0.18), transparent 25%),
    linear-gradient(180deg, #f9f4eb 0%, var(--bg) 100%);
  color: var(--surface-ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  padding: var(--space-3);
  max-width: 1680px;
  margin: 0 auto;
}

.app-footer {
  padding: 0.15rem var(--space-2) var(--space-2);
  text-align: center;
}

.app-footer p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.app-footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(97, 113, 128, 0.28);
  transition: border-color 0.18s ease, color 0.18s ease;
}

.app-footer a:hover,
.app-footer a:focus-visible {
  color: var(--surface-ink);
  border-bottom-color: rgba(29, 42, 51, 0.45);
}

.topbar,
.tabbar,
.page-card,
.auth-card,
.context-panel,
.search-card,
.map-legend,
.note-banner,
.hint-card,
.activity-card,
.saved-car-card,
.quick-stat-card {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand-mark {
  width: clamp(3rem, 6vw, 4rem);
  height: clamp(3rem, 6vw, 4rem);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #0a1320;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(1.5rem, 1.1rem + 1vw, 2.2rem);
}

h2 {
  font-size: clamp(1.35rem, 1rem + 0.8vw, 1.9rem);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.install-button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.install-icon {
  width: 1.5rem;
  height: 1.5rem;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(24, 76, 90, 0.12);
}

.install-icon svg {
  width: 1rem;
  height: 1rem;
  display: block;
}

.install-icon path,
.map-legend__close path {
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.tabbar {
  display: inline-flex;
  gap: 0.35rem;
  background: rgba(255, 250, 242, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem;
  margin-bottom: var(--space-3);
}

.tab-button,
.ghost-button,
.chip-button,
.primary-button,
.secondary-button,
.primary-fab,
.secondary-fab,
.search-button {
  border: none;
  border-radius: 999px;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.tab-button {
  background: transparent;
  color: var(--muted);
  padding: 0.8rem 1.15rem;
  font-weight: 700;
}

.tab-button[hidden],
.tab-button.is-hidden {
  display: none !important;
}

.tab-button.is-active {
  background: #173f4b;
  color: #fff;
  box-shadow: 0 10px 25px rgba(23, 63, 75, 0.2);
}

.views {
  min-height: calc(100vh - 10rem);
}

.view {
  display: none;
}

.view.view--active {
  display: block;
}

.map-layout {
  display: grid;
  gap: var(--space-3);
  min-height: calc(100vh - 12rem);
}

.map-stage {
  position: relative;
  min-height: 72vh;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(29, 42, 51, 0.08);
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, rgba(24, 76, 90, 0.08), rgba(255, 250, 242, 0.8));
}

#map {
  width: 100%;
  height: 100%;
  min-height: 72vh;
  z-index: 1;
}

.map-toolbar {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  right: var(--space-3);
  z-index: 800;
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}

.search-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1 1 18rem;
  background: rgba(255, 250, 242, 0.94);
  border: 1px solid rgba(29, 42, 51, 0.08);
  border-radius: 999px;
  padding: 0.45rem;
  box-shadow: 0 20px 50px rgba(23, 63, 75, 0.12);
}

.search-card input,
label input:not([type="checkbox"]),
label select,
label textarea {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--surface-ink);
}

.search-card input {
  padding: 0.55rem 0.75rem;
}

.search-button,
.primary-button,
.primary-fab {
  background: linear-gradient(145deg, #194c59, #2f7885);
  color: #fff9f0;
  padding: 0.85rem 1.2rem;
  font-weight: 800;
  box-shadow: 0 14px 24px rgba(23, 63, 75, 0.18);
}

.secondary-button,
.secondary-fab,
.ghost-button,
.chip-button,
.google-button {
  background: rgba(255, 250, 242, 0.9);
  color: var(--surface-ink);
  padding: 0.85rem 1.05rem;
  border: 1px solid rgba(29, 42, 51, 0.08);
  font-weight: 700;
}

.google-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  background: #fffdf8;
}

.google-button svg {
  width: 1.2rem;
  height: 1.2rem;
  display: block;
}

.chip-button--icon {
  width: 3rem;
  height: 3rem;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.chip-button--icon svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
}

.ghost-button.full-width,
.primary-button.full-width {
  width: 100%;
}

.note-banner {
  background: rgba(255, 248, 236, 0.92);
  border: 1px solid rgba(212, 136, 36, 0.18);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  color: #7b5a17;
  font-size: 0.92rem;
}

.dismissible-note {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.note-copy {
  display: grid;
  gap: 0.28rem;
  flex: 1 1 auto;
}

.note-copy span {
  display: flex;
  align-items: flex-start;
  gap: 0.42rem;
  flex: 1 1 auto;
}

.note-copy span::before {
  content: "";
  width: 0.34rem;
  height: 0.34rem;
  margin-top: 0.42rem;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.note-close {
  width: 1.95rem;
  height: 1.95rem;
  min-width: 1.95rem;
  border: 1px solid rgba(123, 90, 23, 0.18);
  border-radius: 50%;
  background: rgba(255, 252, 247, 0.7);
  color: #7b5a17;
  padding: 0;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.note-close svg {
  width: 0.96rem;
  height: 0.96rem;
  display: block;
}

.note-close path {
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.dismissible-note.is-hidden {
  display: none !important;
}

.mobile-note {
  position: absolute;
  left: var(--space-3);
  right: var(--space-3);
  top: calc(var(--space-3) + 4.5rem);
  z-index: 700;
}

.map-legend {
  position: absolute;
  left: var(--space-3);
  bottom: var(--space-3);
  z-index: 800;
  max-width: min(18rem, calc(100% - 2 * var(--space-3)));
  background: rgba(255, 252, 247, 0.9);
  border-radius: 20px;
  border: 1px solid rgba(29, 42, 51, 0.08);
  padding: 0.9rem 1rem;
}

.map-legend.is-expanded {
  max-width: min(18rem, calc(100% - 2 * var(--space-3)));
}

.map-legend.is-collapsed {
  padding: 0.6rem 0.75rem;
}

.map-legend__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.map-legend__toggle {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
}

.map-legend.is-expanded .map-legend__toggle {
  cursor: default;
}

.map-legend__close {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: 1px solid rgba(29, 42, 51, 0.1);
  background: rgba(255, 250, 242, 0.9);
  color: var(--muted);
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.map-legend__close svg {
  width: 0.78rem;
  height: 0.78rem;
  display: block;
}

.map-legend.is-collapsed .map-legend__close {
  display: none;
}

.map-legend.is-expanded .map-legend__header {
  margin-bottom: 0.6rem;
}

.map-legend ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.map-legend.is-collapsed ul {
  display: none;
}

.map-legend li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.92rem;
}

.legend-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot--green {
  background: var(--green);
}

.legend-dot--orange {
  background: var(--orange);
}

.legend-dot--red {
  background: var(--red);
}

.legend-dot--grey {
  background: var(--grey);
}

.legend-dot--blue {
  background: var(--blue);
}

.floating-actions {
  position: absolute;
  right: var(--space-3);
  bottom: var(--space-3);
  z-index: 800;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
  max-width: min(18rem, calc(100% - 2 * var(--space-3)));
}

.primary-fab,
.secondary-fab {
  width: 100%;
}

.pin-composer {
  position: absolute;
  z-index: 900;
  width: min(22rem, calc(100% - 2 * var(--space-3)));
  background: rgba(255, 251, 245, 0.98);
  border: 1px solid rgba(29, 42, 51, 0.1);
  border-radius: 24px;
  box-shadow: 0 20px 48px rgba(14, 28, 34, 0.18);
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
}

.pin-composer[hidden] {
  display: none !important;
}

.pin-composer::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  background: inherit;
  border-right: 1px solid rgba(29, 42, 51, 0.1);
  border-bottom: 1px solid rgba(29, 42, 51, 0.1);
  transform: rotate(45deg);
  bottom: -9px;
  left: 28px;
}

.pin-composer.is-below::after {
  top: -9px;
  bottom: auto;
  border-right: none;
  border-bottom: none;
  border-top: 1px solid rgba(29, 42, 51, 0.1);
  border-left: 1px solid rgba(29, 42, 51, 0.1);
}

.pin-composer__header,
.pin-composer__footer,
.pin-composer__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pin-composer__coords {
  color: var(--muted);
  font-size: 0.86rem;
}

.pin-composer__body {
  display: grid;
  gap: 0.9rem;
}

.pin-composer__progress {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.35rem;
}

.pin-composer__progress--car {
  grid-template-columns: repeat(4, 1fr);
}

.pin-composer__dot {
  height: 0.38rem;
  border-radius: 999px;
  background: rgba(23, 63, 75, 0.12);
}

.pin-composer__dot.is-active {
  background: linear-gradient(90deg, #194c59, #2f7885);
}

.choice-grid {
  display: grid;
  gap: 0.7rem;
}

.choice-card {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(29, 42, 51, 0.1);
  background: rgba(255, 253, 249, 0.95);
  text-align: left;
  color: var(--surface-ink);
}

.choice-card strong {
  font-size: 0.98rem;
}

.choice-card small {
  color: var(--muted);
}

.choice-card.is-selected {
  border-color: rgba(23, 63, 75, 0.32);
  background: rgba(24, 76, 90, 0.08);
  box-shadow: 0 12px 24px rgba(23, 63, 75, 0.1);
}

.inline-input {
  display: grid;
  gap: 0.4rem;
}

.inline-input input,
.inline-input textarea {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(29, 42, 51, 0.12);
  background: #fffdf8;
}

.composer-summary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 26, 29, 0.28);
  z-index: 1090;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.panel-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.context-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  max-height: min(82vh, 46rem);
  overflow-y: auto;
  border-radius: 28px 28px 0 0;
  background: rgba(255, 251, 245, 0.98);
  border: 1px solid rgba(29, 42, 51, 0.08);
  box-shadow: 0 -18px 40px rgba(16, 31, 37, 0.18);
  padding: var(--space-4);
  transform: translateY(105%);
  transition: transform 220ms ease;
}

.context-panel.is-visible {
  transform: translateY(0);
}

.panel-card,
.page-card,
.auth-card {
  display: grid;
  gap: var(--space-3);
}

.panel-card--welcome {
  gap: var(--space-4);
}

.panel-copy {
  display: grid;
  gap: 0.75rem;
}

.hint-list,
.stack-list,
.quick-stats,
.stack-form {
  display: grid;
  gap: var(--space-2);
}

.hint-card,
.activity-card,
.saved-car-card,
.quick-stat-card,
.admin-user-card,
.admin-report-card {
  background: rgba(252, 247, 239, 0.86);
  border-radius: var(--radius-md);
  border: 1px solid rgba(29, 42, 51, 0.08);
  padding: var(--space-3);
}

.quick-stats {
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
}

.quick-stat-card strong {
  display: block;
  font-size: 1.4rem;
  font-family: "Space Grotesk", sans-serif;
}

.future-note {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(47, 120, 133, 0.08), rgba(233, 174, 106, 0.15));
  color: #38525a;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}

.page-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
}

.page-grid--admin {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

.page-card,
.auth-card {
  background: rgba(255, 251, 245, 0.9);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(29, 42, 51, 0.08);
  padding: var(--space-4);
  box-shadow: var(--shadow);
}

.page-card--wide {
  grid-column: 1 / -1;
}

.auth-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 14rem);
}

.auth-card {
  width: min(100%, 34rem);
}

.auth-status {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(24, 76, 90, 0.08);
  color: #214d58;
}

label {
  display: grid;
  gap: 0.45rem;
  font-weight: 700;
}

label span {
  font-size: 0.92rem;
}

label input,
label select,
label textarea {
  padding: 0.95rem 1rem;
  background: #fffdf8;
  border: 1px solid rgba(29, 42, 51, 0.12);
  border-radius: 16px;
}

label input[type="checkbox"] {
  width: auto;
  margin: 0.15rem 0 0;
  accent-color: var(--blue);
}

label textarea {
  min-height: 6rem;
  resize: vertical;
}

.button-row,
.inline-row,
.meta-row,
.card-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.admin-report-grid {
  display: grid;
  gap: 0.8rem;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(24, 76, 90, 0.08);
  color: #305762;
  font-size: 0.85rem;
  font-weight: 700;
}

.availability-pill {
  color: #fff;
}

.availability-pill.available {
  background: var(--green);
}

.availability-pill.almost_full {
  background: var(--orange);
}

.availability-pill.full {
  background: var(--red);
}

.availability-pill.old {
  background: var(--grey);
}

.warning-box,
.info-box {
  border-radius: var(--radius-md);
  padding: 1rem;
}

.warning-box {
  background: rgba(212, 136, 36, 0.12);
  color: #7b5a17;
}

.info-box {
  background: rgba(46, 120, 255, 0.08);
  color: #1d57b7;
}

.thumb-preview {
  width: 100%;
  max-height: 15rem;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(29, 42, 51, 0.08);
}

.empty-state {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(29, 42, 51, 0.18);
  color: var(--muted);
  background: rgba(255, 252, 247, 0.72);
}

.desktop-only {
  display: none;
}

.leaflet-control-attribution {
  font-size: 0.68rem;
}

.leaflet-top.leaflet-right .leaflet-control-zoom {
  margin-top: calc(var(--space-3) + 4rem);
  margin-right: calc(var(--space-3) + 0.45rem);
  border: 1px solid rgba(29, 42, 51, 0.08);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(21, 37, 43, 0.14);
}

.leaflet-control-zoom a {
  width: 2.75rem;
  height: 2.75rem;
  line-height: 2.75rem;
  background: rgba(255, 250, 242, 0.94);
  color: var(--surface-ink);
  border-bottom-color: rgba(29, 42, 51, 0.08);
}

.map-pin-icon,
.user-location-marker {
  position: relative;
}

.map-pin-icon {
  width: 28px;
  height: 40px;
}

.map-pin-icon svg,
.user-location-marker svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 12px 18px rgba(17, 29, 34, 0.22));
}

.map-pin-icon.selected {
  transform: scale(1.08);
}

.user-location-marker {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(46, 120, 255, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(17, 29, 34, 0.18);
  display: grid;
  place-items: center;
}

.user-location-core {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(46, 120, 255, 0.22);
}

.user-location-marker::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: var(--blue);
  opacity: 0.14;
  z-index: -1;
}

.user-location-marker {
  animation: pulse 1.9s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

button:hover,
button:focus-visible {
  transform: translateY(-1px);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(46, 120, 255, 0.22);
  outline-offset: 2px;
}

@media (min-width: 900px) {
  .desktop-only {
    display: inline-flex;
  }

  .mobile-note {
    display: none;
  }

  .map-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(24rem, 0.65fr);
    align-items: stretch;
  }

  .context-panel {
    display: none;
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    max-height: none;
    transform: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
  }

  .context-panel.is-visible {
    display: grid;
    transform: none;
  }

  .panel-backdrop {
    display: none;
  }

  .primary-fab,
  .secondary-fab {
    width: auto;
  }

  .pin-composer {
    width: min(21rem, calc(100% - 2 * var(--space-3)));
  }
}

@media (max-width: 899px) {
  .app-shell {
    padding: var(--space-2);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .tabbar {
    width: 100%;
    justify-content: space-between;
  }

  .tab-button {
    flex: 1 1 0;
  }

  .map-stage {
    min-height: calc(100vh - 14rem);
  }

  #map {
    min-height: calc(100vh - 14rem);
  }

  .floating-actions {
    left: var(--space-3);
  }

  .primary-fab,
  .secondary-fab {
    width: 100%;
  }

  .pin-composer {
    left: var(--space-3) !important;
    right: var(--space-3);
    bottom: 8.75rem;
    top: auto !important;
    width: auto;
  }

  .pin-composer::after,
  .pin-composer.is-below::after {
    display: none;
  }
}

@media (max-width: 560px) {
  .map-toolbar {
    top: var(--space-2);
    left: var(--space-2);
    right: var(--space-2);
  }

  .mobile-note {
    left: var(--space-2);
    right: var(--space-2);
    top: 9.8rem;
    border-radius: 20px;
  }

  .leaflet-top.leaflet-right .leaflet-control-zoom {
    margin-top: 5.6rem;
    margin-right: calc(var(--space-2) + 0.4rem);
  }

  .map-legend {
    left: var(--space-2);
    bottom: 8.8rem;
    max-width: min(9rem, calc(100% - 2 * var(--space-2)));
    padding: 0.7rem 0.85rem;
  }

  .map-legend__toggle {
    font-size: 0.8rem;
  }

  .map-legend.is-expanded {
    max-width: min(14rem, calc(100% - 2 * var(--space-2)));
  }

  .map-legend li {
    font-size: 0.82rem;
  }

  .floating-actions {
    left: var(--space-2);
    right: var(--space-2);
    bottom: var(--space-2);
    max-width: none;
  }

  .context-panel {
    padding: var(--space-3);
  }
}

@media (max-width: 420px), (max-height: 760px) {
  .map-legend {
    bottom: 9.2rem;
    max-width: min(8.2rem, calc(100% - 2 * var(--space-2)));
    padding: 0.65rem 0.8rem;
  }

  .leaflet-top.leaflet-right .leaflet-control-zoom {
    margin-top: 5.35rem;
    margin-right: calc(var(--space-2) + 0.35rem);
  }

  .map-legend.is-expanded {
    max-width: min(13rem, calc(100% - 2 * var(--space-2)));
  }
}
