/* Tract Explorer viewer layout and controls. Requirement IDs match SPEC.md. */
* { margin:0; padding:0; box-sizing:border-box; }
html, body, #map { height:100%; width:100%; overflow:hidden; }
body { font-family:-apple-system, "Source Sans 3", "Segoe UI", sans-serif; font-size:15px; color:#1C1917; }

/* Property/project summary card (V-10, P-2, P-5). */
.card { position:absolute; top:12px; left:12px; z-index:5; background:rgba(255,255,255,.95);
  border:1px solid rgba(28,25,23,.12); border-radius:12px; padding:14px 16px; max-width:270px;
  box-shadow:0 4px 16px rgba(28,25,23,.12); }
.card h1 { font-size:17px; line-height:1.25; margin-bottom:2px; }
.card .proj { color:#64604D; font-size:13px; margin-bottom:8px; }
.card .row { display:flex; gap:12px; align-items:baseline; }
.card .price { font-size:19px; font-weight:700; }
.card .acres { color:#2A2723; }
.card .status { display:inline-block; margin-top:6px; font-size:11px; font-weight:600; letter-spacing:.05em;
  text-transform:uppercase; background:#EAF3EF; color:#2F6A57; border-radius:999px; padding:2px 10px; }
.card .county { color:#8C8279; font-size:12px; margin-top:6px; }
#c-strip { display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; }
#c-strip span { font-size:11px; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  border-radius:999px; padding:2px 9px; }
#c-links { margin-top:9px; font-size:14px; display:flex; flex-direction:column; gap:3px; }
#c-links a { color:#4A7C6F; text-decoration:none; font-weight:600; }
#c-links .back { margin-top:4px; padding:0; border:0; background:none; color:#8C8279;
  font:inherit; font-size:12px; text-align:left; cursor:pointer; }
#c-provenance { margin-top:8px; font-size:11px; color:#64604D; line-height:1.4; }
#c-provenance summary { cursor:pointer; font-weight:700; color:#4A7C6F; }
#c-area-sales { margin-top:9px; padding:8px 9px; background:#F2ECDC; border-radius:8px;
  font-size:11px; line-height:1.35; color:#4B453C; }
#c-area-sales b, #c-area-sales span { display:block; }
#c-area-sales .sale-main { font-size:12px; margin:2px 0; color:#1C1917; }

/* Compact project-tract bubble used inside Countrytyme listing embeds. */
.maplibregl-popup-content { padding:0; border-radius:10px; box-shadow:0 5px 18px rgba(28,25,23,.24); }
.tract-popup { display:flex; min-width:190px; flex-direction:column; gap:3px; padding:12px 14px;
  color:#1C1917; background:#FFFFFF; border-radius:10px; text-decoration:none; }
.tract-popup[href]:hover, .tract-popup[href]:focus-visible { background:#F7F3EB; outline:3px solid #FFC53D;
  outline-offset:1px; }
.tract-popup strong { font-size:15px; line-height:1.25; }
.tract-popup-status { color:#514A43; font-size:12px; font-weight:700; text-transform:uppercase;
  letter-spacing:.04em; }
.tract-popup-price { font-size:16px; font-weight:800; color:#17633F; }
.tract-popup-action { margin-top:3px; color:#2F6A57; font-size:12px; font-weight:800; }

/* Collapsible map and layer controls. */
.panel { position:absolute; top:12px; right:12px; z-index:5; background:rgba(255,255,255,.95);
  border:1px solid rgba(28,25,23,.12); border-radius:12px; padding:10px 10px 12px 12px; width:168px;
  max-height:35vh; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable;
  box-shadow:0 4px 16px rgba(28,25,23,.12); transition:transform .18s ease,opacity .18s ease; }
.panel.collapsed { transform:translateX(calc(100% + 24px)); opacity:0; visibility:hidden; pointer-events:none; }
.panel-section + .panel-section { margin-top:5px; padding-top:5px; border-top:1px solid rgba(28,25,23,.1); }
.panel-section summary { display:flex; min-height:30px; align-items:center; justify-content:space-between;
  padding:3px 34px 3px 2px; color:#4B473E; font-size:11px; font-weight:800; letter-spacing:.08em;
  text-transform:uppercase; cursor:pointer; list-style:none; }
.panel-section summary::-webkit-details-marker { display:none; }
.panel-section summary::after { content:"+"; font:700 18px/1 sans-serif; color:#2F6A57; }
.panel-section[open] summary::after { content:"−"; }
.panel-section summary:hover, .panel-section summary:focus-visible { color:#1C1917; outline:none; }
.panel-section summary:focus-visible { border-radius:6px; box-shadow:0 0 0 2px rgba(74,124,111,.35); }
.panel-section-body { padding-bottom:3px; }
.map-option { display:flex; align-items:center; gap:4px; min-width:0; }
.map-option[hidden] { display:none; }
.panel label { display:flex; flex:1 1 auto; min-width:0; align-items:center; gap:7px; padding:3px 0;
  cursor:pointer; font-size:14px; }
.source-info { display:inline-flex; flex:0 0 auto; min-width:30px; min-height:28px; align-items:center;
  justify-content:center; margin-left:auto; padding:3px 2px; color:#2F6A57; font-size:10.5px;
  font-weight:700; line-height:1; text-decoration:underline; text-underline-offset:2px; border-radius:5px; }
.source-info:hover, .source-info:focus-visible { background:#EAF3EF; outline:none; }
.panel input { accent-color:#4A7C6F; }
.btn3d { width:100%; margin-top:8px; padding:7px 0; border:1px solid rgba(28,25,23,.15); border-radius:8px;
  background:#fff; font-weight:600; font-size:14px; cursor:pointer; }
.btn3d.on { background:#4A7C6F; color:#fff; border-color:#4A7C6F; }
.rotate-controls { display:grid; grid-template-columns:1fr 1fr; gap:5px; margin-top:5px; }
.rotate-controls[hidden] { display:none; }
.rotate-controls button { min-width:0; padding:7px 2px; border:1px solid rgba(28,25,23,.15);
  border-radius:8px; background:#fff; font-family:inherit; font-size:11.5px; font-weight:600;
  line-height:1.2; cursor:pointer; }
.rotate-controls button:hover, .rotate-controls button:focus-visible { background:#EAF3EF;
  border-color:#4A7C6F; outline:2px solid rgba(74,124,111,.35); outline-offset:1px; }

/* Buyer-opened plain-language layer information (V-16, V-17). */
.legend { position:absolute; bottom:64px; left:12px; z-index:5; background:rgba(255,255,255,.95);
  border:1px solid rgba(28,25,23,.12); border-radius:10px; max-width:310px;
  font-size:13px; line-height:1.45; display:none; box-shadow:0 2px 8px rgba(28,25,23,.1); }
.legend.visible { display:block; }
.legend > summary { display:flex; min-height:42px; align-items:center; justify-content:space-between;
  gap:12px; padding:9px 12px; color:#2F6A57; font-weight:800; cursor:pointer; list-style:none; }
.legend > summary::-webkit-details-marker { display:none; }
.legend > summary::after { content:"+"; flex:0 0 auto; width:26px; height:26px; border-radius:7px;
  background:#EAF3EF; color:#2F6A57; font:700 21px/25px sans-serif; text-align:center; }
.legend[open] > summary::after { content:"−"; }
.legend > summary:hover, .legend > summary:focus-visible { color:#1C1917; outline:none; }
.legend > summary:focus-visible { border-radius:9px; box-shadow:inset 0 0 0 2px rgba(74,124,111,.45); }
.legend-body { max-height:38vh; overflow:auto; padding:0 12px 11px; border-top:1px solid rgba(28,25,23,.1); }
.legend-body > :first-child { margin-top:9px; }
.legend b { display:block; margin-bottom:2px; }
.soil-index { margin-top:8px; padding-top:8px; border-top:1px solid rgba(28,25,23,.12);
  max-height:180px; overflow-y:auto; }
.soil-row { display:flex; gap:8px; padding:2px 0; align-items:baseline; }
.soil-swatch { flex:0 0 12px; height:12px; border-radius:3px; border:1px solid rgba(28,25,23,.25);
  align-self:center; }
.soil-sym { flex:0 0 40px; font-weight:700; color:#5c4a1e; }
.soil-row i { color:#64604D; font-style:italic; }
.soil-score { margin-top:8px; padding:7px 8px; background:#F2ECDC; border-radius:7px; }
.soil-score b, .soil-score span { display:block; }
.soil-score span, .soil-note { color:#64604D; font-size:11px; }
.soil-note { margin-top:7px; }

/* Photo pins and lightbox (V-30). */
.photo-pin { width:46px; height:46px; border-radius:50%; border:3px solid #fff; cursor:pointer;
  box-shadow:0 2px 8px rgba(28,25,23,.4); position:relative; }
.photo-pin-img { position:absolute; inset:0; width:100%; height:100%; border-radius:50%;
  object-fit:cover; pointer-events:none; }
.photo-pin .pcount { position:absolute; top:-6px; right:-6px; background:#B45A2B; color:#fff;
  font-size:11px; font-weight:700; border-radius:999px; min-width:20px; height:20px;
  display:flex; align-items:center; justify-content:center; border:2px solid #fff; }
.lightbox { position:fixed; inset:0; z-index:50; background:rgba(20,17,14,.92);
  display:flex; align-items:center; justify-content:center; }
.lightbox[hidden] { display:none; }
.lightbox img { max-width:92vw; max-height:88vh; border-radius:8px; box-shadow:0 10px 40px rgba(0,0,0,.5); }
.lb-x { position:absolute; top:14px; right:18px; font-size:34px; background:none; border:none;
  color:#fff; cursor:pointer; line-height:1; }
.lb-nav { position:absolute; top:50%; transform:translateY(-50%); font-size:52px; background:none;
  border:none; color:#fff; cursor:pointer; padding:0 18px; line-height:1; }
.lb-prev { left:0; }
.lb-next { right:0; }
.lb-count { position:absolute; bottom:16px; left:50%; transform:translateX(-50%); color:#F5F0E8; font-size:13px; }

/* Persistent boundary disclaimer (V-11) and compact convenience controls. */
.disclaimer { position:absolute; bottom:0; left:0; right:0; z-index:6; text-align:center;
  background:rgba(28,25,23,.82); color:#F5F0E8; font-size:12px; padding:5px 10px; }
.mini-btns { display:flex; gap:5px; margin-top:8px; }
.mini-btns button { flex:1; font:inherit; font-size:11.5px; font-weight:600; padding:5px 0;
  border:1px solid rgba(28,25,23,.15); border-radius:7px; background:#fff; cursor:pointer; }
.mini-btns button.on { background:#4A7C6F; color:#fff; border-color:#4A7C6F; }
#measure-chip { position:absolute; bottom:64px; right:12px; z-index:6; background:rgba(28,25,23,.85);
  color:#F5F0E8; font-size:13px; border-radius:10px; padding:8px 13px; max-width:250px; }
#measure-chip b { color:#FFC53D; }
#vtoast { position:absolute; top:14px; left:50%; transform:translateX(-50%); z-index:20;
  background:#1C1917; color:#F5F0E8; font-size:13px; font-weight:600; border-radius:999px;
  padding:7px 16px; max-width:86vw; }
.panel-toggle { display:flex; position:absolute; top:12px; right:12px; z-index:8; width:42px; height:42px;
  align-items:center; justify-content:center; border:1px solid rgba(28,25,23,.16); border-radius:11px;
  background:rgba(255,255,255,.96); color:#1C1917; box-shadow:0 3px 12px rgba(28,25,23,.16);
  font:700 20px/1 -apple-system,"Source Sans 3","Segoe UI",sans-serif; cursor:pointer; }
.panel-toggle[hidden] { display:none !important; }
.panel-close { display:block; position:sticky; float:right; top:0; z-index:2; width:30px; height:30px;
  margin:-4px -3px 0 6px; border:0; border-radius:8px; background:#EDE8DF; color:#1C1917;
  font:700 20px/1 sans-serif; cursor:pointer; }
.fullscreen-close { position:absolute; top:12px; right:12px; z-index:30; width:52px; height:52px;
  border:2px solid #fff; border-radius:12px; background:#1C1917; color:#fff;
  box-shadow:0 4px 18px rgba(0,0,0,.35); font:400 40px/44px sans-serif; cursor:pointer; }
.fullscreen-close[hidden] { display:none !important; }
.fullscreen-close:hover, .fullscreen-close:focus-visible { background:#7C2D20; outline:3px solid #FFC53D; outline-offset:2px; }
.fullscreen-active .panel, .fullscreen-active .panel-toggle { top:76px; }

@media (max-width:520px) {
  .tract-popup { min-width:180px; padding:13px 14px; }
  .card { top:8px; left:8px; right:64px; max-width:none; max-height:42vh; overflow:auto;
    padding:12px 14px; box-shadow:0 3px 12px rgba(28,25,23,.16); }
  .card h1 { font-size:16px; }
  .card .price { font-size:18px; }
  .panel-toggle { top:8px; right:8px; width:48px; height:48px; border-radius:12px; font-size:21px; }
  .panel { position:absolute; top:auto; right:8px; bottom:36px; left:8px; width:auto; max-height:35vh;
    overflow-y:auto; padding:14px 16px calc(14px + env(safe-area-inset-bottom)); z-index:12;
    transform:translateY(calc(100% + 52px)); opacity:0; visibility:hidden; pointer-events:none;
    transition:transform .2s ease, opacity .2s ease, visibility 0s linear .2s; }
  .panel.open { transform:translateY(0); opacity:1; visibility:visible; pointer-events:auto;
    transition:transform .2s ease, opacity .2s ease; }
  .panel-close { width:44px; height:44px; margin:-8px -8px 0 8px; border-radius:10px; font-size:24px; }
  .fullscreen-close { top:8px; right:8px; width:52px; height:52px; }
  .fullscreen-active .panel { top:auto; }
  .fullscreen-active .panel-toggle { top:68px; }
  .panel-section summary { clear:left; min-height:44px; padding:7px 52px 7px 2px; font-size:12px; }
  .panel label { min-height:40px; padding:7px 2px; }
  .source-info { min-width:40px; min-height:40px; }
  .panel input { width:18px; height:18px; }
  .btn3d, .rotate-controls button, .mini-btns button { min-height:44px; }
  .legend { right:8px; bottom:40px; left:8px; max-width:none; }
  .legend summary { min-height:46px; padding:10px 12px; }
  .legend-body { max-height:34vh; }
  #measure-chip { right:8px; bottom:40px; left:8px; max-width:none; }
  .maplibregl-ctrl-bottom-right { bottom:30px; }
  .disclaimer { padding-bottom:calc(5px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion:reduce) { .panel { transition:none; } }
