/* ---------- โครงหน้า: แถบหัว + ผังเต็มจอ ---------- */
.page { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

.masthead {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 24px;
  background: var(--brand);
  color: #fff;
}
/* เส้นทองบางๆ คั่นโลโก้กับชื่อโครงการ */
.title-block {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  min-width: 0;
  padding-left: 24px;
  border-left: 1px solid rgba(206, 176, 131, .35);
}
.masthead h1 { font-size: 24px; font-weight: 600; letter-spacing: .02em; }
.location { margin: 0; color: #C9CCD8; font-size: 14px; }
.project-switch { margin-left: auto; }
.project-switch select {
  min-height: 38px;
  padding: 4px 32px 4px 12px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: var(--r-sm);
  background: transparent;
  color: #fff;
}
.project-switch option { color: var(--ink); }

.plan-area { position: relative; flex: 1; min-height: 0; background: var(--plan-bg); }
#plan { position: absolute; inset: 0; }
.plan-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  text-align: center;
  color: var(--ink-2);
}

/* ปุ่ม "ดูทั้งผัง" (ใช้กรอบเดียวกับปุ่มซูมของ Leaflet) */
.fit-btn { display: grid !important; place-items: center; }
.fit-btn svg { width: 16px; height: 16px; fill: none; stroke: #334155; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- การ์ดรายละเอียดแปลง ---------- */
.detail {
  position: absolute;
  z-index: 500;
  left: 16px;
  bottom: 16px;
  width: min(320px, calc(100% - 32px));
  padding: 18px 20px 20px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-float);
}
.detail h2 { font-size: 28px; font-weight: 700; margin-right: 40px; }
.detail-status { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; font-weight: 600; }
.detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; margin: 0; font-size: 14px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.detail-note { margin: 12px 0 0; font-size: 14px; color: var(--ink-2); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.detail-actions .btn { flex: 1 1 auto; }

/* ---------- มือถือ ---------- */
@media (max-width: 820px) {
  .masthead { flex-wrap: wrap; gap: 6px 14px; padding: 8px 16px; }
  .masthead .brand-logo img { height: 40px; }
  .title-block { padding-left: 14px; }
  .masthead h1 { font-size: 20px; }
  .project-switch { margin-left: 0; width: 100%; }
  .project-switch select { width: 100%; }
  .pin-key { top: 8px; left: 8px; gap: 2px 10px; padding: 6px 10px; font-size: 12px; }
  .detail {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    border-radius: var(--r-md) var(--r-md) 0 0;
  }
}
