:root {
  color-scheme: dark;
  --bg: #171411;
  --panel: #211c18;
  --line: #443831;
  --text: #f4ebe1;
  --muted: #c6b7a9;
  --accent: #ff9d69;
  --mono: ui-monospace,Consolas,monospace;
  font: 16px/1.5 system-ui,sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none!important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,a,select {
  -webkit-tap-highlight-color: transparent;
}

button,select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

button:disabled {
  cursor: default;
  opacity: .42;
}

svg {
  display: block;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.masthead {
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  height: 76px;
  padding: 0 clamp(14px,3.1vw,48px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 850;
  line-height: .96;
  letter-spacing: .06em;
}

.mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #25160f;
}

.mark svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
  stroke: none;
}

.header-label,.eyebrow,.view-tag,.panel-foot {
  font: 600 11px/1.4 var(--mono);
  letter-spacing: .12em;
}

.header-label {
  color: var(--muted);
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.gallery-trigger {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 13px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #231e19;
}

.gallery-trigger svg {
  color: var(--accent);
}

main {
  padding: 0 clamp(12px,3.1vw,48px) 24px;
}

.trail {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.trail a {
  padding: 9px 0;
}

.trail a:hover {
  text-decoration: underline;
}

.trail [aria-current] {
  color: var(--text);
  font-weight: 650;
}

.trail .divider {
  color: #ad826d;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0,4fr) minmax(238px,1fr);
  gap: 14px;
}

.viewport,.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  min-width: 0;
}

.viewport {
  height: clamp(420px,calc(100dvh - 156px),820px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(ellipse at 48% 43%,#45382d 0,#2a231c 48%,#1d1815 100%);
}

.viewport::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .35;
  background-image: radial-gradient(#9b8068 1px,transparent 1px);
  background-size: 25px 25px;
  mask-image: radial-gradient(ellipse at 50% 48%,transparent 28%,black 86%);
}

#surface,#marker-layer {
  position: absolute;
  inset: 0;
}

#surface canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#surface canvas:active {
  cursor: grabbing;
}

#marker-layer {
  pointer-events: none;
}

.hotspot {
  position: absolute;
  transform: translate(-50%,-100%);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 9px;
  background: #241b16;
  border: 1px solid var(--accent);
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 5px 20px #120b08a0;
}

.hotspot span {
  color: var(--accent);
}

.viewport-top {
  display: flex;
  align-items: center;
  gap: 10px;
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
}

.view-tag,.back,.view-help {
  background: #211a15e8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.view-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  color: #f1dbcb;
}

.view-tag i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.back {
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0 12px;
  font-size: 13px;
}

.view-tools {
  display: grid;
  gap: 7px;
  position: absolute;
  right: 14px;
  bottom: 16px;
}

.view-tools button,#gallery-close,#toggle-panel {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #211a15;
  font-size: 23px;
  line-height: 1;
}

.view-tools button:hover,.gallery-trigger:hover,.back:hover,#gallery-close:hover,#toggle-panel:hover {
  border-color: var(--accent);
}

.view-help {
  position: absolute;
  left: 14px;
  bottom: 16px;
  margin: 0;
  padding: 8px 10px;
  font-size: 12px;
  color: #e0cfc1;
  pointer-events: none;
}

.mobile-help {
  display: none;
}

.message {
  position: absolute;
  z-index: 3;
  inset: 50% auto auto 50%;
  transform: translate(-50%,-50%);
  width: min(82%,360px);
  padding: 15px;
  text-align: center;
  background: #211a15;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.message p {
  margin: 0;
}

.message button {
  margin-top: 10px;
  padding: 8px 14px;
  background: var(--accent);
  color: #291810;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
}

.panel {
  background: var(--panel);
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  max-height: clamp(420px,calc(100dvh - 156px),820px);
  overflow: auto;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.eyebrow {
  color: var(--accent);
  margin: 0 0 8px;
}

h1,h2 {
  font-size: clamp(25px,2.7vw,42px);
  font-weight: 760;
  line-height: 1.06;
  letter-spacing: -.05em;
  margin: 0;
  overflow-wrap: anywhere;
}

#description {
  font-size: 14px;
  color: var(--muted);
  margin: 14px 0 20px;
}

.destinations {
  padding-top: 18px;
  border-top: 1px solid var(--line);
  margin-bottom: 16px;
}

.destinations h2 {
  font: 600 11px/1.4 var(--mono);
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 9px;
}

.destination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 9px 11px;
  background: #32241c;
  border: 1px solid #76513b;
  border-radius: 8px;
  font-weight: 700;
  gap: 8px;
}

.destination span,.panel-gallery span {
  color: var(--accent);
}

.destination:hover,.panel-gallery:hover {
  border-color: var(--accent);
}

.panel-gallery {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 7px 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  font-size: 14px;
}

.panel-foot {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  color: var(--muted);
  margin-top: auto;
  padding-top: 26px;
  font-size: 9px;
}

#toggle-panel {
  display: none;
  flex: none;
}

dialog {
  width: min(92vw,720px);
  max-height: 88dvh;
  padding: 0;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

dialog::backdrop {
  background: #120c09c9;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.dialog-content {
  padding: 20px;
}

.dialog-content label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
}

select {
  min-height: 44px;
  width: min(100%,260px);
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 0;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(135px,1fr));
  gap: 10px;
  margin-top: 14px;
}

.photo-grid button,.photo-back {
  background: var(--bg);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.photo-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 6px;
}

.photo-full {
  display: block;
  max-width: 100%;
  max-height: 56dvh;
  object-fit: contain;
  margin: 14px auto;
}

.photo-caption {
  color: var(--muted);
}

@media(max-width:760px) {
  .masthead {
    height: 60px;
    gap: 10px;
  }
  .header-label {
    display: none;
  }
  .trail {
    min-height: 44px;
  }
  .layout {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .viewport {
    height: max(250px,calc(100dvh - 213px));
    max-height: 670px;
  }
  .panel {
    max-height: none;
    padding: 13px 15px;
    position: relative;
  }
  .panel-head h1 {
    font-size: 25px;
  }
  .eyebrow {
    margin-bottom: 4px;
  }
  #toggle-panel {
    display: grid;
  }
  #toggle-panel[aria-expanded="false"] svg {
    transform: rotate(180deg);
  }
  .panel:not(.expanded) #panel-content,.panel-foot {
    display: none;
  }
  #panel-content {
    max-height: 35dvh;
    overflow: auto;
    padding: 0 3px 6px;
  }
  .mobile-help {
    display: inline;
  }
  .desktop-help {
    display: none;
  }
  .view-help,.viewport-top {
    left: 8px;
  }
  .view-tools {
    right: 8px;
  }
  .viewport-top {
    top: 8px;
  }
  .view-help,.view-tools {
    bottom: 8px;
  }
  main {
    padding-bottom: max(12px,env(safe-area-inset-bottom));
  }
}

@media (max-width:760px) {
  .layout {
    position: relative;
    padding-bottom: 82px;
  }
  .panel {
    position: absolute;
    inset: auto 0 0;
    z-index: 4;
    min-height: 74px;
  }
  .panel.expanded {
    box-shadow: 0 -12px 30px #140d09b3;
  }
  .panel-head {
    touch-action: none;
  }
}

.header-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.header-actions .gallery-trigger {
  margin-left: 0;
}
.help-trigger {
  justify-content: center;
  min-width: 44px;
}
#rotation[aria-pressed="true"], #show-editor[aria-expanded="true"] {
  color: var(--accent);
  border-color: #926247;
}
.guide-steps {
  margin: 0 0 20px;
  display: grid;
  gap: 14px;
}
.guide-steps dt {
  font-weight: 750;
}
.guide-steps dd {
  color: var(--muted);
  margin: 3px 0 0;
}
#editor {
  margin-top: 15px;
}
#editor form, #editor fieldset {
  display: grid;
  gap: 6px;
}
#editor fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
#editor form {
  margin-top: 14px;
}
#editor label {
  font-size: 13px;
  color: var(--muted);
}
#editor input, #editor select, #editor textarea {
  width: 100%;
  min-width: 0;
  padding: 8px;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}
#editor input[type="file"] {
  font-size: 12px;
}
#editor textarea {
  resize: vertical;
}
#editor p {
  margin: 4px 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
#editor button, .edit-primary, .pick-note button {
  padding: 7px 10px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
}
#editor button.edit-primary, button.edit-primary {
  color: #25160f;
  background: var(--accent);
  font-weight: 700;
}
#editor img {
  max-width: 100%;
  max-height: 130px;
  object-fit: contain;
}
#editor-status {
  color: var(--accent);
}
.pick-note {
  position: absolute;
  left: 12px;
  right: 68px;
  bottom: 50px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 8px;
}
#viewport.picking canvas {
  cursor: crosshair;
}
#viewport.picking #marker-layer a {
  pointer-events: none;
  visibility: hidden;
}
.hotspot {
  max-width: min(210px, 67vw);
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 420px) {
  .header-actions .gallery-trigger {
    padding-inline: 8px;
  }
  .header-actions .gallery-trigger svg {
    display: none;
  }
}


.hotspot.anchored {
  transform: translate(-50%, calc(-100% - 7px));
}
.hotspot.anchored.anchor-below {
  transform: translate(-50%, 7px);
}
.hotspot.anchored::after {
  content: "";
  position: absolute;
  left: calc(50% + var(--anchor-offset, 0px));
  bottom: -8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: var(--accent);
}
.hotspot.anchored.anchor-below::after {
  top: -8px;
  bottom: auto;
}

