/* map.css: the resident map's own stylesheet, carried from dashboard/map.html by
   scratchpad/assemble_map.py, minus the old theme, fonts and chrome (the shell
   provides those), with the Fora-look restyle appended at the end. Variable
   names (--bg, --card, --line, --ink, --muted, --faint, --accent) resolve to the
   brand tokens through mhrc.css. */
:root { --accent2: var(--mh-accent-hover); --pinring: rgba(3, 16, 28, 0.9); }
* { box-sizing: border-box; }
  body { margin: 0; background:
           radial-gradient(1400px 600px at 70% -12%, var(--bg2), transparent 65%) var(--bg);
         color: var(--ink); font: 15px/1.5 var(--sans);
         display: flex; flex-direction: column; }
  
  html.tg-fs .maproom.fs { top: var(--tg-top); }
  .adminbadge { display: none; border: 1px solid var(--accent); color: var(--accent);
                border-radius: 999px; padding: 3px 12px; font-size: 11px;
                letter-spacing: .09em; text-transform: uppercase; }

  .maproom { position: relative; flex: 1; min-height: 380px; margin: 4px 14px 14px;
             border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
             background: var(--bg2); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
  
  .maproom.fs { position: fixed; inset: 0; z-index: 70; margin: 0;
                border-radius: 0; min-height: 0; }
  body.mapfs { overflow: hidden; }
  #shell { position: absolute; inset: 0; touch-action: none; cursor: grab;
           overflow: hidden; }
  #shell.dragging { cursor: grabbing; }
  
  
  #stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
  #stage img.plan { position: absolute; inset: 0; width: 100%; height: 100%;
               user-select: none; -webkit-user-drag: none;
               pointer-events: none; filter: saturate(.94); }
  
  #tiles { position: absolute; inset: 0; }
  
  #tiles img { position: absolute; user-select: none; -webkit-user-drag: none;
               pointer-events: none; filter: saturate(.94); }
  
  #gmap { position: absolute; inset: 0; display: none; background: var(--bg2); }
  
  
  .layerbar { position: absolute; left: 84px; bottom: 12px; z-index: 8;
              display: none; gap: 6px; padding: 4px; border-radius: 12px;
              background: color-mix(in srgb, var(--card) 88%, transparent);
  
              border: 1px solid var(--line); box-shadow: 0 8px 26px rgba(0,0,0,.35); }
  .layerbar.on { display: flex; }
  
  .layerbar button { border: 1px solid transparent; background: transparent;
                     color: var(--muted); border-radius: 9px; cursor: pointer;
                     padding: 7px 12px; font: 12.5px var(--sans); white-space: nowrap; }
  .layerbar button:hover { color: var(--ink); }
  .layerbar button[aria-pressed="true"] { background: var(--card2);
                     border-color: var(--accent); color: var(--accent); }
  
  .planage { position: absolute; left: 84px; bottom: 62px; z-index: 8;
             display: none; align-items: center; border-radius: 10px;
             padding: 6px 10px; cursor: pointer; text-align: start;
             background: color-mix(in srgb, var(--card) 88%, transparent);
             border: 1px solid var(--line); color: var(--muted);
             font: 11.5px var(--sans); box-shadow: 0 6px 20px rgba(0,0,0,.3); }
  .planage.on { display: inline-flex; }
  .planage:hover { color: var(--ink); border-color: var(--accent); }
  .maproom.photo .planage, .maproom.photo .planagecard { display: none; }
  
  .planagecard { position: absolute; left: 84px; bottom: 62px; z-index: 9;
                 max-width: 340px; padding: 14px 16px; border-radius: 14px;
                 background: var(--card); border: 1px solid var(--line);
                 box-shadow: 0 14px 40px rgba(0,0,0,.45); }
  .planagecard[hidden] { display: none; }
  .planagecard h3 { margin: 0 0 8px; font: 600 14px var(--sans); color: var(--ink); }
  .planagecard p { margin: 0 0 8px; font: 12.5px/1.55 var(--sans); color: var(--muted); }
  .planagecard p:last-child { margin-bottom: 0; }
  .planagecard .pax { position: absolute; top: 8px; right: 8px; border: 0;
                      background: transparent; color: var(--muted);
                      cursor: pointer; font-size: 14px; padding: 4px 6px; }
  @media (max-width: 560px) { .planagecard { max-width: calc(100vw - 48px); } }
  .fade { position: absolute; inset: 0; pointer-events: none;
          box-shadow: inset 0 0 90px 30px rgba(4, 14, 25, .55); z-index: 4; }
  
  .maproom.photo .fade { display: none; }


  
  .pin { position: absolute; width: 15px; height: 15px; border-radius: 50%;
         background: radial-gradient(circle at 34% 30%, #f2d5a5, var(--accent) 58%, var(--accent2));
         border: 1.6px solid var(--pinring);
         box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
         transform: translate(-50%, -50%) scale(calc(1 / var(--k, 1)));
         transition: opacity .5s ease; opacity: 0; }
  .pin.in { opacity: 1; }
  .pin.adm { background: var(--card2); border: 1.6px solid var(--faint);
             box-shadow: 0 1px 4px rgba(0, 0, 0, .4); width: 13px; height: 13px; }
  .pin:hover { z-index: 4; }
  .pin.hit { z-index: 5; }
  .pin.hit::after { content: ""; position: absolute; inset: -8px; border-radius: 50%;
                    border: 2px solid var(--accent); animation: ring 1.5s infinite; }
  @keyframes ring { 0% { transform: scale(.55); opacity: 1; }
                    100% { transform: scale(1.5); opacity: 0; } }

  
  .dotsvg { position: absolute; inset: 0; width: 100%; height: 100%;
            pointer-events: none; overflow: visible; }
  
  
  
  
  .dotsvg circle { stroke: var(--pinring); }
  .dotsvg circle.sold { fill: var(--muted); opacity: .78; }
  
  .dotsvg circle.future { fill: none; opacity: .8; }
  .dotsvg circle.market { fill: #4c83d8; opacity: 1; }
  .dotsvg circle.pending { fill: #cc7e23; opacity: 1; }

  
  #limbanner { display: none; max-width: 1180px; margin: 10px auto 0;
               padding: 10px 16px; border: 1px solid var(--line);
               border-radius: 12px; background: var(--card);
               color: var(--muted); font-size: 13.5px; line-height: 1.5; }
  #limbanner b { color: var(--ink); }

  
  
  .builtsvg { position: absolute; inset: 0; width: 100%; height: 100%;
              pointer-events: none; z-index: 2; overflow: visible; }
  .builtsvg .bsq { fill: color-mix(in srgb, var(--accent) 16%, transparent);
                   stroke: var(--accent); stroke-linejoin: round;
                   stroke-width: calc(1.6px / var(--fscale, 1) / var(--k, 1));
                   stroke-dasharray: calc(5px / var(--fscale, 1) / var(--k, 1))
                                     calc(4px / var(--fscale, 1) / var(--k, 1));
                   opacity: 0; transition: opacity .45s ease; }
  #stage.zoomed .builtsvg .bsq { opacity: .9; }
  .streetsvg { position: absolute; inset: 0; width: 100%; height: 100%;
               pointer-events: none; z-index: 3; overflow: visible; }
  .streetsvg text { fill: #fff; font-family: var(--brandfont); font-weight: 500;
                    letter-spacing: .18em; text-anchor: middle;
                    font-size: calc(11.5px / var(--fscale, 1) / var(--k, 1));
                    paint-order: stroke; stroke: rgba(6, 16, 28, .82);
                    stroke-width: calc(2.2px / var(--fscale, 1) / var(--k, 1));
                    opacity: 0; transition: opacity .45s ease; }
  #stage.zoomed .streetsvg text { opacity: .94; }
  
  #stage.zoomed .streetsvg text.lodoff { opacity: 0; }
  
  
  .gslabel { position: absolute; transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
             color: #fff; opacity: .95; font: 600 11px/1 var(--brandfont);
             letter-spacing: .2em; text-transform: uppercase;
             text-shadow: 0 0 2px rgba(6, 16, 28, .95), 0 0 4px rgba(6, 16, 28, .9),
                          0 1px 3px rgba(0, 0, 0, .95), 0 0 10px rgba(0, 0, 0, .6);
             pointer-events: none; white-space: nowrap; }

  #tip { position: absolute; z-index: 8; pointer-events: none; display: none;
         background: var(--card); border: 1px solid var(--line); border-radius: 10px;
         padding: 7px 11px; font-size: 12.5px; max-width: 240px;
         box-shadow: 0 10px 26px rgba(0, 0, 0, .45); }
  #tip b { display: block; font-size: 13px; }
  #tip span { color: var(--muted); font-size: 11.5px; }
  

  .toolbar { position: absolute; left: 12px; top: 12px; right: 12px; z-index: 6;
             display: flex; gap: 10px; align-items: flex-start; pointer-events: none; }
  .searchbox { pointer-events: auto; position: relative; flex: 0 1 340px; }
  .searchbox input { width: 100%; background: color-mix(in srgb, var(--card) 88%, transparent);
                     -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
                     border: 1px solid var(--line); border-radius: 12px; color: var(--ink);
                     padding: 11px 14px; font: 14.5px var(--sans); outline: none;
                     box-shadow: 0 8px 26px rgba(0, 0, 0, .35); }
  .searchbox input::placeholder { color: var(--faint); }
  .searchbox input:focus { border-color: var(--accent); }
  .results { position: absolute; left: 0; right: 0; top: 48px; max-height: 46vh;
             overflow: auto; display: none; background: var(--card);
             border: 1px solid var(--line); border-radius: 12px;
             box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
  .results .r { padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer;
                display: flex; gap: 10px; align-items: center; }
  .results .r:last-child { border-bottom: none; }
  .results .r:hover, .results .r.sel { background: var(--card2); }
  .avi { flex: none; width: 30px; height: 30px; border-radius: 50%; display: flex;
         align-items: center; justify-content: center; font: 700 12px var(--sans);
         background: linear-gradient(135deg, var(--accent), var(--accent2));
         color: #10233a; }
  .results .r b { display: block; font-size: 13.5px; }
  .results .r span { color: var(--muted); font-size: 12px; }

  .legend { pointer-events: auto; margin-left: auto; display: flex; gap: 12px;
            align-items: center; flex-wrap: wrap; justify-content: flex-end;
            background: color-mix(in srgb, var(--card) 82%, transparent);
            -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
            border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
            color: var(--muted); font-size: 11.5px; }
  .legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%;
                 vertical-align: -1px; margin-right: 5px; }
  .dot.res { background: var(--accent); }
  .dot.adm { background: transparent; border: 2px solid var(--faint); }
  .dot.mkt { background: #4c83d8; }
  .dot.pnd { background: #cc7e23; }
  .dot.fut { background: transparent; border: 2px solid var(--muted); opacity: .55; }
  .dot.snl { background: var(--muted); opacity: .45; }

  @media (max-width: 560px) {
    .toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
    .searchbox { flex: none; }
    .legend { margin-left: 0; align-self: flex-start; justify-content: flex-start;
              border-radius: 12px; font-size: 11px; padding: 6px 12px; }
  }

  .zoomui { position: absolute; right: 12px; bottom: 14px; display: flex;
            flex-direction: column; gap: 7px; z-index: 8; }
  .zoomui button { width: 42px; height: 42px; border-radius: 12px; border: 1px solid
                   var(--line); background: color-mix(in srgb, var(--card) 90%, transparent);
                   
                   color: var(--ink); font-size: 19px; cursor: pointer;
                   box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
                   transition: transform .12s ease, color .12s ease, border-color .12s ease; }
  .zoomui button:hover { border-color: var(--accent); color: var(--accent); }
  .zoomui button:active { transform: scale(.92); }
  
  .zoomui button:disabled { opacity: .38; cursor: default; box-shadow: none; }
  .zoomui button:disabled:hover { border-color: var(--line); color: var(--ink); }
  .zoomui button:disabled:active { transform: none; }

  
  
  #overlay { position: fixed; inset: 0; background: rgba(3, 10, 18, .55);
             -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
             opacity: 0; pointer-events: none; transition: opacity .22s ease; z-index: 80; }
  #overlay.open { opacity: 1; pointer-events: auto; }
  #detail { position: fixed; z-index: 81; left: 50%; bottom: 0;
            transform: translate(-50%, 24px); width: min(560px, 100%);
            max-height: 78vh; overflow: auto; background: var(--card);
            border: 1px solid var(--line); border-radius: 18px 18px 0 0;
            padding: 20px 22px 26px; opacity: 0; pointer-events: none;
            transition: opacity .22s ease, transform .26s cubic-bezier(.2, .9, .3, 1);
            box-shadow: 0 -18px 60px rgba(0, 0, 0, .5); }
  #detail.open { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
  @media (min-width: 700px) {
    #detail { bottom: auto; top: 50%; border-radius: 18px;
              transform: translate(-50%, calc(-50% + 18px)); }
    #detail.open { transform: translate(-50%, -50%); } }
  #detail h3 { font-family: var(--serif); font-weight: 600; margin: 0 0 2px;
               font-size: 22px; }
  #detail .sub { color: var(--muted); margin-bottom: 8px; font-size: 13px; }
  #detail .close { position: absolute; right: 10px; top: 8px; border: none;
                   background: none; color: var(--muted); font-size: 22px; cursor: pointer; }
  .person { border-top: 1px solid var(--line); padding: 11px 0; display: flex;
            gap: 12px; }
  .person .avi { margin-top: 2px; }
  .person b { font-size: 15.5px; }
  .person .meta { color: var(--muted); font-size: 13px; margin-top: 2px;
                  display: flex; flex-direction: column; gap: 2px; }
  .person a { color: var(--accent); text-decoration: none; }
  .tag { display: inline-block; border: 1px solid var(--line); color: var(--muted);
         border-radius: 999px; padding: 1px 9px; font-size: 10.5px; margin-left: 6px;
         letter-spacing: .05em; text-transform: uppercase; vertical-align: 1px; }
  .tag.warn { border-color: #c23b52; color: #e08a9b; }
  .propgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
              gap: 8px; margin-top: 14px; }
  .prop { background: var(--card2); border: 1px solid var(--line); border-radius: 10px;
          padding: 8px 10px; }
  .prop span { display: block; color: var(--faint); font-size: 10.5px;
               letter-spacing: .07em; text-transform: uppercase; }
  .prop b { font-size: 14px; font-weight: 600; }
  .note { margin-top: 12px; color: var(--muted); font-size: 13px; border-left: 3px solid
          var(--accent); padding-left: 10px; }

  #signedout, #admunlisted { display: none; max-width: 480px; margin: 8vh auto; background: var(--card);
               border: 1px solid var(--line); border-radius: 16px; padding: 26px 28px; }
  #signedout h2, #admunlisted h2 { font-family: var(--serif); margin: 0 0 10px; }
  #signedout p, #admunlisted p { color: var(--muted); }
  #signedout code, #admunlisted code {  background: var(--card2); border-radius: 6px; padding: 1px 7px;
                    color: var(--accent); }
  #loading { margin: 10vh auto; color: var(--muted); text-align: center; }

  #adminpanel { display: none; margin: 0 14px 18px; background: var(--card);
                border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; }
  #adminpanel h2 { font-family: var(--serif); font-size: 17px; margin: 0 0 8px; }
  #adminpanel .r { color: var(--muted); font-size: 13.5px; padding: 4px 0; }
  #adminpanel .r b { color: var(--ink); }
  @media (max-width: 560px) { .langer > button { padding: 4px 9px; } }

  @media (prefers-reduced-motion: reduce) {
    .pin, .slabel, #overlay, #detail, .zoomui button { transition: none; }
    .pin.hit::after { animation: none; }
  }

/* ---- restyle on top: the Fora look -------------------------------------------- */
.maproom { border-radius: var(--r-card); box-shadow: inset 0 0 0 1px var(--hair-2), 0 30px 80px -30px rgba(0, 0, 0, 0.7); overflow: hidden; background: var(--mh-surface); }
.maproom.fs { border-radius: 0; box-shadow: none; }
.layerbar { border-radius: var(--r-pill); background: color-mix(in srgb, var(--mh-deep) 80%, transparent); border: 0; box-shadow: inset 0 0 0 1px var(--hair); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.layerbar button { border-radius: var(--r-pill); border: 0; color: var(--text-soft); font-weight: 500; }
.layerbar button[aria-pressed="true"] { background: color-mix(in srgb, var(--mh-text) 12%, transparent); color: var(--mh-text); border: 0; }
.zoomui button { width: 44px; height: 44px; border-radius: 10px; border: 0; box-shadow: inset 0 0 0 1px var(--hair); background: color-mix(in srgb, var(--mh-deep) 85%, transparent); color: var(--mh-text); }
.searchbox input { border-radius: var(--r-pill); border: 0; box-shadow: inset 0 0 0 1px var(--hair-2); background: color-mix(in srgb, var(--mh-deep) 88%, transparent); color: var(--mh-text); }
.searchbox input:focus { outline: none; box-shadow: inset 0 0 0 1px var(--mh-accent); }
.results { border-radius: 14px; border: 0; box-shadow: inset 0 0 0 1px var(--hair-2), 0 18px 40px -12px rgba(0, 0, 0, 0.6); background: var(--mh-surface); }
.planage { border-radius: var(--r-pill); border: 0; box-shadow: inset 0 0 0 1px var(--hair); }
.planagecard { border-radius: 14px; border: 0; box-shadow: inset 0 0 0 1px var(--hair-2), 0 18px 40px -12px rgba(0, 0, 0, 0.6); }
#detail { border-radius: var(--r-card); border: 0; box-shadow: inset 0 0 0 1px var(--hair-2), 0 30px 80px -20px rgba(0, 0, 0, 0.7); background: var(--mh-surface); }
#detail .close { border-radius: 50%; border: 0; background: color-mix(in srgb, var(--mh-text) 9%, transparent); color: var(--mh-text); }
#adminpanel, #signedout, #admunlisted, #loading { border-radius: var(--r-card); border: 0; box-shadow: inset 0 0 0 1px var(--hair-2); background: var(--glass); }
#limbanner { border-radius: 14px; border: 0; box-shadow: inset 0 0 0 1px var(--hair-2); background: var(--glass); }
/* the page head */
.maphead { padding: 2rem 0 1.2rem; }
.maphead h1 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.9rem; }
.adminbadge { font-size: 0.78rem; font-weight: 500; letter-spacing: 0; padding: 0.25rem 0.7rem; border-radius: var(--r-pill); background: color-mix(in srgb, var(--mh-text) 8%, transparent); box-shadow: inset 0 0 0 1px var(--hair); color: var(--text-soft); display: none; }
.maphead .stats { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; margin-top: 0.8rem; }
.maphead .stat { cursor: default; display: inline-flex; gap: 0.45rem; align-items: baseline; color: var(--mh-text-muted); font-size: 0.9rem; }
.maphead .stat b { font-size: 1.35rem; font-weight: 500; letter-spacing: -0.03em; color: var(--mh-text); font-variant-numeric: tabular-nums; }
.mapwrap { padding-bottom: 3rem; }

/* A4: opaque controls and separate phone search, legend, layer and zoom space. */
.searchbox input, .legend, .layerbar, .planage, .zoomui button { background: var(--mh-deep); }
.searchbox input::placeholder { color: var(--mh-text-muted); }
.searchbox input:focus-visible { outline: 2px solid var(--mh-focus); outline-offset: 2px; }
.searchbox { z-index: 1; }
.results { z-index: 2; }
@media (max-width: 600px) {
  .maproom { min-height: 520px; }
  .maproom.fs { min-height: 0; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .legend { order: 0; margin: 0; align-self: stretch; justify-content: flex-start; }
  .searchbox { order: 1; flex: none; }
  /* Keep native iOS focus from enlarging the page around smaller form text. */
  .searchbox input { font-size: 16px; }
  .results { max-height: 160px; }
  .layerbar { left: 12px; right: 68px; border-radius: 12px; gap: 3px; }
  .layerbar.on { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .layerbar button { min-width: 0; min-height: 44px; padding: 6px 3px; white-space: normal; overflow-wrap: break-word; }
  .planage, .planagecard { left: 12px; right: 68px; bottom: 120px; max-width: none; }
  .planage { border-radius: 12px; }
}
