/* ============================================================================
   3.6.0 — ชุดสีแบรนด์ใหม่ (เหลือง #FFC91F / หมึก #0F0F0E) แบบแบน ไม่มีเงา
   หน้าเดิม (ธีม) ประกาศตัวแปรไว้ที่ ':root' ซึ่งแก้ไม่ได้ และลำดับการโหลดของ map.css
   ต่างกันระหว่างเครื่องนี้ (อยู่ต้น <head>) กับเว็บจริง (ปลั๊กอินฉีดท้าย </head>)
   จึงต้องชนะด้วย "น้ำหนักตัวเลือก" อย่างเดียว ห้ามพึ่งลำดับ:
   ':root:root' = (0,2,0) ชนะ ':root' (0,1,0) ได้ทั้งสองแบบ และยังตกทอดถึง #propertyModal
   ที่อยู่นอก .app ด้วย
   ห้ามผูกกฎ "สี" ไว้กับ .tlt-ui-ready เพราะคลาสนั้นติดจาก JS ที่โหลดแบบ defer
   ถ้า JS ช้าหรือพัง แถบจะเป็นสีขาวแบบเดิม — .tlt-ui-ready ใช้กับ "เลย์เอาต์" เท่านั้น
   ============================================================================ */
:root:root {
  --ink: #0F0F0E;
  --gold: #FFC91F;
  --gold2: #FFC91F;
  --muted: #4E5257;
  --green: #0E6B4A;
  --red: #C0392B;
  --cream: #FFFFFF;
  --white: #FFFFFF;
  --shadow: none;
  --line: #e6e7df;
  --blue: #3178c6;
  /* ตัวแปรใหม่ที่ map.css ใช้เอง */
  --surface: #FFFFFF;
  --surface-2: #F2F2EF;
  --card-line: #D5D5CE;
  --ink-2: #202020;
  --pin: #FFC91F;
  --candidate: #C2410C;
  --candidate-ink: #7C2D12;
  --warn: #B45309;
}

#tlt-live-map {
  width: 100%;
  height: 100%;
  background: #dfe7df;
}

.maplibregl-map,
.maplibregl-popup,
.maplibregl-ctrl {
  font-family: "IBM Plex Sans Thai", sans-serif;
}

.maplibregl-ctrl-attrib {
  max-width: min(70vw, 680px);
  font-size: 10px;
}

/* MapLibre translates each marker from the canvas origin. Keep marker roots
   out of document flow; relative positioning adds a cumulative row offset. */
.maplibregl-marker.tlt-map-marker,
.maplibregl-marker.tlt-area-marker {
  position: absolute;
  top: 0;
  left: 0;
}

.tlt-map-marker {
  z-index: 5;
  width: 44px;
  height: 41px;
  display: grid;
  place-items: start center;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, .34));
}

.tlt-map-marker__pin {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 8px;
  background: #f4bf2a;
  transform: rotate(-45deg);
  transition: transform .16s ease, filter .16s ease;
}

.tlt-map-marker__icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: #102d4f;
  transform: rotate(45deg);
}

.tlt-map-marker:hover .tlt-map-marker__pin,
.tlt-map-marker:focus-visible .tlt-map-marker__pin {
  transform: rotate(-45deg) scale(1.12);
  filter: brightness(1.08);
}

.tlt-map-marker:focus-visible {
  outline: 3px solid #f5d872;
  outline-offset: 2px;
  border-radius: 8px;
}

.tlt-map-marker--verified {
  z-index: 6;
}

.tlt-map-marker--verified .tlt-map-marker__pin {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 0 0 5px rgba(244, 191, 42, .7);
}

.tlt-map-marker--candidate {
  z-index: 4;
}

.tlt-map-marker--candidate .tlt-map-marker__pin {
  background: #f0642a;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .92), 0 0 0 5px rgba(143, 63, 10, .72);
}

.tlt-map-marker--candidate:focus-visible {
  outline-color: #f0642a;
}

.tlt-map-marker__candidate-badge {
  position: absolute;
  z-index: 2;
  top: -5px;
  right: -1px;
  width: 18px;
  height: 18px;
  display: block;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .28));
  pointer-events: none;
}

.tlt-map-marker__candidate-badge svg {
  display: block;
}

/* 3.4.0: ขนาดวงพื้นที่ตามจำนวนทรัพย์ (--tlt-base-size ตั้งจาก JS 24–48px) คูณตัวคูณตามระดับซูม
   มองไกล (zoom < 10.5) เล็กลง 0.72 เท่า เพื่อให้เห็นการกระจุกตัวแทนวงทับกัน */
#tlt-live-map { --tlt-zoom-scale: 1; --tlt-pin-scale: 1; }
#tlt-live-map[data-zoom-band="far"] { --tlt-zoom-scale: .72; --tlt-pin-scale: .62; }
#tlt-live-map[data-zoom-band="mid"] { --tlt-zoom-scale: .86; --tlt-pin-scale: .82; }

.tlt-area-marker {
  --tlt-base-size: 40px;
  z-index: 3;
  min-width: calc(var(--tlt-base-size) * var(--tlt-zoom-scale));
  height: calc(var(--tlt-base-size) * var(--tlt-zoom-scale));
  display: grid;
  place-items: center;
  padding: 0 6px;
  border: 2px solid #c96e08;
  border-radius: 999px;
  background: rgba(232, 137, 32, .78);
  color: #fff;
  box-shadow: 0 2px 0 rgba(255, 255, 255, .85) inset, 0 4px 10px rgba(0, 0, 0, .24);
  font: 800 calc(11px * max(var(--tlt-zoom-scale), .85)) / 1 "IBM Plex Sans Thai", sans-serif;
  cursor: pointer;
}

/* กลุ่มหมุดทอง/หมุดส้มเมื่อมองไกล: วงกลมพร้อมจำนวน กดเพื่อซูมเข้า */
.maplibregl-marker.tlt-cluster-marker {
  position: absolute;
  top: 0;
  left: 0;
}

.tlt-cluster-marker {
  --tlt-base-size: 34px;
  z-index: 6;
  width: calc(var(--tlt-base-size) * max(var(--tlt-zoom-scale), .8));
  height: calc(var(--tlt-base-size) * max(var(--tlt-zoom-scale), .8));
  display: grid;
  place-items: center;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #f4bf2a;
  color: #102d4f;
  box-shadow: 0 0 0 3px rgba(244, 191, 42, .45), 0 4px 10px rgba(0, 0, 0, .3);
  font: 800 11px/1 "IBM Plex Sans Thai", sans-serif;
  cursor: pointer;
}

.tlt-cluster-marker--candidate {
  z-index: 4;
  background: #f0642a;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(240, 100, 42, .4), 0 4px 10px rgba(0, 0, 0, .3);
}

.tlt-cluster-marker:hover,
.tlt-cluster-marker:focus-visible {
  filter: brightness(1.06);
  outline: 3px solid rgba(255, 255, 255, .95);
  outline-offset: 2px;
}

/* หมุดเดี่ยวเล็กลงเมื่อมองไกล/กลาง */
#tlt-live-map[data-zoom-band="far"] .tlt-map-marker,
#tlt-live-map[data-zoom-band="mid"] .tlt-map-marker {
  width: calc(44px * var(--tlt-pin-scale));
  height: calc(41px * var(--tlt-pin-scale));
}

#tlt-live-map[data-zoom-band="far"] .tlt-map-marker__pin,
#tlt-live-map[data-zoom-band="mid"] .tlt-map-marker__pin {
  width: calc(34px * var(--tlt-pin-scale));
  height: calc(34px * var(--tlt-pin-scale));
  border-width: 2px;
}

#tlt-live-map[data-zoom-band="far"] .tlt-map-marker__icon,
#tlt-live-map[data-zoom-band="mid"] .tlt-map-marker__icon {
  width: calc(20px * var(--tlt-pin-scale));
  height: calc(20px * var(--tlt-pin-scale));
}

#tlt-live-map[data-zoom-band="far"] .tlt-map-marker__icon svg,
#tlt-live-map[data-zoom-band="mid"] .tlt-map-marker__icon svg {
  width: 100%;
  height: 100%;
}

#tlt-live-map[data-zoom-band="far"] .tlt-map-marker__candidate-badge {
  width: 13px;
  height: 13px;
  top: -3px;
}

.tlt-area-marker[data-type="ns3"] {
  border-color: #626970;
  background: rgba(125, 133, 140, .82);
}

.tlt-area-marker:hover,
.tlt-area-marker:focus-visible {
  filter: brightness(1.08);
  outline: 3px solid rgba(255, 255, 255, .95);
  outline-offset: 2px;
}

.tlt-map-legend {
  position: absolute;
  z-index: 8;
  left: 20px;
  bottom: 102px;
  display: grid;
  gap: 6px;
  width: min(235px, calc(100% - 40px));
  padding: 9px 10px;
  border: 1px solid rgba(24, 33, 27, .13);
  border-radius: 10px;
  background: rgba(255, 255, 255, .94);
  color: #344039;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  font-size: 9px;
  line-height: 1.25;
  pointer-events: auto;
}

.tlt-map-legend__item {
  display: grid;
  grid-template-columns: 21px 1fr;
  align-items: center;
  gap: 7px;
}

.tlt-map-legend__item b {
  color: #18211b;
}

.tlt-map-legend__exact {
  width: 15px;
  height: 15px;
  justify-self: center;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 4px;
  background: #f4bf2a;
  box-shadow: 0 0 0 1px rgba(118, 82, 0, .24);
  transform: rotate(-45deg);
}

.tlt-map-legend__candidate {
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  justify-self: center;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 4px;
  background: #f0642a;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(143, 63, 10, .62);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  transform: rotate(-45deg);
}

.tlt-map-legend__candidate i {
  display: block;
  font-style: normal;
  transform: rotate(45deg);
}

.tlt-map-legend__area {
  width: 20px;
  height: 14px;
  justify-self: center;
  border: 2px solid;
  border-radius: 50%;
}

.tlt-map-legend__area--ns3k {
  border-color: #c96e08;
  background: rgba(232, 137, 32, .3);
}

.tlt-map-legend__area--ns3 {
  border-color: #626970;
  background: rgba(125, 133, 140, .3);
}

.tlt-map-legend__source {
  margin-top: 2px;
  padding-top: 5px;
  border-top: 1px solid rgba(24, 33, 27, .1);
  color: #68736d;
  font-size: 8px;
}

.tlt-map-legend__source a {
  color: inherit;
  text-decoration: underline;
}

.tlt-map-popup {
  min-width: 240px;
  max-width: 310px;
  line-height: 1.45;
}

.tlt-map-popup h3 {
  margin: 0 24px 4px 0;
  font-size: 15px;
  line-height: 1.35;
}

.tlt-map-popup p {
  margin: 4px 0;
  color: #4f5d54;
  font-size: 12px;
}

.tlt-map-popup strong {
  display: block;
  margin-top: 8px;
  color: #18211b;
  font-size: 17px;
}

.tlt-map-popup small {
  display: block;
  margin-top: 6px;
  color: #66736b;
}

.tlt-map-popup__eyebrow {
  display: inline-flex;
  margin: 0 0 7px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.tlt-map-popup__eyebrow--candidate {
  border: 1px solid #b4480f;
  background: rgba(240, 100, 42, .14);
  color: #913706;
}

.tlt-map-popup__warning {
  margin-top: 9px;
  padding: 8px 9px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.45;
}

.tlt-map-popup__warning--candidate {
  border: 1px solid rgba(180, 72, 15, .25);
  background: #fff2e8;
  color: #71300c;
}

.tlt-map-popup__candidate-source {
  color: #71300c !important;
  font-weight: 700;
}

.tlt-map-popup__candidate-observed {
  color: #7a6860 !important;
  font-size: 10px;
}

.tlt-map-popup__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.tlt-map-popup__actions button,
.tlt-map-popup__actions a {
  border: 1px solid #d9ddd6;
  border-radius: 8px;
  padding: 7px 9px;
  background: #fff;
  color: #18211b;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.tlt-map-popup__actions button {
  background: #18211b;
  color: #fff;
  border-color: #18211b;
}

.tlt-area-popup__type {
  display: inline-flex;
  margin: 0 0 7px;
  padding: 3px 7px;
  border: 1px solid #626970;
  border-radius: 999px;
  background: rgba(125, 133, 140, .14);
  color: #3f474d;
  font-size: 10px;
  font-weight: 700;
}

.tlt-area-popup__type[data-type="ns3k"] {
  border-color: #c96e08;
  background: rgba(232, 137, 32, .14);
  color: #8f4b03;
}

.tlt-area-popup__warning {
  margin-top: 9px;
  padding: 8px 9px;
  border-radius: 8px;
  background: #f1f3f4;
  color: #4e585e;
  font-size: 11px;
  line-height: 1.4;
}

.tlt-area-popup__source {
  margin-top: 7px !important;
  color: #7a8480 !important;
  font-size: 9px;
}

.tlt-map-status {
  position: absolute;
  z-index: 8;
  left: 20px;
  bottom: 63px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid rgba(24, 33, 27, .12);
  border-radius: 9px;
  background: rgba(255, 255, 255, .94);
  color: #344039;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  font-size: 10px;
  pointer-events: none;
}

.tlt-map-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #17845b;
}

.tlt-map-status[data-state="pending"]::before {
  background: #d9a928;
}

.tlt-map-status[data-state="fallback"]::before,
.tlt-map-status[data-state="error"]::before {
  background: #d74c3f;
}

main > .pin,
main > .cluster {
  display: none !important;
}

@media (max-width: 720px) {
  .tlt-map-legend {
    left: 10px;
    bottom: calc(43% + 82px);
    width: min(220px, calc(100% - 20px));
  }

  .tlt-map-status {
    left: 10px;
    bottom: calc(43% + 44px);
  }

  .maplibregl-ctrl-bottom-left,
  .maplibregl-ctrl-bottom-right {
    bottom: 42%;
  }
}

/* Compact map chrome. Scope header overrides to the map page only. */
/* 3.5.0 กันภาพกระตุก: หน้าเดิมวาดแถบค้นหา/ตัวกรองทับแผนที่ตั้งแต่ตอน parse แล้ว map.js (defer)
   ค่อยย้ายขึ้นแถบบนทีหลัง ผู้ใช้จึงเห็น "รก" แวบหนึ่งทุกครั้งที่โหลด — ซ่อนไว้ก่อนแล้วค่อยโผล่ในแถบ
   ถ้า JS ไม่ทำงานเลย animation จะคืนให้เห็นใน 3 วินาที เพื่อไม่ให้ช่องค้นหาหายถาวร */
.app:not(.tlt-ui-ready) .searchbar,
.app:not(.tlt-ui-ready) .filter-row {
  visibility: hidden;
  animation: tlt-chrome-fallback 0s linear 3s forwards;
}
@keyframes tlt-chrome-fallback { to { visibility: visible; } }
/* 3.5.0 — แถบบนแถบเดียว: ค้นหา + ตัวกรอง + ยอดรวม + ปุ่ม อยู่ในแถบเดียวกัน ไม่มีอะไรลอยทับแผนที่ */
/* คอลัมน์ของกริดเป็น auto โดยปริยาย มันจะโตตามความกว้างขั้นต่ำของแถบ ทำให้ทั้ง header และ main
   กว้างเกินจอบนมือถือแล้วถูก .app{overflow:hidden} ตัดทิ้งเงียบ ๆ — ล็อกคอลัมน์ไว้ที่ความกว้างจริง */
.tlt-ui-ready.app { grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); }
.tlt-ui-ready > header {
  position: relative; z-index: 20;
  gap: 12px; min-height: 68px; padding: 6px 20px; flex-wrap: nowrap;
}
.tlt-ui-ready > header .brand { flex-shrink: 0; }
/* แถวแถบเป็น auto แล้ว height:100% ของ .tabs (index.html) จะกลายเป็น auto — ยืดให้เท่าเดิมด้วย align-self */
.tlt-ui-ready > header .tabs { flex-shrink: 0; align-self: stretch; }
.tlt-ui-ready > header .tab,
.tlt-ui-ready > header .outline,
.tlt-ui-ready > header .primary { white-space: nowrap; }
.tlt-ui-ready > header .header-actions { margin-left: 0; flex-shrink: 0; }
.tlt-ui-ready main > .legend { display: none; }

/* แถบค้นหา: จากกล่องลอยกลางแผนที่ → กลายเป็นช่องกรอกยืดหยุ่นในแถบบน */
.tlt-ui-ready > header .searchbar {
  position: static; inset: auto; transform: none;
  flex: 1 1 auto; min-width: 150px; max-width: 620px; width: auto;
  gap: 6px; padding: 4px; border-radius: 12px;
  background: #f4f5f0; border: 1px solid #e3e5dd; box-shadow: none;
}
.tlt-ui-ready > header .searchbar:focus-within { background: #fff; border-color: #d9a928; }
.tlt-ui-ready > header .searchbar input { min-width: 0; font-size: 14px; }
.tlt-ui-ready > header .searchbar .locate { flex-shrink: 0; }
.tlt-ui-ready > header .searchbar #searchBtn { flex-shrink: 0; padding: 8px 15px; border-radius: 9px; }

/* ตัวกรองทั้งชุดยุบเป็นปุ่มเดียว — พื้นที่แนวนอนไม่พอให้ select ทั้งสามอยู่ในแถบพร้อมช่องค้นหา */
/* ยืดเต็มความสูงกล่องเนื้อหาของแถบ เพื่อให้ top:100% ของแผง = ขอบล่างของแถบพอดี ไม่ว่าแถบจะสูงเท่าไร */
.tlt-filters { position: relative; flex-shrink: 0; align-self: stretch; display: flex; align-items: center; }
.tlt-filters__trigger {
  display: flex; align-items: center; gap: 7px; min-height: 44px;
  padding: 8px 12px; border: 1px solid #e2e5dd; border-radius: 12px;
  background: #fff; color: #354c3f; cursor: pointer; white-space: nowrap;
}
.tlt-filters__trigger:hover { background: #f7f4e9; }
.tlt-filters--active > .tlt-filters__trigger { border-color: #d9a928; background: #fffaea; color: #60490e; }
.tlt-filters__label { font-size: 14px; font-weight: 600; }
.tlt-filters__count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: #d9a928; color: #332600; font-size: 12px; font-weight: 700; line-height: 1;
}
/* display ที่ประกาศเองชนะกฎ [hidden] ของเบราว์เซอร์ ต้องปิดเอง ไม่งั้นป้ายว่างจะโผล่ตลอด */
.tlt-filters__count[hidden] { display: none; }
.tlt-filters__arrow { font-size: 15px; line-height: 1; }
.tlt-filters__trigger svg {
  width: 20px; height: 20px; flex-shrink: 0; fill: none;
  stroke: currentColor; stroke-width: 1.9; stroke-linecap: round;
}
/* .locate ในหน้าเดิมตั้ง background/padding เป็น !important — ต้องลบล้างเมื่อมันย้ายมาอยู่ในแถบเครื่องมือ */
.tlt-map-tools .tlt-locate-tool {
  background: #fff !important; color: #354c3f !important; font-size: 21px; line-height: 1;
}
.tlt-map-tools .tlt-locate-tool:hover { background: #f7f4e9 !important; }
.tlt-filters[open] .tlt-filters__arrow { transform: rotate(180deg); }
/* ต้องมี .tlt-ui-ready นำหน้า เพราะ .tlt-tool-panel (แผงเครื่องมือมุมล่างซ้าย ซึ่งเปิดขึ้นบน)
   ถูกประกาศทีหลังในไฟล์นี้ ถ้าน้ำหนักเท่ากันมันจะชนะ แล้ว bottom:54px + top จะบีบแผงจนสูงเหลือ 0 */
.tlt-ui-ready .tlt-filters__panel {
  left: auto; right: 0; bottom: auto; top: calc(100% + 8px);
  width: min(300px, calc(100vw - 24px)); max-height: min(70dvh, 520px); z-index: 12;
}
/* select กลับมาเรียงลงเป็นแถวในแผง ไม่ใช่เรียงข้างกันบนแผนที่แล้ว */
.tlt-ui-ready .tlt-filters__panel .filter-row {
  position: static; inset: auto; transform: none;
  display: grid; gap: 9px; width: auto; max-width: none; overflow: visible;
}
.tlt-ui-ready .tlt-filters__panel .chip { justify-self: start; }
.tlt-ui-ready .tlt-filters__panel .filter-select {
  width: 100%; min-width: 0; flex: none; box-shadow: none; border-radius: 10px;
}
/* #dataNote ถูกวางไว้ที่ top:310px เพื่อหลบกล่องสรุปกับปุ่มดาวเทียมที่ย้ายไปแล้ว ตอนนี้มันลอยกลางแผนที่เปล่า
   (โผล่เฉพาะตอน API คืน 0 รายการ) — ดึงกลับมาชิดใต้แถบบน */
.tlt-ui-ready main > .data-note { top: 14px; left: 20px; right: auto; }
.tlt-ui-ready .maplibregl-popup { z-index: 10; }
.tlt-disclosure > summary { list-style: none; cursor: pointer; }
.tlt-disclosure > summary::-webkit-details-marker { display: none; }
.tlt-disclosure > summary:focus-visible,
.tlt-map-tool:focus-visible { outline: 3px solid #b78612; outline-offset: 3px; }
.tlt-disclosure:not([open]) > :not(summary) { display: none !important; }
.tlt-disclosure[open] > summary { background: #fff5d6; border-color: #d9a928; }
/* 3.5.0: ไม่ใช้ margin-left:auto แล้ว เพราะ .searchbar เป็นตัวยืด (flex-grow) จึงไม่เหลือที่ว่างให้ auto margin ดูด
   และวางแผงให้อ้างอิงความสูงของ "แถบ" ไม่ใช่ความสูงของปุ่ม แผงจะได้ไม่ทับแถบเมื่อแถบสูงขึ้น */
.tlt-overview { position: static; flex-shrink: 0; }
.tlt-overview > summary {
  display: flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 8px 12px; border: 1px solid #e5dbb9; border-radius: 12px;
  background: #fbf7e9; color: #60490e;
}
.tlt-overview svg, .tlt-map-tool svg {
  width: 21px; height: 21px; flex-shrink: 0; fill: none;
  stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.tlt-overview #liveTotal { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.4; max-width: 180px; }
.tlt-overview__arrow { font-size: 16px; }
.tlt-overview[open] .tlt-overview__arrow { transform: rotate(180deg); }
.tlt-ui-ready header .summary {
  display: block; position: absolute; left: auto; right: 20px; top: calc(100% + 8px); bottom: auto;
  width: min(320px, calc(100vw - 24px)); padding: 18px; border-radius: 16px; z-index: 12;
  background: #fff; color: #18211b; border: 1px solid #e6e7df;
  box-shadow: 0 12px 35px rgba(18,28,22,.18); backdrop-filter: none;
}
.tlt-ui-ready header .summary .eyebrow { font-size: 15px; color: #18211b; font-weight: 700; letter-spacing: 0; }
.tlt-ui-ready header .summary p { color: #66736b; font-size: 12px; margin-top: 6px; }
.tlt-ui-ready header .summary .metric { justify-content: space-between; gap: 12px; border-color: #ecece4; }
.tlt-ui-ready header .summary .metric b { color: #846211; font-size: 21px; }
.tlt-ui-ready header .summary .metric span { color: #536157; font-size: 11px; }
.tlt-ui-ready header .summary .tlt-overview__note { border-top: 1px solid #ecece4; margin-top: 14px; padding-top: 12px; line-height: 1.6; }
.tlt-post-icon { display: none; }
.tlt-map-tools {
  position: absolute; z-index: 8; left: 64px; bottom: 27px;
  display: flex; align-items: center; gap: 8px;
}
.tlt-map-tools .tlt-map-legend,
.tlt-map-tools .tlt-map-health {
  position: static; display: block; width: auto; padding: 0; margin: 0;
  border: 0; border-radius: 0; box-shadow: none; background: none;
}
.tlt-map-tools .tlt-map-tool {
  position: relative; inset: auto; display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; min-height: 44px; padding: 0;
  border: 1px solid #e2e5dd; border-radius: 12px; background: #fff; color: #354c3f;
  box-shadow: 0 3px 12px rgba(18,28,22,.12); cursor: pointer;
}
.tlt-map-tool:hover { background: #f7f4e9; }
.tlt-map-tools .tlt-disclosure[open] > summary { background: #fff5d6; border-color: #d9a928; }
.tlt-map-tools #mapToggle { font-size: 0; }
.tlt-map-tools #mapToggle::before { content: '▧'; font-size: 25px; line-height: 1; }
.tlt-map-tools #mapToggle[aria-pressed="true"]::before { content: '▤'; }
.tlt-map-tools #mapToggle:disabled { opacity: .55; cursor: wait; }
.tlt-tool-panel {
  position: absolute; left: -44px; bottom: 54px; width: min(310px, calc(100vw - 32px));
  max-height: min(420px, calc(100dvh - 230px)); overflow: auto;
  display: grid; gap: 14px; padding: 18px; background: #fff;
  border: 1px solid #e2e5dd; border-radius: 16px;
  box-shadow: 0 8px 30px rgba(18,28,22,.18); color: #344039; font-size: 12px; line-height: 1.55;
}
.tlt-tool-panel h3 { font-size: 16px; color: #18211b; margin: 0; }
.tlt-tool-panel__note { margin: 0; padding: 9px 10px; border-radius: 8px; background: #fbf5e6; color: #77591a; font-size: 11px; }
.tlt-map-legend__item { grid-template-columns: 25px 1fr; gap: 10px; }
.tlt-map-legend__source { font-size: 10px; line-height: 1.7; }
.tlt-map-health .tlt-map-status {
  position: static; min-height: 0; padding: 0; background: none; border: 0;
  border-radius: 0; box-shadow: none; font-size: 12px; line-height: 1.6;
}
.tlt-map-health .tlt-map-status::before { flex-shrink: 0; }
.tlt-health-dot { position: absolute; width: 8px; height: 8px; right: 7px; top: 7px; border: 1px solid #fff; border-radius: 50%; background: #17845b; }
.tlt-map-health[data-state="pending"] .tlt-health-dot { background: #d9a928; }
.tlt-map-health[data-state="error"] .tlt-health-dot,
.tlt-map-health[data-state="fallback"] .tlt-health-dot { background: #d74c3f; }
/* แถบเดียวมีทั้งโลโก้ + เมนู + ช่องค้นหา + ตัวกรอง + ยอดรวม + ปุ่ม จึงต้องซ่อนเมนูเร็วกว่าเดิม
   (วัดที่ 1440px: โลโก้ 158 + เมนู 423 + ยอดรวม 157 + ปุ่ม 271 + ช่องไฟ = เหลือให้ช่องค้นหาแค่ ~341px) */
@media (max-width: 1440px) {
  .tlt-ui-ready > header .tabs { display: none; }
}
@media (max-width: 1100px) {
  .tlt-ui-ready > header .outline { display: none; }
}
/* 721–1000px (แท็บเล็ตแนวนอน/โน้ตบุ๊กเล็ก) เป็นช่วงที่คับที่สุด เพราะแผงรายการด้านขวายังกว้าง 370px อยู่
   ย่อป้ายกำกับลงก่อน เพื่อกันไม่ให้ช่องค้นหาถูกบีบจนพิมพ์ไม่ได้ */
@media (max-width: 1000px) {
  .tlt-ui-ready .tlt-brand-logo { width: 128px; }
  .tlt-ui-ready .tlt-filters__trigger { gap: 5px; padding: 8px 10px; }
  .tlt-ui-ready .tlt-filters__label, .tlt-ui-ready .tlt-filters__arrow { display: none; }
  .tlt-ui-ready .tlt-overview #liveTotal { max-width: 96px; }
}
@media (max-width: 720px) {
  .tlt-ui-ready > header { gap: 8px; padding: 7px 12px; min-height: 60px; }
  .tlt-ui-ready > header .searchbar { min-width: 110px; padding: 3px; }
  .tlt-ui-ready > header .searchbar #searchBtn { font-size: 0; padding: 10px 11px; }
  .tlt-ui-ready > header .searchbar #searchBtn::before { content: '⌕'; font-size: 21px; line-height: 1; }
  .tlt-ui-ready .tlt-filters__trigger { padding: 8px 9px; }
  .tlt-ui-ready .tlt-filters__panel { right: -12px; width: min(300px, calc(100vw - 20px)); }
  .tlt-ui-ready .tlt-overview > summary { gap: 5px; padding: 8px; }
  .tlt-ui-ready .tlt-overview #liveTotal { font-size: 12px; max-width: 120px; }
  .tlt-ui-ready .tlt-overview svg { width: 18px; height: 18px; }
  .tlt-ui-ready header .summary { right: 12px; }
  .tlt-map-tools { left: 58px; bottom: calc(41% + 26px); gap: 7px; }
  .tlt-tool-panel { left: -46px; max-height: calc(59dvh - 175px); }
  .tlt-ui-ready .header-actions .primary { min-width: 44px; min-height: 44px; padding: 8px; }
}
@media (max-width: 560px) {
  .tlt-ui-ready .header-actions .tlt-post-label { display: none; }
  .tlt-ui-ready .tlt-post-icon { display: inline; font-size: 22px; line-height: 1; }
  .tlt-ui-ready .tlt-brand-logo { width: 112px; }
  .tlt-ui-ready .tlt-overview #liveTotal { display: none; }
  .tlt-ui-ready .tlt-overview__arrow { display: none; }
}
/* จอแคบมาก: ยอดรวมทั้งระบบซ้ำกับ "78,434 รายการ" ที่หัวแผงรายการอยู่แล้ว ยอมตัดออกเพื่อให้ช่องค้นหาพิมพ์ได้จริง */
@media (max-width: 430px) {
  .tlt-ui-ready > header .tlt-overview { display: none; }
  /* ป้ายจำนวนตัวกรองต้องไม่กินความกว้างในแถว ไม่งั้นพอผู้ใช้เลือกจังหวัด แถบจะยาวเกินจอแล้วถูกตัดเงียบ ๆ */
  .tlt-ui-ready .tlt-filters__trigger { position: relative; }
  .tlt-ui-ready .tlt-filters__count {
    position: absolute; top: 1px; right: 1px;
    min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px;
  }
}
@media (max-width: 400px) {
  .tlt-ui-ready .tlt-brand-logo { width: 84px; }
}

/* ============================================================================
   3.6.0 — ชั้นสีแบรนด์ใหม่
   วางไว้ท้ายไฟล์โดยตั้งใจ: กฎที่น้ำหนักเท่ากันใน "ไฟล์เดียวกัน" ตัวหลังชนะเสมอ
   จึงทับค่าสีของ 3.5.0 ด้านบนได้แน่นอน โดยไม่ต้องไล่แก้ทีละบรรทัดให้เสี่ยงพลาด
   (ส่วนบน = เลย์เอาต์, ส่วนนี้ = สี/ผิว)
   ============================================================================ */

/* --- แถบบน ------------------------------------------------------------- */
/* (0,1,1) ชนะ 'header' (0,0,1) ของหน้าเดิม และไม่พึ่ง .tlt-ui-ready จึงเป็นสีเหลือง
   ตั้งแต่ยังไม่ทัน parse JS — ไม่มีจังหวะที่แถบขาวแวบ */
.app > header {
  background: #FFC91F;
  color: #0F0F0E;
  border-bottom: 2px solid #0F0F0E;
  gap: 12px;
  padding: 6px 20px;
}
@media (max-width: 720px) {
  .app > header { gap: 8px; padding: 7px 12px; }
}

/* --- โลโก้: แผ่นขาวเต็มความสูงด้านซ้าย ---------------------------------- */
/* หมุดทองในโลโก้ (#E9A81C) บนพื้นเหลือง #FFC91F ได้ค่าตัดกันแค่ 1.35:1 คือมองไม่เห็นรูปหมุด
   ถ้าใช้แผ่นสีเข้มแทน ตัวหนังสือเขียวเข้มจะหายแทน (1.16:1) — พื้นขาวจึงเป็นทางเดียวที่
   ไม่ทำให้อะไรหาย และเท่ากับสภาพเดิมพอดี (หน้าเดิมแถบบนก็เกือบขาวอยู่แล้ว)
   margin ลบหักล้างกับ padding ของแถบพอดี แผ่นจึงเต็มความสูงโดยไม่ทำให้แถบสูงขึ้น */
.app > header .brand {
  align-self: stretch;
  display: flex;
  align-items: center;
  margin: -6px 2px -6px -20px;
  padding: 0 14px;
  background: #FFFFFF;
  border-right: 2px solid #0F0F0E;
}
@media (max-width: 720px) {
  .app > header .brand { margin: -7px 2px -7px -12px; padding: 0 10px; }
}
.app .tlt-brand-home:focus-visible {
  outline: 3px solid #0F0F0E;
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- ช่องค้นหา ---------------------------------------------------------- */
.tlt-ui-ready > header .searchbar {
  padding: 3px 3px 3px 10px;
  background: #FFFFFF;
  border: 2px solid #0F0F0E;
  border-radius: 6px;
  box-shadow: none;
}
.tlt-ui-ready > header .searchbar:focus-within {
  background: #FFFFFF;
  border-color: #0F0F0E;
  box-shadow: inset 0 0 0 1px #0F0F0E;
}
.tlt-ui-ready > header .searchbar input { color: #0F0F0E; }
.tlt-ui-ready > header .searchbar input::placeholder { color: #4E5257; }
/* (1,1,0) ชนะ '.searchbar button' ของหน้าเดิม และไม่ผูกกับ .tlt-ui-ready
   ห้ามใช้เหลืองอ่อน #FFC252 แบบเว็บอ้างอิงตรงนี้ — บนพื้นเหลืองได้ 1.04:1 คือสีเดียวกัน */
.app #searchBtn {
  background: #0F0F0E;
  color: #FFC91F;
  border-radius: 3px;
  font-weight: 700;
  font-size: 13px;
}
.app #searchBtn:hover { background: #202020; }
/* ต้องมี #searchBtn ในตัวเลือกนี้ด้วย ไม่งั้นกฎ 3.5.0 ด้านบนที่มี id อยู่แล้วจะชนะเรื่องมุมโค้ง */
.tlt-ui-ready > header .searchbar #searchBtn { padding: 9px 16px; border-radius: 3px; }
@media (max-width: 720px) {
  .tlt-ui-ready > header .searchbar { padding: 2px; }
}

/* --- ปุ่มตัวกรอง / ยอดรวม / เมนู / ปุ่มมุมขวา -------------------------- */
.tlt-filters__trigger {
  border: 2px solid #0F0F0E;
  border-radius: 6px;
  background: #FFFFFF;
  color: #0F0F0E;
  font-weight: 600;
}
.tlt-filters__trigger:hover { background: #F2F2EF; }
.tlt-filters--active > .tlt-filters__trigger {
  background: #0F0F0E;
  border-color: #0F0F0E;
  color: #FFC91F;
}
.tlt-filters__count { background: #FFC91F; color: #0F0F0E; }
.tlt-overview > summary {
  border: 2px solid #0F0F0E;
  border-radius: 6px;
  background: #FFFFFF;
  color: #0F0F0E;
}
/* สถานะ "เปิดอยู่" ต้องกลับสีทั้งแผ่น เพราะโทนครีมทุกเฉดบนพื้นเหลืองต่างกันไม่ถึง 1.5:1
   คือมองไม่ออกเลย — และ color สำคัญ เพราะไอคอนใช้ stroke:currentColor */
.tlt-disclosure[open] > summary {
  background: #0F0F0E;
  border-color: #0F0F0E;
  color: #FFC91F;
}
.app > header .tab { color: #0F0F0E; border-radius: 3px; }
.app > header .tab:hover { background: rgba(15, 15, 14, .12); }
.app > header .tab.active { background: #0F0F0E; color: #FFC91F; font-weight: 700; border-radius: 3px; }
.app > header .outline {
  background: #FFFFFF; border: 2px solid #0F0F0E; color: #0F0F0E;
  border-radius: 3px; font-weight: 700; font-size: 13px; box-shadow: none;
}
.app > header .primary { border-radius: 3px; box-shadow: none; font-size: 13px; }
.app > header .primary:hover { background: #202020; }
.tlt-disclosure > summary:focus-visible,
.tlt-map-tool:focus-visible { outline: 3px solid #0F0F0E; outline-offset: 3px; }

/* --- แผงยอดรวมใต้แถบ ---------------------------------------------------- */
.tlt-ui-ready header .summary {
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  border: 2px solid #0F0F0E;
  box-shadow: none;
}
.tlt-ui-ready header .summary .eyebrow { color: var(--ink); }
.tlt-ui-ready header .summary p { color: var(--muted); }
.tlt-ui-ready header .summary .metric { border-color: var(--card-line); }
.tlt-ui-ready header .summary .metric b { color: var(--ink); font-size: 22px; font-weight: 800; }
.tlt-ui-ready header .summary .metric span { color: var(--muted); }
.tlt-ui-ready header .summary .tlt-overview__note { border-top-color: var(--card-line); }
.tlt-overview #liveTotal { font-size: 14px; font-weight: 700; }

/* --- ผิวบนแผนที่ -------------------------------------------------------- */
/* เงาของหมุดห้ามเอาออก: เหลืองแบรนด์บนพื้นแผนที่ได้ 1.41:1 บนน้ำได้ 1.13:1
   และบนภาพดาวเทียมไม่รู้พื้นหลังเลย — ขอบขาว+เงาคือสิ่งเดียวที่ทำให้หมุดมีขอบ
   เว็บอ้างอิงเป็นบล็อกพื้นขาว ไม่ใช่แผนที่ จึงลอกความ "แบน" มาทั้งดุ้นไม่ได้ */
.tlt-map-marker__pin { background: var(--pin); box-shadow: 0 0 0 1px #0F0F0E; }
.tlt-map-marker__icon { color: var(--ink); }
.tlt-map-marker:focus-visible { outline: 3px solid #0F0F0E; border-radius: 6px; }
.tlt-map-marker--verified .tlt-map-marker__pin {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 0 0 5px #0F0F0E;
}
/* หมุดรอยืนยันเป็นสีสนิม #C2410C — แยกจากเหลืองแบรนด์ด้วย "ความสว่าง" (3.36:1)
   จึงยังแยกออกแม้ตาบอดสีแดง-เขียว; ไม่ใช้สีขาวเพราะขาวบนพื้นแผนที่ได้แค่ 1.09:1 */
.tlt-map-marker--candidate .tlt-map-marker__pin {
  background: var(--candidate);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .92), 0 0 0 5px #0F0F0E;
}
.tlt-map-marker--candidate:focus-visible { outline-color: #0F0F0E; }
.tlt-cluster-marker {
  background: var(--pin); color: var(--ink);
  box-shadow: 0 0 0 2px #0F0F0E, 0 4px 10px rgba(0, 0, 0, .3);
}
.tlt-cluster-marker--candidate {
  background: var(--candidate); color: #fff;
  box-shadow: 0 0 0 2px #0F0F0E, 0 4px 10px rgba(0, 0, 0, .3);
}
/* วงพื้นที่ น.ส.3/น.ส.3 ก ไม่แตะ: สีอยู่ทั้งใน CSS และใน paint ของ MapLibre ใน map.js
   ถ้าแก้ข้างเดียวสีวงกับสีในคำอธิบายจะไม่ตรงกัน และวงพวกนี้ทึบแค่ 20-42% ไม่ชนกับแถบอยู่แล้ว */

.tlt-map-legend {
  border: 2px solid #0F0F0E; border-radius: 6px;
  background: #FFFFFF; color: var(--ink); box-shadow: none;
}
.tlt-map-legend__item b { color: var(--ink); }
.tlt-map-legend__exact { background: var(--pin); box-shadow: 0 0 0 1px #0F0F0E; }
.tlt-map-legend__candidate { background: var(--candidate); box-shadow: 0 0 0 1px #0F0F0E; }
.tlt-map-legend__source { border-top: 1px solid var(--card-line); color: var(--muted); }

.tlt-map-tools .tlt-map-tool {
  border: 2px solid #0F0F0E; border-radius: 6px; color: var(--ink); box-shadow: none;
}
.tlt-map-tool:hover { background: #FFC91F; }
.tlt-map-tools .tlt-locate-tool { color: #0F0F0E !important; }
.tlt-map-tools .tlt-locate-tool:hover { background: #FFC91F !important; }
.tlt-tool-panel {
  border: 2px solid #0F0F0E; border-radius: 6px;
  box-shadow: none; color: var(--ink);
}
.tlt-tool-panel h3 { color: var(--ink); font-size: 16px; font-weight: 700; }
.tlt-tool-panel__note { background: #FFC91F; color: #0F0F0E; border-radius: 3px; }
.tlt-map-health .tlt-map-status { box-shadow: none; }
/* จุดสถานะ "กำลังตรวจ" ต้องเลิกใช้สีทอง — พอเหลืองกลายเป็นสีแบรนด์ จุดเหลืองจะไม่อ่านว่าเตือนอีก */
.tlt-map-health[data-state="pending"] .tlt-health-dot { background: var(--warn); }
.tlt-map-health[data-state="error"] .tlt-health-dot,
.tlt-map-health[data-state="fallback"] .tlt-health-dot { background: var(--red); }

/* --- แผงรายการทรัพย์ ---------------------------------------------------- */
/* เส้นขอบหมึกคือสิ่งที่มาแทนเงาที่ถูกตัดออก ถ้าไม่ใส่ แผงขาวจะละลายไปกับพื้นแผนที่ */
.app .side { background: #FFFFFF; border: 1px solid #0F0F0E; border-radius: 6px; }
.tlt-ui-ready .side .side-head { border-bottom: 1px solid var(--card-line); }
.tlt-ui-ready .side .side-head h2 { font-size: 18px; font-weight: 700; }
.tlt-ui-ready .side .count { color: var(--muted); }
.tlt-ui-ready .side .cards { background: var(--surface-2); }
.tlt-ui-ready .side .card {
  background: #FFFFFF; border: 1px solid var(--card-line);
  border-radius: 6px; box-shadow: none;
}
.tlt-ui-ready .side .card:hover,
.tlt-ui-ready .side .card.active {
  border-color: #0F0F0E; box-shadow: inset 0 0 0 1px #0F0F0E; transform: none;
}
.tlt-ui-ready .side .thumb { border-radius: 6px; background: var(--surface-2); }
.tlt-ui-ready .side .segmented { background: var(--surface-2); border-radius: 6px; }
.tlt-ui-ready .side .segmented button { border-radius: 4px; }
/* ต้องแทนที่เงา ไม่ใช่แค่ลบ: ขาวบนพื้น #ecece6 ได้ 1.13:1 เงาคือตัวเดียวที่บอกว่าเลือกอันไหนอยู่ */
.tlt-ui-ready .side .segmented button.active {
  background: #0F0F0E; color: #FFC91F; font-weight: 700; box-shadow: none;
}
.tlt-ui-ready .side .price { font-size: 18px; font-weight: 800; }
.tlt-ui-ready .side .source { background: var(--surface-2); border-radius: 3px; }
.tlt-ui-ready .side .card-foot { border-top-color: var(--card-line); }
.tlt-ui-ready .side .score { color: var(--ink); }

/* --- แผงตัวกรอง (ชิป + select) ------------------------------------------ */
.tlt-ui-ready .tlt-filters__panel .chip,
.tlt-ui-ready .tlt-filters__panel .filter-select {
  border: 1px solid #0F0F0E; border-radius: 6px;
  background: #FFFFFF; color: #0F0F0E; box-shadow: none;
}
/* ชิปที่เลือกอยู่ต้องคงพื้นเข้ม ห้ามเปลี่ยนเป็นเหลืองแบรนด์:
   เหลืองบนแผงขาวได้ 1.54:1 สถานะ "เลือกอยู่" จะหายไปเลย */
.tlt-ui-ready .tlt-filters__panel .chip.on {
  background: #0F0F0E; color: #FFC91F; border-color: #0F0F0E;
}

/* --- ของหน้าเดิมที่ทับด้วยน้ำหนักตัวเลือก ------------------------------- */
html body { background: var(--surface-2); }
.tlt-ui-ready .map::after { display: none; }      /* เงาไล่สีทับขอบแผนที่ = ตรงข้ามกับดีไซน์แบน */
.tlt-ui-ready main > .data-note {
  background: #FFFFFF; color: #0F0F0E;
  border: 2px solid #0F0F0E; border-radius: 6px; box-shadow: none;
}
/* #propertyModal อยู่นอก .app (เป็นพี่น้องกัน) ตัวเลือกที่ขึ้นต้นด้วย .app จึงไปไม่ถึง */
body .modal { background: rgba(15, 15, 14, .62); }
body .modal-card { border: 1px solid #0F0F0E; border-radius: 6px; box-shadow: none; }
body .modal-close { background: #0F0F0E; color: #FFFFFF; }
body .detail-grid div { background: var(--surface-2); border-radius: 6px; }
body .source-link { border-radius: 3px; }

/* ============================================================================
   3.6.0 — แผงรายการทรัพย์ย่อได้บนมือถือ
   ความสูงของแผงถูกอ้างอิงอยู่หลายที่ (แถบเครื่องมือแผนที่ / แผงเครื่องมือ /
   ปุ่มซูมกับเครดิตแผนที่ / toast) เดิมเขียนเป็นเลข 41% 42% 45% 59dvh กระจายกัน
   จึงรวมเป็นตัวแปรเดียว --tlt-sheet-h ที่ JS เขียนค่าจริงเป็น px ลงบน <main>
   ทุกที่ที่ใช้ยังใส่ค่าสำรองเดิมไว้ในหน่วยของตัวเอง หน้าเว็บก่อน JS ทำงานจึงเหมือนเดิมเป๊ะ
   ============================================================================ */
.tlt-ui-ready .side .tlt-sheet-toggle { display: none; }   /* เดสก์ท็อปไม่มีปุ่มนี้ */

@media (max-width: 720px) {
  /* +44 ไม่ใช่ +26: แถบเครดิตแผนที่ของ MapLibre อยู่ที่ +14 สูงราว 20px ถ้าวางที่ +26 ปุ่มจะทับข้อความเครดิต
     (ของเดิม 41%+26 กับ 42% ก็ทับกันอยู่แล้ว แต่พอปุ่มมีเส้นขอบหมึกหนาเลยเห็นชัดขึ้น) */
  .tlt-map-tools { bottom: calc(var(--tlt-sheet-h, 41%) + 44px); }
  /* ต้องเจาะจง .tlt-map-tools เพราะแผงตัวกรองบนแถบก็มีคลาส .tlt-tool-panel เหมือนกัน
     ถ้าเขียนกว้างกว่านี้จะไปแย่ง max-height ของแผงตัวกรองมาใช้สูตรของแถบเครื่องมือ
     และค่าสำรองต้องเป็น dvh ไม่ใช่ % เพราะ % จะอิงกับแถบเครื่องมือสูง 44px */
  .tlt-map-tools .tlt-tool-panel { max-height: calc(100dvh - var(--tlt-sheet-h, 41dvh) - 175px); }
  /* (0,2,0) — ของเดิมเป็น (0,1,0) ซึ่งแค่เสมอกับกฎของ MapLibre แล้วชนะด้วยลำดับโหลด
     ห้ามซ่อนเครดิตแผนที่ OpenFreeMap/OSM ไม่ว่าแผงจะย่อหรือกาง เป็นเงื่อนไขสัญญาอนุญาต */
  .tlt-ui-ready .maplibregl-ctrl-bottom-left,
  .tlt-ui-ready .maplibregl-ctrl-bottom-right { bottom: calc(var(--tlt-sheet-h, 41%) + 14px); }
  /* ต้องพ้นแถบเครื่องมือ (อยู่ที่ +44 สูง 44px) ไม่งั้นข้อความแจ้งเตือนจะทับปุ่มบนจอแคบ */
  .app #toast { bottom: calc(var(--tlt-sheet-h, 41%) + 98px); }

  .tlt-ui-ready .side .side-head { position: relative; }
  .tlt-ui-ready .side .side-head .topline { padding-right: 48px; gap: 8px; }
  .tlt-ui-ready .side .side-head h2 {
    font-size: 15px; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  /* ปุ่มวางแบบ absolute ไม่ใช่ flex ตัวที่สาม เพราะที่ 375px หัวแผงเหลือ 331px
     ซึ่งไม่พอให้หัวเรื่อง + จำนวนรายการ + ปุ่ม 44px อยู่บรรทัดเดียว */
  .tlt-ui-ready .side .tlt-sheet-toggle {
    display: grid; place-items: center;
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; padding: 0;
    border: 2px solid #0F0F0E; border-radius: 6px;
    background: #FFC91F; color: #0F0F0E;
    font-size: 20px; line-height: 1; cursor: pointer;
  }
  .tlt-ui-ready .side .tlt-sheet-toggle:focus-visible { outline: 3px solid #0F0F0E; outline-offset: 3px; }
  .tlt-ui-ready .side .tlt-sheet-toggle__arrow { display: block; transition: transform .18s ease; }
  .tlt-ui-ready .side.tlt-sheet--collapsed .tlt-sheet-toggle__arrow { transform: rotate(180deg); }
  .tlt-ui-ready .side.tlt-sheet--collapsed { height: auto; }
  .tlt-ui-ready .side.tlt-sheet--collapsed .cards { display: none; }
  .tlt-ui-ready .side.tlt-sheet--collapsed .side-head { border-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tlt-ui-ready .side .tlt-sheet-toggle__arrow { transition: none; }
}

/* 3.7.0 — ringed location pins, type colors independent of confidence. */
#tlt-live-map .tlt-map-marker {
  width: calc(44px * var(--tlt-pin-scale));
  height: calc(50px * var(--tlt-pin-scale));
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.18));
}
#tlt-live-map .tlt-map-marker .tlt-map-marker__pin {
  position: relative;
  display: block;
  width: calc(40px * var(--tlt-pin-scale));
  height: calc(50px * var(--tlt-pin-scale));
  color: var(--pa-marker-color, #444b57);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
  transform-origin: 50% 100%;
}
#tlt-live-map .tlt-map-marker .pa-type-pin { display: block; width: 100%; height: auto; overflow: visible; }
#tlt-live-map .tlt-map-marker:hover .tlt-map-marker__pin,
#tlt-live-map .tlt-map-marker:focus-visible .tlt-map-marker__pin { transform: scale(1.12); filter: brightness(1.04); }
#tlt-live-map .tlt-map-marker:focus-visible { outline: 2px solid #20242b; outline-offset: 4px; }
#tlt-live-map .tlt-cluster-marker { background: var(--pa-marker-color, #626975); color: #fff; box-shadow: 0 0 0 1px #fff, 0 2px 5px #0003; }
#tlt-live-map .tlt-cluster-marker--candidate { border-style: dashed; }
#tlt-live-map .tlt-cluster-marker--candidate::after { content: '?'; position: absolute; top: -7px; right: -7px; width: 14px; height: 14px; background: #fff; color: #222; border: 1px solid #555; border-radius: 50%; font: bold 11px/14px sans-serif; }
#tlt-legend-panel { max-height: min(650px, 65dvh); overflow-y: auto; }
.pa-type-legend { display: grid; gap: 4px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid #ddd; }
.pa-legend-pin { display: inline-block; flex: 0 0 18px; width: 18px; height: 25px; }
.pa-legend-pin svg { display: block; width: 18px; height: 25px; }
#tlt-legend-panel > p { line-height: 1.7; margin: 10px 0; }
@media (prefers-reduced-motion: reduce) { #tlt-live-map .tlt-map-marker__pin { transition: none; } }

@media (max-width: 720px) { #tlt-legend-panel { max-height: max(120px, calc(59dvh - 175px)); } }
