:root {
  color: #eef2ea;
  background: #0b0f0d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body, .app-shell, .map { width: 100%; height: 100%; margin: 0; }
body { overflow: hidden; }

.app-shell {
  position: relative;
  isolation: isolate;
  background: #071116;
}

.app-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.map { position: absolute; inset: 0; }

.map-labels {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.map-label {
  position: absolute;
  top: 0;
  left: 0;
  max-width: 220px;
  color: #f5f2df;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .01em;
  line-height: 1.12;
  text-align: center;
  text-shadow:
    -1px -1px 0 rgba(7, 11, 9, .96),
    1px -1px 0 rgba(7, 11, 9, .96),
    -1px 1px 0 rgba(7, 11, 9, .96),
    1px 1px 0 rgba(7, 11, 9, .96),
    0 2px 5px rgba(0, 0, 0, .95);
  white-space: nowrap;
  opacity: 0;
  transform: translate3d(-1000px, -1000px, 0) translate(-50%, -50%);
  transition: opacity .12s ease;
  contain: layout style;
  will-change: transform;
}

.map-label.is-visible {
  opacity: 1;
}

.marker-labels {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.marker-label {
  position: absolute;
  top: 0;
  left: 0;
  max-width: 220px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 4px;
  color: #fff;
  background: rgba(10, 15, 12, .78);
  box-shadow: 0 2px 7px rgba(0, 0, 0, .35);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
  opacity: 0;
  transform: translate3d(-1000px, -1000px, 0) translate(-50%, 0);
  transition: opacity .12s ease;
  will-change: transform;
}

.marker-label.is-visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .map-label {
    transition: none;
  }
}

.map-label[data-type="Capital"] {
  color: #fff5c2;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.map-label[data-type="City"] {
  color: #fff8dc;
  font-size: 14px;
  font-weight: 900;
}

.map-label[data-type="Village"] {
  color: #f5edcf;
  font-size: 12px;
  font-weight: 820;
}

.map-label[data-type="Local"] {
  color: #dce8cd;
}

.map-label[data-type="Hill"] {
  color: #e5e6dc;
  font-style: italic;
}

.map-label[data-type="Marine"] {
  color: #bce3e7;
  font-style: italic;
}

.map-label[data-type="Camp"] {
  color: #d5e8bd;
}

.map-label[data-type="Ruin"] {
  color: #e5d0b4;
}

.map-search {
  position: absolute;
  z-index: 6;
  top: 14px;
  left: 14px;
  pointer-events: none;
}

.map-search-form {
  position: relative;
  display: flex;
  align-items: flex-start;
  pointer-events: auto;
}

.map-search-toggle,
.map-search-input-wrap,
.map-search-panel {
  border: 1px solid rgba(231, 239, 229, .2);
  color: #eef2ea;
  background: rgba(13, 18, 15, .9);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .3);
  backdrop-filter: blur(8px);
}

.map-search-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 9px;
  border-radius: 9px;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, color .14s ease;
}

.map-search-toggle:hover,
.map-search-toggle:focus-visible,
.map-search-toggle[aria-expanded="true"] {
  border-color: rgba(155, 210, 126, .72);
  color: #b9e3a2;
  background: rgba(31, 55, 36, .95);
  outline: none;
}

.map-search-toggle svg,
.map-search-input-wrap > svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.map-search-panel {
  position: absolute;
  top: 0;
  left: 50px;
  display: grid;
  width: min(390px, calc(100vw - 76px));
  overflow: hidden;
  border-radius: 10px;
}

.map-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 9px;
  border: 0;
  border-bottom: 1px solid rgba(231, 239, 229, .13);
  border-radius: 0;
  box-shadow: none;
}

.map-search-input-wrap input {
  min-width: 0;
  flex: 1;
  padding: 9px 0;
  border: 0;
  outline: none;
  color: #f1f5ef;
  background: transparent;
  font: inherit;
  font-size: 13px;
  appearance: none;
}

.map-search-input-wrap input::-webkit-search-cancel-button { appearance: none; }

.map-search-input-wrap input::placeholder { color: #89988b; }
.map-search-clear {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  color: #abb8ad;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.map-search-clear:hover { color: #fff; }

.map-search-results {
  display: grid;
  max-height: min(370px, 55vh);
  overflow-y: auto;
}

.map-search-result {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid rgba(231, 239, 229, .08);
  color: #eef2ea;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.map-search-result:hover,
.map-search-result:focus-visible,
.map-search-result.is-active {
  background: rgba(90, 126, 83, .24);
  outline: none;
}
.map-search-result strong { font-size: 13px; font-weight: 800; }
.map-search-result small { color: #9eaea0; font-size: 11px; }
.map-search-result em { color: #d3e58a; font-size: 10px; font-style: normal; text-transform: uppercase; letter-spacing: .06em; }
.map-search-hint { margin: 0; padding: 9px 12px 10px; color: #92a092; font-size: 11px; line-height: 1.35; }

.search-target-marker {
  width: 18px;
  height: 18px;
  border: 3px solid #f7c95b;
  border-radius: 50%;
  background: #203621;
  box-shadow: 0 0 0 5px rgba(247, 201, 91, .23), 0 3px 13px rgba(0, 0, 0, .6);
}

.grid-labels {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.measure-labels {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.measure-label {
  position: absolute;
  max-width: 230px;
  padding: 3px 6px;
  border: 1px solid rgba(247, 201, 91, .42);
  border-radius: 5px;
  color: #fff7d8;
  background: rgba(15, 18, 14, .9);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .38);
  font-size: 11px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.measure-label.preview {
  border-style: dashed;
  color: #fff1ba;
}

.measure-label.saved {
  border-color: rgba(155, 210, 126, .38);
  color: #e5f4dd;
}

.grid-label {
  position: absolute;
  padding: 1px 4px;
  color: #f4f7f0;
  background: rgba(0, 0, 0, .68);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.grid-label[data-anchor="right"] {
  transform: translate(-100%, -50%);
}

.settings-backdrop {
  position: absolute;
  z-index: 4;
  inset: 0;
  background: rgba(3, 8, 10, .62);
  backdrop-filter: blur(5px);
}

.measure-label-primary,
.measure-label-direction {
  display: block;
}

.measure-label-direction {
  margin-top: 2px;
  color: #b9d8aa;
  font-size: 10px;
  font-weight: 700;
}

.panel {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  width: min(720px, calc(100vw - 40px));
  max-height: min(780px, calc(100vh - 40px));
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(231, 239, 229, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(22, 32, 27, .98), rgba(8, 14, 16, .985));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .58);
  backdrop-filter: blur(18px);
  transform: translate(-50%, -50%);
}

.settings-panel-header,
.map-label-settings-section > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.settings-panel-header h2 {
  margin-bottom: 0;
}

.settings-panel-header button,
.map-label-settings-section > header button {
  flex: 0 0 auto;
  border: 1px solid rgba(231, 239, 229, .16);
  color: #dce5d9;
  background: rgba(10, 16, 14, .74);
  cursor: pointer;
}

.settings-panel-header button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 7px;
  border-radius: 8px;
}

.settings-panel-header button:hover,
.settings-panel-header button:focus-visible,
.map-label-settings-section > header button:hover,
.map-label-settings-section > header button:focus-visible {
  border-color: rgba(155, 210, 126, .62);
  color: #b9e3a2;
  outline: none;
}

.settings-panel-header svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.map-label-settings-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(231, 239, 229, .12);
}

.map-label-settings-section h2 {
  margin: 0;
  font-size: 17px;
}

.map-label-settings-section > header button {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
}

.map-label-settings-section > header .map-label-settings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-label-settings-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform .16s ease;
}

.map-label-settings-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.map-label-settings-details {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(231, 239, 229, .09);
}

.map-label-settings-details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.map-label-settings-details-header > strong {
  color: #dce7d8;
  font-size: 12px;
}

.map-label-settings-details-header > button {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(231, 239, 229, .14);
  border-radius: 7px;
  color: #dce5d9;
  background: rgba(10, 16, 14, .74);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.map-label-settings-details-header > button:hover,
.map-label-settings-details-header > button:focus-visible {
  border-color: rgba(155, 210, 126, .62);
  color: #b9e3a2;
  outline: none;
}

.map-label-settings-hint {
  margin: 9px 0 14px;
  color: #95a296;
  font-size: 12px;
  line-height: 1.45;
}

.map-label-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.map-label-setting {
  padding: 12px;
  border: 1px solid rgba(231, 239, 229, .11);
  border-radius: 10px;
  background: rgba(7, 13, 12, .48);
}

.map-label-setting > strong {
  display: block;
  margin-bottom: 10px;
  color: #edf3e9;
  font-size: 13px;
}

.map-label-setting label {
  display: grid;
  grid-template-columns: minmax(115px, .85fr) minmax(110px, 1fr) 38px;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.map-label-setting label > span {
  margin: 0;
  font-size: 10px;
  line-height: 1.25;
}

.map-label-setting input[type="range"] {
  min-height: 20px;
  padding: 0;
  accent-color: #b8d93b;
  cursor: pointer;
}

.map-label-setting output {
  color: #dce7d8;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.marker-label-settings {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  padding: 10px 11px;
  border: 1px solid rgba(231, 239, 229, .11);
  border-radius: 8px;
  background: rgba(7, 13, 12, .48);
  cursor: pointer;
}

.marker-label-settings input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: #b8d93b;
  cursor: pointer;
}

.marker-label-settings span {
  display: grid;
  gap: 3px;
}

.marker-label-settings strong {
  color: #edf3e9;
  font-size: 12px;
}

.marker-label-settings small {
  color: #9eaa9a;
  font-size: 10px;
  line-height: 1.3;
}

@media (max-width: 700px) {
  .panel {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    padding: 16px;
  }

  .map-label-settings {
    grid-template-columns: 1fr;
  }
}

.map-tools {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: 12px;
  display: grid;
  gap: 7px;
  transform: translateY(-50%);
}

.map-tools button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 6px;
  border: 1px solid rgba(231, 239, 229, .15);
  border-radius: 7px;
  color: #eef2ea;
  background: rgba(13, 18, 15, .88);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .24);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, color .14s ease;
}

.map-tools button:hover,
.map-tools button:focus-visible {
  border-color: rgba(231, 239, 229, .32);
  color: #fff;
  background: rgba(31, 40, 34, .94);
  outline: none;
}

.map-tools button.active {
  border-color: rgba(155, 210, 126, .72);
  color: #b9e3a2;
  background: rgba(31, 55, 36, .94);
}

.map-tools svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.tool-message[hidden] {
  display: none;
}

.loot-tier-legend {
  position: absolute;
  z-index: 2;
  bottom: 14px;
  left: 14px;
  display: grid;
  grid-template-columns: repeat(5, auto);
  align-items: center;
  gap: 5px 10px;
  padding: 7px 10px 8px;
  border: 1px solid rgba(231, 239, 229, .13);
  border-radius: 8px;
  color: #cad3c7;
  background: rgba(10, 15, 12, .84);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .28);
  backdrop-filter: blur(7px);
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
}

.loot-tier-legend > strong {
  grid-column: 1 / -1;
  color: #eef2ea;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.loot-tier-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.loot-tier-legend i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #7f8a82;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .55);
}

.loot-tier-legend [data-tier="tier-1"] i { background: #7da66a; }
.loot-tier-legend [data-tier="tier-2"] i { background: #4d9fd5; }
.loot-tier-legend [data-tier="tier-3"] i { background: #e8ad42; }
.loot-tier-legend [data-tier="tier-4"] i { background: #e26a55; }
.loot-tier-legend [data-tier="unique"] i { background: #b77ae6; }
.loot-tier-legend [data-tier="dynamic"] i { background: #62c8b5; }
.loot-tier-legend [data-tier="untiered"] i { background: #7f8a82; }

.tool-message {
  position: absolute;
  z-index: 3;
  right: 76px;
  bottom: 18px;
  max-width: 250px;
  padding: 8px 11px;
  border: 1px solid rgba(231, 239, 229, .13);
  border-radius: 7px;
  color: #d6e6cf;
  background: rgba(13, 18, 15, .9);
  font-size: 12px;
  pointer-events: none;
  box-shadow: 0 9px 24px rgba(0, 0, 0, .3);
}

.app-shell.measure-active .tool-message {
  bottom: 78px;
}

.measure-panel[hidden] {
  display: none;
}

.measure-panel {
  position: absolute;
  z-index: 3;
  right: 58px;
  bottom: 14px;
  max-width: calc(100vw - 76px);
  padding: 8px 11px;
  border: 1px solid rgba(231, 239, 229, .15);
  border-radius: 7px;
  color: #fff7d8;
  background: rgba(13, 18, 15, .9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .24);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.measure-panel output {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.measure-panel output.measure-heading {
  margin-top: 3px;
  color: #b9d8aa;
  font-size: 10px;
  font-weight: 700;
}

.measure-heading[hidden] {
  display: none;
}

.measure-save-hint {
  display: block;
  margin-top: 4px;
  color: #9eaa9a;
  font-size: 10px;
  line-height: 1.25;
}

.measure-save-hint kbd {
  display: inline-block;
  min-width: 31px;
  padding: 1px 4px;
  border: 1px solid rgba(231, 239, 229, .2);
  border-radius: 4px;
  color: #dce7d8;
  background: rgba(10, 16, 14, .58);
  font: inherit;
  text-align: center;
}

.measure-list-panel[hidden],
.marker-list-panel[hidden] {
  display: none;
}

.measure-list-panel,
.marker-list-panel {
  position: absolute;
  z-index: 4;
  top: 16px;
  right: 58px;
  width: min(610px, calc(100vw - 76px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border: 1px solid rgba(231, 239, 229, .15);
  border-radius: 9px;
  color: #e8eee5;
  background: rgba(13, 18, 15, .94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .36);
  backdrop-filter: blur(10px);
}

.measure-list-panel > header,
.marker-list-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 8px 11px;
  border-bottom: 1px solid rgba(231, 239, 229, .1);
}

.measure-list-panel > header strong,
.marker-list-panel > header strong {
  color: #f7c95b;
  font-size: 13px;
}

.measure-list-panel button,
.marker-list-panel button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 5px;
  border: 1px solid rgba(231, 239, 229, .15);
  border-radius: 6px;
  color: #eef2ea;
  background: rgba(20, 27, 23, .9);
  cursor: pointer;
}

.measure-list-panel button:hover,
.measure-list-panel button:focus-visible,
.measure-list-panel button.active,
.marker-list-panel button:hover,
.marker-list-panel button:focus-visible,
.marker-list-panel button.active {
  border-color: rgba(155, 210, 126, .72);
  color: #b9e3a2;
  background: rgba(31, 55, 36, .94);
  outline: none;
}

.measure-list-panel svg,
.marker-list-panel svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.measure-route-list,
.marker-point-list {
  display: grid;
  max-height: calc(100vh - 94px);
  overflow: auto;
}

.measure-route,
.marker-point {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(231, 239, 229, .09);
}

.measure-route:last-child,
.marker-point:last-child {
  border-bottom: 0;
}

.measure-route input,
.marker-point input {
  min-width: 0;
  min-height: 30px;
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
}

.measure-route-stats,
.marker-point-coordinates {
  grid-column: 2;
  color: #aab5a6;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.measure-route-actions,
.marker-point-actions {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.marker-point button.marker-point-color {
  --marker-color: #f46d5f;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 5px;
}

.measure-route button.measure-route-color {
  --route-color: #9bc985;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 5px;
}

.marker-point-color::before,
.measure-route-color::before {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .84);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .38);
  content: "";
}

.marker-point-color::before {
  background: var(--marker-color);
}

.measure-route-color::before {
  background: var(--route-color);
}

.marker-draft-panel {
  position: absolute;
  z-index: 8;
  display: grid;
  gap: 10px;
  width: min(270px, calc(100vw - 16px));
  padding: 12px;
  border: 1px solid rgba(231, 239, 229, .18);
  border-radius: 10px;
  color: #e8eee5;
  background: rgba(13, 18, 15, .97);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .48);
  backdrop-filter: blur(12px);
}

.marker-draft-panel > header strong {
  color: #f7c95b;
  font-size: 14px;
}

.marker-draft-name {
  display: grid;
  gap: 5px;
  color: #aab5a6;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.marker-draft-name input {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid rgba(231, 239, 229, .18);
  border-radius: 6px;
  color: #eef2ea;
  background: rgba(7, 12, 9, .82);
  font: inherit;
  font-size: 13px;
  text-transform: none;
}

.marker-draft-name input:focus {
  border-color: rgba(155, 210, 126, .72);
  outline: 2px solid rgba(155, 210, 126, .18);
}

.marker-draft-coordinates {
  color: #aab5a6;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.marker-draft-panel button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(231, 239, 229, .15);
  border-radius: 6px;
  color: #eef2ea;
  background: rgba(20, 27, 23, .9);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.marker-draft-panel button:hover,
.marker-draft-panel button:focus-visible {
  border-color: rgba(155, 210, 126, .72);
  background: rgba(31, 55, 36, .94);
  outline: none;
}

.marker-draft-panel button.marker-draft-color {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.marker-draft-color-swatch {
  --marker-color: #f46d5f;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .84);
  border-radius: 50%;
  background: var(--marker-color);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .38);
}

.marker-draft-panel > footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.marker-draft-panel > footer button.primary {
  border-color: rgba(155, 210, 126, .58);
  color: #f3f8f0;
  background: rgba(62, 104, 60, .92);
}

.marker-context-menu {
  position: absolute;
  z-index: 9;
  display: grid;
  gap: 4px;
  width: min(230px, calc(100vw - 16px));
  padding: 7px;
  border: 1px solid rgba(231, 239, 229, .18);
  border-radius: 8px;
  background: rgba(13, 18, 15, .97);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .48);
  backdrop-filter: blur(12px);
}

.marker-context-menu > strong {
  overflow: hidden;
  padding: 5px 7px 7px;
  color: #f7c95b;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marker-context-menu button {
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #eef2ea;
  background: transparent;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.marker-context-menu button:hover,
.marker-context-menu button:focus-visible {
  border-color: rgba(155, 210, 126, .58);
  background: rgba(31, 55, 36, .94);
  outline: none;
}

.marker-context-menu button.delete:hover,
.marker-context-menu button.delete:focus-visible {
  border-color: rgba(244, 109, 95, .58);
  color: #ffb4a9;
  background: rgba(85, 29, 25, .84);
}

.marker-color-picker[hidden] {
  display: none;
}

.marker-color-picker {
  position: fixed;
  z-index: 9;
  width: 272px;
  max-height: calc(100vh - 16px);
  overflow: auto;
  padding: 9px;
  border: 1px solid rgba(231, 239, 229, .16);
  border-radius: 10px;
  color: #e8eee5;
  background: rgba(13, 18, 15, .97);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .48);
  backdrop-filter: blur(12px);
}

.marker-color-picker > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  margin-bottom: 8px;
  padding-left: 2px;
}

.marker-color-picker > header strong {
  color: #f7c95b;
  font-size: 13px;
}

.marker-color-picker button {
  display: grid;
  place-items: center;
  border: 1px solid rgba(231, 239, 229, .15);
  color: #eef2ea;
  background: rgba(20, 27, 23, .9);
  cursor: pointer;
}

.marker-color-picker > header button {
  width: 28px;
  height: 28px;
  padding: 5px;
  border-radius: 6px;
}

.marker-color-picker button:hover,
.marker-color-picker button:focus-visible,
.marker-color-picker button.active {
  border-color: rgba(155, 210, 126, .72);
  background-color: rgba(31, 55, 36, .94);
  outline: none;
}

.marker-color-picker svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.marker-color-sv {
  position: relative;
  height: 122px;
  overflow: hidden;
  border: 1px solid rgba(231, 239, 229, .18);
  border-radius: 7px;
  background:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, rgba(255, 255, 255, 0)),
    var(--marker-hue, #f00);
  cursor: crosshair;
  touch-action: none;
}

.marker-color-sv:focus-visible {
  border-color: #9bc985;
  outline: 2px solid rgba(155, 201, 133, .25);
}

.marker-color-cursor {
  position: absolute;
  width: 13px;
  height: 13px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px #000, inset 0 0 0 1px rgba(0, 0, 0, .45);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.marker-color-hue {
  width: 100%;
  height: 14px;
  margin: 8px 0 9px;
  appearance: none;
  border: 1px solid rgba(231, 239, 229, .16);
  border-radius: 999px;
  background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  cursor: pointer;
}

.marker-color-hue::-webkit-slider-thumb {
  width: 14px;
  height: 20px;
  appearance: none;
  border: 2px solid #fff;
  border-radius: 5px;
  background: transparent;
  box-shadow: 0 1px 4px #000;
}

.marker-color-hue::-moz-range-thumb {
  width: 12px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 5px;
  background: transparent;
  box-shadow: 0 1px 4px #000;
}

.marker-color-presets {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  margin: 6px 0 8px;
}

.marker-color-picker button.marker-color-preset {
  width: 21px;
  height: 21px;
  padding: 3px;
  border-radius: 50%;
  background: var(--marker-preset-color);
}

.marker-color-picker button.marker-color-preset.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px #9bc985;
}

.marker-color-value {
  display: grid;
  grid-template-columns: 24px 10px minmax(0, 1fr);
  align-items: center;
  height: 32px;
  padding: 3px 7px 3px 4px;
  border: 1px solid rgba(231, 239, 229, .15);
  border-radius: 6px;
  color: #899488;
  background: rgba(9, 14, 11, .75);
}

.marker-color-preview {
  --marker-color: #f46d5f;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, .78);
  border-radius: 50%;
  background: var(--marker-color);
}

.marker-color-value input {
  width: 100%;
  min-width: 0;
  height: 24px;
  padding: 0;
  border: 0;
  color: #eef2ea;
  background: transparent;
  font: 700 12px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  text-transform: uppercase;
  outline: none;
}

.marker-color-section-title,
.marker-color-favorites-title strong {
  color: #aeb9aa;
  font-size: 11px;
  font-weight: 750;
}

.marker-color-favorites-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 1px 6px;
}

.marker-color-favorites-title span {
  color: #748078;
  font-size: 10px;
}

.marker-color-favorites-title span[hidden] {
  display: none;
}

.marker-color-favorites {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  min-height: 25px;
  gap: 5px;
  padding: 3px;
  border: 1px dashed rgba(231, 239, 229, .12);
  border-radius: 7px;
  background: rgba(9, 14, 11, .45);
}

.marker-color-picker button.marker-color-favorite {
  width: 21px;
  height: 21px;
  padding: 3px;
  border-radius: 50%;
  background: var(--marker-favorite-color);
}

.marker-color-picker button.marker-color-favorite.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px #f7c95b;
}

.marker-color-favorite-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 6px;
}

.marker-color-picker .marker-color-favorite-actions button {
  display: flex;
  min-width: 0;
  height: 32px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 5px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
}

.marker-color-picker .marker-color-favorite-actions svg {
  width: 14px;
  height: 14px;
}

.marker-color-picker button:disabled {
  opacity: .36;
  cursor: default;
  pointer-events: none;
}

.marker-color-picker .delete:not(:disabled):hover,
.marker-color-picker .delete:not(:disabled):focus-visible {
  border-color: rgba(239, 107, 86, .65);
  color: #ff9c8d;
  background: rgba(70, 28, 24, .92);
}

.marker-color-picker > footer {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 7px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(231, 239, 229, .1);
}

.marker-color-picker > footer button {
  display: block;
  height: 34px;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
}

.marker-color-picker > footer button.primary {
  border-color: rgba(155, 210, 126, .68);
  color: #102014;
  background: #9bc985;
}

.marker-color-picker > footer button.primary:hover,
.marker-color-picker > footer button.primary:focus-visible {
  color: #08120a;
  background: #b0db99;
}

.measure-route-actions button[aria-pressed="false"],
.marker-point-actions button[aria-pressed="false"] {
  color: #748078;
}

.measure-route-actions .delete:hover,
.measure-route-actions .delete:focus-visible,
.marker-point-actions .delete:hover,
.marker-point-actions .delete:focus-visible {
  border-color: rgba(239, 107, 86, .65);
  color: #ff9c8d;
  background: rgba(70, 28, 24, .92);
}

.measure-list-empty,
.marker-list-empty {
  margin: 0;
  padding: 18px 12px;
  color: #899488;
  font-size: 12px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 4px;
  color: #94a08f;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 { margin: 0 0 18px; font-size: 21px; }

label { display: block; margin-top: 13px; }
label > span {
  display: block;
  margin-bottom: 6px;
  color: #aeb9ab;
  font-size: 12px;
  font-weight: 650;
}

select, input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid rgba(231, 239, 229, 0.18);
  border-radius: 7px;
  outline: 0;
  color: #eef2ea;
  background: #101613;
}

select:focus, input:focus { border-color: #8ab17c; }

.muted { display: block; margin-top: 14px; color: #98a397; font-size: 12px; }
.status { margin: 13px 0 0; color: #b7c7b2; font-size: 12px; }
.status[data-state="error"] { color: #ffaaa0; }

.coordinates {
  position: absolute;
  z-index: 9;
  bottom: 16px;
  left: 50%;
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  gap: 1px 4px;
  padding: 7px 11px 8px;
  border: 1px solid rgba(216, 231, 210, .16);
  border-radius: 8px;
  color: #dce3da;
  background: rgba(10, 15, 12, .82);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .28);
  backdrop-filter: blur(7px);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  pointer-events: none;
  text-align: center;
  transform: translateX(-50%);
}

.coordinates .gps-grid {
  grid-column: 1 / -1;
  color: #f0f4ee;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .025em;
}
.coordinates-caption { display: none; }
.coordinates > span:nth-of-type(3) b,
.coordinates > span:nth-of-type(4) b { display: none; }
.coordinates > span:nth-of-type(3)::after { content: " /"; color: #849181; }
.coordinates > span:nth-of-type(3),
.coordinates > span:nth-of-type(4) {
  min-width: 0;
  white-space: nowrap;
}

.coordinates b { color: #9eb694; }

.maplibregl-ctrl-group, .maplibregl-ctrl-attrib {
  border: 1px solid rgba(231, 239, 229, .13) !important;
  border-radius: 7px !important;
  background: rgba(13, 18, 15, .88) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .24) !important;
}

.maplibregl-ctrl-group button { width: 34px; height: 34px; }

.maplibregl-ctrl-group button .maplibregl-ctrl-icon {
  filter: invert(1) brightness(1.25);
}

.building-loot-panel[hidden] { display: none; }

.building-loot-panel {
  position: absolute;
  z-index: 7;
  top: 0;
  bottom: 0;
  left: 0;
  display: grid;
  width: min(440px, calc(100vw - 52px));
  min-width: 320px;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(231, 239, 229, .16);
  border-left: 0;
  border-radius: 0;
  color: #eef2ea;
  background:
    linear-gradient(155deg, rgba(25, 36, 29, .98), rgba(10, 15, 12, .985) 42%),
    #0d120f;
  box-shadow: 18px 0 52px rgba(0, 0, 0, .46);
  backdrop-filter: blur(18px);
}

.building-loot-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 20px 18px 24px;
  border-bottom: 1px solid rgba(231, 239, 229, .1);
  background: rgba(9, 14, 11, .34);
}

.building-loot-panel > header > div { min-width: 0; }

.building-loot-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.building-loot-category {
  display: block;
  margin-bottom: 5px;
  color: #9eb694;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.building-loot-panel h2 {
  overflow: hidden;
  margin: 0;
  font-size: 22px;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.building-loot-panel > header button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  padding: 8px;
  border: 1px solid rgba(231, 239, 229, .16);
  border-radius: 8px;
  color: #e9eee7;
  background: rgba(21, 29, 24, .82);
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}

.building-loot-panel > header button:hover,
.building-loot-panel > header button:focus-visible {
  border-color: rgba(247, 201, 91, .58);
  background: rgba(48, 50, 32, .9);
  outline: none;
}

.building-loot-panel > header svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.1;
}

.building-loot-content {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px 26px 24px;
  overscroll-behavior: contain;
  scrollbar-color: rgba(158, 182, 148, .68) transparent;
  scrollbar-width: thin;
}

.building-loot-content::-webkit-scrollbar { width: 7px; }
.building-loot-content::-webkit-scrollbar-track { background: transparent; }
.building-loot-content::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(158, 182, 148, .68);
  background-clip: padding-box;
}
.building-loot-content::-webkit-scrollbar-thumb:hover {
  background: rgba(185, 216, 171, .9);
  background-clip: padding-box;
}

.building-loot-summary {
  display: grid;
  gap: 14px;
}

.building-tier {
  --tier-color: #aeb8b0;
  --tier-border: rgba(174, 184, 176, .42);
  --tier-background: rgba(83, 93, 86, .2);
  width: fit-content;
  padding: 5px 10px;
  border: 1px solid var(--tier-border);
  border-radius: 999px;
  color: var(--tier-color);
  background: var(--tier-background);
  font-size: 12px;
  font-weight: 800;
}

.building-loot-panel > header button[aria-pressed="true"] {
  border-color: rgba(247, 201, 91, .72);
  color: #f7c95b;
  background: rgba(70, 61, 31, .9);
}

.building-tier[data-tier="tier-1"] {
  --tier-color: #a9ce93;
  --tier-border: rgba(125, 166, 106, .5);
  --tier-background: rgba(56, 92, 44, .22);
}

.building-tier[data-tier="tier-2"] {
  --tier-color: #83c8f2;
  --tier-border: rgba(77, 159, 213, .5);
  --tier-background: rgba(31, 93, 133, .22);
}

.building-tier[data-tier="tier-3"] {
  --tier-color: #f3c763;
  --tier-border: rgba(232, 173, 66, .5);
  --tier-background: rgba(112, 72, 14, .23);
}

.building-tier[data-tier="tier-4"] {
  --tier-color: #f29583;
  --tier-border: rgba(226, 106, 85, .52);
  --tier-background: rgba(117, 42, 31, .24);
}

.building-tier[data-tier="unique"] {
  --tier-color: #d8a6f5;
  --tier-border: rgba(183, 122, 230, .55);
  --tier-background: rgba(85, 38, 119, .25);
}

.building-tier[data-tier="dynamic"] {
  --tier-color: #8ee0d0;
  --tier-border: rgba(98, 200, 181, .5);
  --tier-background: rgba(31, 101, 88, .23);
}

.building-loot-summary dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.building-loot-summary dl div {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid rgba(231, 239, 229, .09);
  border-radius: 9px;
  background: rgba(4, 9, 6, .34);
}

.building-loot-summary dt {
  color: #91a08f;
  font-size: 11px;
  line-height: 1.25;
}

.building-loot-summary dd {
  margin: 0;
  color: #f4f5ef;
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.building-loot-average-note {
  margin: -4px 1px 0;
  color: #879586;
  font-size: 10px;
  line-height: 1.4;
}

.building-loot-list-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 12px;
  padding-top: 17px;
  border-top: 1px solid rgba(231, 239, 229, .1);
}

.building-loot-list-heading > div { display: grid; gap: 2px; }
.building-loot-list-heading strong { font-size: 17px; }
.building-loot-list-heading span,
.building-loot-list-heading small {
  color: #859484;
  font-size: 11px;
  line-height: 1.3;
}
.building-loot-list-heading small {
  flex: 0 0 auto;
  text-align: right;
}

.building-loot-probability-note {
  margin: -3px 0 10px;
  color: #788876;
  font-size: 11px;
  line-height: 1.4;
}

.building-loot-group {
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid rgba(231, 239, 229, .1);
  border-radius: 10px;
  background: rgba(4, 9, 6, .28);
}

.building-loot-group > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background: rgba(32, 44, 35, .58);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background .14s ease;
}

.building-loot-group > summary::-webkit-details-marker { display: none; }

.building-loot-group > summary:hover,
.building-loot-group > summary:focus-visible {
  background: rgba(48, 64, 52, .72);
  outline: none;
}

.building-loot-group[open] > summary {
  border-bottom: 1px solid rgba(231, 239, 229, .08);
}

.building-loot-group h3 {
  flex: 1 1 auto;
  margin: 0;
  color: #cbd8c7;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.building-loot-group > summary span {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #b9c8b5;
  background: rgba(0, 0, 0, .28);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.building-loot-group > summary svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: #aebbab;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform .16s ease;
}

.building-loot-group[open] > summary svg { transform: rotate(180deg); }

.building-loot-items { display: grid; }

.building-loot-item {
  display: grid;
  gap: 7px;
  padding: 10px 12px 9px;
  border-bottom: 1px solid rgba(231, 239, 229, .07);
}

.building-loot-item:last-child { border-bottom: 0; }

.building-loot-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.building-loot-item-row > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.building-loot-item-row b {
  overflow: hidden;
  color: #eef2ea;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.building-loot-item-row small {
  color: #839381;
  font-size: 11px;
}

.building-loot-item-row > strong {
  flex: 0 0 auto;
  color: #f7cf6c;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.building-loot-probability {
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(231, 239, 229, .08);
}

.building-loot-probability i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #789f67, #d7bb58);
}

.building-loot-empty,
.building-loot-loading {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 180px;
  padding: 24px;
  border: 1px dashed rgba(231, 239, 229, .14);
  border-radius: 10px;
  color: #a5b2a2;
  text-align: center;
}

.building-loot-empty strong { color: #e8ece5; }
.building-loot-empty span { max-width: 310px; font-size: 12px; line-height: 1.5; }
.building-loot-empty.error { color: #e4958c; }

.building-loot-loading span {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(158, 182, 148, .2);
  border-top-color: #9eb694;
  border-radius: 50%;
  animation: building-loot-spin .8s linear infinite;
}

@keyframes building-loot-spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .panel { top: 8px; left: 8px; width: min(300px, calc(100vw - 16px)); max-height: 55vh; }
  .coordinates { bottom: 16px; }
  .loot-tier-legend {
    bottom: 58px;
    left: 8px;
    grid-template-columns: repeat(3, auto);
  }
  .loot-tier-legend > strong { grid-column: 1 / -1; }
  .measure-panel { right: 50px; bottom: 58px; }
  .app-shell.measure-active .tool-message { right: 50px; bottom: 126px; }
  .measure-list-panel,
  .marker-list-panel { top: 8px; right: 50px; width: min(320px, calc(100vw - 66px)); max-height: calc(100vh - 16px); }
    .map-tools { right: 8px; }
    .map-tools button { width: 34px; height: 34px; }
    .map-search { top: 8px; left: 8px; }
    .map-search-panel { left: 46px; width: min(350px, calc(100vw - 62px)); }
  .building-loot-panel { width: calc(100vw - 44px); min-width: 0; }
  .building-loot-panel > header { padding: 18px 14px 15px 18px; }
  .building-loot-content { padding: 15px 14px 22px 18px; }
  .building-loot-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
