/* กริดการ์ดประกาศ — ใช้ร่วม find-agent, listings-rent, ฯลฯ */
.agent-list{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(220px, 1fr));
  gap:14px;
  align-items:stretch;
}
.agent-list .empty{ grid-column:1 / -1; }
.agent-card{
  display:flex;
  flex-direction:column;
  background:var(--card, #fff);
  border:1px solid var(--line, #e5e7eb);
  border-radius:16px;
  padding:0;
  box-shadow:var(--shadow, 0 18px 40px rgba(15,23,42,.08));
  overflow:hidden;
  min-height:0;
}
.agent-card.is-focused{
  outline:3px solid rgba(30,78,216,.45);
  box-shadow:0 0 0 4px rgba(30,78,216,.12), var(--shadow, 0 18px 40px rgba(15,23,42,.08));
}
.agent-card-hero{
  position:relative;
  aspect-ratio:1;
  background:linear-gradient(135deg,#e2e8f0,#f1f5f9);
  overflow:hidden;
  border:none;
  padding:0;
  width:100%;
  text-align:left;
  font:inherit;
}
.agent-card-hero.has-media{ cursor:pointer; }
.agent-card-hero.has-media:focus-visible{
  outline:3px solid rgba(30,78,216,.55);
  outline-offset:-3px;
}
.agent-card-hero-fill{ position:relative; width:100%; height:100%; }
.agent-card-hero-fill.is-loading{ animation:plgMediaPulse 1.2s ease-in-out infinite; }
.agent-card-hero-fill img,
.agent-card-hero-fill video{ width:100%; height:100%; object-fit:cover; display:block; }
.agent-hero-empty{
  width:100%; height:100%;
  display:flex; align-items:center; justify-content:center;
  font-size:40px; color:#94a3b8;
}
.agent-hero-count{
  position:absolute; right:8px; top:8px;
  padding:4px 8px; border-radius:999px;
  background:rgba(15,23,42,.78); color:#fff;
  font-size:11px; font-weight:1000; pointer-events:none;
}
.agent-hero-open-hint{
  position:absolute; left:0; right:0; bottom:0;
  padding:18px 8px 8px;
  background:linear-gradient(transparent, rgba(15,23,42,.72));
  color:#fff; font-size:10px; font-weight:1000; text-align:center; pointer-events:none;
}
.agent-card-hero-badges{
  position:absolute; left:8px; top:8px;
  display:flex; flex-wrap:wrap; gap:4px;
  max-width:calc(100% - 16px);
}
.agent-card-content{
  padding:11px 12px 12px;
  display:flex; flex-direction:column; gap:8px; flex:1; min-height:0;
}
.agent-card-title{
  font-size:13px; font-weight:1100; line-height:1.35; margin:0;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.agent-card-meta{ margin:0; font-size:10px; font-weight:900; color:var(--muted, #64748b); }
.agent-card-rec{
  margin:0; font-size:10px; font-weight:900; color:#475569; line-height:1.35;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.agent-card-hero-badges .badge{
  padding:4px 8px; border-radius:999px; font-size:10px; font-weight:900;
  white-space:nowrap; box-shadow:0 2px 8px rgba(15,23,42,.12);
}
.badge.deal-sell{ background:#dcfce7; color:#166534; }
.badge.deal-rent{ background:#dbeafe; color:#1e40af; }
.badge.broker{ background:#fdf2f8; color:#be185d; border:1px solid #fbcfe8; }
@keyframes plgMediaPulse{ 0%,100%{opacity:.55;} 50%{opacity:1;} }
.agent-summary{
  padding:8px 9px; border-radius:10px;
  background:#f8fafc; border:1px solid #e2e8f0;
}
.agent-summary-line{
  font-size:11px; font-weight:900; line-height:1.4; color:#334155;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.agent-summary-line + .agent-summary-line{ margin-top:4px; color:#0f172a; font-weight:1000; }
.agent-body{
  font-size:11px; font-weight:850; line-height:1.45; color:#334155;
  white-space:pre-wrap; max-height:140px; overflow:auto;
}
.agent-actions{ margin-top:auto; display:flex; flex-direction:column; gap:6px; }
.agent-actions .btn{ width:100%; padding:8px 10px; font-size:11px; }
.plg-empty{
  text-align:center; padding:40px 20px;
  border:1px dashed var(--line, #e5e7eb); border-radius:18px;
  background:#fff; color:var(--muted, #64748b);
  font-size:14px; font-weight:900; line-height:1.5;
}
@media(max-width:600px){
  .agent-list{ grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); gap:10px; }
}
/* media viewer */
.plg-media-viewer{
  position:fixed; inset:0; z-index:49000;
  display:none; align-items:center; justify-content:center;
  flex-direction:column; padding:22px;
  background:rgba(2,6,23,.78); backdrop-filter:blur(6px);
}
.plg-media-viewer.show{ display:flex; }
.plg-media-viewer .media-viewer-head,
.plg-media-viewer .media-viewer-body,
.plg-media-viewer .media-viewer-strip{ width:min(92vw, 1120px); }
.plg-media-viewer .media-viewer-head{
  min-height:58px; padding:10px 14px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  color:#fff; background:rgba(15,23,42,.96);
  border:1px solid rgba(255,255,255,.1); border-bottom:none; border-radius:18px 18px 0 0;
}
.plg-media-viewer .media-viewer-title{ font-size:14px; font-weight:1100; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.plg-media-viewer .media-viewer-sub{ margin-top:2px; color:rgba(255,255,255,.7); font-size:11px; font-weight:900; }
.plg-media-viewer .media-viewer-close{
  width:42px; height:42px; border:none; border-radius:999px;
  background:rgba(255,255,255,.14); color:#fff; cursor:pointer; font-size:26px;
}
.plg-media-viewer .media-viewer-body{
  height:min(68vh, 640px); min-height:300px; position:relative;
  display:flex; align-items:center; justify-content:center; padding:18px 70px;
  background:#080d18; border-left:1px solid rgba(255,255,255,.1); border-right:1px solid rgba(255,255,255,.1);
}
.plg-media-viewer .media-viewer-stage{ width:100%; height:100%; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.plg-media-viewer .media-viewer-stage img,
.plg-media-viewer .media-viewer-stage video{ max-width:100%; max-height:100%; object-fit:contain; border-radius:12px; background:#000; }
.plg-media-viewer .media-viewer-nav{
  position:absolute; top:50%; transform:translateY(-50%);
  width:46px; height:46px; border:none; border-radius:999px;
  background:rgba(255,255,255,.16); color:#fff; cursor:pointer; font-size:32px; z-index:2;
}
.plg-media-viewer .media-viewer-nav:disabled{ opacity:.25; cursor:not-allowed; }
.plg-media-viewer .media-viewer-prev{ left:14px; }
.plg-media-viewer .media-viewer-next{ right:14px; }
.plg-media-viewer .media-viewer-strip{
  border:1px solid rgba(255,255,255,.1); border-radius:0 0 18px 18px;
  padding:10px 14px; display:flex; gap:8px; overflow-x:auto; background:rgba(15,23,42,.96);
}
.plg-media-viewer .media-viewer-thumb{
  width:78px; height:58px; border-radius:12px; border:2px solid transparent;
  background:#000; overflow:hidden; flex:0 0 auto; cursor:pointer; position:relative; opacity:.68; padding:0;
}
.plg-media-viewer .media-viewer-thumb.active{ border-color:#60a5fa; opacity:1; }
.plg-media-viewer .media-viewer-thumb img,
.plg-media-viewer .media-viewer-thumb video{ width:100%; height:100%; object-fit:cover; display:block; }
.plg-media-viewer .media-viewer-thumb .vtag{
  position:absolute; left:6px; top:5px; background:rgba(0,0,0,.62); color:#fff;
  border-radius:999px; padding:2px 6px; font-size:10px; font-weight:1000;
}
/* map popup */
.plg-map-modal{
  position:fixed; inset:0; z-index:48500;
  display:none; align-items:center; justify-content:center;
  padding:18px; background:rgba(15,23,42,.45); backdrop-filter:blur(4px);
}
.plg-map-modal.show{ display:flex; }
.plg-map-dialog{
  width:min(920px, calc(100vw - 24px)); max-height:min(92vh, 900px);
  overflow:hidden; background:#fff; border-radius:22px;
  border:1px solid var(--line, #e5e7eb); box-shadow:0 28px 90px rgba(15,23,42,.28);
  display:flex; flex-direction:column;
}
.plg-map-head{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 16px; border-bottom:1px solid var(--line, #e5e7eb);
}
.plg-map-title{ margin:0; font-size:17px; font-weight:1100; }
.plg-map-sub{ margin:4px 0 0; font-size:12px; font-weight:900; color:var(--muted, #64748b); line-height:1.45; }
.plg-map-close{
  width:42px; height:42px; border:none; border-radius:999px;
  background:#eef2f7; color:#334155; cursor:pointer; font-size:22px;
}
.plg-map-body{ padding:12px 14px 14px; min-height:0; }
.plg-map-wrap{ border:1px solid var(--line, #e5e7eb); border-radius:16px; overflow:hidden; background:#dbeafe; }
.plg-map-canvas{ width:100%; height:min(58vh, 520px); min-height:320px; }
@media(max-width:600px){
  .plg-map-modal{ padding:10px; align-items:flex-end; }
  .plg-map-dialog{ width:100%; border-radius:18px 18px 0 0; }
  .plg-map-canvas{ min-height:280px; height:52vh; }
}
