:root {
  color-scheme: light;
  --page-bg: #d8e6ef;
  --page-bg-strong: #eff5f8;
  --text-color: #133247;
  --muted-color: #5b6e7d;
  --line-color: rgba(255, 255, 255, 0.7);
  --panel-fill: rgba(255, 255, 255, 0.58);
  --panel-fill-strong: rgba(255, 255, 255, 0.76);
  --panel-shadow: 0 24px 80px rgba(19, 50, 71, 0.18);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --chip-fill: rgba(255, 255, 255, 0.72);
  --sheet-width: min(720px, calc(100vw - 32px));
  --area-accent: #52beff;
  --poi-accent: #f7b453;
  --service-accent: #74d7a6;
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  color: var(--text-color);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 34%),
    linear-gradient(180deg, #e8f0f5 0%, #d8e6ef 42%, #eaf2f6 100%);
}

fest-map-app,
.app-shell {
  display: block;
  width: 100%;
  height: 100vh;
}

.app-shell {
  position: relative;
  isolation: isolate;
}

.map-canvas,
.map-overlay {
  position: absolute;
  inset: 0;
}

.map-overlay {
  z-index: 320;
  pointer-events: none;
  background:
    radial-gradient(circle at top center, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0) 24%),
    linear-gradient(180deg, rgba(216, 230, 239, 0.18) 0%, rgba(216, 230, 239, 0) 22%, rgba(216, 230, 239, 0.22) 100%);
}

.glass-panel {
  background: var(--panel-fill);
  border: 1px solid var(--line-color);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
}

.app-header {
  position: absolute;
  z-index: 900;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 32px));
  padding: 18px 22px;
  border-radius: var(--radius-xl);
}

.app-header__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.app-header__eyebrow {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-color);
}

.app-header h1 {
  margin: 0;
  font-size: clamp(1.7rem, 1.1rem + 1.7vw, 2.8rem);
  line-height: 1.04;
}

.app-header__description {
  margin: 10px 0 0;
  max-width: 54ch;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted-color);
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 24px rgba(19, 50, 71, 0.08);
}

.language-switch__button {
  border: 0;
  min-width: 52px;
  border-radius: 999px;
  padding: 9px 12px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--muted-color);
  background: transparent;
}

.language-switch__button.is-active {
  color: var(--text-color);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(19, 50, 71, 0.1);
}

entity-sheet {
  position: absolute;
  z-index: 950;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  width: var(--sheet-width);
  transform: translateX(-50%);
  display: block;
}

.bottom-sheet {
  padding: 12px;
  border-radius: 32px;
  overflow: hidden;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 220ms ease;
}

entity-sheet[data-state="expanded"] .bottom-sheet {
  background: var(--panel-fill-strong);
}

.sheet-grabber {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 6px 8px 14px;
  cursor: pointer;
  user-select: none;
}

.sheet-grabber__bar {
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: rgba(19, 50, 71, 0.14);
}

.sheet-grabber__copy {
  min-width: 0;
}

.sheet-grabber__copy strong,
.sheet-grabber__copy span {
  display: block;
}

.sheet-grabber__copy strong {
  font-size: 0.94rem;
}

.sheet-grabber__copy span {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--muted-color);
}

.sheet-grabber__button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  color: var(--text-color);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 24px rgba(19, 50, 71, 0.08);
}

.sheet-preview {
  padding: 0 4px 4px;
}

.entity-card {
  display: grid;
  grid-template-columns: minmax(74px, 88px) 1fr;
  gap: 16px;
  align-items: start;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.84);
}

.entity-card__logo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

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

.entity-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.7);
}

.pill[data-type="area"] {
  color: #1c7fc8;
}

.pill[data-type="poi"] {
  color: #b97412;
}

.pill[data-type="service"] {
  color: #228f59;
}

.entity-card__location {
  font-size: 0.82rem;
  color: var(--muted-color);
}

.entity-card h2 {
  margin: 0 0 8px;
  font-size: 1.18rem;
  line-height: 1.16;
}

.entity-card p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted-color);
}

.entity-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.entity-card__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 106px;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text-color);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 24px rgba(19, 50, 71, 0.08);
}

.sheet-directory {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height 220ms ease,
    opacity 140ms ease;
}

entity-sheet[data-state="expanded"] .sheet-directory {
  max-height: min(58vh, 520px);
  opacity: 1;
}

.sheet-directory__inner {
  padding: 10px 4px 4px;
}

.sheet-filters {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
}

.sheet-filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-color);
  background: var(--chip-fill);
}

.filter-chip.is-active {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(19, 50, 71, 0.08);
}

.entity-list {
  display: grid;
  gap: 10px;
  max-height: min(42vh, 360px);
  overflow: auto;
  padding-right: 4px;
}

.entity-list__item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 0;
  border-radius: 22px;
  padding: 10px;
  text-align: left;
  font: inherit;
  color: var(--text-color);
  background: rgba(255, 255, 255, 0.5);
}

.entity-list__item.is-active {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 34px rgba(19, 50, 71, 0.1);
}

.entity-list__logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
}

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

.entity-list__content strong,
.entity-list__content span,
.entity-list__content small {
  display: block;
}

.entity-list__content strong {
  font-size: 0.94rem;
}

.entity-list__content span {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--muted-color);
}

.entity-list__content small {
  margin-top: 3px;
  font-size: 0.76rem;
  color: rgba(19, 50, 71, 0.6);
}

.entity-list__arrow {
  font-size: 1.2rem;
  color: rgba(19, 50, 71, 0.4);
}

.entity-list__empty {
  padding: 20px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.55);
  text-align: center;
  color: var(--muted-color);
}

.leaflet-container {
  background: var(--page-bg-strong);
  font: inherit;
}

.leaflet-control-zoom {
  margin-top: 126px;
  margin-right: 18px;
  border: 1px solid rgba(255, 255, 255, 0.82) !important;
  border-radius: 18px !important;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(19, 50, 71, 0.12);
}

.leaflet-control-zoom a {
  width: 42px !important;
  height: 42px !important;
  line-height: 42px !important;
  background: rgba(255, 255, 255, 0.82) !important;
  color: var(--text-color) !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-color);
  box-shadow: 0 18px 40px rgba(19, 50, 71, 0.14);
}

.leaflet-popup-content {
  margin: 14px 16px;
  font-family: inherit;
}

.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.74) !important;
  border-radius: 14px 0 0 0;
  padding: 4px 8px !important;
}

@media (max-width: 768px) {
  .app-header {
    top: max(12px, env(safe-area-inset-top));
    width: calc(100vw - 18px);
    padding: 14px 14px 12px;
    border-radius: 24px;
  }

  .app-header__top {
    align-items: center;
    gap: 12px;
  }

  .app-header__eyebrow {
    margin-bottom: 4px;
    font-size: 0.72rem;
    letter-spacing: 0.11em;
  }

  .app-header h1 {
    font-size: clamp(1.4rem, 1rem + 2vw, 2rem);
  }

  .app-header__description {
    margin-top: 8px;
    font-size: 0.84rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .language-switch {
    padding: 3px;
  }

  .language-switch__button {
    min-width: 46px;
    padding: 8px 10px;
    font-size: 0.75rem;
  }

  entity-sheet {
    width: calc(100vw - 14px);
    bottom: max(8px, env(safe-area-inset-bottom));
  }

  .sheet-grabber {
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 4px 4px 10px;
  }

  .sheet-grabber__bar {
    grid-column: 1 / -1;
    justify-self: center;
    width: 34px;
  }

  .sheet-grabber__copy strong {
    font-size: 0.88rem;
  }

  .sheet-grabber__copy span {
    font-size: 0.76rem;
  }

  .sheet-grabber__button {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .bottom-sheet {
    padding: 8px;
    border-radius: 24px;
  }

  .entity-card {
    grid-template-columns: 64px 1fr;
    gap: 12px;
    padding: 12px;
    border-radius: 20px;
  }

  .leaflet-control-zoom {
    margin-top: 112px;
    margin-right: 12px;
  }

  .entity-card__logo {
    border-radius: 18px;
  }

  .entity-card__meta {
    gap: 6px;
    margin-bottom: 6px;
  }

  .entity-card h2 {
    margin-bottom: 6px;
    font-size: 1rem;
  }

  .entity-card p {
    font-size: 0.84rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .entity-card__actions {
    gap: 8px;
    margin-top: 10px;
  }

  .entity-card__action {
    min-width: 90px;
    padding: 9px 12px;
    font-size: 0.8rem;
  }

  entity-sheet[data-state="expanded"] .sheet-directory {
    max-height: min(48vh, 420px);
  }

  .sheet-directory__inner {
    padding-top: 8px;
  }

  .sheet-filters {
    gap: 8px;
    padding-bottom: 8px;
  }

  .filter-chip {
    padding: 8px 12px;
    font-size: 0.78rem;
  }

  .entity-list {
    gap: 8px;
    max-height: min(31vh, 240px);
  }

  .entity-list__item {
    grid-template-columns: 44px 1fr auto;
    gap: 10px;
    padding: 8px;
    border-radius: 18px;
  }

  .entity-list__logo {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .entity-list__content strong {
    font-size: 0.88rem;
  }

  .entity-list__content span,
  .entity-list__content small {
    font-size: 0.74rem;
  }
}

@media (max-width: 560px) {
  .app-header h1 {
    max-width: 10ch;
  }

  .language-switch {
    margin-left: auto;
  }

  .language-switch__button {
    min-width: 42px;
    padding-inline: 9px;
  }

  .entity-card {
    grid-template-columns: 56px 1fr;
  }

  .entity-card__logo {
    width: 56px;
  }

  .entity-list__item {
    grid-template-columns: 40px 1fr auto;
    gap: 8px;
    padding: 7px;
  }

  .entity-list__logo {
    width: 40px;
    height: 40px;
  }

  .entity-list__content span,
  .entity-list__content small {
    display: none;
  }
}

@media (max-width: 420px) {
  .app-header {
    width: calc(100vw - 12px);
    padding: 12px 12px 10px;
  }

  .app-header__top {
    align-items: flex-start;
  }

  .app-header__description {
    -webkit-line-clamp: 1;
    font-size: 0.8rem;
  }

  .bottom-sheet {
    padding: 7px;
  }

  .sheet-grabber__copy span {
    display: none;
  }

  .entity-card {
    grid-template-columns: 48px 1fr;
    gap: 10px;
    padding: 10px;
  }

  .entity-card__logo {
    width: 48px;
    border-radius: 14px;
  }

  .entity-card h2 {
    font-size: 0.94rem;
  }

  .entity-card__actions {
    margin-top: 8px;
  }

  .entity-card__action {
    min-width: 78px;
    padding: 8px 10px;
    font-size: 0.76rem;
  }
}
