:root {
  --bg: #eef7fd;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --surface-alt: #e6f3fb;
  --text: #16324a;
  --muted: #5b7890;
  --primary: #2f89d9;
  --primary-dark: #155a96;
  --primary-soft: #d9eefc;
  --accent: #f15a3c;
  --accent-soft: #fff3ee;
  --border: rgba(47, 137, 217, 0.14);
  --shadow: 0 24px 60px rgba(22, 50, 74, 0.12);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(47, 137, 217, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(113, 193, 255, 0.2), transparent 24%),
    linear-gradient(180deg, #f9fdff 0%, var(--bg) 42%, #edf6fb 100%);
}

body.map-is-fullscreen {
  overflow: hidden;
}

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

.shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 56px;
  overflow-x: clip;
}

.topbar {
  display: grid;
  gap: 18px;
  padding: 26px 28px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.topbar__languages {
  display: flex;
  justify-content: flex-end;
}

.topbar__main {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 22px;
}

.top-branding {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 22px;
  border-radius: 28px;
  border: 1px solid rgba(47, 137, 217, 0.1);
  background:
    radial-gradient(circle at 50% 0%, rgba(47, 137, 217, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 248, 253, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.brand__logo {
  display: block;
  width: min(320px, 100%);
  max-width: 100%;
  max-height: 230px;
  object-fit: contain;
  height: auto;
  margin: 0 auto;
}

.top-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  padding: 34px 34px 32px;
  border-radius: 28px;
  border: 1px solid rgba(116, 201, 255, 0.16);
  background:
    radial-gradient(circle at top left, rgba(139, 214, 255, 0.22), transparent 28%),
    linear-gradient(135deg, #1770b8 0%, #2c8fdd 46%, #1e6cae 100%);
  color: #fff;
  box-shadow: var(--shadow);
}

.top-intro__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.82rem;
  opacity: 0.9;
}

.top-intro__title {
  margin: 10px 0 14px;
  font-family: "Sora", sans-serif;
  font-size: clamp(2.2rem, 4vw, 4.3rem);
  line-height: 0.96;
}

.top-intro__lead {
  max-width: 52ch;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.7;
}

.top-intro__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.language-switcher {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
}

.language-pill {
  width: 52px;
  height: 34px;
  border: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(22, 50, 74, 0.12);
  overflow: hidden;
  cursor: pointer;
  flex: 0 0 auto;
  line-height: 0;
}

.flag-image-pill {
  padding: 0;
  background: #ffffff;
}

.flag-image-pill img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
}

.flag-de {
  background: linear-gradient(180deg, #111 0 33.33%, #d00 33.33% 66.66%, #ffce00 66.66% 100%);
}

.flag-ua {
  background: linear-gradient(180deg, #1e73d8 0 50%, #ffd54a 50% 100%);
}

.flag-lt {
  background: linear-gradient(180deg, #f9cf28 0 33.33%, #2f8f46 33.33% 66.66%, #c43b2f 66.66% 100%);
}

.flag-pl {
  background: linear-gradient(180deg, #ffffff 0 50%, #dc143c 50% 100%);
}

.topbar__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: stretch;
  min-width: 0;
  align-items: stretch;
}

.history-strip {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 22px 24px;
  border-radius: 24px;
  border: 1px solid rgba(47, 137, 217, 0.12);
  background:
    radial-gradient(circle at top left, rgba(104, 186, 242, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(229, 244, 252, 0.98));
  box-shadow: 0 18px 36px rgba(17, 93, 156, 0.1);
}

.history-strip__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.history-strip__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.history-strip__title {
  margin: 6px 0 10px;
  font-family: "Sora", sans-serif;
  font-size: 1.75rem;
  line-height: 1.08;
  color: var(--text);
}

.history-strip__lead,
.history-strip__content p {
  margin: 0;
  line-height: 1.68;
  color: var(--muted);
}

.history-strip__content {
  display: grid;
  gap: 12px;
}

.history-strip__content.is-collapsed p:nth-child(n+4) {
  display: none;
}

.history-strip__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.section__heading h2,
.panel__header h3,
.place-card__title {
  font-family: "Sora", sans-serif;
}

.hero__content h1,
.section__heading h2,
.panel__header h3,
.place-card__title {
  font-family: "Sora", sans-serif;
}

.hero__content h1 {
  margin: 10px 0 14px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.eyebrow,
.section__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  opacity: 0.88;
}

.hero__lead {
  max-width: 56ch;
  margin: 0;
  font-size: 1.03rem;
  line-height: 1.7;
}

.hero__actions,
.route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button,
.chip,
.mini-button,
.category-card,
.language-pill {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  border: 0;
  cursor: pointer;
}

.button__icon,
.button__label {
  display: inline-flex;
  align-items: center;
}

.button:hover,
.chip:hover,
.mini-button:hover,
.category-card:hover,
.language-pill:hover {
  transform: translateY(-2px);
}

.button--primary {
  color: #fff;
  background: #12375b;
  box-shadow: 0 12px 24px rgba(18, 55, 91, 0.22);
}

.button--secondary,
.chip,
.mini-button--details {
  color: var(--text);
  background: var(--surface-alt);
}

.button--ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.button--audio-spotlight {
  position: relative;
  gap: 10px;
  color: #fff;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.26), transparent 34%),
    linear-gradient(135deg, #ff8a00 0%, #ff5c5c 45%, #8a3ffc 100%);
  box-shadow:
    0 16px 30px rgba(255, 92, 92, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.button--audio-spotlight .button__icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 999px;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  font-size: 0.9rem;
}

.button--audio-spotlight:hover {
  box-shadow:
    0 20px 38px rgba(255, 92, 92, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.24) inset;
}

.button--audio-spotlight.is-playing {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(135deg, #12a4ff 0%, #00c2a8 48%, #1768d2 100%);
  box-shadow:
    0 18px 34px rgba(18, 164, 255, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}


.button--disabled {
  opacity: 0.5;
  pointer-events: none;
}

.section {
  margin-top: 26px;
  padding: 28px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.section__heading,
.panel__header,
.place-card__topline,
.toolbar,
.selected-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.section__heading {
  margin-bottom: 22px;
}

.section__heading h2,
.panel__header h3 {
  margin: 6px 0 0;
}

.section__heading h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.section__heading p,
.panel__header p,
.place-card__description,
.place-card__meta,
#route-summary,
.selected-item span {
  color: var(--muted);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.category-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-content: start;
  min-height: 168px;
  padding: 20px 18px 18px;
  text-align: left;
  color: #ffffff;
  border: 0;
  border-radius: 26px;
  border: 1px solid transparent;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.22), transparent 28%),
    linear-gradient(145deg, var(--category-color, #2f89d9) 0%, #12375b 100%);
  box-shadow: 0 18px 36px rgba(17, 93, 156, 0.16);
  overflow: hidden;
}

.category-marker {
  background: transparent;
  border: 0;
}

.category-card::after {
  content: "";
  position: absolute;
  inset: auto -10% -24% auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.category-card.is-active {
  outline: 4px solid rgba(255, 255, 255, 0.28);
}

.category-card__badge {
  position: absolute;
  top: 18px;
  left: 18px;
  display: inline-flex;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  z-index: 1;
}

.category-card__title {
  display: block;
  margin-top: 54px;
  font-size: 1.35rem;
  line-height: 1.08;
  align-self: start;
  position: relative;
  z-index: 1;
}

.category-card__count {
  display: block;
  margin-top: 12px;
  align-self: end;
  color: rgba(255, 255, 255, 0.9);
  opacity: 1;
  position: relative;
  z-index: 1;
}

.toolbar {
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search {
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  min-height: 56px;
  border-radius: 999px;
  background: #f1f9ff;
}

.search__icon {
  font-weight: 700;
  color: var(--muted);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 999px;
  background: #f2f8fd;
}

.content-grid,
.planner-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.panel {
  padding: 20px;
  border-radius: 24px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.panel--map {
  padding: 12px;
  position: relative;
}

.panel--list {
  padding: 24px;
}

.map {
  min-height: 500px;
  border-radius: 22px;
  overflow: hidden;
  margin: 0 auto;
  width: 100%;
}

.map-mobile-actions {
  display: none;
  margin-bottom: 10px;
}

.map-expand-button {
  width: 100%;
}

.map-close-button {
  display: none;
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1200;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  color: #fff;
  background: rgba(18, 55, 91, 0.92);
  box-shadow: 0 12px 28px rgba(18, 55, 91, 0.24);
  cursor: pointer;
}

.places-list,
.selected-list,
.route-steps {
  display: grid;
  gap: 16px;
}

.places-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.place-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  background: #f8fcff;
  min-height: 100%;
}

.place-card__media {
  min-height: 220px;
  border-radius: 18px;
  background-size: cover;
  background-position: center;
}

.place-card__category {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.check-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  font-size: 0.92rem;
}

.place-card__title {
  margin: 8px 0 8px;
  font-size: 1.25rem;
}

.place-card__description {
  margin: 0 0 10px;
  line-height: 1.65;
}

.place-card__meta {
  font-size: 0.92rem;
}

.place-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
  margin-top: 14px;
}

.mini-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
}

.mini-button--audio {
  margin-left: auto;
  gap: 10px;
  color: #fff;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.26), transparent 34%),
    linear-gradient(135deg, #ff8a00 0%, #ff5c5c 45%, #8a3ffc 100%);
  box-shadow:
    0 14px 28px rgba(255, 92, 92, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

.mini-button--audio .button__icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  font-size: 0.8rem;
}

.mini-button--audio .button__label {
  white-space: nowrap;
}

.mini-button--audio:hover {
  box-shadow:
    0 18px 34px rgba(255, 92, 92, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.22) inset;
}

.place-card__audio {
  margin-top: 12px;
}

.place-card__audio audio {
  width: 100%;
}

.selected-item,
.route-steps li {
  padding: 14px 16px;
  border-radius: 16px;
  background: #f6fbff;
}

.selected-item strong {
  display: block;
}

.route-steps {
  padding-left: 20px;
}

.leaflet-popup-content {
  font-family: "Manrope", sans-serif;
}

.popup-title {
  margin: 0 0 6px;
  font-family: "Sora", sans-serif;
  font-size: 1.05rem;
}

.empty-state {
  padding: 24px;
  border-radius: 18px;
  background: #f3f9fd;
  color: var(--muted);
}

@media (max-width: 980px) {
  .topbar__main,
  .content-grid,
  .planner-grid {
    grid-template-columns: 1fr;
  }

  .top-branding {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .places-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map {
    min-height: 380px;
  }
}

@media (max-width: 720px) {
  .shell {
    width: calc(100% - 20px);
    padding-top: 10px;
  }

  .topbar,
  .section {
    padding: 18px;
    border-radius: 24px;
  }

  .top-intro {
    width: 100%;
    padding: 24px 20px;
    border-radius: 22px;
  }

  .brand {
    padding: 18px;
  }

  .brand__logo {
    width: min(280px, 100%);
    max-height: 190px;
  }

  .top-intro__title {
    font-size: clamp(2rem, 10vw, 3.3rem);
  }

  .top-intro__lead {
    font-size: 0.96rem;
  }

  .top-intro__actions .button {
    width: 100%;
  }

  .topbar__languages {
    justify-content: center;
    width: 100%;
  }

  .language-switcher {
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 3px !important;
    flex-wrap: nowrap !important;
    width: auto;
    max-width: 100%;
    overflow: hidden;
  }

  .language-pill {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    border-radius: 6px !important;
    flex: 0 0 38px !important;
  }

  .flag-image-pill img {
    border-radius: 6px;
  }

  .brand {
    padding: 16px;
    border-radius: 22px;
  }

  .brand__logo {
    width: min(210px, 100%);
    max-height: 128px;
  }

  .history-strip {
    padding: 18px 16px;
    border-radius: 18px;
  }

  .history-strip__title {
    font-size: 1.32rem;
  }

  .history-strip__header {
    flex-direction: column;
    align-items: stretch;
  }

  .history-strip__audio {
    width: 100%;
  }

  .history-strip__actions {
    flex-direction: column;
  }

  .history-strip__actions .button {
    width: 100%;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .category-card {
    min-height: 148px;
    padding: 16px;
  }

  .category-card__title {
    margin-top: 48px;
    font-size: 1rem;
  }

  .category-card__count,
  .category-card__badge {
    font-size: 0.72rem;
  }

  .place-card {
    grid-template-columns: 1fr;
  }

  .place-card__media {
    min-height: 220px;
  }

  .places-list {
    grid-template-columns: 1fr;
  }

  .place-card__actions {
    gap: 10px;
  }

  .mini-button--audio .button__label {
    font-size: 0.92rem;
  }

  .panel--map {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .map {
    min-height: 260px;
    width: min(100%, 100%);
    max-width: 100%;
  }

  .map-mobile-actions {
    display: block;
  }

  .panel--map.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1300;
    margin: 0;
    padding: 14px;
    border-radius: 0;
    background: rgba(239, 247, 253, 0.98);
    display: flex;
    justify-content: flex-start;
  }

  .panel--map.is-fullscreen .map-mobile-actions {
    display: none;
  }

  .panel--map.is-fullscreen .map-close-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .panel--map.is-fullscreen .map {
    min-height: calc(100vh - 28px);
    height: calc(100vh - 28px);
    width: 100%;
    border-radius: 18px;
  }

  .section__heading,
  .panel__header,
  .toolbar,
  .selected-item {
    align-items: flex-start;
    flex-direction: column;
  }
}
