:root {
  --ink: #101820;
  --muted: #5c6874;
  --surface: #ffffff;
  --surface-soft: #eef3f6;
  --line: rgba(16, 24, 32, 0.16);
  --blue: #0067b1;
  --teal: #008c7a;
  --amber: #f5a400;
  --red: #cf3f36;
  --green: #4b8f29;
  --shadow: 0 24px 70px rgba(16, 24, 32, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body,
.kiosk-shell,
.map-stage {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #d9e5eb;
}

button {
  font: inherit;
}

.map-stage {
  position: relative;
  isolation: isolate;
}

.map-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.topbar {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  pointer-events: none;
}

.topbar h1,
.topbar p {
  margin: 0;
}

.topbar h1 {
  max-width: 720px;
  color: #ffffff;
  font-size: clamp(1.8rem, 3.1vw, 3.6rem);
  line-height: 1;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.48);
}

.eyebrow {
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(0.9rem, 1.4vw, 1.25rem);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.45);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  pointer-events: auto;
}

.control-button,
.project-list-close,
.project-list-tab,
.panel-close {
  border: 1px solid rgba(255, 255, 255, 0.48);
  color: #ffffff;
  background: rgba(16, 24, 32, 0.72);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.control-button {
  min-height: 54px;
  border-radius: 8px;
  padding: 0 18px;
  font-size: 1rem;
  font-weight: 800;
}

.control-button:hover,
.project-list-close:hover,
.project-list-tab:hover,
.panel-close:hover {
  background: rgba(16, 24, 32, 0.9);
  transform: translateY(-1px);
}

.project-list-panel {
  position: absolute;
  top: 150px;
  left: 24px;
  bottom: 24px;
  z-index: 500;
  display: flex;
  width: min(380px, calc(100vw - 48px));
  flex-direction: column;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transition:
    transform 260ms ease,
    opacity 180ms ease;
}

.is-list-collapsed .project-list-panel {
  transform: translateX(calc(-100% - 30px));
  opacity: 0;
  pointer-events: none;
}

.project-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.project-list-panel h2 {
  margin: 0;
  font-size: 1.05rem;
}

.project-list-close {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 8px;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.project-list-tab {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 490;
  min-width: 112px;
  min-height: 48px;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translate(-76px, -50%) rotate(-90deg);
  transform-origin: left center;
  transition:
    opacity 180ms ease,
    transform 220ms ease,
    background 180ms ease;
}

.is-list-collapsed .project-list-tab {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%) rotate(-90deg);
}

.project-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.project-list-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(16, 24, 32, 0.12);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.project-list-item:hover,
.project-list-item.is-active {
  border-color: rgba(0, 103, 177, 0.5);
  background: #ffffff;
  transform: translateY(-1px);
}

.project-list-item strong,
.project-list-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-list-item strong {
  margin-bottom: 4px;
  font-size: 0.98rem;
  line-height: 1.2;
  white-space: nowrap;
}

.project-list-item small {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.25;
}

.project-list-dot {
  width: 18px;
  height: 18px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(16, 24, 32, 0.3);
}

.legend {
  position: absolute;
  left: 24px;
  bottom: 24px;
  z-index: 500;
  width: min(360px, calc(100vw - 48px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  visibility: hidden;
}

.legend h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
}

.legend-items {
  display: grid;
  gap: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  color: var(--muted);
  font-weight: 750;
}

.legend-dot {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(16, 24, 32, 0.3);
}

.project-panel {
  position: absolute;
  top: 120px;
  right: 24px;
  bottom: 24px;
  z-index: 550;
  display: flex;
  width: min(560px, calc(100vw - 48px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateX(calc(100% + 48px));
  opacity: 0;
  pointer-events: none;
  transition:
    transform 300ms ease,
    opacity 220ms ease;
}

.project-panel.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.panel-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  font-size: 2rem;
  line-height: 1;
}

.panel-media {
  width: 100%;
  aspect-ratio: 1 / 0.82;
  min-height: 300px;
  max-height: 46%;
  flex: 0 0 auto;
  background:
    linear-gradient(rgba(16, 24, 32, 0.05), rgba(16, 24, 32, 0.05)),
    var(--surface-soft);
}

.panel-media img,
.panel-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.panel-content {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  overflow: auto;
  padding: 26px 32px 32px;
}

.project-type,
.project-location,
.project-details,
.project-details dd,
.project-details dt {
  margin: 0;
}

.project-type {
  align-self: flex-start;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--blue);
  font-size: 0.92rem;
  font-weight: 900;
  text-transform: uppercase;
}

.panel-content h2 {
  margin: 0;
  font-size: clamp(1.7rem, 2.35vw, 2.7rem);
  line-height: 1.02;
}

.project-location {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.45;
}

.project-details {
  display: grid;
  gap: 18px;
}

.project-details div {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.project-details dt {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
}

.project-details dd {
  color: #26323d;
  font-size: 0.98rem;
  line-height: 1.5;
}

.work-marker {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 4px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(16, 24, 32, 0.3);
}

.work-marker::after {
  content: "";
  position: absolute;
  inset: -10px;
  border: 2px solid currentColor;
  border-radius: inherit;
  opacity: 0.28;
}

.leaflet-container {
  background: #c9dce4;
  font-family: inherit;
}

.leaflet-control-zoom {
  margin-top: 150px !important;
  margin-left: 424px !important;
  border: 0 !important;
  box-shadow: var(--shadow);
}

.leaflet-control-zoom a {
  width: 48px !important;
  height: 48px !important;
  color: var(--ink) !important;
  font-size: 1.6rem !important;
  line-height: 48px !important;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-list-panel {
    top: 150px;
    right: 12px;
    bottom: auto;
    left: 12px;
    width: auto;
    max-height: 32vh;
    padding: 12px;
  }

  .is-list-collapsed .project-list-panel {
    transform: translateX(calc(-100% - 18px));
  }

  .project-list-tab {
    top: 260px;
  }

  .project-panel {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: 72vh;
    flex-direction: column;
    transform: translateY(calc(100% + 24px));
  }

  .project-panel.is-open {
    transform: translateY(0);
  }

  .panel-media {
    width: 100%;
    min-height: 220px;
    max-height: none;
    aspect-ratio: 1 / 0.78;
  }

  .panel-content {
    justify-content: flex-start;
    overflow: auto;
    padding: 24px;
  }

  .legend {
    display: none;
  }

  .leaflet-control-zoom {
    display: none;
  }
}
