.tf-atlas {
  color: var(--ink); width: 100%; min-width: 0;
  font-family:var(--sans);
}
.tf-atlas * { box-sizing: border-box; }
.tf-atlas-stage {
  position: relative; isolation: isolate; width: 100%; height: clamp(355px, 58svh, 620px);
  background: var(--inset); overflow: hidden; border: 1px solid var(--line-strong);
  border-radius: 14px; touch-action: none; user-select:none; cursor:grab;
}
.tf-atlas-stage:active { cursor:grabbing; }
.tf-atlas-stage:focus-visible,
.tf-atlas button:focus-visible, .tf-atlas select:focus-visible, .tf-atlas a:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
.tf-atlas-canvas,.tf-atlas-pins { position:absolute; inset:0; width:100%; height:100%; }
.tf-atlas-pins { pointer-events:none; overflow:hidden; isolation:isolate; }
.tf-atlas-pin {
  position:absolute; top:0; left:0; display:grid; place-items:center; width:44px; height:44px;
  min-height:0; padding:0; margin:0; border:0; background:transparent; cursor:pointer;
  pointer-events:auto; color:white; border-radius:50%; box-shadow:none;
}
.tf-atlas-pin > span {
  display:grid; place-items:center; background:#c8482e; width:17px; height:17px;
  border:2px solid #fffbed; border-radius:50%; box-shadow:0 1px 3px #27353166;
  font:600 12px/1 -apple-system,BlinkMacSystemFont,sans-serif;
}
.tf-atlas-pin.maybe span { background:#405b6b; }
.tf-atlas-pin.cluster span { min-width:28px; width:auto; height:28px; padding:0 5px; border-radius:50px; }
.tf-atlas-pin.hotel { z-index:1; width:44px; height:44px; }
.tf-atlas-pin.hotel span {
  display:inline-flex; align-items:center; justify-content:center; gap:3px;
  width:30px; height:30px; border-radius:7px; background:#195448; color:#fffdf3;
}
.tf-atlas-pin.hotel.cluster span { width:auto; min-width:38px; padding:0 4px; }
.tf-atlas-pin.hotel .ico { width:19px; height:19px; stroke-width:2; }
.tf-atlas-pin:not(.cluster):hover span,.tf-atlas-pin.is-selected span { outline:2px solid var(--ink); outline-offset:2px; }
.tf-atlas-controls {
  position:absolute; top:12px; right:12px; display:flex; flex-direction:column;
  overflow:hidden; border-radius:6px; border:1px solid var(--line-strong); box-shadow:0 2px 8px #2b27191a;
}
.tf-atlas-controls button,.tf-atlas-close {
  display:grid; place-items:center; padding:0; border:0; margin:0;
  background:var(--surface); color:var(--ink); border-radius:0; min-height:44px; width:44px;
  cursor:pointer; font:400 24px/1 -apple-system,BlinkMacSystemFont,sans-serif;
}
.tf-atlas-controls button + button { border-top:1px solid var(--line); }
.tf-atlas-controls button:hover,.tf-atlas-close:hover,.tf-atlas-choice:hover { background:var(--inset); }
.tf-atlas-controls button:disabled { color:var(--muted); cursor:default; }
.tf-atlas-compass {
  position:absolute; display:flex; align-items:center; flex-direction:column; gap:2px; top:13px; left:15px;
  color:var(--muted); font:600 10px/1 ui-monospace,monospace; text-shadow:0 0 2px var(--surface);pointer-events:none;
}
.tf-atlas-compass::before {content:"";display:block;width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:13px solid var(--muted); }
.tf-atlas-scale {
  position:absolute; bottom:12px; left:12px;border:solid var(--muted);border-width:0 1px 2px;
  color:var(--ink); text-align:center; font:600 10px/1 ui-monospace,monospace;
  padding:0 0 3px;background:var(--surface);white-space:nowrap;pointer-events:none;
}
.tf-atlas-popup {
  position:absolute; bottom:13px; left:50%; transform:translateX(-50%);
  width:min(380px,calc(100% - 24px)); border:1px solid var(--line-strong); border-radius:7px;
  background:var(--surface); padding:0 12px 8px; box-shadow:0 3px 18px #28271d2e; cursor:auto;
}
.tf-atlas-popup[hidden] { display:none; }
.tf-atlas-popup-top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.tf-atlas-kicker {font:600 12px/1.3 ui-monospace,monospace;letter-spacing:.04em;color:var(--muted);text-transform:uppercase;}
.tf-atlas-close { min-height:44px; width:44px; margin-right:-8px; background:transparent; border-radius:6px; }
.tf-atlas-selection { max-height:min(30vh,170px);overflow:auto;overscroll-behavior:contain;touch-action:pan-y; }
.tf-atlas-choice {
  display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:44px;
  color:var(--ink);text-align:left;background:transparent;border:0;border-top:1px solid var(--line);padding:5px 0;cursor:pointer;
}
.tf-atlas-choice strong {font:600 16px/1.3 -apple-system,BlinkMacSystemFont,sans-serif;}
.tf-atlas-choice span {font:600 13px/1.2 -apple-system,BlinkMacSystemFont,sans-serif;color:var(--accent);text-decoration:underline;flex-shrink:0;}
.tf-atlas-bar {display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding-top:9px;}
.tf-atlas-legend {display:flex;align-items:center;gap:15px;font-size:14px;}
.tf-atlas-legend span {display:inline-flex;align-items:center;gap:6px;}
.tf-atlas-legend span > i {display:inline-block;width:9px;height:9px;border-radius:50%;}
.tf-atlas-legend .must {background:#c8482e;} .tf-atlas-legend .maybe {background:#405b6b;}
.tf-atlas-legend span > .tf-atlas-hotel-key {
  display:grid; place-items:center; width:21px; height:21px; border-radius:5px;
  background:#195448; color:#fffdf3;
}
.tf-atlas-hotel-key .ico { width:16px; height:16px; stroke-width:2; }
.tf-atlas-picker {width:auto;min-width:0;max-width:55%;min-height:44px;border:1px solid var(--line-strong);background-color:var(--surface);color:var(--ink);border-radius:5px;padding:7px 22px 7px 9px;text-overflow:ellipsis;font-size:16px;}
.tf-atlas-caption {margin:7px 0 0;font:400 12px/1.5 -apple-system,BlinkMacSystemFont,sans-serif;color:var(--muted);}
.tf-atlas-caption a { color:inherit; text-decoration:underline; text-underline-offset:2px; }
.tf-atlas-empty {position:absolute;bottom:30px;left:50%;transform:translateX(-50%);padding:10px 12px;background:var(--surface);border-radius:4px;color:var(--ink);font-size:15px;text-align:center;width:max-content;max-width:90%;}
@media (max-width:760px) {
  .tf-atlas-stage { height:clamp(265px,calc(100svh - 320px - env(safe-area-inset-top) - env(safe-area-inset-bottom)),620px); }
  .tf-atlas-picker { flex:1 1 170px; max-width:100%; }
  .tf-atlas-bar { gap:6px 10px; }
}
:root[data-theme="dark"] .tf-atlas-pin.must > span { background:#c04f34; }
:root[data-theme="dark"] .tf-atlas-pin.maybe > span { background:#4e7289; }
:root[data-theme="dark"] .tf-atlas-pin.hotel > span { background:#346c58; }
:root[data-theme="dark"] .tf-atlas-pin > span { border-color:#e1e8d8; }
.tf-atlas-picker { color:var(--ink); }
