/* แผนที่กลางคืน มือถือก่อน ใช้คู่กับ Leaflet */
:root {
  color-scheme: light;
  --bg: #FBF7EE;
  --night: #17221D;
  --panel: #24342C;
  --panel-2: #2F443A;
  --ink: #3F5A4A;
  --muted: #57725F;
  --line: #E3E9DF;
  --line-2: #CFDDD2;
  --mint: #E3F1E6;
  --green-ink: #2F6B4C;
  --green-deep: #3E7A56;
  /* ข้อความบนพื้นเขียวเข้ม */
  --on-dark: #E3F1E6;
  --on-dark-muted: #A9C2B2;
  --dline: rgba(207, 229, 213, 0.22);
  --cyan: #BFE3CC;
  --gold: #ffd15c;
  /* สีหมุดตามผู้โพสต์ (ไม่เกี่ยวกับป้าย Official/รวบรวม/ติ๊กเหลือง) */
  --r-pharmacist: #2ee66b;
  --r-assistant: #ffe14d;
  --r-other: #b794f6;
  --r-job: #ffffff;
  --outline: #0a1020;
  --display: "Kanit", "Sarabun", system-ui, sans-serif;
  --body: "Sarabun", "Noto Sans Thai", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--night);
  color: var(--on-dark);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
}
button, a { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
#list-view :focus-visible, .leaflet-popup :focus-visible, .dock :focus-visible { outline-color: var(--green-deep); }

.demo, .top, .stage, .dock { position: relative; z-index: 1; }

.demo {
  margin: 0;
  background: #FBF0DC;
  color: #8A5A12;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 6px 12px;
}

.top {
  padding: 6px 12px 8px;
  padding-top: calc(6px + env(safe-area-inset-top));
  background: var(--night);
  border-bottom: 1px solid var(--dline);
}
.bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.back {
  flex: none;
  color: var(--on-dark);
  text-decoration: none;
  width: 36px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  line-height: 1;
}
.title { flex: 1 1 auto; min-width: 0; }
.title .meta { margin: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title .meta:empty { display: none; }
.info-btn { color: var(--on-dark); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
h1 {
  margin: 0;
  white-space: nowrap;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}
.view {
  display: flex;
  padding: 2px;
  border: 1px solid var(--dline);
  border-radius: 999px;
  background: var(--panel);
}
.view button {
  border: 0;
  background: transparent;
  color: var(--on-dark-muted);
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
}
.view button[aria-pressed="true"] {
  background: #ffffff;
  color: var(--ink);
}
.meta, .status, .tile-note, .list-note {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--on-dark-muted);
}
.status:empty { display: none; }
.status.is-device { color: #BFE3CC; }
.status.is-fallback { color: var(--gold); }
.tile-note { color: var(--gold); }
/* ตัวกรอง: เงินเดือนขั้นต่ำ / ระบุเงินเดือน / บันทึก (ไอคอนนำ ห่อบรรทัดได้) */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 5px;
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--on-dark);
}
.filters select {
  min-height: 36px;
  max-width: 100%;
  border: 1px solid var(--dline);
  border-radius: 999px;
  background: var(--panel);
  color: var(--on-dark);
  font: inherit;
  font-weight: 600;
  padding: 0 4px;
  min-width: 0;
  flex: 0 1 auto;
}
/* รูปแบบงาน: segmented control ทั้งหมด · ฟูลไทม์ · พาร์ทไทม์ */
.emp { display: inline-flex; border: 1px solid var(--dline); border-radius: 999px; overflow: hidden; flex: none; }
.emp button {
  min-height: 36px;
  padding: 0 5px;
  border: 0;
  background: var(--panel);
  color: var(--on-dark);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.emp button + button { border-left: 1px solid var(--dline); }
.emp button[aria-pressed="true"] { background: #ffffff; color: var(--ink); }
.emp button:focus-visible { outline: 2px solid var(--gold); outline-offset: -3px; }
/* ป้ายรูปแบบงาน: พื้นมิ้นต์ ตัวอักษรเขียวเข้ม (ในรายการและป๊อปอัป) */
.tags, .pop-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 2px; }
.pop-tags { margin: 0 0 4px; }
.etag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.f-check { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-weight: 600; white-space: nowrap; }
.f-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--green-deep); }
.f-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid var(--dline);
  border-radius: 999px;
  background: var(--panel);
  color: var(--on-dark);
  font-weight: 600;
  white-space: nowrap;
}
.f-chip svg { flex: none; }
.f-chip[aria-pressed="true"] { background: #ffffff; color: var(--ink); }
/* ชิปกรอง = คำอธิบายสีหมุดในตัว: ประเภทโพสต์ | ตำแหน่ง ห่อบรรทัดได้ */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 4px 0 0; }
.chip-group { display: contents; }
.chip-sep { width: 1px; height: 18px; background: var(--dline); margin: 0 2px; }
.rchip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--dline);
  border-radius: 999px;
  background: #E3F1E6;
  color: #17221D;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
}
.rchip:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
.rchip[aria-pressed="false"] { background: transparent; color: var(--on-dark); opacity: 0.45; }
.rchip[aria-pressed="false"] .swatch { background: transparent; box-shadow: none; border-color: var(--c, var(--on-dark-muted)); }
.swatch.r-any {
  --c: #2ee66b;
  --edge: #ffffff;
  background: conic-gradient(#2ee66b 0 33%, #ffe14d 0 66%, #b794f6 0);
  box-shadow: none;
}
.brand-name { color: #8FD0A8; }

/* ✓ เหลือง = ติ๊กเหลือง ต่อท้ายชื่อร้าน/บริษัท */
.vtick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15em;
  height: 1.15em;
  margin-left: 0.3em;
  border-radius: 50%;
  background: var(--gold);
  color: #3a2e12;
  font-size: 0.75em;
  font-weight: 800;
  line-height: 1;
  vertical-align: 0.08em;
  flex: none;
}

.stage { flex: 1; min-height: 0; position: relative; }
#map { position: absolute; inset: 0; background: #17221D; }
.leaflet-gl-layer,
.maplibregl-map { background: #17221D; }
.boot {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 16px;
  text-align: center;
  color: var(--on-dark-muted);
  pointer-events: none;
}
/* แผนที่ว่างจริง (Supabase ตอบ 0 แถว): โน้ตสั้นลอยบนแผนที่ ไม่บังการลาก/ซูม */
.map-empty { position: absolute; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; padding: 64px 12px 40px; pointer-events: none; } /* z 900: เหนือ pane ของ Leaflet (≤700) ใต้ปุ่มซูม (1000) */
.me-card { pointer-events: auto; width: min(340px, 100%); padding: 14px 16px; border-radius: 18px; background: rgba(255, 255, 255, .96); color: var(--ink); box-shadow: 0 4px 18px rgba(0, 0, 0, .3); text-align: center; }
.me-t { margin: 0; font-weight: 600; font-size: 15px; }
.me-acts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.me-acts:empty { display: none; }
.me-act { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 14px; border: 2px dashed #6FB58A; border-radius: 999px; background: #fff; color: var(--green-ink); font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.me-act:hover { background: #F4FAF5; }
.me-act.solid { border: 0; background: var(--green-deep); color: #fff; }
.me-act b { font-weight: 700; }
#list .empty-acts { display: flex; flex-direction: column; gap: 8px; padding: 0 16px 16px; max-width: 360px; }
#list .empty-acts .me-act:focus-visible, .me-card .me-act:focus-visible { outline-color: var(--green-deep); }
@media (min-width: 1024px) { #list .me-map { display: none; } } /* เดสก์ท็อปเห็นแผนที่ข้างรายการอยู่แล้ว */
#list-view { overflow: auto; background: var(--bg); color: var(--ink); padding-bottom: 12px; }
.list-note { padding: 10px 12px 0; color: var(--muted); }
.empty { margin: 0; padding: 24px 16px; color: var(--muted); }
.row-item {
  margin: 10px 12px 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(63, 90, 74, 0.06), 0 3px 10px rgba(63, 90, 74, 0.07);
}
.row-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 0 12px 12px 36px;
  font-size: 14px;
  font-weight: 600;
}
.row-contact a { color: var(--green-ink); min-height: 24px; }
/* ปุ่มนำทาง: ปุ่มรองสีขาว ตัวอักษร/ขอบเขียวเข้ม */
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--green-deep);
  border-radius: 999px;
  background: #fff;
  color: var(--green-deep);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  max-width: 100%;
  box-sizing: border-box;
}
.row-contact a.nav-btn, .leaflet-container a.nav-btn { color: var(--green-deep); min-height: 36px; }
.row-contact a.contact-btn, .leaflet-container a.contact-btn { color: var(--green-deep); }
.leaflet-popup-content p.pop-contact { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.nav-btn svg { flex: none; }
.nav-btn:hover { background: var(--mint); }
.leaflet-popup-content p.pop-nav { margin: 6px 0 0; }
.row {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-radius: 16px;
  padding: 12px;
  min-height: 76px;
}
.row-main { flex: 1; min-width: 0; }
.row b {
  display: block;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
}
.sub {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.km {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.swatch, .tick, .dot {
  flex: none;
  box-sizing: border-box;
}
.swatch { width: 12px; height: 12px; display: inline-block; }
.tick { width: 14px; height: 14px; display: block; }
.dot {
  width: 16px;
  height: 16px;
  margin: 5px;
  display: block;
  position: relative;
}
/* สีตามผู้โพสต์ */
.r-pharmacist { --c: var(--r-pharmacist); }
.r-assistant { --c: var(--r-assistant); }
.r-other { --c: var(--r-other); }
.r-job { --c: var(--r-job); --edge: #141b2e; }
/* เภสัชกร/ผู้ช่วย: ขอบขาว 2px + วงเงาเข้มรอบนอก ให้เด่นบนพื้นแผนที่มืด */
.r-pharmacist, .r-assistant { --edge: #ffffff; }
.swatch, .tick, .dot {
  background: var(--c);
  border: 2px solid var(--edge, var(--outline));
  box-shadow: 0 0 0 1px var(--c), 0 0 8px var(--c);
}
.swatch.r-pharmacist, .tick.r-pharmacist, .dot.r-pharmacist,
.swatch.r-assistant, .tick.r-assistant, .dot.r-assistant {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.75), 0 0 10px var(--c);
}
/* รูปร่างตามชนิด: ร้าน = สี่เหลี่ยมมน, คนหางาน = วงกลม */
.job { border-radius: 4px; }
.seeker { border-radius: 50%; }
/* รวบรวมจากกลุ่ม = เส้นขอบประ + จางลงเล็กน้อย (ไม่เปลี่ยนสี) */
.s-collected { border-style: dashed; opacity: 0.82; }
/* ร้านปักหมุดตำแหน่งจริง = จุดทึบเล็กตรงกลางสี่เหลี่ยมขาว (ขอบ #141b2e เหมือนเดิม) */
.dot.s-exact::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #141b2e;
}
.dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 1px solid var(--c);
  animation: ping 2.4s ease-out infinite;
}
.leaflet-marker-icon.dot-icon,
.leaflet-marker-icon.me-icon,
.leaflet-marker-icon.origin-icon,
.leaflet-marker-icon.ring-label {
  background: none;
  border: 0;
  overflow: visible;
}
.me { position: relative; width: 22px; height: 22px; }
.me-dot {
  position: absolute;
  left: 5px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan), 0 0 18px rgba(126, 231, 255, 0.75);
}
.me-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(126, 231, 255, 0.9);
  border-radius: 50%;
  animation: ping 2s ease-out infinite;
}
.cross {
  display: block;
  width: 18px;
  height: 18px;
  margin: 2px;
  border: 1px dashed rgba(198, 214, 255, 0.95);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(140, 170, 255, 0.4);
  position: relative;
}
.cross::before, .cross::after {
  content: "";
  position: absolute;
  background: rgba(220, 230, 255, 0.95);
}
.cross::before { width: 1px; top: 3px; bottom: 3px; left: 50%; }
.cross::after { height: 1px; left: 3px; right: 3px; top: 50%; }
.ring-label {
  color: #d7efe0;
  font-size: 11px;
  font-weight: 600;
  text-shadow: 0 0 6px #10201a, 0 0 2px #10201a;
}
.ring-label span { display: block; text-align: center; line-height: 16px; }

.dock {
  z-index: 2;
  display: flex;
  justify-content: center;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line-2);
}
.dock button {
  width: min(420px, 100%);
  min-height: 48px;
  border-radius: 999px;
  border: 0;
  background: var(--green-deep);
  color: #ffffff;
  font-family: var(--display);
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(62, 122, 86, 0.3);
}
.dock button:disabled { background: #B7CDBE; box-shadow: none; cursor: default; }

.leaflet-control-zoom a {
  background: #ffffff;
  color: var(--ink);
  border-bottom-color: var(--line-2);
  width: 36px;
  height: 36px;
  line-height: 36px;
}
.leaflet-control-zoom a:hover { background: var(--mint); color: var(--green-ink); }
.leaflet-bar {
  border: 1px solid var(--line-2);
  border-radius: 10px;
  overflow: hidden;
}
.leaflet-control-attribution {
  background: rgba(251, 247, 238, 0.92) !important;
  color: var(--ink) !important;
  font-size: 11px;
  line-height: 1.35;
  max-width: min(440px, calc(100% - 12px));
  white-space: normal;
}
.leaflet-control-attribution a { color: var(--green-ink) !important; }
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #ffffff;
  color: var(--ink);
}
.leaflet-popup-content-wrapper {
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(23, 34, 29, 0.35);
}
.leaflet-popup-content { margin: 10px 12px; line-height: 1.4; }
.leaflet-popup-content p { margin: 0 0 4px; }
.leaflet-popup-close-button {
  color: var(--muted) !important;
  font-size: 18px !important;
}
.pop-badge { font-size: 12px; font-weight: 700; letter-spacing: 0.01em; color: var(--ink); }
.pop-contact a { color: var(--green-ink); }
.pop-contact { font-weight: 600; }
.pop-title {
  color: var(--ink);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px;
}
.pop-muted { color: var(--muted); font-size: 13px; }
.pop-dist { font-weight: 600; }

@keyframes ping {
  0% { transform: scale(0.7); opacity: 0.75; }
  100% { transform: scale(2.15); opacity: 0; }
}

@media (max-width: 480px) {
  h1 { font-size: 17px; }
  .bar { gap: 4px; }
  .view { flex-shrink: 0; }
  .view button { padding: 6px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .dot::after, .me-ring { animation: none; opacity: 0.8; }
}

/* เงินเดือน (สไตล์ Money): ตัวเลขหนาสีเขียวเข้ม หน่วยตัวเล็ก */
.salary { color: var(--green-ink); font-weight: 600; }
.salary b { font-family: var(--display); font-size: 18px; font-weight: 600; }
.salary small { font-size: 13px; color: var(--green-ink); }
.row-main .salary { display: block; margin-top: 4px; white-space: nowrap; }
.row .salary b { display: inline; color: #2F6B4C; font-size: 16px; font-weight: 700; }
.row .salary small { display: inline; color: #2F6B4C; font-size: 13px; font-weight: 400; }
.leaflet-popup-content p.salary { margin: 0 0 6px; }

/* ปุ่มบันทึก (บุ๊กมาร์ก) มุมขวาบนของการ์ดและ popup */
.bm {
  flex: none;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  padding: 0;
}
.bm svg { fill: none; stroke: currentColor; }
.bm[aria-pressed="true"] { background: var(--mint); color: var(--green-deep); border-color: var(--green-deep); }
.bm[aria-pressed="true"] svg { fill: var(--green-deep); stroke: var(--green-deep); }
.row-item { position: relative; }
.row-item .bm { position: absolute; top: 10px; right: 10px; }
.row-item .row { padding-right: 64px; }
.pop-head { display: flex; align-items: flex-start; gap: 8px; padding-right: 18px; }
.pop-head-text { flex: 1; min-width: 0; }
.pop-head .bm { width: 40px; height: 40px; }

/* จอแคบ: ซ่อนคำว่า "แผนที่" หลังชื่อแบรนด์ (ปุ่มสลับมุมมองบอกอยู่แล้ว) แต่โปรแกรมอ่านจอยังอ่านได้ */
@media (max-width: 400px) {
  h1 .h1-sub {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
}

/* ===== เดสก์ท็อป (>=1024px): แถบกรองซ้าย + รายการกลาง + แผนที่เล็กขวา ===== */
.work { display: contents; }
.side { display: none; }
@media (min-width: 1024px) {
  .work {
    display: grid;
    flex: 1;
    min-height: 0;
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .filters, .chips { display: none; }
  .side {
    display: block;
    grid-column: 1;
    grid-row: 1 / -1;
    position: relative;
    z-index: 3;
    overflow-y: auto;
    padding: 14px 14px 18px;
    background: var(--bg);
    color: var(--ink);
    border-right: 1px solid var(--line-2);
  }
  .side :focus-visible { outline-color: var(--green-deep); }
  .sb-group { margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
  .sb-h { margin: 0 0 1px; font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
  .sb-opt {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 40px;
    padding: 6px 10px;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: #fff;
    color: var(--muted);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
  }
  .sb-opt:hover { border-color: var(--green-deep); }
  .sb-opt[aria-pressed="true"] { background: var(--mint); border-color: var(--green-deep); color: var(--ink); font-weight: 600; }
  .sb-opt .sb-t { flex: 1; min-width: 0; }
  .sb-opt .sb-n { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }
  .sb-opt:not([aria-pressed="true"]) .swatch { opacity: 0.55; }
  .sb-opt svg { flex: none; }
  .sb-select {
    width: 100%;
    min-height: 40px;
    padding: 0 8px;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
  }

  /* โหมดแผนที่: แผนที่ใหญ่ถัดจากแถบกรอง */
  #map-view { grid-column: 2; grid-row: 1; }
  .dock { grid-column: 2 / -1; grid-row: 2; }
  /* โหมดรายการ: รายการกลาง + แผนที่เล็กขวา */
  body.v-list .work { grid-template-columns: 240px clamp(400px, 40vw, 600px) minmax(0, 1fr); }
  body.v-list #list-view { grid-column: 2; grid-row: 1; border-right: 1px solid var(--line-2); }
  body.v-list #map-view { grid-column: 3; }
  /* การ์ดกะทัดรัด: ระยะทางอยู่ชิดบุ๊กมาร์ก ไม่ลอยไปสุดขอบ */
  .row-item { max-width: 600px; }
  .row { align-items: flex-start; }
  .row .km { align-self: flex-start; margin-top: 11px; font-size: 14px; }
  .row-item .bm { top: 8px; }
  .row-item.is-hl, .row-item:hover { border-color: var(--green-deep); }
  /* ไฮไลต์หมุดเมื่อชี้/โฟกัสการ์ด */
  .dot-icon.is-hl .dot {
    transform: scale(1.45);
    box-shadow: 0 0 0 3px var(--mint), 0 0 0 5px var(--green-ink), 0 0 14px var(--c);
  }
  .dot-icon .dot { transition: transform 0.12s; }
}

/* แถบแจ้งตัวกรองเฉพาะครั้งนี้ (?store= / ?id=) และไฮไลต์การ์ดที่เปิดจากหน้าแรก (?id=) */
.visit-note {
  margin: 6px 12px 0;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 14px;
}
.visit-note[hidden] { display: none; }
.visit-note button {
  min-height: 32px;
  padding: 0 12px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: 600 14px/1 var(--body, inherit);
  cursor: pointer;
}
.row-item.is-target { outline: 3px solid #6FB58A; outline-offset: 2px; }

/* ระบบสมาชิก (t92u): ความสดของประกาศ, ปุ่มแจ้งปิด, หลายหมุด, รูปประจำตัว */
.fresh { display: block; margin-top: 4px; font-size: 13px; font-weight: 600; color: #2F6B4C; }
.leaflet-popup-content p.fresh { margin: 2px 0 6px; }
.fresh.is-stale { color: #6b6f6c; font-weight: 500; }
/* เก่ากว่า 21 วัน (STALE_DAYS ใน freshness.js): จางลงและเรียงต่ำกว่า (ข้อความยังอ่านได้ ปุ่มด้านล่างไม่จาง) */
.row-item.is-stale .row { opacity: .62; }
.dot.is-stale { opacity: .5; }
.leaflet-popup-content .is-stale > p:not(.pop-report):not(.pop-nav) { opacity: .7; }
.pins-note { font-weight: 600; }
.pop-branch { font-weight: 700; margin: 2px 0; }
.report-btn {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #fff;
  color: #5b615e;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}
.report-btn:hover:not(:disabled) { border-color: var(--green-deep); color: var(--green-deep); }
.report-btn:disabled { background: #f1f3f1; color: #6b6f6c; cursor: default; }
.leaflet-popup-content p.pop-report { margin: 8px 0 0; }
.row-contact .report-btn { margin-left: auto; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--mint); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: 14px; background: #17221D; color: #fff; font-weight: 700; font-size: 15px; box-shadow: 0 6px 20px rgba(23, 34, 29, .3); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s, transform .2s, visibility .2s; z-index: 2000; text-align: center; }
.toast.on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* กล่องยืนยันแจ้งปิด: มือถือ = bottom sheet, จอกว้าง = กลางจอ ; <dialog> modal อยู่ชั้นบนสุดเหนือแผนที่/ป๊อปอัป */
dialog.confirm-dialog {
  box-sizing: border-box;
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: 20px 20px 0 0;
  background: #FBF7EE;
  color: #17221D;
  box-shadow: 0 -8px 30px rgba(23, 34, 29, .35);
  overflow: hidden;
}
dialog.confirm-dialog::backdrop { background: rgba(23, 34, 29, .55); }
.confirm-q { margin: 0 0 16px; font: 600 18px/1.45 "Kanit", "Sarabun", system-ui, sans-serif; text-align: center; overflow-wrap: anywhere; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions button { flex: 1; min-height: 48px; border-radius: 12px; font: 600 16px "Sarabun", "Noto Sans Thai", system-ui, sans-serif; cursor: pointer; }
.confirm-no { border: 2px solid var(--green-deep); background: var(--green-deep); color: #fff; }
.confirm-yes { border: 1.5px solid var(--line-2); background: #fff; color: #3F5A4A; }
.confirm-actions button:focus-visible { outline: 3px solid #3E7A56; outline-offset: 2px; }
@media (min-width: 640px) {
  dialog.confirm-dialog { inset: 0; margin: auto; width: 400px; height: fit-content; border-radius: 16px; padding-bottom: 20px; box-shadow: 0 12px 34px rgba(23, 34, 29, .4); }
  dialog.confirm-dialog::backdrop { background: rgba(23, 34, 29, .35); }
}
/* t122u: ป้าย "พร้อมเริ่มงานทันที" */
.etag.rtag { background: #E3F4E8; border: 1px solid #8CCB9F; color: #145A2E; }
/* t122u: ชิปตัวกรองที่ลบได้ในแถบ "กำลังกรอง" */
.filter-chips { display: inline-flex; flex-wrap: wrap; gap: 4px 6px; }
.filter-chips:empty { display: none; }
.visit-note button.fchip { min-height: 32px; padding: 0 10px; background: #fff; color: var(--ink, #17221D); border-color: #fff; }
#f-exp { max-width: 100%; }
