@font-face {
  font-family: "Alte Haas Grotesk";
  font-display: swap;
  src: url("assets/wildeburg-style/Alte-Haas-Grotesk.051e2ba8.woff2") format("woff2");
}

:root {
  --paper: #f0ede4;
  --paper-2: #fbf9f3;
  --sand: #d8cfb7;
  --tan: #dcc19c;
  --ink: #272727;
  --muted: #75817d;
  --clay: #c2492f;
  --terra: #dd8d6e;
  --green: #bfd8b4;
  --blue: #6f91bd;
  --lilac: #dfc2eb;
  --board: #2b2622;
  --display: "Alte Haas Grotesk", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --body: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--paper);
}

.topbar {
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 2px solid var(--sand);
  background: rgba(240, 237, 228, .94);
}

.app.tab-plan #locateBtn {
  visibility: hidden;
}

.brand b {
  display: block;
  font-family: var(--display);
  font-size: clamp(25px, 4vw, 44px);
  line-height: .88;
  text-transform: uppercase;
}

.brand span,
.sheet-head small,
.checkin-dialog small {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.tab-switch,
.layer-switch,
.zoom-switch {
  display: inline-flex;
  padding: 3px;
  border: 1.5px solid var(--sand);
  border-radius: 999px;
  background: var(--paper-2);
}

.top-tab,
.layer-btn,
.zoom-btn,
.mini-btn,
.primary-btn {
  min-height: 38px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--ink);
  background: transparent;
  font-family: var(--display);
  font-weight: 700;
}

.top-tab.is-active,
.layer-btn.is-active {
  color: var(--paper);
  background: var(--ink);
}

.zoom-switch {
  align-items: center;
  gap: 5px;
}

.zoom-btn {
  width: 38px;
  padding: 0;
}

#zoomLevel {
  min-width: 48px;
  color: var(--muted);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.mini-btn {
  border-color: var(--sand);
  background: var(--paper);
  box-shadow: 0 2px 0 rgba(39, 39, 39, .12);
}

.primary-btn {
  width: 100%;
  color: var(--paper);
  background: var(--clay);
}

.app-main {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.planning-view,
.map-view {
  position: absolute;
  inset: 0;
  min-height: 0;
}

.planning-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #ece9e2;
}

.app.tab-plan .map-view,
.app.tab-map .planning-view {
  display: none;
}

.map-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.planning-view,
.map-view {
  position: absolute;
  inset: 0;
  min-height: 0;
}

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

.map-toolbar > * {
  pointer-events: auto;
}

.map-shell {
  position: absolute;
  inset: 0;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: none;
  background:
    radial-gradient(circle at 12% 16%, rgba(221, 141, 110, .32), transparent 22%),
    radial-gradient(circle at 78% 80%, rgba(111, 145, 189, .32), transparent 28%),
    var(--paper);
}

.map-shell.grabbing {
  cursor: grabbing;
}

.map-canvas {
  position: relative;
  width: 1120px;
  height: 1528px;
  margin: 86px auto 340px;
  border: 2px solid var(--sand);
  border-radius: 28px;
  overflow: hidden;
  background: var(--tan);
  box-shadow: 0 18px 48px rgba(39, 39, 39, .22);
  will-change: width, height;
}

.map-image,
.satellite-layer,
.map-lines,
.pin-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-image {
  object-fit: fill;
  transition: opacity .2s ease;
}

.satellite-layer {
  opacity: 0;
  background:
    radial-gradient(circle at 22% 20%, rgba(117, 129, 125, .9), transparent 18%),
    radial-gradient(circle at 70% 28%, rgba(93, 120, 82, .9), transparent 24%),
    radial-gradient(circle at 42% 58%, rgba(38, 93, 75, .9), transparent 22%),
    radial-gradient(circle at 72% 75%, rgba(56, 94, 126, .74), transparent 20%),
    linear-gradient(135deg, #405947, #6d7f56 38%, #314b48 68%, #71896c);
  filter: saturate(.95) contrast(1.06);
  transition: opacity .2s ease;
}

.satellite-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .28;
  background-image:
    repeating-linear-gradient(24deg, transparent 0 22px, rgba(240,237,228,.14) 22px 24px),
    repeating-linear-gradient(114deg, transparent 0 35px, rgba(39,39,39,.12) 35px 37px);
}

.app.layer-sat .map-image {
  opacity: 0;
}

.app.layer-sat .satellite-layer {
  opacity: 1;
}

.app.nav-compass .map-image,
.app.nav-compass .satellite-layer,
.app.nav-compass .network-line,
.app.nav-compass .pin:not(.friend) {
  opacity: .22;
}

.app.nav-compass .route-line {
  opacity: .45;
}

.map-lines {
  pointer-events: none;
  overflow: visible;
}

.network-line {
  stroke: rgba(240, 237, 228, .82);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.app.layer-plan .network-line {
  stroke: rgba(117, 129, 125, .36);
}

.route-line {
  stroke: var(--clay);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 14 9;
  filter: drop-shadow(0 2px 2px rgba(39,39,39,.22));
}

.pin-layer {
  pointer-events: none;
}

.pin {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: auto;
  display: grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  padding: 6px 9px;
  border: 2px solid var(--paper);
  border-radius: 999px 999px 999px 8px;
  color: var(--paper);
  background: var(--ink);
  box-shadow: 0 5px 16px rgba(39,39,39,.28);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pin.stage {
  background: var(--clay);
}

.pin.facility {
  background: var(--muted);
}

.pin.friend {
  background: var(--terra);
  color: var(--ink);
}

.you-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border: 3px solid var(--paper);
  border-radius: 999px;
  color: var(--paper);
  background: var(--blue);
  box-shadow: 0 0 0 10px rgba(111,145,189,.22), 0 10px 28px rgba(39,39,39,.34);
  font-family: var(--display);
  font-size: 12px;
  line-height: .95;
  text-align: center;
  text-transform: uppercase;
  z-index: 6;
}

.you-pin::after {
  content: "";
  position: absolute;
  inset: -18px;
  border: 2px solid rgba(111,145,189,.45);
  border-radius: inherit;
}

.you-label {
  position: relative;
  z-index: 2;
}

.heading-arrow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 20px solid var(--clay);
  filter: drop-shadow(0 2px 2px rgba(39,39,39,.28));
  transform: translate(-50%, -50%) rotate(var(--heading, 28deg)) translateY(-56px);
  transform-origin: 50% 50%;
  z-index: 3;
}

.plan-sheet,
.route-sheet {
  position: absolute;
  z-index: 25;
  background: rgba(240, 237, 228, .96);
  border: 2px solid var(--sand);
  box-shadow: 0 16px 44px rgba(39,39,39,.22);
  transition: transform .22s ease, opacity .22s ease;
}

.plan-sheet {
  left: 14px;
  bottom: 14px;
  width: min(420px, calc(100vw - 28px));
  max-height: calc(100vh - 126px);
  display: none;
  grid-template-rows: auto auto auto 1fr;
  border-radius: 24px;
  overflow: hidden;
}

.app.tab-map .plan-sheet {
  transform: translateY(calc(100% - 86px));
}

.app.tab-plan .route-sheet {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

.sheet-handle {
  width: 46px;
  height: 5px;
  margin: 9px auto 6px;
  border-radius: 999px;
  background: var(--sand);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 10px;
}

.sheet-head h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 34px;
  line-height: .9;
  text-transform: uppercase;
}

.next-card {
  margin: 0 14px 12px;
  padding: 13px;
  border-radius: 16px;
  color: var(--paper);
  background: var(--board);
}

.next-card strong {
  display: block;
  font-family: var(--display);
  font-size: 24px;
  line-height: .95;
}

.next-card span {
  display: block;
  margin-top: 5px;
  color: #cbb9a6;
  font-size: 13px;
}

.act-list {
  min-height: 0;
  overflow: auto;
  padding: 0 14px 14px;
}

.act {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-top: 1.5px solid var(--sand);
}

.act time {
  font-family: var(--display);
  font-size: 16px;
  color: var(--clay);
}

.act b {
  display: block;
  font-family: var(--display);
  font-size: 18px;
  line-height: 1;
}

.act p {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.act-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.act-actions button,
.route-sheet button {
  border: 1.5px solid var(--sand);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
}

.act-actions .hot,
.route-sheet .hot {
  color: var(--paper);
  background: var(--clay);
  border-color: var(--clay);
}

.route-sheet {
  right: 14px;
  bottom: 14px;
  width: min(360px, calc(100vw - 28px));
  max-height: calc(100vh - 128px);
  overflow: auto;
  padding: 16px;
  border-radius: 24px;
}

.route-sheet h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 32px;
  line-height: .9;
  text-transform: uppercase;
}

.route-sheet p {
  margin: 0 0 12px;
  color: var(--muted);
}

.route-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.route-stats div {
  flex: 1;
  padding: 12px;
  border-radius: 15px;
  background: var(--tan);
}

.route-stats b {
  display: block;
  font-family: var(--display);
  font-size: 29px;
  line-height: .9;
}

.route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-mode-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  margin: 0 0 12px;
  border: 1.5px solid var(--sand);
  border-radius: 999px;
  background: var(--paper-2);
}

.nav-mode-switch button {
  min-width: 0;
  border: 0;
  border-radius: 999px;
  padding: 8px 6px;
  color: var(--muted);
  background: transparent;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
}

.nav-mode-switch button.is-active {
  color: var(--paper);
  background: var(--ink);
}

.route-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  padding: 9px 11px;
  border: 1.5px solid var(--sand);
  border-radius: 14px;
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
}

.route-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--clay);
}

.nav-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 18px;
  color: var(--paper);
  background: var(--board);
}

.nav-card.is-compass {
  min-height: 128px;
  grid-template-columns: 92px 1fr;
  background: #1f2328;
}

.nav-arrow {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 2px solid rgba(240,237,228,.75);
  border-radius: 999px;
  color: var(--clay);
  background: rgba(240,237,228,.12);
  font-size: 34px;
  line-height: 1;
  transform: rotate(var(--nav-bearing, 0deg));
  transform-origin: center;
}

.nav-card.is-compass .nav-arrow {
  width: 86px;
  height: 86px;
  font-size: 54px;
  box-shadow: 0 0 0 10px rgba(194,73,47,.12);
}

.nav-card strong,
.nav-card span {
  display: block;
}

.nav-card strong {
  font-family: var(--display);
  font-size: 21px;
  line-height: 1;
}

.nav-card span {
  margin-top: 4px;
  color: #d8cfb7;
  font-size: 13px;
}

.route-warn {
  padding: 9px 11px;
  border-radius: 12px;
  color: #6d3115;
  background: var(--tan);
  font-weight: 700;
}

.surface-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.surface-list span {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  padding: 6px 9px;
  border: 1.5px solid var(--sand);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 12px;
}

.surface-list b {
  color: var(--ink);
  font-family: var(--display);
}

.checkin-dialog {
  width: min(430px, calc(100vw - 24px));
  border: 2px solid var(--sand);
  border-radius: 24px;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 20px 70px rgba(39,39,39,.32);
}

.checkin-dialog::backdrop {
  background: rgba(39,39,39,.38);
}

.checkin-dialog form {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 22px;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--sand);
  border-radius: 999px;
  background: var(--paper-2);
}

.checkin-dialog h2 {
  margin: 0 0 2px;
  font-family: var(--display);
  font-size: 40px;
  line-height: .9;
  text-transform: uppercase;
}

.checkin-dialog label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.checkin-dialog select,
.checkin-dialog input {
  width: 100%;
  min-height: 42px;
  border: 1.5px solid var(--sand);
  border-radius: 12px;
  padding: 0 11px;
  color: var(--ink);
  background: var(--paper-2);
  text-transform: none;
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .brand span,
  #locateBtn {
    display: none;
  }

  .tab-switch {
    grid-column: 1 / -1;
    width: 100%;
  }

  .top-tab {
    flex: 1;
  }

  .map-toolbar {
    top: 10px;
    flex-wrap: wrap;
  }

  .zoom-switch {
    order: 3;
  }

  .map-canvas {
    width: 900px;
    height: 1228px;
    margin-top: 104px;
    margin-bottom: 360px;
  }

  .plan-sheet {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 58vh;
    border-radius: 22px 22px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  .app.tab-map .plan-sheet {
    transform: translateY(calc(100% - 70px));
  }

  .app.tab-map .plan-sheet .next-card,
  .app.tab-map .plan-sheet .act-list {
    display: none;
  }

  .route-sheet {
    left: 10px;
    right: 10px;
    bottom: 12px;
    width: auto;
    max-height: calc(100vh - 178px);
    padding: 14px;
  }

  .route-sheet h2 {
    font-size: 29px;
  }

  .route-sheet p {
    margin-bottom: 10px;
    font-size: 14px;
  }

  .route-stats {
    gap: 8px;
    margin-bottom: 10px;
  }

  .route-stats div {
    padding: 10px;
  }

  .route-stats b {
    font-size: 26px;
  }

  .nav-mode-switch button {
    font-size: 11px;
  }

  .nav-card {
    grid-template-columns: 56px 1fr;
    padding: 10px;
  }

  .nav-card.is-compass {
    grid-template-columns: 82px 1fr;
    min-height: 116px;
  }

  .nav-arrow {
    width: 52px;
    height: 52px;
    font-size: 30px;
  }

  .nav-card.is-compass .nav-arrow {
    width: 76px;
    height: 76px;
    font-size: 48px;
  }
}
