/* Cebu Property Atlas — /atlas/
   Mobile-first. Reuses the site tokens from /css/style.css (ivory canvas,
   brand red / blue / gold, DM Serif Display + DM Sans). */

body.atlas-page { padding-bottom: 0; }

.atlas {
  --ap-w: 340px;
  --card-w: 380px;
  --pre: var(--red, #D6261D);
  --rfo: var(--blue, #1B49B8);
  --done: var(--gold, #E8B007);
  position: relative;
  height: calc(100vh - var(--atlas-top, 110px));
  height: calc(100dvh - var(--atlas-top, 110px));
  min-height: 460px;
  overflow: hidden;
  background: var(--off-white, #F4EFE3);
  isolation: isolate;
}

.atlas-map { position: absolute; inset: 0; }
.atlas-map canvas { outline: none; }
.atlas-map.is-hover canvas { cursor: pointer; }

/* ── Fallback message (tiles or WebGL unavailable) ── */
.atlas-msg {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 72px 20px 0;
  background: var(--off-white, #F4EFE3);
}
.atlas-msg[hidden] { display: none; }
.atlas-msg-box {
  max-width: 360px; text-align: center;
  background: var(--paper, #fff); border: 1px solid var(--line, #E5DDC9);
  border-radius: 14px; padding: 22px 22px 20px;
}
.atlas-msg-box strong { font-family: var(--display); font-weight: 400; font-size: 22px; display: block; line-height: 1.2; }
.atlas-msg-box p { margin: 8px 0 14px; color: var(--ink-3, #6E6557); font-size: 14px; }
.atlas-noscript { position: absolute; top: 16px; left: 16px; right: 16px; z-index: 2; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 14px; }

/* ── Floating tower labels ── */
.atlas-labels { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.atlas-label {
  position: absolute; left: 0; top: 0;
  pointer-events: auto; cursor: pointer;
  border: 0; margin: 0;
  font: 600 12px/1.2 var(--sans); color: var(--ink, #14110B);
  background: rgba(255,255,255,.94);
  padding: 5px 9px; border-radius: 999px;
  box-shadow: 0 2px 10px rgba(20,17,11,.18);
  white-space: nowrap;
  will-change: transform;
}
.atlas-label::after {
  content: ""; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px;
  background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 1px;
}
.atlas-label[hidden] { display: none; }
.atlas-label.is-on { background: var(--ink, #14110B); color: #fff; }

/* ── Hover tooltip (desktop) ── */
.atlas-tip {
  position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none;
  background: var(--ink, #14110B); color: #fff;
  font: 500 12px/1.35 var(--sans);
  padding: 7px 10px; border-radius: 8px; white-space: nowrap;
  box-shadow: 0 6px 20px rgba(20,17,11,.25);
}
.atlas-tip[hidden] { display: none; }
.atlas-tip b { display: block; font-weight: 700; font-size: 13px; }

/* ── Touch hint ── */
.atlas-hint {
  position: absolute; left: 50%; bottom: 146px; transform: translateX(-50%); z-index: 5;
  background: rgba(20,17,11,.86); color: #fff; font: 500 12px/1 var(--sans);
  padding: 9px 14px; border-radius: 999px; pointer-events: none;
  transition: opacity .4s;
}
.atlas-hint[hidden] { display: none; }
.atlas-hint.is-out { opacity: 0; }
.atlas.has-card .atlas-hint, .atlas-nomap .atlas-hint { display: none; }

/* ── Legend ── */
.atlas-legend {
  position: absolute; left: 10px; top: 10px; z-index: 4;
  display: flex; flex-direction: column; gap: 5px;
  background: rgba(255,255,255,.94); border: 1px solid var(--line, #E5DDC9);
  border-radius: 10px; padding: 8px 10px;
  font: 500 11px/1 var(--sans); color: var(--ink-2, #3A332A);
}
.atlas-legend span { display: flex; align-items: center; gap: 7px; }
.atlas-legend i { width: 10px; height: 10px; border-radius: 2px; display: block; }
.lg-pre { background: var(--pre); } .lg-rfo { background: var(--rfo); } .lg-done { background: var(--done); }

/* ── Reset view ── */
.atlas-reset {
  position: absolute; right: 10px; top: 118px; z-index: 4;
  background: #fff; border: 0; border-radius: 8px;
  box-shadow: 0 0 0 2px rgba(0,0,0,.1);
  font: 600 11px/1 var(--sans); color: var(--ink, #14110B);
  padding: 9px 10px; cursor: pointer;
}
.atlas-reset:hover { background: var(--off-white, #F4EFE3); }
.atlas-nomap .atlas-reset, .atlas-nomap .atlas-legend, .atlas-nomap .atlas-labels { display: none; }

/* ── Project panel: bottom sheet (mobile) ── */
.atlas-panel {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 7;
  height: var(--sheet-h, 132px); max-height: 86%;
  display: flex; flex-direction: column;
  background: var(--white, #FBF8F2);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 30px rgba(20,17,11,.16);
  transition: height .28s cubic-bezier(.2,.8,.2,1);
}
.atlas-panel.is-drag { transition: none; }
.atlas.has-card .atlas-panel { display: none; }

.ap-head { flex: none; padding: 8px 16px 6px; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.ap-grab { display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-dark, #D6CBB1); margin: 0 auto 8px; }
.ap-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ap-title h1 { font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.15; margin: 0; color: var(--ink, #14110B); letter-spacing: -.01em; }
.ap-title h1 em { font-style: italic; color: var(--blue, #1B49B8); }
.ap-count { font: 600 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3, #6E6557); white-space: nowrap; }

.ap-filters { flex: none; display: flex; align-items: center; gap: 8px; padding: 4px 16px 10px; }
.ap-filters[hidden] { display: none; }
.ap-chips { display: flex; gap: 6px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; padding: 2px 0; }
.ap-chips::-webkit-scrollbar { display: none; }
.ap-chip {
  flex: none; border: 1px solid var(--line-dark, #D6CBB1); background: #fff; color: var(--ink-2, #3A332A);
  font: 500 12px/1 var(--sans); padding: 8px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.ap-chip[aria-pressed="true"] { background: var(--ink, #14110B); border-color: var(--ink, #14110B); color: #fff; }
.ap-city { flex: none; display: flex; align-items: center; }
.ap-city span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ap-city select {
  font: 500 16px/1 var(--sans); /* 16px: no iOS zoom on focus */
  color: var(--ink, #14110B); background: #fff;
  border: 1px solid var(--line-dark, #D6CBB1); border-radius: 999px;
  padding: 5px 8px; max-width: 132px;
}

.ap-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0 16px 20px; border-top: 1px solid var(--line, #E5DDC9); }
.ap-intro { font-size: 13.5px; line-height: 1.5; color: var(--ink-3, #6E6557); margin: 12px 0 6px; }
.ap-list { list-style: none; margin: 0; padding: 0; }
.ap-list li { border-bottom: 1px solid var(--line, #E5DDC9); }
.ap-list li[hidden] { display: none; }
.ap-list a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 12px 2px; color: inherit; text-decoration: none; }
.ap-list a strong { font: 600 15px/1.25 var(--sans); color: var(--ink, #14110B); grid-column: 1; }
.ap-list a > span { font-size: 12.5px; line-height: 1.3; color: var(--ink-3, #6E6557); grid-column: 1; }
.ap-list a .ap-meta { grid-column: 2; grid-row: 1 / span 2; text-align: right; font: 600 12.5px/1.3 var(--sans); color: var(--ink, #14110B); white-space: nowrap; }
.ap-list a .ap-meta small { display: flex; align-items: center; justify-content: flex-end; gap: 5px; font: 500 11px/1.4 var(--sans); color: var(--ink-3, #6E6557); }
.ap-list a .ap-meta i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.ap-list a:hover strong, .ap-list a.is-on strong { color: var(--red, #D6261D); }
.ap-list a.is-on { background: var(--off-white, #F4EFE3); margin: 0 -8px; padding-left: 10px; padding-right: 10px; border-radius: 8px; }
.ap-empty, .ap-more { font-size: 13px; color: var(--ink-3, #6E6557); margin: 14px 0 0; }
.ap-empty[hidden] { display: none; }
.ap-more a { color: var(--blue, #1B49B8); text-decoration: underline; }

/* ── Project card: bottom sheet (mobile) ── */
.atlas-card {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 8;
  max-height: 66%;
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  background: var(--white, #FBF8F2);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 30px rgba(20,17,11,.2);
}
.atlas-card[hidden] { display: none; }
.ac-hero { position: relative; height: 112px; background: var(--warm-gray, #ECE5D2); }
.ac-hero img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 18px 18px 0 0; }
.ac-close {
  position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: rgba(20,17,11,.72); color: #fff; font: 400 22px/1 var(--sans); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.ac-badge {
  position: absolute; left: 12px; bottom: 12px;
  font: 700 10px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase;
  color: #fff; padding: 6px 9px; border-radius: 6px; background: var(--pre);
}
.ac-badge[data-status="RFO"] { background: var(--rfo); }
.ac-badge[data-status="completed"] { background: var(--done); color: var(--ink, #14110B); }
.ac-in { padding: 14px 16px 18px; }
.ac-name { font-family: var(--display); font-weight: 400; font-size: 25px; line-height: 1.12; margin: 0; color: var(--ink, #14110B); letter-spacing: -.01em; }
.ac-sub { font-size: 13px; color: var(--ink-3, #6E6557); margin: 4px 0 0; line-height: 1.4; }
.ac-facts { display: flex; flex-wrap: wrap; gap: 0; margin: 12px 0 0; padding: 0; border: 1px solid var(--line, #E5DDC9); border-radius: 10px; background: #fff; }
.ac-facts div { flex: 1 1 0; min-width: 84px; padding: 9px 11px; border-right: 1px solid var(--line, #E5DDC9); }
.ac-facts div:last-child { border-right: 0; }
.ac-facts dt { font: 600 10px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3, #6E6557); }
.ac-facts dd { margin: 5px 0 0; font: 600 14px/1.25 var(--sans); color: var(--ink, #14110B); }
.ac-price { margin: 12px 0 0; font: 400 15px/1.2 var(--sans); color: var(--ink-2, #3A332A); }
.ac-price b { font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--red, #D6261D); margin-left: 4px; }
.ac-desc { margin: 14px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink-2, #3A332A); }
.ac-cta { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; }
.ac-wa {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #1FAF54; color: #fff; text-decoration: none;
  font: 700 15px/1 var(--sans); padding: 16px 18px; border-radius: 10px;
}
.ac-wa:hover { background: #17964A; }
.ac-wa svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.ac-more {
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--ink, #14110B); color: var(--ink, #14110B); text-decoration: none;
  font: 600 14px/1 var(--sans); padding: 13px 18px; border-radius: 10px; background: transparent;
}
.ac-more:hover { background: var(--ink, #14110B); color: #fff; }
.ac-note { margin: 12px 0 0; font-size: 11px; line-height: 1.45; color: var(--ink-4, #A89F8B); }

/* ── Phase 2: payment calculator + lead form (inside the project card) ── */
.ac-calc { margin: 12px 0 0; }
.ac-calc[hidden] { display: none; }
.cc-open {
  width: 100%; border: 1.5px solid var(--red, #D6261D); background: #fff; color: var(--red, #D6261D);
  font: 700 15px/1 var(--sans); padding: 15px 18px; border-radius: 10px; cursor: pointer;
}
.cc-open:hover { background: var(--red, #D6261D); color: #fff; }
.ac-calc:not(:empty) > .cc-head ~ * { margin-top: 12px; }
.cc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line, #E5DDC9); }
.cc-head h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 21px; line-height: 1.2; color: var(--ink, #14110B); }
.cc-x, .cc-link { border: 0; background: none; color: var(--ink-3, #6E6557); font: 500 13px/1 var(--sans); text-decoration: underline; cursor: pointer; padding: 8px 4px; }
.cc-link { display: block; margin-left: auto; margin-right: auto; }
.cc-f { display: block; }
.cc-f > span { display: block; font: 600 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3, #6E6557); margin-bottom: 6px; }
.cc-f > span small { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 4px; }
.cc-f select, .cc-f input {
  width: 100%; box-sizing: border-box; min-height: 48px; padding: 10px 12px;
  border: 1px solid var(--line-dark, #D6CBB1); border-radius: 10px; background: #fff; color: var(--ink, #14110B);
  font: 500 16px/1.2 var(--sans);   /* 16px: no zoom on focus on iOS */
}
.cc-f select:focus, .cc-f input:focus { outline: 2px solid var(--blue, #1B49B8); outline-offset: 1px; }
.cc-f--row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cc-f--row > span { margin: 0; }
.cc-f--row select { width: auto; min-width: 150px; }
.cc-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-seg button {
  flex: 1 1 auto; min-height: 46px; padding: 8px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line-dark, #D6CBB1); background: #fff; color: var(--ink-2, #3A332A); font: 600 14px/1.15 var(--sans);
}
.cc-seg button[aria-pressed="true"] { background: var(--ink, #14110B); border-color: var(--ink, #14110B); color: #fff; }
.cc-res { margin: 14px 0 0; padding: 4px 14px; background: #fff; border: 1px solid var(--line, #E5DDC9); border-radius: 12px; }
.cc-res > div { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line, #E5DDC9); }
.cc-res > div:last-child { border-bottom: 0; }
.cc-res dt { font: 500 13.5px/1.3 var(--sans); color: var(--ink-2, #3A332A); }
.cc-res dt small { display: block; font-size: 11.5px; line-height: 1.35; color: var(--ink-3, #6E6557); margin-top: 2px; font-weight: 400; }
.cc-res dd { margin: 0; text-align: right; font: 600 15px/1.3 var(--sans); color: var(--ink, #14110B); white-space: nowrap; }
.cc-res dd i { font-style: normal; font-weight: 500; font-size: 12px; color: var(--ink-3, #6E6557); }
.cc-res dd em { display: block; font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--ink-3, #6E6557); }
.cc-res .is-big dd { font-family: var(--display); font-weight: 400; font-size: 21px; color: var(--red, #D6261D); }
.cc-res .is-big dd i, .cc-res .is-big dd em { font-family: var(--sans); }
.cc-note { margin: 8px 0 0 !important; font-size: 12.5px; line-height: 1.45; color: var(--ink-3, #6E6557); }
.ac-calc .ac-wa { margin-top: 14px; }
.cc-mail, .cc-send {
  width: 100%; min-height: 50px; border-radius: 10px; cursor: pointer; font: 600 15px/1 var(--sans); padding: 14px 18px;
  border: 1px solid var(--ink, #14110B); background: transparent; color: var(--ink, #14110B);
}
.cc-send { background: var(--ink, #14110B); color: #fff; }
.cc-send[disabled] { opacity: .65; cursor: progress; }
.cc-form { display: grid; gap: 12px; padding: 14px; background: var(--off-white, #F4EFE3); border-radius: 12px; }
.cc-form > * { margin: 0 !important; }
.cc-form-t { font: 700 15px/1.2 var(--sans); color: var(--ink, #14110B); }
.cc-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cc-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; line-height: 1.45; color: var(--ink-2, #3A332A); cursor: pointer; }
.cc-consent input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--red, #D6261D); }
.cc-err { padding: 10px 12px; border-radius: 8px; background: #fdecec; border: 1px solid #f3b4b4; color: #8a1c1c; font-size: 13.5px; line-height: 1.4; }
.cc-err[hidden], #cc-fallback[hidden] { display: none; }
.cc-ok { padding: 16px; border-radius: 12px; background: #ecf8ef; border: 1px solid #b7e2c2; color: #14532d; }
.cc-ok strong { display: block; font: 700 17px/1.25 var(--sans); }
.cc-ok span { display: block; font-size: 14px; margin-top: 4px; }
/* Mobile: give the sheet more room while the calculator is open */
.atlas.has-calc .atlas-card { max-height: 88%; }
/* One WhatsApp button at a time: the calculator has its own */
.atlas.has-calc #ac-wa-general { display: none; }

/* ── "Ask on WhatsApp" popup (appended to <body>; bottom sheet on phones, centred on desktop) ── */
.atlas-ask {
  position: fixed; inset: 0; z-index: 4000; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(20, 17, 11, .55); font-family: var(--sans, system-ui, sans-serif);
}
.atlas-ask[hidden] { display: none; }
.aa-box {
  position: relative; box-sizing: border-box; width: 100%; max-height: 92%; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--paper, #FBF8F1); color: var(--ink, #14110B);
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px)); border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 40px rgba(20, 17, 11, .25);
}
.aa-box > * { margin: 0; }
.aa-x {
  position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink, #14110B); font-size: 26px; line-height: 1; cursor: pointer;
}
.aa-x:hover { background: rgba(20, 17, 11, .08); }
.aa-kick { font: 700 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: #17964A; }
.aa-title { margin: 8px 44px 0 0; font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.15; color: var(--ink, #14110B); }
.aa-lede { margin-top: 10px; font-size: 15px; line-height: 1.5; color: var(--ink-2, #3A332A); }
.aa-sum { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--off-white, #F4EFE3); font-size: 13px; line-height: 1.45; color: var(--ink-2, #3A332A); }
.aa-form { display: grid; gap: 14px; margin-top: 16px; }
.aa-form > * { margin: 0; }
.aa-send {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px;
  border: 0; border-radius: 10px; background: #1FAF54; color: #fff; cursor: pointer;
  font: 700 16px/1 var(--sans); padding: 16px 18px;
}
.aa-send:hover { background: #17964A; }
.aa-send[disabled] { opacity: .65; cursor: progress; }
.aa-send svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.aa-link { display: block; text-align: center; font: 600 14px/1.3 var(--sans); color: var(--ink-2, #3A332A); text-decoration: underline; padding: 8px 4px; }
.aa-link[hidden] { display: none; }
.aa-note { font-size: 11.5px; line-height: 1.45; color: var(--ink-3, #6E6557); }
.aa-box > .cc-ok { margin-top: 14px; }
.aa-box > .aa-send { margin-top: 14px; }
.aa-box > .aa-link { margin-top: 6px; }
@media (min-width: 640px) {
  .atlas-ask { align-items: center; padding: 20px; }
  .aa-box { max-width: 440px; padding: 30px 28px 26px; border-radius: 18px; box-shadow: 0 24px 60px rgba(20, 17, 11, .35); }
}

/* MapLibre controls: sit clear of the sheet */
.atlas .maplibregl-ctrl-bottom-left, .atlas .maplibregl-ctrl-bottom-right { display: none; }
.atlas-attrib {
  position: absolute; right: 6px; top: 6px; z-index: 3;
  font: 400 10px/1.2 var(--sans); color: var(--ink-3, #6E6557);
  background: rgba(255,255,255,.7); padding: 2px 6px; border-radius: 4px;
}
.atlas-attrib a { color: inherit; text-decoration: underline; }
.atlas .maplibregl-ctrl-top-right { top: 20px; }

/* ── Desktop: left sidebar + right card ── */
@media (min-width: 900px) {
  .atlas-panel {
    left: 16px; top: 16px; bottom: 16px; right: auto;
    width: var(--ap-w); height: auto; max-height: none;
    border-radius: 16px; border: 1px solid var(--line, #E5DDC9);
    box-shadow: 0 12px 40px rgba(20,17,11,.14);
    transition: none;
  }
  .atlas.has-card .atlas-panel { display: flex; }
  .ap-head { padding: 18px 20px 8px; cursor: default; touch-action: auto; }
  .ap-grab { display: none; }
  .ap-title { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ap-title h1 { font-size: 30px; }
  .ap-filters { flex-wrap: wrap; padding: 6px 20px 14px; }
  .ap-chips { flex-wrap: wrap; overflow: visible; flex-basis: 100%; }
  .ap-city select { font-size: 13px; padding: 7px 10px; max-width: none; }
  .ap-body { padding: 0 20px 20px; }

  .atlas-card {
    left: auto; right: 16px; top: 16px; bottom: auto;
    width: var(--card-w); max-height: calc(100% - 32px);
    border-radius: 16px; border: 1px solid var(--line, #E5DDC9);
    box-shadow: 0 12px 40px rgba(20,17,11,.18);
  }
  .ac-hero { height: 200px; }
  .ac-hero img { border-radius: 15px 15px 0 0; }
  .ac-in { padding: 18px 20px 20px; }
  .ac-name { font-size: 30px; }

  .atlas-legend { left: calc(var(--ap-w) + 32px); top: 16px; flex-direction: row; gap: 14px; padding: 10px 14px; font-size: 12px; }
  .atlas-reset { right: 16px; top: auto; bottom: 16px; padding: 11px 14px; font-size: 12px; }
  .atlas .maplibregl-ctrl-top-right { top: auto; bottom: 62px; right: 6px; }
  .atlas-attrib { right: 120px; top: auto; bottom: 22px; }
  .atlas.has-card .maplibregl-ctrl-top-right,
  .atlas.has-card .atlas-reset { right: calc(var(--card-w) + 22px); }
  .atlas.has-card .atlas-reset { right: calc(var(--card-w) + 32px); }
  .atlas.has-card .atlas-attrib { right: calc(var(--card-w) + 136px); }
  .atlas-msg { padding-left: calc(var(--ap-w) + 40px); align-items: center; padding-top: 0; }
  .atlas-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-panel, .atlas-hint { transition: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 3 — all projects, filters, Layers menu, timeline, landmarks, zonal
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Layers menu (region, landmarks, zonal values, map key) ── */
.atlas-layers { position: absolute; left: 10px; top: 10px; z-index: 6; max-width: calc(100% - 70px); }
.al-btn {
  background: #fff; border: 0; border-radius: 10px; box-shadow: 0 0 0 2px rgba(0,0,0,.1);
  font: 600 13px/1 var(--sans); color: var(--ink, #14110B); padding: 11px 14px 11px 34px; cursor: pointer; position: relative;
}
.al-btn::before {
  content: ""; position: absolute; left: 12px; top: 50%; width: 14px; height: 12px; transform: translateY(-50%);
  background: linear-gradient(var(--ink, #14110B), var(--ink, #14110B)) 0 0 / 100% 2px no-repeat,
              linear-gradient(var(--ink, #14110B), var(--ink, #14110B)) 0 5px / 100% 2px no-repeat,
              linear-gradient(var(--ink, #14110B), var(--ink, #14110B)) 0 10px / 100% 2px no-repeat;
}
.al-btn[aria-expanded="true"] { background: var(--ink, #14110B); color: #fff; }
.al-btn[aria-expanded="true"]::before { filter: invert(1); }
.al-menu {
  margin-top: 8px; width: 264px; max-width: 100%; max-height: min(62vh, 460px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--white, #FBF8F2); border: 1px solid var(--line, #E5DDC9); border-radius: 12px;
  box-shadow: 0 12px 34px rgba(20,17,11,.18); padding: 12px 14px;
}
.al-menu[hidden], .al-sec[hidden], .al-tog[hidden] { display: none; }
.al-sec { padding: 10px 0 2px; border-top: 1px solid var(--line, #E5DDC9); margin-top: 10px; }
.al-sec:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.al-h { display: block; font: 600 10.5px/1 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3, #6E6557); margin-bottom: 8px; }
.al-seg button { min-height: 40px; font-size: 13px; }
.al-tog { display: flex; align-items: center; gap: 10px; min-height: 44px; font: 600 14px/1.2 var(--sans); color: var(--ink, #14110B); cursor: pointer; }
.al-tog input { width: 22px; height: 22px; margin: 0; accent-color: var(--red, #D6261D); flex: none; }
.al-note { margin: 8px 0 0; font-size: 11px; line-height: 1.45; color: var(--ink-3, #6E6557); }
/* the map key now lives inside the menu */
.atlas .atlas-legend {
  position: static; display: flex; flex-direction: column; gap: 7px; background: none; border: 0; border-radius: 0; padding: 0;
  font: 500 12.5px/1.25 var(--sans); color: var(--ink-2, #3A332A);
}
.atlas-legend span { display: flex; align-items: center; gap: 8px; }
.atlas .atlas-legend i { width: 12px; height: 12px; border-radius: 3px; display: block; flex: none; }
.lg-ghost { background: rgba(214,38,29,.2); outline: 1px dashed var(--red, #D6261D); outline-offset: -1px; }
.lg-tba { background: rgba(142,134,118,.3); outline: 1px dashed #8E8676; outline-offset: -1px; }
.atlas .atlas-legend i.lg-feat { background: rgba(232,176,7,.4); border-radius: 50%; }
.atlas .atlas-legend i.lg-area { background: #EBA9A0; border-radius: 50%; }

/* ── Search + filters in the list panel ── */
.ap-tools { flex: none; display: flex; gap: 8px; padding: 4px 16px 10px; }
.ap-tools[hidden], .ap-fpanel[hidden] { display: none; }
#ap-q {
  flex: 1; min-width: 0; min-height: 44px; box-sizing: border-box; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--line-dark, #D6CBB1); background: #fff; color: var(--ink, #14110B); font: 500 16px/1.2 var(--sans);
  -webkit-appearance: none; appearance: none;
}
#ap-q:focus { outline: 2px solid var(--blue, #1B49B8); outline-offset: 1px; }
.ap-fbtn {
  flex: none; min-height: 44px; padding: 8px 14px; border-radius: 10px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line-dark, #D6CBB1); background: #fff; color: var(--ink, #14110B); font: 600 13.5px/1 var(--sans);
}
.ap-fbtn.is-on, .ap-fbtn[aria-expanded="true"] { background: var(--ink, #14110B); border-color: var(--ink, #14110B); color: #fff; }
.ap-fpanel { flex: none; max-height: 46%; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 14px; border-top: 1px solid var(--line, #E5DDC9); background: var(--off-white, #F4EFE3); }
.af-devs { margin: 8px 0 4px; }
.af-devs summary { cursor: pointer; font: 600 13.5px/1 var(--sans); color: var(--ink, #14110B); padding: 10px 0; }
.af-devs summary b { color: var(--red, #D6261D); font-weight: 700; }
.af-checks { max-height: 168px; overflow-y: auto; background: #fff; border: 1px solid var(--line, #E5DDC9); border-radius: 10px; padding: 4px 10px; }
.af-checks label { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 13.5px; color: var(--ink-2, #3A332A); cursor: pointer; }
.af-checks input, .af-tog input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--red, #D6261D); }
.af-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin: 8px 0; }
.af-grid label span { display: block; font: 600 10.5px/1 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3, #6E6557); margin-bottom: 5px; }
.af-grid select {
  width: 100%; min-height: 42px; box-sizing: border-box; padding: 6px 8px; border-radius: 9px;
  border: 1px solid var(--line-dark, #D6CBB1); background: #fff; color: var(--ink, #14110B); font: 500 16px/1.2 var(--sans);
}
.af-tog { display: flex; align-items: center; gap: 10px; min-height: 40px; font: 600 13.5px/1.2 var(--sans); color: var(--ink, #14110B); cursor: pointer; }
.af-clear { margin-top: 6px; border: 0; background: none; padding: 8px 0; color: var(--ink-3, #6E6557); font: 500 13px/1 var(--sans); text-decoration: underline; cursor: pointer; }
.ap-list a .ap-meta small.ap-nopin { color: var(--ink-4, #A89F8B); font-style: italic; }

/* ── Tower / project labels ── */
.atlas-label { display: inline-flex; align-items: center; gap: 5px; }
.atlas-label svg { width: 13px; height: 13px; fill: currentColor; flex: none; }
.atlas-label.is-featured { box-shadow: 0 2px 10px rgba(20,17,11,.18), 0 0 0 2px rgba(232,176,7,.75); }
.atlas-label.is-house { color: var(--ink-2, #3A332A); }
.atlas-label.is-compact { padding: 6px; }
.atlas-label.is-compact span { display: none; }

/* ── Future skyline timeline ── */
.atlas-time {
  position: absolute; left: 10px; right: 10px; bottom: 142px; z-index: 6;
  display: flex; align-items: center; gap: 10px;
  background: rgba(251,248,242,.96); border: 1px solid var(--line, #E5DDC9); border-radius: 14px;
  box-shadow: 0 6px 22px rgba(20,17,11,.14); padding: 8px 12px 8px 8px;
}
.atlas-time[hidden] { display: none; }
.atlas.has-card .atlas-time, .atlas-nomap .atlas-time, .atlas-nomap .atlas-layers { display: none; }
.at-play {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--ink, #14110B); color: #fff; font: 400 14px/1 var(--sans); display: flex; align-items: center; justify-content: center;
}
.at-play[aria-pressed="true"] { background: var(--red, #D6261D); font-size: 11px; letter-spacing: -1px; }
.at-year { flex: none; min-width: 62px; font-family: var(--display); font-size: 30px; line-height: 1; color: var(--ink, #14110B); text-align: center; }
.at-track { flex: 1; min-width: 0; }
.at-track input[type=range] { width: 100%; height: 30px; margin: 0; accent-color: var(--red, #D6261D); cursor: pointer; touch-action: none; }
.at-ends { display: flex; justify-content: space-between; font: 500 10.5px/1 var(--sans); color: var(--ink-3, #6E6557); margin-top: -2px; }
.atlas .atlas-hint { bottom: 214px; }

/* ── Project card additions ── */
.ac-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.ac-tags:empty { display: none; }
.ac-when {
  display: inline-block; font: 700 11px/1 var(--sans); letter-spacing: .04em; padding: 6px 9px; border-radius: 6px;
  background: var(--red, #D6261D); color: #fff; border: 1px solid var(--red, #D6261D);
}
.ac-when.is-built { background: var(--blue, #1B49B8); border-color: var(--blue, #1B49B8); }
.ac-when.is-ghost { background: rgba(214,38,29,.08); color: var(--red, #D6261D); border-style: dashed; }
.ac-when.is-approx { background: var(--off-white, #F4EFE3); color: var(--ink-2, #3A332A); border: 1px dashed var(--ink-4, #A89F8B); }
.atlas .atlas-legend i.lg-approx { background: #E08A82; border-radius: 50%; width: 9px; height: 9px; margin: 0 1.5px; }
.ac-towers { width: 100%; border-collapse: collapse; margin: 10px 0 0; font-size: 13px; }
.ac-towers th, .ac-towers td { text-align: left; padding: 7px 4px; border-bottom: 1px solid var(--line, #E5DDC9); font-weight: 500; color: var(--ink-2, #3A332A); }
.ac-towers th { font-weight: 600; color: var(--ink, #14110B); }
.ac-towers td:last-child { text-align: right; }
.ac-note.ac-note--tight { margin-top: 6px; }
.ac-extra:empty { display: none; }
.ac-extra { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line, #E5DDC9); }
.ax-zonal { margin: 0 0 10px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2, #3A332A); }
.ax-zonal b { color: var(--ink, #14110B); }
.ax-zonal small { display: block; font-size: 11.5px; color: var(--ink-3, #6E6557); }
.ax-around h3 { margin: 0 0 4px; font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--ink, #14110B); }
.ax-cat h4 { display: flex; align-items: center; gap: 7px; margin: 12px 0 2px; font: 600 10.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3, #6E6557); }
.ax-cat h4 svg { width: 15px; height: 15px; color: var(--ink, #14110B); }
.ax-cat ul { list-style: none; margin: 0; padding: 0; }
.ax-cat li { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line, #E5DDC9); font-size: 13.5px; color: var(--ink-2, #3A332A); }
.ax-cat li span { flex: 1; min-width: 0; }
.ax-cat li b { font-weight: 700; color: var(--ink, #14110B); white-space: nowrap; }
.ax-cat li i { font-style: normal; font-size: 12px; color: var(--ink-3, #6E6557); white-space: nowrap; min-width: 48px; text-align: right; }

/* ── Landmark markers ── */
/* marker styles live in /atlas/shared/pe-map.css (shared with the Deal Room mini map) */
.atlas .atlas-legend .atlas-lm--key { display: inline-flex; height: 22px; min-width: 22px; border-width: 0; box-shadow: none; cursor: default; justify-content: center; }
.atlas-lm--key svg { width: 13px; height: 13px; margin: 0; }

/* ── Tap info (barangay zonal value) ── */
.atlas-info {
  position: absolute; left: 10px; right: 10px; top: 60px; z-index: 6; max-width: 320px;
  background: var(--white, #FBF8F2); border: 1px solid var(--line, #E5DDC9); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(20,17,11,.18); padding: 12px 40px 12px 14px; font-size: 13px; color: var(--ink-2, #3A332A);
}
.atlas-info[hidden] { display: none; }
.atlas-info strong { display: block; font-family: var(--display); font-weight: 400; font-size: 19px; color: var(--ink, #14110B); line-height: 1.2; }
.atlas-info > span { font-size: 12px; color: var(--ink-3, #6E6557); }
.atlas-info p { margin: 6px 0; }
.atlas-info p b { font-size: 16px; color: var(--ink, #14110B); }
.atlas-info dl { margin: 6px 0 0; }
.atlas-info dl div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-top: 1px solid var(--line, #E5DDC9); font-size: 12px; }
.atlas-info dt { color: var(--ink-3, #6E6557); }
.atlas-info dd { margin: 0; font-weight: 600; color: var(--ink, #14110B); text-align: right; }
.ai-x { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; background: none; font-size: 20px; line-height: 1; color: var(--ink-3, #6E6557); cursor: pointer; }
.atlas.has-card .atlas-info { display: none; }

@media (min-width: 900px) {
  .atlas-layers { left: calc(var(--ap-w) + 32px); top: 16px; }
  .ap-tools { padding: 2px 20px 12px; }
  .ap-fpanel { padding: 4px 20px 14px; max-height: 50%; }
  #ap-q, .af-grid select { font-size: 14px; }
  .atlas-time { left: calc(var(--ap-w) + 32px); right: 150px; bottom: 16px; max-width: 520px; padding: 8px 16px 8px 8px; }
  .atlas.has-card .atlas-time { display: flex; right: calc(var(--card-w) + 160px); }
  .atlas-info { left: calc(var(--ap-w) + 32px); top: 70px; right: auto; width: 300px; }
  .atlas.has-card .atlas-info { display: block; }
  .atlas .atlas-attrib { bottom: 84px; right: 16px; }
  .atlas.has-card .atlas-attrib { right: calc(var(--card-w) + 32px); }
}
@media (min-width: 900px) and (max-width: 1180px) {
  .atlas.has-card .atlas-time { display: none; }
}

/* ── Embedded preview (admin page): map only, no site header or footer ── */
.atlas-embed .topbar, .atlas-embed nav.nav, .atlas-embed .mob-drawer, .atlas-embed footer,
.atlas-embed .atlas-panel, .atlas-embed .atlas-hint, .atlas-embed .pe-chat, .atlas-embed [class*="float"] { display: none !important; }
.atlas-embed .atlas { height: 100vh; height: 100dvh; min-height: 0; }
.atlas-embed .atlas-msg { padding-left: 20px; }
.atlas-embed .atlas-layers, .atlas-embed .atlas-time { left: 10px; }
.atlas-embed .atlas-time { right: 10px; bottom: 10px; max-width: none; }
.atlas-label.is-house.is-compact { padding: 4px; box-shadow: 0 1px 5px rgba(20,17,11,.2); }
.atlas-label.is-house.is-compact svg { width: 11px; height: 11px; }

/* ── Edit mode in the admin preview: drag the chosen building ── */
.atlas-editing .atlas-map.is-hover canvas { cursor: grab; }
.atlas-dragging .atlas-map canvas { cursor: grabbing !important; }
.atlas-placing .atlas-map canvas { cursor: crosshair !important; }
.atlas-editing .atlas-card { display: none !important; }
.atlas-editing .atlas-time { display: none; }
