:root {
  color-scheme: dark;
  --color-bg: #101113;
  --mosaic-bg:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(225deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(315deg, rgba(244, 197, 66, 0.045) 25%, transparent 25%),
    linear-gradient(45deg, rgba(69, 190, 177, 0.04) 25%, transparent 25%),
    linear-gradient(135deg, #111215, #0c0d0f);
  --mosaic-size: 48px 48px;
  --color-panel: rgba(14, 15, 18, 0.84);
  --color-panel-border: rgba(255, 255, 255, 0.16);
  --color-text: #f2f3f5;
  --color-muted: #b7bbc4;
  --color-accent: #f4c542;
  --color-accent-strong: #ffd95a;
  --shadow-panel: 0 12px 32px rgba(0, 0, 0, 0.38);
  --transition-map: 220ms ease;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  background: var(--mosaic-bg);
  background-size: var(--mosaic-size);
  color: var(--color-text);
}

button {
  border: 0;
  font: inherit;
}

.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: var(--mosaic-bg);
  background-size: var(--mosaic-size);
}

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

.seo-content img {
  width: 1px;
  height: 1px;
}

#viewer {
  width: 100%;
  height: 100%;
  background: var(--mosaic-bg);
  background-size: var(--mosaic-size);
  transition:
    opacity var(--transition-map),
    filter var(--transition-map),
    transform var(--transition-map);
  will-change: opacity, filter, transform;
}

#viewer.is-switching {
  opacity: 0;
  filter: blur(10px);
}

#viewer.is-switching-down {
  transform: translateY(-34px);
}

#viewer.is-switching-up {
  transform: translateY(34px);
}

#viewer.is-entering-from-bottom {
  transform: translateY(34px);
}

#viewer.is-entering-from-top {
  transform: translateY(-34px);
}

.map-navigation {
  position: fixed;
  z-index: 20;
  bottom: 76px;
  left: 28px;
  pointer-events: none;
}

.map-navigation__center {
  display: flex;
  position: relative;
  gap: 4px;
  align-items: center;
  padding: 5px;
  background: rgba(18, 19, 22, 0.9);
  border: 1px solid var(--color-panel-border);
  border-radius: 999px;
  box-shadow: var(--shadow-panel);
  pointer-events: auto;
  backdrop-filter: blur(12px);
}

.map-navigation__center::before,
.map-navigation__center::after {
  content: none;
}

.map-navigation__button,
.map-navigation__arrow,
.map-navigation__home {
  min-height: 32px;
  color: var(--color-text);
  border-radius: 999px;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.map-navigation__button {
  display: grid;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  place-items: center;
  color: #121212;
  background: var(--color-accent);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
}

.map-navigation__button--reset {
  width: 32px;
  min-width: 32px;
  padding: 0;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.12);
  font-size: 1.05rem;
  font-weight: 800;
}

.map-navigation__button:hover,
.map-navigation__button:focus-visible,
.map-navigation__home:hover,
.map-navigation__home:focus-visible {
  outline: none;
  filter: brightness(1.08);
}

.map-navigation__button:active,
.map-navigation__arrow:active,
.map-navigation__home:active {
  transform: scale(0.96);
}

.map-navigation__arrow {
  position: absolute;
  left: 50%;
  display: grid;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  place-items: center;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: var(--shadow-panel);
  transform: translateX(-50%);
}

.map-navigation__arrow:hover,
.map-navigation__arrow:focus-visible {
  outline: none;
  transform: translateX(-50%) translateY(-2px);
}

.map-navigation__arrow:active {
  transform: translateX(-50%) scale(0.96);
}

.map-navigation__arrow--top {
  bottom: calc(100% + 6px);
  color: #fff;
  background: #d473d4;
}

.map-navigation__arrow--top:hover,
.map-navigation__arrow--top:focus-visible,
.map-navigation__arrow--top.is-active {
  filter: brightness(1.12);
}

.map-navigation__arrow--bottom {
  top: calc(100% + 6px);
  color: #fff;
  background: #123f68;
}

.map-navigation__arrow--bottom:hover,
.map-navigation__arrow--bottom:focus-visible,
.map-navigation__arrow--bottom.is-active {
  filter: brightness(1.14);
}

.map-navigation__tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: min(220px, calc(100vw - 32px));
  padding: 6px 8px;
  color: var(--color-text);
  background: rgba(16, 17, 20, 0.95);
  border: 1px solid var(--color-panel-border);
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translateX(-50%) translateY(4px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.map-navigation__arrow--bottom .map-navigation__tooltip {
  top: calc(100% + 8px);
  bottom: auto;
}

.map-navigation__arrow:hover .map-navigation__tooltip,
.map-navigation__arrow:focus-visible .map-navigation__tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.map-navigation__home {
  position: absolute;
  top: 50%;
  left: calc(100% + 8px);
  min-width: 86px;
  padding: 0 10px;
  color: #171717;
  background: var(--color-accent);
  box-shadow: var(--shadow-panel);
  font-size: 0.76rem;
  font-weight: 800;
  transform: translateY(-50%);
  white-space: nowrap;
}

.map-navigation__home:active {
  transform: translateY(-50%) scale(0.96);
}

.map-navigation__home:hover,
.map-navigation__home:focus-visible,
.map-navigation__home.is-active {
  color: #121212;
  filter: brightness(1.12);
}

.map-copyright {
  position: fixed;
  z-index: 30;
  bottom: 16px;
  left: 50%;
  padding: 6px 10px;
  color: #f7f7f7;
  background: rgba(0, 0, 0, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35;
  pointer-events: none;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.tour-fab {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 35;
  min-height: 42px;
  padding: 0 16px;
  color: #171717;
  background: var(--color-accent);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  box-shadow: var(--shadow-panel);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 900;
  touch-action: manipulation;
}

.tour-fab:hover,
.tour-fab:focus-visible {
  background: var(--color-accent-strong);
  outline: none;
}

.tour-sheet {
  position: fixed;
  z-index: 70;
  inset: 0;
}

.tour-sheet__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
}

.tour-sheet__panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  gap: 12px;
  max-height: min(78vh, 620px);
  padding: 10px 16px 18px;
  overflow: auto;
  color: var(--color-text);
  background: rgba(18, 19, 22, 0.97);
  border-top: 1px solid var(--color-panel-border);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -18px 42px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(16px);
}

.tour-sheet__handle {
  width: 44px;
  height: 4px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
}

.tour-sheet__header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.tour-sheet__section h3 {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.25;
}

.tour-sheet__close {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  color: var(--color-muted);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.2rem;
}

.tour-sheet__close:hover,
.tour-sheet__close:focus-visible {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.13);
  outline: none;
}

.tour-sheet__body {
  display: grid;
  gap: 16px;
}

.tour-sheet__section {
  display: grid;
  gap: 9px;
}

.tour-sheet__reset,
.tour-card {
  cursor: pointer;
  touch-action: manipulation;
}

.tour-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.tour-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  width: 100%;
  min-height: 0;
  padding: 9px;
  color: var(--color-text);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  text-align: left;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.tour-card__cover {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  overflow: hidden;
  place-items: center;
  color: #171717;
  background:
    linear-gradient(135deg, rgba(244, 197, 66, 0.95), rgba(69, 190, 177, 0.9)),
    var(--color-accent);
  border-radius: 7px;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
}

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

.tour-card__content {
  display: grid;
  min-width: 0;
  gap: 4px;
  align-content: start;
}

.tour-card__title {
  font-size: 0.96rem;
  font-weight: 900;
  line-height: 1.25;
}

.tour-card__meta {
  color: var(--color-muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.25;
}

.tour-card__description {
  color: var(--color-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.tour-card__cta {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  margin-top: 4px;
  padding: 0 10px;
  align-items: center;
  color: #171717;
  background: var(--color-accent);
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 950;
  line-height: 1;
}

.tour-sheet__reset {
  min-height: 32px;
  width: fit-content;
  padding: 0 10px;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 900;
}

.tour-card:hover,
.tour-card:focus-visible,
.tour-sheet__reset:hover,
.tour-sheet__reset:focus-visible {
  outline: none;
}

.tour-card:hover,
.tour-card:focus-visible {
  background:
    linear-gradient(135deg, rgba(244, 197, 66, 0.18), rgba(69, 190, 177, 0.12)),
    rgba(255, 255, 255, 0.08);
  border-color: rgba(244, 197, 66, 0.52);
  transform: translateY(-1px);
}

.tour-sheet__reset:hover,
.tour-sheet__reset:focus-visible {
  background: rgba(255, 255, 255, 0.15);
}

.tour-step-popover {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 45;
  width: min(380px, calc(100vw - 32px));
}

.tour-step-card {
  display: grid;
  gap: 10px;
  max-height: min(640px, calc(100vh - 36px));
  padding: 14px;
  overflow: auto;
  color: var(--color-text);
  background: rgba(18, 19, 22, 0.96);
  border: 1px solid var(--color-panel-border);
  border-radius: 8px;
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(14px);
}

.tour-step-card__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 10px;
  align-items: start;
}

.tour-step-card__eyebrow,
.tour-step-card__count,
.tour-step-card__text {
  margin: 0;
}

.tour-step-card__eyebrow,
.tour-step-card__count {
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
}

.tour-step-card h2,
.tour-step-card h3 {
  margin: 0;
  line-height: 1.25;
}

.tour-step-card h2 {
  margin-top: 2px;
  font-size: 1rem;
}

.tour-step-card h3 {
  font-size: 0.86rem;
}

.tour-step-card__text {
  color: var(--color-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.tour-step-card__music {
  display: grid;
  gap: 7px;
  padding-left: 10px;
  border-left: 3px solid var(--color-accent);
}

.tour-step-card__track-title {
  margin: 0;
  color: var(--color-text);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
}

.tour-step-card__track-description {
  margin: -2px 0 0;
  color: var(--color-muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.tour-step-card__close {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  color: var(--color-muted);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.2rem;
}

.tour-step-card__player iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  background: #000;
  border: 0;
  border-radius: 8px;
}

.tour-step-card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  color: #171717;
  background: var(--color-accent);
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 900;
  text-decoration: none;
}

.tour-step-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tour-step-card__button {
  min-height: 36px;
  padding: 0 10px;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 900;
}

.tour-step-card__button--primary {
  color: #171717;
  background: var(--color-accent);
}

.tour-step-card__button:disabled {
  cursor: default;
  opacity: 0.42;
}

.tour-step-card__close:hover,
.tour-step-card__close:focus-visible,
.tour-step-card__link:hover,
.tour-step-card__link:focus-visible,
.tour-step-card__track-title:hover,
.tour-step-card__track-title:focus-visible,
.tour-step-card__button:not(:disabled):hover,
.tour-step-card__button:not(:disabled):focus-visible {
  filter: brightness(1.08);
  outline: none;
}

.openseadragon-container,
.openseadragon-canvas {
  background: var(--mosaic-bg) !important;
  background-size: var(--mosaic-size) !important;
}

.poi-marker {
  display: grid;
  position: relative;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  color: #171717;
  background: var(--marker-background, var(--marker-color, var(--color-accent)));
  border: 3px solid #171717;
  border-radius: 50%;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.82),
    0 10px 22px rgba(0, 0, 0, 0.38);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

.poi-marker__dot {
  position: absolute;
  inset: 6px;
  display: grid;
  place-items: center;
  background: #171717;
  border-radius: 50%;
}

.poi-marker--numbered .poi-marker__dot {
  inset: 3px;
  background: var(--marker-background, var(--marker-color, var(--color-accent)));
}

.poi-marker__number {
  color: #171717;
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1;
}

.poi-marker__numbers {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 2px);
  display: flex;
  gap: 3px;
  justify-content: center;
  transform: translateX(-50%);
  white-space: nowrap;
}

.poi-marker__numbers button {
  display: grid;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  place-items: center;
  color: #171717;
  background: var(--marker-number-color, var(--marker-color, var(--color-accent)));
  border: 2px solid #171717;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.78);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.poi-marker__numbers button:hover,
.poi-marker__numbers button:focus-visible {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.78),
    0 0 0 4px rgba(255, 255, 255, 0.28);
  outline: none;
  transform: translateY(-1px);
}

.poi-marker--multi .poi-marker__dot {
  inset: 7px;
}

.poi-marker--diamond {
  width: 31px;
  height: 31px;
  border-radius: 6px;
  transform: rotate(45deg);
}

.poi-marker--diamond .poi-marker__dot {
  inset: 7px;
  background: #171717;
  border-radius: 3px;
  transform: rotate(-45deg);
}

.poi-marker:hover,
.poi-marker:focus-visible {
  background: var(--marker-background, var(--marker-color, var(--color-accent-strong)));
  outline: none;
  transform: scale(1.08);
}

.poi-marker--diamond:hover,
.poi-marker--diamond:focus-visible {
  transform: rotate(45deg) scale(1.08);
}

.poi-marker--book {
  width: 29px;
  height: 33px;
  border-radius: 4px 7px 7px 4px;
}

.poi-marker--book .poi-marker__dot {
  inset: 5px 7px 5px 6px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0 2px, transparent 2px),
    #171717;
  border-radius: 2px 5px 5px 2px;
}

.poi-cluster {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  color: #171717;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  background: var(--cluster-background, var(--color-accent));
  border: 3px solid #171717;
  border-radius: 50%;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.78),
    0 0 0 11px rgba(244, 197, 66, 0.2),
    0 12px 26px rgba(0, 0, 0, 0.42);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.poi-cluster__core {
  display: block;
  width: 18px;
  height: 18px;
  background: #171717;
  border-radius: 50%;
  box-shadow:
    0 0 0 6px rgba(23, 23, 23, 0.22),
    0 0 0 13px rgba(255, 255, 255, 0.2);
}

.poi-cluster:hover,
.poi-cluster:focus-visible {
  background: var(--cluster-background, var(--color-accent-strong));
  outline: none;
  transform: scale(1.08);
}

.poi-popover {
  position: absolute;
  z-index: 40;
  width: min(340px, calc(100vw - 32px));
}

.poi-popover::after {
  position: absolute;
  bottom: -7px;
  left: var(--popover-arrow-left, 50%);
  width: 14px;
  height: 14px;
  background: rgba(18, 19, 22, 0.96);
  border-right: 1px solid var(--color-panel-border);
  border-bottom: 1px solid var(--color-panel-border);
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.poi-popover--below::after {
  top: -7px;
  bottom: auto;
  border: 0;
  border-top: 1px solid var(--color-panel-border);
  border-left: 1px solid var(--color-panel-border);
}

.poi-card {
  position: relative;
  max-height: var(--popover-max-height, calc(100vh - 32px));
  padding: 16px;
  overflow: auto;
  color: var(--color-text);
  background: rgba(18, 19, 22, 0.96);
  border: 1px solid var(--color-panel-border);
  border-radius: 8px;
  box-shadow: var(--shadow-panel);
}

.poi-card__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--color-muted);
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
}

.poi-card__close:hover,
.poi-card__close:focus-visible {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.poi-card__title {
  margin: 0 34px 8px 0;
  font-size: 1rem;
  line-height: 1.25;
}

.poi-card__description {
  margin: 0 0 12px;
  color: var(--color-muted);
  line-height: 1.45;
}

.poi-card__music {
  display: grid;
  gap: 14px;
}

.poi-card__series {
  display: grid;
  gap: 10px;
}

.poi-card__feature {
  display: grid;
  gap: 10px;
}

.poi-card__feature-image {
  display: block;
  width: min(180px, 100%);
  height: auto;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
}

.poi-card__music-item {
  display: grid;
  gap: 7px;
  padding-left: 10px;
  border-left: 3px solid var(--track-color, var(--color-accent));
}

.poi-card__track-heading {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
}

.poi-card__narration {
  display: grid;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  place-items: center;
  color: #171717;
  background: var(--track-color, var(--color-accent));
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1;
}

.poi-card__track-title {
  margin: 0;
  color: var(--color-text);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
}

.poi-card__track-description {
  margin: -2px 0 0;
  color: var(--color-muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.poi-card__track-title:hover,
.poi-card__track-title:focus-visible {
  color: var(--track-color, var(--color-accent-strong));
  outline: none;
}

.poi-card__player iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  margin-top: 2px;
  background: #000;
  border: 0;
  border-radius: 8px;
}

.poi-card__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  color: #121212;
  background: var(--color-accent);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.poi-card__button:hover,
.poi-card__button:focus-visible {
  background: var(--color-accent-strong);
  outline: none;
}

.builder-panel {
  position: absolute;
  z-index: 40;
  width: min(360px, calc(100vw - 24px));
}

.builder-form {
  display: grid;
  position: relative;
  gap: 10px;
  max-height: min(680px, calc(100vh - 32px));
  padding: 14px;
  overflow: auto;
  color: var(--color-text);
  background: rgba(18, 19, 22, 0.97);
  border: 1px solid var(--color-panel-border);
  border-radius: 8px;
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(14px);
}

.builder-form__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  color: var(--color-muted);
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
}

.builder-form__close:hover,
.builder-form__close:focus-visible {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.builder-form__title {
  margin: 0 34px 0 0;
  font-size: 1rem;
  line-height: 1.25;
}

.builder-form__coords {
  margin: -4px 0 2px;
  color: var(--color-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.builder-form__field {
  display: grid;
  gap: 5px;
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

.builder-form__field input,
.builder-form__field select,
.builder-form__field textarea,
.builder-form__output {
  width: 100%;
  min-width: 0;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  font: inherit;
}

.builder-form__field input,
.builder-form__field select,
.builder-form__field textarea {
  padding: 8px 9px;
}

.builder-form__field select[multiple] {
  min-height: 168px;
}

.builder-form__field textarea,
.builder-form__output {
  resize: vertical;
}

.builder-form__field input:focus,
.builder-form__field select:focus,
.builder-form__field textarea:focus,
.builder-form__output:focus {
  border-color: rgba(244, 197, 66, 0.8);
  outline: none;
}

.builder-form__field--color {
  grid-template-columns: 1fr 46px;
  align-items: center;
}

.builder-form__field--color input {
  height: 34px;
  padding: 2px;
  cursor: pointer;
}

.builder-form__track-details {
  display: grid;
  gap: 8px;
}

.builder-form__track-details[hidden] {
  display: none;
}

.builder-form__track-detail {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
}

.builder-form__track-detail legend {
  max-width: 100%;
  padding: 0 4px;
  color: var(--color-text);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
}

.builder-form__actions {
  display: grid;
  gap: 8px;
}

.builder-form__button {
  min-height: 34px;
  padding: 0 10px;
  color: #121212;
  background: var(--color-accent);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 800;
}

.builder-form__button--secondary {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.12);
}

.builder-form__button:hover,
.builder-form__button:focus-visible {
  filter: brightness(1.08);
  outline: none;
}

.builder-form__output {
  padding: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.42;
}

@media (max-width: 640px) {
  .map-navigation {
    bottom: 72px;
    left: 14px;
  }

  .map-navigation__button,
  .map-navigation__arrow,
  .map-navigation__home {
    min-height: 30px;
  }

  .map-navigation__arrow {
    width: 34px;
    height: 34px;
    min-height: 34px;
    font-size: 1.2rem;
  }

  .map-navigation__button {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
  }

  .map-navigation__home {
    left: calc(100% + 6px);
    min-width: 72px;
    padding: 0 8px;
    font-size: 0.68rem;
    transform: translateY(-50%);
  }

  .map-navigation__home:active {
    transform: translateY(-50%) scale(0.96);
  }

  .poi-card__platforms {
    grid-template-columns: 1fr;
  }

  .tour-fab {
    top: 12px;
    right: 12px;
    bottom: auto;
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.76rem;
  }

  .tour-card {
    display: flex;
    min-height: 84px;
    gap: 10px;
  }

  .tour-card__cover {
    flex: 0 0 66px;
    width: 66px;
    height: 66px;
    aspect-ratio: auto;
  }

  .tour-card__title {
    font-size: 0.9rem;
  }

  .tour-card__cta {
    min-height: 26px;
    font-size: 0.7rem;
  }

  .tour-step-popover {
    right: 9px;
    bottom: 9px;
    width: calc(100vw - 18px);
  }

  .tour-step-card {
    max-height: min(560px, calc(100vh - 18px));
    padding: 12px;
  }

  .tour-sheet__panel {
    max-height: 82vh;
    padding: 10px 12px 14px;
  }

  .builder-panel {
    position: fixed;
    top: auto !important;
    bottom: 12px;
    left: 50% !important;
    transform: translateX(-50%);
  }

  .builder-form {
    max-height: min(620px, calc(100vh - 24px));
  }

}
