/* ==========================================================================
   SITEMAP PAGE STYLES (sitemap.ejs) — DOAE RISK MAP · กรมส่งเสริมการเกษตร
   Theme: DOAE Green & Forest (#2d6a4f, #1b4332, #1b5e20) Aligned with GEOPLOTS
   ========================================================================== */

:root {
  --smp-primary: #2d6a4f;
  --smp-primary-dark: #1b4332;
  --smp-primary-deep: #0f2e21;
  --smp-primary-light: #e8f5e9;
  --smp-accent: #d28b5c;
  --smp-border: #e2e8f0;
  --smp-text: #1e293b;
  --smp-muted: #64748b;
  --smp-bg: #f8fafc;
  --smp-card-radius: 14px;
  --smp-shadow: 0 2px 10px rgba(15, 40, 24, 0.06);
  --smp-shadow-hover: 0 10px 24px rgba(45, 106, 79, 0.18);
}

body {
  font-family: 'Prompt', 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--smp-bg);
  color: var(--smp-text);
  margin: 0;
  padding: 0;
}

/* ── Top Navigation Bar ───────────────────────────────────── */
.sitemap-topbar {
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.65rem 0;
  color: #ffffff;
}

.sitemap-topbar .home-link {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.sitemap-topbar .home-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
}

/* ป้าย "หน้าหลัก" ชิดซ้ายเสมอ (แม้แถบผู้ใช้ตัดขึ้นบรรทัดใหม่) */
.sitemap-topbar .home-link {
  margin-right: auto;
}

.sitemap-topbar .user-pill {
  font-size: 0.82rem;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.12);
  padding: 4px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── แถบผู้ใช้บน topbar: ใช้ชุดสไตล์เดียวกับหน้า landing (.user-bar) ── */
.sitemap-topbar .sitemap-user-bar {
  width: auto;
  margin-bottom: 0;
  margin-left: auto !important; /* บังคับชิดขวาของแถบเสมอ */
  justify-content: flex-end;
  flex-wrap: wrap;
}

.sitemap-topbar .sitemap-user-bar .visitor-counter-pill,
.sitemap-topbar .sitemap-user-bar .user-pill-container,
.sitemap-topbar .sitemap-user-bar .user-level-pill-container,
.sitemap-topbar .sitemap-user-bar .manual-btn-top,
.sitemap-topbar .sitemap-user-bar .btn-logout--icon {
  height: 34px;
}

.sitemap-topbar .sitemap-user-bar .visitor-counter-pill {
  padding: 0 13px;
  font-size: 0.8rem;
}

.sitemap-topbar .sitemap-user-bar .user-pill-container,
.sitemap-topbar .sitemap-user-bar .user-level-pill-container {
  padding: 3px 11px;
  font-size: 0.78rem;
  box-shadow: none;
}

.sitemap-topbar .sitemap-user-bar .manual-btn-top,
.sitemap-topbar .sitemap-user-bar .btn-logout--icon {
  width: 34px;
}

.sitemap-topbar .sitemap-user-bar .manual-btn-top svg {
  width: 15px;
  height: 15px;
}

/* ── Hero ─────────────────────────────────────────────────── */
.sitemap-hero {
  background:
    radial-gradient(1100px 320px at 88% -60%, rgba(210, 139, 92, 0.22), transparent 60%),
    linear-gradient(135deg, var(--smp-primary-deep) 0%, var(--smp-primary-dark) 45%, var(--smp-primary) 100%);
  color: #ffffff;
  padding: 2.6rem 0 2.2rem;
  position: relative;
}

.sitemap-hero__logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
  flex: 0 0 auto;
}

.sitemap-hero__org {
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.88);
}

.sitemap-hero__title {
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
}

.sitemap-hero__en {
  display: inline-block;
  font-size: 0.55em;
  font-weight: 500;
  vertical-align: middle;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  padding: 0.15em 0.85em;
  margin-left: 0.4em;
  letter-spacing: 0.05em;
}

.sitemap-hero__sub {
  font-size: 0.96rem;
  color: rgba(255, 255, 255, 0.92);
}

.sitemap-legend .badge {
  font-weight: 500;
  font-size: 0.8rem;
  padding: 0.45em 0.9em;
  border-radius: 999px;
}

.sitemap-stats-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

/* ── Badges ───────────────────────────────────────────────── */
.sitemap-badge-login {
  background: #fff7ed;
  color: #b45309;
  border: 1px solid #fed7aa;
}

.sitemap-badge-public {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.sitemap-badge-admin {
  background: #fdf2f8;
  color: #be185d;
  border: 1px solid #fbcfe8;
}

.sitemap-badge-ext {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* ── Search toolbar ───────────────────────────────────────── */
.sitemap-toolbar {
  background: #ffffff;
  border-bottom: 1px solid var(--smp-border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: var(--smp-shadow);
  transition: box-shadow 0.2s ease;
}

.sitemap-toolbar.is-stuck {
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
}

.sitemap-search {
  position: relative;
  display: flex;
  align-items: center;
}

.sitemap-search__icon {
  position: absolute;
  left: 16px;
  color: var(--smp-muted);
  font-size: 1rem;
  pointer-events: none;
}

.sitemap-search__input {
  width: 100%;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.72rem 2.9rem;
  font-size: 0.98rem;
  font-family: inherit;
  color: var(--smp-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.sitemap-search__input:focus {
  outline: none;
  border-color: var(--smp-primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(45, 106, 79, 0.15);
}

.sitemap-search__clear {
  position: absolute;
  right: 12px;
  border: 0;
  background: transparent;
  color: var(--smp-muted);
  font-size: 1.05rem;
  padding: 4px 6px;
  border-radius: 8px;
  display: none;
  cursor: pointer;
}

.sitemap-search__clear.is-visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sitemap-search__clear:hover {
  color: var(--smp-primary-dark);
  background: var(--smp-primary-light);
}

/* ── Access-type filter pills ─────────────────────────────── */
.sitemap-filter-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  min-width: 0;
}

.sitemap-filter-pills__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--smp-muted);
  white-space: nowrap;
}

.sitemap-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.5rem;
  font-size: 0.78rem;
  font-family: inherit;
  font-weight: 500;
  line-height: 1.2;
  color: var(--smp-text);
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.sitemap-pill:hover {
  color: var(--smp-primary-dark);
  background: #f1f8f5;
  border-color: var(--smp-primary);
}

.sitemap-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.2);
}

.sitemap-pill--active {
  color: #ffffff;
  background: var(--smp-primary);
  border-color: var(--smp-primary);
  box-shadow: 0 3px 8px rgba(45, 106, 79, 0.28);
}

.sitemap-pill--active:hover {
  color: #ffffff;
  background: var(--smp-primary-dark);
  border-color: var(--smp-primary-dark);
}

.sitemap-pill .badge {
  font-size: 0.66rem;
  font-weight: 600;
  padding: 0.18em 0.42em;
  border-radius: 999px;
  color: var(--smp-primary-dark);
  background: #e2ede8;
}

.sitemap-pill--active .badge {
  color: var(--smp-primary-dark);
  background: #ffffff;
}

/* ── Toolbar result counter ───────────────────────────────── */
.sitemap-toolbar .sitemap-stats-badge,
.sitemap-stats-badge.sitemap-match-counter {
  font-size: 0.8rem;
  padding: 0.34rem 0.8rem;
  color: var(--smp-primary-dark);
  background: #f1f8f5;
  border: 1px solid #cde8dc;
  white-space: nowrap;
}

.sitemap-stats-badge.sitemap-match-counter strong {
  font-weight: 700;
  color: var(--smp-primary);
}

/* ── Category jump bar ────────────────────────────────────── */
.sitemap-jump-container {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--smp-border);
}

.sitemap-jump-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.sitemap-jump-label {
  flex: 0 0 auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--smp-muted);
  white-space: nowrap;
}

.sitemap-jump-track {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  min-width: 0;
  flex: 1 1 auto;
  padding: 2px 2px 4px;
  margin: -2px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.sitemap-jump-track::-webkit-scrollbar {
  height: 5px;
}

.sitemap-jump-track::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.sitemap-jump-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  color: var(--smp-text);
  background: #ffffff;
  border: 1px solid var(--smp-border);
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.sitemap-jump-pill:hover,
.sitemap-jump-pill:focus-visible {
  color: var(--smp-primary-dark);
  background: #f1f8f5;
  border-color: rgba(45, 106, 79, 0.45);
  text-decoration: none;
}

.sitemap-jump-pill--active {
  color: #ffffff;
  background: var(--smp-primary);
  border-color: var(--smp-primary);
  box-shadow: 0 2px 6px rgba(45, 106, 79, 0.25);
}

.sitemap-jump-pill--active:hover {
  color: #ffffff;
  background: var(--smp-primary-dark);
}

/* ── Section item counter ─────────────────────────────────── */
.sitemap-section__count {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  padding: 0.24rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--smp-primary-dark);
  background: #f1f8f5;
  border: 1px solid #cde8dc;
  border-radius: 999px;
  white-space: nowrap;
}

.sitemap-section__count i {
  font-size: 0.72rem;
  color: var(--smp-primary);
}

/* ── Section ──────────────────────────────────────────────── */
.sitemap-container {
  padding-top: 2rem;
}

.sitemap-section {
  margin-bottom: 2.3rem;
}

.sitemap-section__head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e2e8f0;
}

.sitemap-section__icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #ffffff;
  background: linear-gradient(135deg, var(--smp-primary) 0%, var(--smp-primary-dark) 100%);
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(45, 106, 79, 0.25);
}

.sitemap-section__title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--smp-primary-dark);
  margin: 0;
  line-height: 1.3;
}

.sitemap-section__desc {
  font-size: 0.86rem;
  color: var(--smp-muted);
  margin: 0;
}

/* ── Card ─────────────────────────────────────────────────── */
.sitemap-card {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  height: 100%;
  background: #ffffff;
  border: 1px solid var(--smp-border);
  border-radius: var(--smp-card-radius);
  padding: 1rem 1.05rem;
  text-decoration: none;
  color: var(--smp-text);
  box-shadow: var(--smp-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
  overflow: hidden;
}

.sitemap-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--smp-primary);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.sitemap-card:hover,
.sitemap-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(45, 106, 79, 0.45);
  box-shadow: var(--smp-shadow-hover);
  color: var(--smp-text);
  outline: none;
}

.sitemap-card:hover::before,
.sitemap-card:focus-visible::before {
  opacity: 1;
}

.sitemap-card__icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--smp-primary);
  background: #f1f8f5;
  border-radius: 11px;
  transition: all 0.18s ease;
}

.sitemap-card:hover .sitemap-card__icon {
  color: #ffffff;
  background: var(--smp-primary);
}

.sitemap-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  min-width: 0;
  flex: 1 1 auto;
}

.sitemap-card__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--smp-primary-dark);
  line-height: 1.35;
}

.sitemap-card__title .badge {
  font-weight: 500;
  font-size: 0.7rem;
  padding: 0.28em 0.7em;
  border-radius: 999px;
  white-space: nowrap;
}

.sitemap-card__desc {
  font-size: 0.85rem;
  color: var(--smp-muted);
  line-height: 1.48;
}

.sitemap-card__url {
  align-self: flex-start;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 0.74rem;
  font-family: monospace;
  color: #075985;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 0.14em 0.55em;
  margin-top: 0.15rem;
}

/* ── No result ────────────────────────────────────────────── */
.sitemap-no-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 2.8rem 1rem;
  color: var(--smp-muted);
  background: #ffffff;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--smp-card-radius);
  text-align: center;
}

.sitemap-no-result i {
  font-size: 2.4rem;
  color: #94a3b8;
}

/* ── Back to Top Floating Button ──────────────────────────── */
.sitemap-back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--smp-primary);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 1030;
  transition: all 0.2s ease;
}

.sitemap-back-to-top:hover {
  background: var(--smp-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

/* ── Footer ───────────────────────────────────────────────── */
.sitemap-footer {
  background: #0f172a;
  border-top: 3px solid var(--smp-primary);
  color: #cbd5e1;
  padding: 1.6rem 0 1.8rem;
  font-size: 0.92rem;
}

.sitemap-footer__meta {
  font-size: 0.82rem;
  color: #94a3b8;
}

@media (min-width: 992px) and (max-width: 1399.98px) {
  /* ระหว่าง lg–xl พื้นที่แถบเครื่องมือจำกัด: ซ่อนไอคอนใน pill เพื่อให้อยู่บรรทัดเดียว */
  .sitemap-pill > i {
    display: none;
  }

  .sitemap-stats-badge.sitemap-match-counter {
    font-size: 0.74rem;
    padding: 0.28rem 0.5rem;
  }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sitemap-jump-label {
    display: none;
  }

  .sitemap-toolbar .sitemap-stats-badge,
  .sitemap-stats-badge.sitemap-match-counter {
    display: inline-flex;
    margin-top: 0.2rem;
  }
}

@media (max-width: 767.98px) {
  .sitemap-toolbar {
    padding: 0.65rem 0 0.55rem;
  }

  .sitemap-filter-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .sitemap-filter-pills::-webkit-scrollbar {
    display: none;
  }

  .sitemap-pill {
    font-size: 0.78rem;
    padding: 0.3rem 0.6rem;
  }

  /* Keep the sticky bar short on phones: the counter row is redundant
     because the search hint already shows the match total. */
  .sitemap-toolbar .sitemap-stats-badge,
  .sitemap-stats-badge.sitemap-match-counter {
    display: none;
  }

  .sitemap-jump-container {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
  }

  .sitemap-jump-track {
    padding: 1px 1px 2px;
  }
}

@media (max-width: 575.98px) {
  .sitemap-hero {
    padding: 1.8rem 0 1.6rem;
  }

  .sitemap-hero__logo {
    width: 56px;
    height: 56px;
  }

  .sitemap-section__icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .sitemap-card {
    padding: 0.85rem 0.9rem;
  }

  .sitemap-back-to-top {
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .sitemap-topbar,
  .sitemap-toolbar,
  .sitemap-jump-container,
  .sitemap-filter-pills,
  .sitemap-section__count,
  .sitemap-search__clear,
  .sitemap-back-to-top,
  .sitemap-hero .sitemap-legend {
    display: none !important;
  }

  body {
    background: #ffffff;
  }

  .sitemap-card {
    box-shadow: none;
    break-inside: avoid;
  }

  .sitemap-hero {
    background: var(--smp-primary-dark) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ==========================================================================
   Block Visibility (Full-Parity · พอร์ตจาก GEOPLOTS)
   เพิ่มเมื่อ 2026-11-11 — ป้ายโหมด + ปุ่มควบคุมต่อการ์ด (แผง Admin ถูกนำออกตามข้อกำหนด)
   ========================================================================== */

/* ── Mode badge ต่อการ์ด (แสดงโหมดจริงจากฐานข้อมูล) ── */
/* ── คอลัมน์การ์ด: ให้การ์ด + แถวป้ายโหมดเรียงในแนวตั้ง ไม่ซ้อนกัน ── */
.sitemap-col {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

/* เดิม height:100% ทำให้การ์ดสูงเต็มคอลัมน์ แล้วแถวป้ายโหมดล้นไปทับการ์ดแถวถัดไป */
.sitemap-col .sitemap-card {
  flex: 1 1 auto;
  height: auto;
}

.sitemap-card__mode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 0;
  padding: 0 0.15rem 0.1rem;
}

.sitemap-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid transparent;
  white-space: nowrap;
}

.sitemap-mode-badge--public {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.sitemap-mode-badge--login {
  background: #fff7ed;
  color: #b45309;
  border-color: #fed7aa;
}

.sitemap-mode-badge--hidden {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

/* ── ปุ่มควบคุมโหมดรายการเดียว (เห็นเฉพาะผู้ดูแล) ── */
.sitemap-bv-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.sitemap-bv-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.sitemap-bv-btn:hover:not(:disabled) {
  background: #e2e8f0;
  color: #0f172a;
}

.sitemap-bv-btn.is-active {
  background: var(--smp-primary, #2d6a4f);
  color: #ffffff;
}

.sitemap-bv-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.sitemap-pill--hidden {
  border-color: #fecaca;
  color: #b91c1c;
}

.sitemap-pill--hidden.sitemap-pill--active {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}

/* ══════════════════════════════════════════════════════════════════
   สถานะการให้บริการ (Service Status) — อ่านจาก hotspot.block_status
   แสดงป้ายบนการ์ดทุกใบ + ตัวกรอง + ปุ่มควบคุมของผู้ดูแล
   ══════════════════════════════════════════════════════════════════ */
.sitemap-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid transparent;
  white-space: nowrap;
}

.sitemap-status-badge--active {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.sitemap-status-badge--dev {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.sitemap-status-badge--maintenance {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.sitemap-status-badge--retired {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

/* หมายเหตุสถานะ (เช่น "ปิดปรับปรุงถึงวันที่ …") */
.sitemap-status-note {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #475569;
  font-size: 0.7rem;
  line-height: 1.45;
  width: 100%;
}

/* ปุ่มควบคุมสถานะรายการเดียว (เห็นเฉพาะผู้ดูแล) */
.sitemap-status-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.sitemap-status-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 0.68rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.sitemap-status-btn:hover:not(:disabled) {
  background: #e2e8f0;
  color: #0f172a;
}

.sitemap-status-btn--active.is-active {
  background: #047857;
  color: #ffffff;
}

.sitemap-status-btn--dev.is-active {
  background: #d97706;
  color: #ffffff;
}

.sitemap-status-btn--maintenance.is-active {
  background: #dc2626;
  color: #ffffff;
}

.sitemap-status-btn--retired.is-active {
  background: #475569;
  color: #ffffff;
}

.sitemap-status-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

/* ตัวกรองตามสถานะ (pill แถวที่ 2) */
.sitemap-filter-pills--status {
  gap: 6px;
}

.sitemap-filter-pills--status .sitemap-pill--status-active {
  border-color: #a7f3d0;
  color: #047857;
}

.sitemap-filter-pills--status .sitemap-pill--status-active.sitemap-pill--active {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}

.sitemap-filter-pills--status .sitemap-pill--status-dev {
  border-color: #fde68a;
  color: #b45309;
}

.sitemap-filter-pills--status .sitemap-pill--status-dev.sitemap-pill--active {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}

.sitemap-filter-pills--status .sitemap-pill--status-maintenance {
  border-color: #fecaca;
  color: #b91c1c;
}

.sitemap-filter-pills--status .sitemap-pill--status-maintenance.sitemap-pill--active {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}

.sitemap-filter-pills--status .sitemap-pill--status-retired {
  border-color: #cbd5e1;
  color: #475569;
}

.sitemap-filter-pills--status .sitemap-pill--status-retired.sitemap-pill--active {
  background: #f8fafc;
  border-color: #64748b;
  color: #334155;
}

/* การ์ดที่ยังใช้งานไม่ได้: ลดความเด่นของลิงก์ แต่ยังเห็นป้าย/ปุ่มควบคุมของผู้ดูแล */
.sitemap-col[data-bv-status="dev"] .sitemap-card > :not(.sitemap-card__body),
.sitemap-col[data-bv-status="maintenance"] .sitemap-card > :not(.sitemap-card__body) {
  opacity: 0.72;
}

.sitemap-card[aria-disabled="true"] {
  cursor: not-allowed;
}

/* ── Toast ── */
.sitemap-bv-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: #0f172a;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  font-size: 0.85rem;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 90vw;
}

.sitemap-bv-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sitemap-bv-toast.is-ok {
  background: #14532d;
  border: 1px solid #34d399;
}

.sitemap-bv-toast.is-error {
  background: #7f1d1d;
  border: 1px solid #f87171;
}

/* ── Modal จำลองสิทธิ์ (แบบ GEOPLOTS — เปิดจากป้ายระดับสิทธิ์) ── */
.usim-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
}

.usim-overlay.is-open { display: flex; }

.usim-dialog {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  animation: usimPop 0.18s ease-out;
}

@keyframes usimPop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.usim-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #15803d, #16a34a);
  color: #ffffff;
  border-radius: 16px 16px 0 0;
}

.usim-head--simulating { background: linear-gradient(135deg, #b45309, #d97706); }

.usim-head__titles { min-width: 0; }

.usim-title { margin: 0; font-size: 1.05rem; font-weight: 700; color: #ffffff; }
.usim-title i { margin-right: 0.35rem; }

.usim-subtitle { margin: 0.2rem 0 0; font-size: 0.78rem; color: rgba(255, 255, 255, 0.85); }

.usim-close {
  flex: 0 0 auto;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.usim-close:hover { background: rgba(255, 255, 255, 0.32); }

.usim-body { padding: 1.1rem 1.25rem 1.25rem; }

.usim-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}

.usim-status i { font-size: 1.05rem; }
.usim-status--off { background: #f0fdf4; border: 1px solid #bbf7d0; color: #000000; }
.usim-status--on { flex-wrap: wrap; background: #fffbeb; border: 1px solid #fde68a; color: #000000; }

.usim-status__row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.usim-status__real { color: #a16207; font-size: 0.8rem; }

.usim-switch-hint {
  text-align: center;
  color: #000000;
  font-size: 0.78rem;
  font-weight: 500;
  margin: 0 0 0.75rem;
}

.usim-form { display: flex; flex-direction: column; gap: 0.6rem; }
.usim-label { font-size: 0.82rem; font-weight: 600; color: #000000; margin: 0; }
.usim-req { color: #000000; }
.usim-field[hidden] { display: none; }

.usim-level-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.usim-level-btn {
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #000000;
  border-radius: 10px;
  padding: 0.5rem 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.usim-level-btn:hover { border-color: #16a34a; color: #000000; }

.usim-level-btn.is-active {
  border-color: #16a34a;
  background: #f0fdf4;
  color: #000000;
  box-shadow: inset 0 0 0 1px #16a34a;
}

.usim-select {
  width: 100%;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  font-size: 0.88rem;
  color: #000000;
  background: #ffffff;
}

.usim-select:focus {
  outline: none;
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.usim-note {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: #000000;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
}

.usim-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.35rem; }

.usim-btn {
  border: none;
  border-radius: 10px;
  padding: 0.5rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.usim-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.usim-btn--primary { background: #16a34a; color: #ffffff; }
.usim-btn--primary:hover:not(:disabled) { background: #15803d; }
.usim-btn--reset { background: #d97706; color: #ffffff; width: 100%; margin-top: 0.35rem; }
.usim-btn--reset:hover:not(:disabled) { background: #b45309; }
.usim-btn--ghost { background: #f1f5f9; color: #000000; }
.usim-btn--ghost:hover { background: #e2e8f0; }

.usim-msg { margin: 0.35rem 0 0; font-size: 0.8rem; color: #000000; min-height: 1.1em; }
.usim-msg--error { color: #000000; }

@media (max-width: 480px) {
  .usim-level-group { grid-template-columns: 1fr; }
}

/* ── แบนเนอร์โหมดจำลองสิทธิ์ (ทดแทน manubar ที่นำออกแล้ว) ── */
.sitemap-sim-banner {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 1px solid #fbbf24;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.9rem;
}

.sitemap-sim-banner > i {
  color: #b45309;
}

.sitemap-sim-banner__btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #b45309;
  background: #b45309;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.sitemap-sim-banner__btn:hover {
  background: #92400e;
}

.sitemap-sim-banner__btn:disabled {
  opacity: 0.6;
  cursor: wait;
}


/* ==========================================================================
   แผงจัดการปุ่มเมนูหน้าแรก (Landing Page) — #sitemapCbPanel
   ใช้ร่วมกับ views/partials/sitemap_landing_buttons.ejs
   ========================================================================== */
.sitemap-cb-panel {
  margin: 0 0 1.25rem;
  border: 1px solid var(--smp-border, #e2e8f0);
  border-radius: var(--smp-card-radius, 14px);
  background: #ffffff;
  box-shadow: var(--smp-shadow, 0 2px 10px rgba(15, 40, 24, 0.06));
  overflow: hidden;
}

.sitemap-cb-panel__head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border-bottom: 1px solid var(--smp-border, #e2e8f0);
}

.sitemap-cb-panel__icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--smp-primary, #2d6a4f);
  color: #ffffff;
  font-size: 0.95rem;
}

.sitemap-cb-panel__titles {
  min-width: 0;
  flex: 1 1 auto;
}

.sitemap-cb-panel__title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--smp-text, #1e293b);
  line-height: 1.35;
}

.sitemap-cb-panel__desc {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--smp-muted, #64748b);
  line-height: 1.45;
}

.sitemap-cb-panel__count {
  flex: 0 0 auto;
  align-self: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(45, 106, 79, 0.1);
  color: var(--smp-primary-dark, #1b4332);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}


.sitemap-cb-panel__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px dashed var(--smp-border, #e2e8f0);
  background: #f8fafc;
}

.sitemap-cb-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 6px 12px;
  border: 1px solid var(--smp-border, #e2e8f0);
  border-radius: 999px;
  background: #ffffff;
  color: var(--smp-text, #1e293b);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}

.sitemap-cb-tool:hover {
  border-color: var(--smp-primary, #2d6a4f);
  color: var(--smp-primary-dark, #1b4332);
  box-shadow: 0 3px 10px rgba(45, 106, 79, 0.14);
}

.sitemap-cb-tool--primary {
  background: var(--smp-primary, #2d6a4f);
  border-color: var(--smp-primary, #2d6a4f);
  color: #ffffff;
}

.sitemap-cb-tool--primary:hover {
  background: var(--smp-primary-dark, #1b4332);
  color: #ffffff;
}

.sitemap-cb-panel__filter {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--smp-muted, #64748b);
}

.sitemap-cb-panel__filter select {
  padding: 5px 8px;
  border: 1px solid var(--smp-border, #e2e8f0);
  border-radius: 8px;
  background: #ffffff;
  font-size: 0.78rem;
  color: var(--smp-text, #1e293b);
}

.sitemap-cb-panel__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem 1rem 1rem;
}

.sitemap-cb-panel__empty {
  padding: 1.25rem 1rem;
  text-align: center;
  font-size: 0.84rem;
  color: var(--smp-muted, #64748b);
  background: #f8fafc;
  border: 1px dashed var(--smp-border, #e2e8f0);
  border-radius: 10px;
}

.sitemap-cb-panel__empty.is-error {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

/* ── แถวรายการปุ่ม ── */
.sitemap-cb-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--smp-border, #e2e8f0);
  border-radius: 12px;
  background: #ffffff;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.sitemap-cb-row:hover {
  border-color: rgba(45, 106, 79, 0.35);
  box-shadow: 0 6px 18px rgba(45, 106, 79, 0.1);
}

.sitemap-cb-row.is-off {
  background: #f8fafc;
  border-style: dashed;
  opacity: 0.82;
}

.sitemap-cb-row__icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #f1f5f9;
  font-size: 1.25rem;
  line-height: 1;
}

.sitemap-cb-row__main {
  flex: 1 1 auto;
  min-width: 0;
}

.sitemap-cb-row__nameline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.45rem;
}

.sitemap-cb-row__name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--smp-text, #1e293b);
}

.sitemap-cb-row__extra {
  font-size: 0.72rem;
  color: var(--smp-muted, #64748b);
}

.sitemap-cb-row__desc {
  margin: 0.15rem 0 0.35rem;
  font-size: 0.78rem;
  color: var(--smp-muted, #64748b);
  line-height: 1.45;
}

.sitemap-cb-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  font-size: 0.72rem;
  color: var(--smp-muted, #64748b);
}

.sitemap-cb-row__meta code {
  padding: 2px 7px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 0.72rem;
  word-break: break-all;
}

.sitemap-cb-row__stamp {
  white-space: nowrap;
}

.sitemap-cb-row__actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
  max-width: 168px;
}


/* ── ป้ายสถานะ (chips) ── */
.sitemap-cb-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  border: 1px solid transparent;
}

.sitemap-cb-chip--builtin {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.sitemap-cb-chip--on {
  background: #dcfce7;
  border-color: #86efac;
  color: #14532d;
}

.sitemap-cb-chip--off {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

.sitemap-cb-chip--dev {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.sitemap-cb-chip--int {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #075985;
}

.sitemap-cb-chip--ext {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #5b21b6;
}

/* ── ปุ่มจัดการในแต่ละแถว ── */
.sitemap-cb-act {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--smp-border, #e2e8f0);
  border-radius: 8px;
  background: #ffffff;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.16s ease;
}

.sitemap-cb-act:hover:not(:disabled) {
  border-color: var(--smp-primary, #2d6a4f);
  background: #f0fdf4;
  transform: translateY(-1px);
}

.sitemap-cb-act:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.sitemap-cb-act--danger:hover:not(:disabled) {
  border-color: #ef4444;
  background: #fef2f2;
}

/* ── โมดัลเพิ่ม/แก้ไขปุ่ม ── */
body.sitemap-cb-modal-open {
  overflow: hidden;
}

.sitemap-cb-modal {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: rgba(15, 23, 42, 0.55);
  overflow-y: auto;
}

.sitemap-cb-modal.open {
  display: flex;
}

.sitemap-cb-modal__dialog {
  width: 100%;
  max-width: 640px;
  margin: auto;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  animation: sitemapCbPop 0.18s ease-out;
  overflow: hidden;
}

@keyframes sitemapCbPop {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.sitemap-cb-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  background: linear-gradient(135deg, #2d6a4f, #16a34a);
  color: #ffffff;
}

.sitemap-cb-modal__head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
}

.sitemap-cb-modal__close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 0.9rem;
  cursor: pointer;
}

.sitemap-cb-modal__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.sitemap-cb-form {
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.sitemap-cb-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.sitemap-cb-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--smp-text, #1e293b);
}

.sitemap-cb-field input[type="text"],
.sitemap-cb-field input[type="color"] {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--smp-border, #e2e8f0);
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--smp-text, #1e293b);
  background: #ffffff;
}

.sitemap-cb-field input[type="text"]:focus {
  outline: none;
  border-color: var(--smp-primary, #2d6a4f);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.14);
}

.sitemap-cb-field input[type="color"] {
  height: 36px;
  padding: 3px;
  cursor: pointer;
}

.sitemap-cb-field input[type="color"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sitemap-cb-req {
  color: #dc2626;
  margin-left: 2px;
}

.sitemap-cb-hint {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--smp-muted, #64748b);
  line-height: 1.45;
}


.sitemap-cb-emoji {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.15rem;
}

.sitemap-cb-emoji button {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--smp-border, #e2e8f0);
  border-radius: 8px;
  background: #ffffff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sitemap-cb-emoji button:hover {
  border-color: var(--smp-primary, #2d6a4f);
  background: #f0fdf4;
  transform: translateY(-1px);
}

.sitemap-cb-linktype {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sitemap-cb-linktype__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--smp-text, #1e293b);
}

.sitemap-cb-linktype__opts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sitemap-cb-lt {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 6px 12px;
  border: 1px solid var(--smp-border, #e2e8f0);
  border-radius: 999px;
  background: #ffffff;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sitemap-cb-lt:has(input:checked) {
  border-color: var(--smp-primary, #2d6a4f);
  background: #f0fdf4;
  color: var(--smp-primary-dark, #1b4332);
  font-weight: 600;
}

.sitemap-cb-lt input {
  accent-color: var(--smp-primary, #2d6a4f);
  margin: 0;
}

.sitemap-cb-urlrow {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
}

.sitemap-cb-urlrow input {
  flex: 1 1 auto;
  min-width: 0;
}

.sitemap-cb-check {
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid var(--smp-primary, #2d6a4f);
  border-radius: 9px;
  background: #ffffff;
  color: var(--smp-primary-dark, #1b4332);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sitemap-cb-check:hover:not(:disabled) {
  background: #f0fdf4;
}

.sitemap-cb-check:disabled {
  opacity: 0.6;
  cursor: wait;
}

.sitemap-cb-audit {
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 0.73rem;
  color: var(--smp-muted, #64748b);
}

.sitemap-cb-audit:empty {
  display: none;
}

.sitemap-cb-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--smp-border, #e2e8f0);
  margin-top: 0.2rem;
}

.sitemap-cb-btn {
  padding: 8px 16px;
  border: 1px solid var(--smp-border, #e2e8f0);
  border-radius: 9px;
  background: #ffffff;
  color: var(--smp-text, #1e293b);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.sitemap-cb-btn--save {
  background: var(--smp-primary, #2d6a4f);
  border-color: var(--smp-primary, #2d6a4f);
  color: #ffffff;
}

.sitemap-cb-btn--save:hover:not(:disabled) {
  background: var(--smp-primary-dark, #1b4332);
}

.sitemap-cb-btn--save:disabled {
  opacity: 0.65;
  cursor: wait;
}

.sitemap-cb-btn--cancel:hover {
  background: #f1f5f9;
}

.sitemap-cb-btn--restore {
  background: #dcfce7;
  border-color: #86efac;
  color: #14532d;
  padding: 5px 12px;
  font-size: 0.76rem;
}

.sitemap-cb-btn--purge {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
  padding: 5px 12px;
  font-size: 0.76rem;
}

/* ── แถวในหน้าต่างกู้คืนปุ่ม ── */
.sitemap-cb-restore-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--smp-border, #e2e8f0);
  font-size: 0.82rem;
}

.sitemap-cb-restore-row:last-child {
  border-bottom: none;
}

.sitemap-cb-restore-row__info small {
  color: var(--smp-muted, #64748b);
  font-size: 0.72rem;
}

.sitemap-cb-restore-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  flex: 0 0 auto;
}

/* ==========================================================================
   แถบจัดการปุ่มเมนูที่ฝังอยู่ใน "ตัวการ์ดจริง" ของหมวด 1 (เห็นเฉพาะผู้ดูแล)
   จับคู่การ์ดด้วย data-cb-key แล้วเติมด้วย JS (views/partials/sitemap_landing_buttons.ejs)
   ========================================================================== */
.sitemap-cb-inline {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(45, 106, 79, 0.25);
  border-left: 3px solid var(--smp-primary, #2d6a4f);
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fffb, #f0fdf4);
  box-sizing: border-box;
  max-width: 100%;
  text-align: left;
  cursor: default;
}

.sitemap-cb-inline.is-dev {
  border-left-color: #d97706;
  background: linear-gradient(180deg, #fffdf5, #fffbeb);
}

.sitemap-cb-inline.is-off {
  border-left-color: #94a3b8;
  background: #f8fafc;
}

.sitemap-cb-inline__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.sitemap-cb-inline__tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--smp-primary, #2d6a4f);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.sitemap-cb-inline.is-dev .sitemap-cb-inline__tag {
  background: #b45309;
}

.sitemap-cb-inline.is-off .sitemap-cb-inline__tag {
  background: #64748b;
}

.sitemap-cb-inline__order {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(45, 106, 79, 0.12);
  color: var(--smp-primary-dark, #1b4332);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.sitemap-cb-inline .sitemap-cb-row__actions {
  margin-left: auto;
  max-width: none;
  justify-content: flex-end;
}

.sitemap-cb-inline .sitemap-cb-act {
  width: 26px;
  height: 26px;
  font-size: 0.72rem;
}

.sitemap-cb-inline__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.55rem;
  font-size: 0.7rem;
  color: var(--smp-muted, #64748b);
}

.sitemap-cb-inline__meta code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  font-size: 0.7rem;
  word-break: break-all;
}

.sitemap-cb-inline__meta .sitemap-cb-row__stamp {
  white-space: normal;
}

/* —— แถบที่ฝังอยู่ในตัวการ์ด (ต่อท้าย .sitemap-card__body) —— */
.sitemap-card__body > .sitemap-cb-inline {
  margin-top: 0.55rem;
  border-top: 1px dashed rgba(45, 106, 79, 0.25);
}

/* พื้นที่แถบไม่ใช่ลิงก์ — จะได้ไม่ชวนให้กดเปิดการ์ด */
.sitemap-card__body > .sitemap-cb-inline,
.sitemap-card__body > .sitemap-cb-inline .sitemap-cb-inline__tag,
.sitemap-card__body > .sitemap-cb-inline .sitemap-cb-inline__order,
.sitemap-card__body > .sitemap-cb-inline .sitemap-cb-chip {
  cursor: default;
}

.sitemap-card__body > .sitemap-cb-inline .sitemap-cb-act {
  cursor: pointer;
}

.sitemap-card__body > .sitemap-cb-inline .sitemap-cb-act:focus-visible {
  outline: 2px solid var(--smp-primary, #2d6a4f);
  outline-offset: 2px;
}

/* การ์ดที่ hover แล้วไม่ต้องยกทั้งใบแรง ๆ ตอนชี้ปุ่มจัดการ */
.sitemap-card__body > .sitemap-cb-inline .sitemap-cb-act:hover:not(:disabled) {
  transform: none;
}

/* —— ตัวอย่าง "การ์ดบนหน้าแรก (Landing Page)" แบบเหมือนจริง 1:1 ——
   หน้าตา/คลาส/styling คัดลอกมาจาก www/css/landing_page.css ทั้งชุด (.hazard-card · ::before ·
   .hazard-icon · .hazard-name · .hazard-desc · .ribbon · .manual-btn · .cb-mode-chip · .card-sub-pill)
   โดยอ้างอิงค่าที่การ์ดจริงใช้บนจอเดสก์ท็อปทั่วไป (1366×768 ตามบล็อก fit-guard §4 ของหน้าแรก)
   แล้วครอบด้วย .sitemap-cb-lp เพื่อไม่ให้สไตล์ของหน้าแรกรั่วไปโดน element อื่นในหน้า /sitemap
   ใช้ 2 ที่: แถบ "ปุ่มเมนู" ที่ฝังในตัวการ์ดของหมวด 1 และกล่องพรีวิวในฟอร์มเพิ่ม/แก้ไข */
.sitemap-cb-preview {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  margin-top: 0.15rem;
  padding-top: 0.45rem;
  border-top: 1px dashed rgba(45, 106, 79, 0.18);
  cursor: default;
}

.sitemap-cb-preview__label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.66rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}

/* ฉากหลังจำลองหน้าแรก — linear-gradient + รูปพื้นหลังตัวเดียวกับ .landing-container */
.sitemap-cb-lp {
  position: relative;
  display: block;
  width: 100%;
  /* เวทีจำลอง = ระยะห่างการ์ด (0.55rem × 2) + ความกว้างการ์ดจริง 312px (19.5rem)
     → การ์ดในพรีวิวได้ความกว้าง 312px เท่าการ์ดจริงบนหน้าแรกที่ 1366×768 เป๊ะ
     (เดิม 15rem ทำให้การ์ดแคบกว่าจริง 90px ข้อความจึงตัดบรรทัดไม่เหมือนหน้าแรก) */
  max-width: 20.6rem;
  padding: 0.55rem;
  border-radius: 14px;
  background: linear-gradient(rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.85)),
    url('/data/landing_bg.png') center/cover no-repeat;
  box-sizing: border-box;
  cursor: default;
  /* หน้าแรกใช้ฟอนต์ Sarabun ทั้งหน้า (landing_page.css: *) — พรีวิวต้องใช้ฟอนต์เดียวกัน
     ไม่งั้นตัวอักษรจะหนา/กว้างต่างจากหน้าแรก เพราะหน้านี้ใช้ Prompt เป็นฟอนต์หลัก */
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  /* เป็น container ให้หน่วย cqw ด้านล่างวัดความกว้างจริงของเวที (ใช้ย่อ/ขยายพรีวิวแบบสัดส่วน) */
  container-type: inline-size;
}

/* .hazard-card — ค่าคัดลอกมาจากการ์ดจริงของหน้าแรกบนจอเดสก์ท็อป
   (landing_page.css: .hazard-card + .hazard-card::before + บล็อก fit-guard §4)
   วัดจากหน้าแรกจริงที่ 1366×768 (การ์ดจริงกว้าง 312×141 · innerW 280):
   padding 8.45px 14.85px · radius 20px · row-gap 4.22px · min-height 141px
   backdrop blur 12px · ไอคอน 39.9px · ชื่อ 11.52px · คำอธิบาย 10px (#cbd5e1)
   · ปุ่มคู่มือวงกลม 24px (svg 18px) ชิดมุม 3.84px · ริบบิ้นมุม 10px ฟอนต์ 8.8px
   (--fit-* ของหน้าแรกเป็น clamp ตาม vh จึงใช้ค่าที่คลายออกมาแล้วแทน)

   ความสูงจริงที่ 1366×768 = 141px (แถว grid หน้าแรกถูกบีบด้วย 1fr) — เนื้อหาที่เกินจะถูกตัดที่
   ขอบการ์ดเหมือนหน้าแรกเป๊ะ (การ์ดที่มีป้ายโหมดเนื้อหาสูง 148px จึงถูกตัด ~3px ทั้งบน/ล่าง เพราะ
   justify-content: center)

   ★ ค่าที่เขียนไว้ในบล็อกนี้เป็น “ค่าสำรอง” (หน่วย px/rem ของจอ 1366×768) ใช้เมื่อเบราว์เซอร์ยังไม่
   รองรับหน่วย cqw ซึ่งเป็นกรณีที่ height: auto (ไม่ตัดข้อความ) · เบราว์เซอร์ที่รองรับจะใช้บล็อก
   @supports (width: 1cqw) ด้านล่างแทน โดยแปลงทุกค่าเป็นสัดส่วนของการ์ดจริง 312px → พรีวิวจะย่อ/ขยาย
   ตามที่ว่างแบบสัดส่วนเดียวกันเสมอ ลำดับบรรทัด/สัดส่วนจึงเหมือนการ์ดจริง 100% (และตรงเป๊ะระดับ
   พิกเซลเมื่อที่ว่างพอสำหรับ 312px) */
.sitemap-cb-lp .hazard-card {
  --theme-color: #ffffff;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.264rem;
  width: 100%;
  height: auto;
  min-height: 8.8125rem;
  padding: 0.528rem 0.928rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  text-align: center;
  overflow: hidden;
  box-sizing: border-box;
  cursor: default;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* แสงเรืองมุมขวาบนตอน hover (เหมือน .hazard-card::before ของหน้าแรก) */
.sitemap-cb-lp .hazard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.sitemap-cb-lp .hazard-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: var(--theme-color, rgba(255, 255, 255, 0.4));
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
}

.sitemap-cb-lp .hazard-card:hover::before {
  opacity: 1;
}

/* ปิดใช้งาน/กำลังพัฒนา — หรี่สีทั้งใบเหมือนการ์ดที่ยังไม่เปิดใช้บนหน้าแรก
   (หรี่เฉพาะเนื้อหา ป้ายสถานะยังแดงชัด) */
.sitemap-cb-lp .hazard-card.disabled {
  opacity: 0.6;
  cursor: default;
}

.sitemap-cb-lp .hazard-card.disabled > :not(.ribbon) {
  filter: grayscale(80%);
}

/* สีธีมการ์ด (คัดลอกจาก landing_page.css) — ปุ่มเพิ่มเองใช้ --theme-color ที่ส่งมาใน style */
.sitemap-cb-lp .card-fire { --theme-color: #ef4444; }
.sitemap-cb-lp .card-drought { --theme-color: #f59e0b; }
.sitemap-cb-lp .card-weather { --theme-color: #0ea5e9; }
.sitemap-cb-lp .card-si { --theme-color: #3b82f6; }
.sitemap-cb-lp .card-kok-toxic { --theme-color: #1e6fd9; }
.sitemap-cb-lp .card-flood { --theme-color: #06b6d4; }
.sitemap-cb-lp .card-elephant { --theme-color: #8b5cf6; }
.sitemap-cb-lp .card-bug { --theme-color: #84cc16; }
.sitemap-cb-lp .card-worm { --theme-color: #10b981; }
.sitemap-cb-lp .card-fruitfly { --theme-color: #f97316; }
.sitemap-cb-lp .card-mosdis { --theme-color: #eab308; }
.sitemap-cb-lp .card-cropins { --theme-color: #14b8a6; }
.sitemap-cb-lp .card-agriwas { --theme-color: #d946ef; }

/* ไอคอน · ชื่อ · คำอธิบาย (span ที่ทำตัวเป็น block ให้เหมือน div/h2/p ของหน้าแรก)
   ค่าขนาดอ้างอิงการ์ดจริงบนจอ 1366×768 (ดู --fit-icon / .hazard-name / .hazard-desc) */
.sitemap-cb-lp .hazard-icon {
  display: block;
  font-size: 2.5rem;
  line-height: 1.1;
  margin: 0 0 0.48rem;
}

.sitemap-cb-lp .hazard-name {
  display: block;
  max-width: 100%;
  padding: 0 0.625rem;
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
  color: #ffffff;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

.sitemap-cb-lp .hazard-desc {
  display: block;
  max-width: 92%;
  padding: 0;
  margin: 0;
  font-size: 0.625rem;
  line-height: 1.45;
  color: #cbd5e1;
  /* แสดงคำอธิบายเต็มความยาวเหมือนหน้าแรก (ไม่ตัด 2 บรรทัด) */
  overflow: visible;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  text-wrap: pretty;
}

/* ริบบิ้นสถานะ มุมซ้ายบน (การ์ดที่ปิดใช้งาน/กำลังพัฒนา) — ค่าจาก .ribbon + .ribbon-dev บนหน้าแรก
   (top/left 10px · padding 1.6px 7.2px · font 8.8px · line-height normal · radius 6px) */
.sitemap-cb-lp .ribbon {
  position: absolute;
  top: 0.625rem;
  left: 0.625rem;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: normal;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  z-index: 10;
}

/* ปุ่มดาวน์โหลดคู่มือ มุมขวาบน — วงกลมไอคอนเดียวกับหน้าแรก (ในพรีวิวเป็น span ไม่ใช่ลิงก์)
   หน้าแรกจอ 1366×768: วงกลม 24px ไม่มีขอบ ชิดมุม 3.84px · ไอคอน svg 18px */
.sitemap-cb-lp .manual-btn {
  position: absolute;
  top: 0.24rem;
  right: 0.24rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.3s ease;
}

.sitemap-cb-lp .manual-btn svg {
  width: 18px;
  height: 18px;
}

.sitemap-cb-lp .manual-btn:hover {
  background: var(--theme-color, #cbd5e1);
  color: #ffffff;
  transform: scale(1.1);
}

/* ป้ายโหมดการแสดงผลของบล็อก (🔒 เข้าสู่ระบบ / 🙈 ปิดการแสดงผล) */
.sitemap-cb-lp .cb-mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px 0 4px;
  padding: 2px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.sitemap-cb-lp .cb-mode-login {
  background: #fff7ed;
  color: #b45309;
  border-color: #fed7aa;
}

.sitemap-cb-lp .cb-mode-hidden {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

/* ปุ่มลิงก์รอง (📊 บอร์ดสรุป) — ตำแหน่ง/ขนาดจากการ์ดจริงบนหน้าแรก (1366×768)
   .card-sub-pill = position absolute top 12px right 12px + margin-top clamp(0.1rem,0.35vh,0.25rem)=2.69px
   padding 0.05rem 0.4rem · font 8.8px (clamp 0.55rem…0.65rem) · line-height 1.3 · radius 12px
   → กล่อง 64×15px ชิดมุมขวาบน (ทับวงกลมปุ่มคู่มือเหมือนการ์ดจริงบนหน้าแรก ไม่ใช่ไหลต่อท้ายคำอธิบาย) */
.sitemap-cb-lp .card-sub-pill {
  position: absolute;
  top: 0.918rem; /* 12px + margin-top 2.69px ของการ์ดจริง */
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0.05rem 0.4rem;
  border: 1px solid rgba(14, 165, 233, 0.5);
  border-radius: 12px;
  background: rgba(14, 165, 233, 0.22);
  color: #e2e8f0;
  font-size: 0.55rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  text-decoration: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.25s ease;
  z-index: 10;
}

.sitemap-cb-lp .card-sub-pill:hover {
  background: #0ea5e9;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.45);
  transform: scale(1.08);
}

/* —— ย่อ/ขยายพรีวิวแบบ "สัดส่วนเดียวกับการ์ดจริง" (ตรงกับระบบจริงทุกความกว้าง) ——
   การ์ดจริงบนหน้าแรกกว้าง 312px · สูง 141px ที่จอ 1366×768 (ค่าจาก --fit-* + fit-guard §4)
   บล็อกนี้แปลงทุกค่าของพรีวิว (padding · gap · radius · ฟอนต์ · ตำแหน่งป้าย/ปุ่ม/ริบบิ้น) เป็น
   หน่วย cqw = 1% ของความกว้าง *ภายใน* เวที .sitemap-cb-lp โดยใช้ 312px เป็นฐาน:
     1px = 100/312 cqw = 0.3205cqw   →  เช่น 11.52px (ชื่อ) = 3.6923cqw
   ผลคือเมื่อเวทีแคบ (เช่นแถบ “ปุ่มเมนู” ในการ์ด /sitemap ≈ 232px) ทั้งการ์ดจะถูกย่อลงเท่ากันทุกจุด
   ทำให้การตัดบรรทัด/สัดส่วน/ระยะห่างเหมือนการ์ดจริง 100% (ไม่ใช่ตัวหนังสือขนาดจริงในกรอบแคบ
   ที่ข้อความตัดบรรทัดคนละแบบ) · เมื่อเวทีมีที่พอ ≥ 312px ค่าจะออกมาเป็นพิกเซลจริงเป๊ะ = 1:1
   เบราว์เซอร์ที่ยังไม่รองรับ cqw ข้ามบล็อกนี้ → ใช้ค่าสำรอง px/rem ด้านบน (height: auto) แทน */
@supports (container-type: inline-size) and (width: 1cqw) {
  .sitemap-cb-lp .hazard-card {
    gap: 1.3542cqw;                       /* 4.224px */
    height: 45.1923cqw;                   /* 141px */
    min-height: 0;
    padding: 2.7083cqw 4.759cqw;          /* 8.448px 14.848px */
    border-width: 0.3205cqw;              /* 1px */
    border-radius: 6.4103cqw;             /* 20px */
    backdrop-filter: blur(3.8462cqw);     /* 12px */
    -webkit-backdrop-filter: blur(3.8462cqw);
  }

  .sitemap-cb-lp .hazard-icon {
    font-size: 12.8cqw;                   /* 39.936px */
    margin: 0 0 2.4615cqw;                /* 7.68px */
  }

  .sitemap-cb-lp .hazard-name {
    padding: 0 3.2051cqw;                 /* 10px */
    margin: 0 0 2.5641cqw;                /* 8px */
    font-size: 3.6923cqw;                 /* 11.52px */
  }

  .sitemap-cb-lp .hazard-desc {
    font-size: 3.2051cqw;                 /* 10px */
  }

  .sitemap-cb-lp .ribbon {
    top: 3.2051cqw;                       /* 10px */
    left: 3.2051cqw;
    padding: 0.5128cqw 2.3077cqw;         /* 1.6px 7.2px */
    border-radius: 1.9231cqw;             /* 6px */
    font-size: 2.8205cqw;                 /* 8.8px */
    letter-spacing: 0.0962cqw;            /* 0.3px */
    box-shadow: 0 0.641cqw 1.6026cqw rgba(0, 0, 0, 0.3);
  }

  .sitemap-cb-lp .manual-btn {
    top: 1.2308cqw;                       /* 3.84px */
    right: 1.2308cqw;
    width: 7.6308cqw;                     /* 23.808px */
    height: 7.6308cqw;
  }

  .sitemap-cb-lp .manual-btn svg {
    width: 5.7692cqw;                     /* 18px */
    height: 5.7692cqw;
  }

  .sitemap-cb-lp .cb-mode-chip {
    gap: 1.2821cqw;                       /* 4px */
    margin: 0.641cqw 0 1.2821cqw;         /* 2px 0 4px */
    padding: 0.641cqw 2.8846cqw;          /* 2px 9px */
    border-width: 0.3205cqw;              /* 1px */
    font-size: 3.4872cqw;                 /* 10.88px */
  }

  .sitemap-cb-lp .card-sub-pill {
    top: 4.7077cqw;                       /* 12px + margin-top 2.688px */
    right: 3.8462cqw;                     /* 12px */
    gap: 1.2821cqw;                       /* 4px */
    padding: 0.2564cqw 2.0513cqw;         /* 0.8px 6.4px */
    border-width: 0.3205cqw;              /* 1px */
    border-radius: 3.8462cqw;             /* 12px */
    font-size: 2.8205cqw;                 /* 8.8px */
    backdrop-filter: blur(1.2821cqw);     /* 4px */
    -webkit-backdrop-filter: blur(1.2821cqw);
  }
}

/* —— กล่องพรีวิวในฟอร์มเพิ่ม/แก้ไขปุ่ม (ฉากหลังเข้มของการ์ดจำลองหน้าแรก) —— */
.sitemap-cb-previewbox {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  padding: 0.5rem 0.6rem;
  border: 1px dashed rgba(45, 106, 79, 0.3);
  border-radius: 10px;
  background: #f8fffb;
}

.sitemap-cb-previewbox__label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #1b4332;
}

.sitemap-cb-previewbox__stage {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sitemap-cb-previewbox .sitemap-cb-lp {
  /* โมดัลกว้างสูงสุด 640px → ให้พรีวิวในฟอร์มได้ขนาดการ์ดจริงเต็ม 312px (1:1 ตรงกับหน้าแรก) */
  max-width: 20.6rem;
}

.sitemap-cb-panel__empty.is-note {
  color: #14532d;
  background: #f0fdf4;
  border-color: #bbf7d0;
  text-align: left;
}

@media (max-width: 767.98px) {
  .sitemap-cb-panel__head {
    flex-wrap: wrap;
  }

  .sitemap-cb-panel__count {
    order: 3;
  }

  .sitemap-cb-panel__toolbar {
    gap: 0.35rem;
  }

  .sitemap-cb-tool span {
    font-size: 0.76rem;
  }

  .sitemap-cb-panel__filter {
    margin-left: 0;
    width: 100%;
  }

  .sitemap-cb-row {
    flex-wrap: wrap;
  }

  .sitemap-cb-row__actions {
    max-width: none;
    width: 100%;
    justify-content: flex-start;
    padding-top: 0.35rem;
    border-top: 1px dashed var(--smp-border, #e2e8f0);
  }

  .sitemap-cb-inline__row {
    gap: 0.25rem;
  }

  .sitemap-card__body > .sitemap-cb-inline {
    margin-top: 0.45rem;
    padding: 0.4rem 0.45rem;
  }

  .sitemap-cb-inline .sitemap-cb-row__actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .sitemap-cb-inline__meta {
    font-size: 0.68rem;
  }

  .sitemap-cb-form__grid {
    grid-template-columns: 1fr;
  }

  .sitemap-cb-modal {
    padding: 0.75rem 0.5rem;
  }
}

