/* Approved floating-map layout. Project filters never change parcel zoning. */
.topbar{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:var(--sp-4)}
.topbar .brand,.topbar .right{grid-row:1;flex-shrink:0}
.topbar .brand{grid-column:1}
.topbar .right{grid-column:3}
.topbar .tbtn.ghost,.topbar .iconbtn{background:rgba(52,50,100,.88);border-color:rgba(176,174,255,.42)}
.topbar .tbtn.ghost:hover,.topbar .iconbtn:hover{background:rgba(68,66,128,.94);border-color:rgba(196,194,255,.7)}
.topbar .masthead-art{grid-column:2/4;grid-row:1;align-self:end;display:grid;grid-template-columns:subgrid;align-items:end;min-width:0;transform:translateX(min(0px,calc(100% - 489px)));overflow:visible;pointer-events:none;z-index:0;filter:saturate(1.25) brightness(1.12) drop-shadow(0 0 10px rgba(160,140,255,.25))}
/* Center in the gap; tuck under buttons first, then the brand when the right side fills. */
.masthead-art img{display:block;grid-column:1;justify-self:safe center;width:489px;max-width:none;height:56px;aspect-ratio:489/56}
/* Analyze stays hidden until the AI SQL endpoint ships. */
#analyzeBtn,#menuAnalyze{display:none!important}
.main{--map-inset:var(--sp-4);position:relative;display:block;min-height:0}
#map{position:absolute;inset:0;z-index:0}
.rail{position:absolute;left:var(--map-inset);top:var(--map-inset);bottom:var(--map-inset);width:var(--rail);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow)}
.listhead{display:flex;flex-direction:column;align-items:flex-start;gap:var(--sp-1);padding:var(--sp-3);flex:none;border-bottom:1px solid var(--line)}
/* Title + count on the left, sort control on the right; the title wraps before they collide. */
.listhead{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:var(--sp-3)}
.listhead h2,.listhead #listCount{grid-column:1}
.listsort{grid-column:2;grid-row:1/3;align-self:center}   /* look + 44px height: .project-filter-trigger */
.project-filter-trigger.listsort{width:auto;min-width:0;gap:6px}
.listsort[aria-expanded=true]{background:#f6f7f9;border-color:#a8adba}
/* Sort menu: a popover (browser handles outside-click + Escape), styled like the filter menus. */
.listsort-menu{inset:auto;width:200px}
.listhead h2{margin:0;font-size:16px;font-weight:700;line-height:1.25;letter-spacing:-.4px}
.listhead #listCount{font-size:12px;line-height:1.4;color:var(--ink-2)}
.list{padding:var(--sp-2);overscroll-behavior:contain}
.list .card{font-family:var(--font)}
.project-toolbar{position:absolute;z-index:650;left:calc(var(--rail) + 2 * var(--map-inset));right:var(--map-inset);top:var(--map-inset);max-width:1044px;padding:var(--sp-3);background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow)}
.project-toolbar-row{display:flex;align-items:center;gap:8px;flex-wrap:nowrap}
/* Min widths fit the full placeholder at 14px (desktop) and 16px (phone). */
.project-toolbar .searchwrap{flex:1 1 0;min-width:240px}
.project-toolbar .searchclear[hidden]{display:none}
.project-toolbar .searchbox{height:44px;padding:0 12px;gap:var(--sp-3);border:1.5px solid #c3c9e8;border-radius:8px;background:var(--accent-soft)}
.project-toolbar .searchbox:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft);background:var(--panel)}
.project-toolbar .searchbox svg{width:20px;height:20px;color:var(--accent)}
.project-toolbar input[type=search]{height:100%;font-size:14px;font-weight:500;line-height:20px;min-width:0}
.project-toolbar input[type=search]::placeholder{color:var(--ink-2);font-weight:400;opacity:1}
.project-toolbar input[type=search]::-webkit-search-cancel-button{display:none}
.project-toolbar-actions{display:flex;align-items:center;gap:8px;flex:none}
/* Never scrolls: project-controls.js folds filters into More instead. */
.project-filter-strip{display:flex;align-items:center;gap:8px;flex:0 1 auto;min-width:0;overflow:hidden}
.project-primary-filter[hidden]{display:none}
.filters-minimal #projectToolbarReset,.filters-minimal .project-filter-label,.filters-minimal .project-filter-trigger>svg:last-child{display:none}
.project-toolbar.filters-minimal .searchwrap{min-width:0}
.project-toolbar.filters-minimal .searchbox{gap:var(--sp-2)}
.project-toolbar.filters-minimal .project-filter-trigger{width:44px;min-width:44px;justify-content:center;padding:5px 10px;gap:0;position:relative}
.filters-minimal .project-filter-count{position:absolute;top:2px;right:2px}
.project-primary-filter,.project-filter-trigger{display:flex;align-items:center;justify-content:space-between;gap:8px;height:44px;flex:none;padding:5px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);font:inherit;font-size:12px;font-weight:500;text-align:left;cursor:pointer}
.project-primary-filter{display:grid;grid-template-columns:minmax(0,1fr) 12px;grid-template-rows:12px 15px;row-gap:1px;align-content:center;width:136px;min-width:136px}
.project-primary-filter:hover,.project-filter-trigger:hover{background:#f6f7f9;border-color:#a8adba}
.project-primary-filter.filter-active,.project-filter-trigger.filter-active{background:var(--accent);border-color:var(--accent);color:#fff}
.project-primary-filter.filter-active:hover,.project-filter-trigger.filter-active:hover{background:#414b91;border-color:#414b91}
.project-filter-caption{grid-column:1/-1;grid-row:1;font-size:11px;line-height:12px;opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.project-filter-selection{grid-column:1;grid-row:2;display:flex;align-items:center;gap:6px;min-width:0;line-height:15px}
.project-selection-text{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.project-primary-filter.selection-overflow{padding:5px 6px;column-gap:6px}
.project-selection-count{flex:none;min-width:18px;white-space:nowrap;font-size:12px;line-height:15px;font-weight:600;text-align:center}
.project-primary-filter>svg{grid-column:2;grid-row:2}
.project-primary-filter svg,.project-filter-trigger svg{flex:none;width:12px;height:12px}
.project-filter-trigger{width:112px;min-width:112px;gap:4px}
.project-filter-trigger>svg:first-child{width:16px;height:16px}
.project-filter-count{padding:1px 4px;min-width:13px;text-align:center;border-radius:4px;font-size:11px;background:#ffffff2e;color:#fff}
#projectToolbarReset{width:36px;min-height:44px;padding:4px 0}
.project-reset{font:inherit;font-size:12px;font-weight:400;border:0;background:none;color:var(--accent);padding:4px;white-space:nowrap;cursor:pointer;flex:none}
.project-reset:hover{background:none;text-decoration:underline}
.project-rail-toggle{position:absolute;z-index:640;top:50%;left:calc(var(--rail) + var(--map-inset));transform:translateY(-50%);width:28px;min-height:52px;padding:8px 3px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;border:1px solid var(--line);border-left:0;border-radius:0 9px 9px 0;background:#fff;color:var(--accent);box-shadow:3px 2px 8px #18203b16;cursor:pointer}
.project-rail-toggle span{display:none;writing-mode:vertical-rl;font-size:13px;font-weight:600}
body.projects-collapsed .rail{display:none}
body.projects-collapsed .project-toolbar{left:var(--map-inset)}
body.projects-collapsed .project-rail-toggle{left:0;min-height:110px}
body.projects-collapsed .project-rail-toggle span{display:inline}
body.projects-collapsed .project-rail-toggle svg{transform:rotate(180deg)}
body.projects-compact .project-toolbar{left:var(--map-inset)}
body.projects-compact .rail{top:var(--project-rail-top,175px)}
body.projects-compact .project-rail-toggle{top:calc(var(--project-rail-top,175px) + 65px);transform:none}
.project-filter-dialog,.project-primary-menu{position:fixed;z-index:1100;margin:0;max-width:calc(100vw - 24px);border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--ink);box-shadow:0 12px 45px #17213c30}
.project-filter-dialog{padding:0;width:560px;max-height:calc(100dvh - 100px);overflow:hidden}
.project-filter-dialog[open]{display:flex;flex-direction:column}
.project-primary-menu{width:260px;padding:14px;overflow:auto}
.project-primary-menu[data-filter-menu=stages]{width:290px}
.project-primary-menu h3{font-size:12px;color:var(--ink-2);margin:0 0 8px}
.project-primary-menu .project-completion-config{max-width:230px}
.project-filter-dialog>header{display:flex;align-items:center;gap:8px;padding:var(--sp-3) var(--sp-4);border-bottom:1px solid var(--line);flex:none}
.project-filter-dialog h2{font-size:14px;margin:0}
.project-filter-dialog>header button{margin-left:auto;display:grid;place-items:center;width:36px;height:36px;border:1px solid var(--line);border-radius:8px;background:#fff;font:inherit;cursor:pointer}
.project-filter-body{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:var(--sp-6);padding:var(--sp-4);overflow:auto;min-height:0;overscroll-behavior:contain}
.project-filter-body section{min-width:0}
/* The long Neighborhood list takes the right column, with the other More filters stacked on its
   left. Only when it leads the panel (desktop); folded bar filters come first on narrow screens. */
.project-filter-body>[data-filter-section="nbs"]:first-child{grid-column:2;grid-row:1 / span 4}
.project-added-options small{display:block;font-size:11px;font-weight:400;color:var(--ink-2);margin-top:var(--sp-1)}
.project-filter-body h3{font-size:12px;color:var(--ink-2);margin:0 0 var(--sp-2)}
.project-filter-option{display:flex;align-items:center;gap:8px;padding:var(--sp-2) var(--sp-1);border-radius:5px;font-size:12px;min-height:32px;cursor:pointer}
.project-filter-option:hover{background:var(--accent-soft)}
.project-filter-option input{margin:0;width:14px;height:14px;flex:none;accent-color:var(--accent)}
.project-filter-option input[data-filter-all]{font-weight:600}
.project-filter-option:has([data-filter-all]),.project-filter-option:has([data-added-window=all]){border-bottom:1px solid var(--line-2);margin-bottom:4px}
.project-completion-config{display:flex;gap:var(--sp-2);align-items:center;min-width:0;margin:var(--sp-1) 0 var(--sp-1) var(--sp-6);padding:0;border:0}
.project-completion-config[hidden]{display:none}
.project-completion-config select,.project-completion-config input{font:inherit;font-size:11px;min-width:0;height:30px;padding:5px 4px;border:1px solid var(--line);border-radius:5px;color:var(--ink);background:#fff}
.project-completion-config select{flex:none;width:85px}
.project-completion-config input{flex:1;width:110px}
.project-filter-dialog>footer{display:flex;justify-content:center;flex:none;padding:var(--sp-3) var(--sp-4);border-top:1px solid var(--line)}
.project-filter-dialog button:focus-visible,.project-filter-dialog input:focus-visible,.project-filter-dialog select:focus-visible,.project-primary-menu input:focus-visible,.project-primary-menu select:focus-visible,.project-toolbar button:focus-visible,.project-rail-toggle:focus-visible,.zoning-legend-header button:focus-visible,.ml-row:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.maplegend{display:flex;flex-direction:column;padding:0;width:288px;max-width:calc(100% - 2 * var(--map-inset));max-height:calc(100% - 2 * var(--map-inset));overflow:hidden}
.zoning-legend-header{display:flex;align-items:center;gap:var(--sp-2);padding:var(--sp-2) var(--sp-3);flex:none}
#zoningLegendHandle{display:flex;align-items:center;gap:var(--sp-2);flex:1;min-height:34px;cursor:grab;touch-action:none;font-size:11px;font-weight:700}
#zoningLegendHandle:active{cursor:grabbing}
#zoningLegendHandle>span{color:var(--ink-3);font-size:16px}
#zoningLegendCollapse{display:grid;place-items:center;width:30px;height:30px;border:0;background:none;border-radius:5px;color:inherit;cursor:pointer}
.maplegend.legend-collapsed #zoningLegendBody{display:none}
.maplegend.legend-collapsed #zoningLegendCollapse svg{transform:rotate(180deg)}
#zoningLegendBody{padding:0 12px 12px;min-height:0;overflow:auto}
.maplegend .ml-row{font-size:11px;line-height:1.35;min-height:25px}
.maplegend .ml-row .ct{font-variant-numeric:tabular-nums}
/* View banner: bottom centre of the map area the project panel leaves uncovered. */
.trackerchip{top:auto;bottom:calc(var(--map-inset) + var(--sp-2));left:calc(var(--rail) + 2 * var(--map-inset));right:var(--map-inset);margin-inline:auto;width:fit-content;max-width:none;transform:none}
body.projects-collapsed .trackerchip{left:var(--map-inset)}
body.intro .project-toolbar,body.intro .project-rail-toggle{visibility:hidden}
body.intro .main{display:block}
.layersbtn{display:none}
.menuitem#menuFeedback,.menuitem#menuAnalyze,.menuitem#menuNotify{display:none}
@media(max-width:1150px){:root{--rail:380px}}
@media(min-width:641px) and (max-width:800px){:root{--rail:320px}}
@media(max-width:1023px){
  .topbar{padding:0 var(--sp-4)}.topbar .right{gap:var(--sp-2)}.brand span,.brand .beta{display:none}
  #feedbackBtn,#analyzeBtn,#notifyBtn{display:none}
  .menuitem#menuFeedback,.menuitem#menuAnalyze,.menuitem#menuNotify{display:block}
}
@media(max-width:640px){
  .main{--map-inset:var(--sp-3)}
  .hero{padding:var(--sp-6)}
  .modal{padding:var(--sp-4)}
  .topbar{grid-template-columns:minmax(0,1fr) auto;gap:8px}.topbar .right{grid-column:2}.topbar .masthead-art{display:none}
  :root{--rail:min(330px,calc(100vw - 54px))}
  .app{height:100dvh;grid-template-rows:60px minmax(0,1fr)}
  .topbar{padding:0 var(--sp-3)}.brand{gap:var(--sp-2)}.brand .mark{width:26px;height:26px}.brand b{font-size:12px}.tbtn{font-size:12px;padding:var(--sp-2) var(--sp-3)}
  .project-toolbar,body.projects-collapsed .project-toolbar{left:var(--map-inset);right:var(--map-inset);top:var(--map-inset);padding:var(--sp-3)}
  .project-toolbar input[type=search]{font-size:16px}
  .project-toolbar .searchwrap{min-width:260px}
  .rail{left:var(--map-inset);top:var(--project-rail-top,175px);bottom:var(--map-inset)}
  .project-rail-toggle{left:calc(var(--rail) + var(--map-inset));top:calc(var(--project-rail-top,175px) + 65px);transform:none}
  .project-filter-body{grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--sp-6) var(--sp-3)}
  .project-filter-option{min-height:40px}
  .project-completion-config{max-width:220px}
  .project-completion-config input,.project-completion-config select{height:34px}
  body:not(.projects-collapsed) .maplegend{visibility:hidden}
  .maplegend .ml-row{min-height:34px}
  /* Clear the zoom buttons at bottom right. */
  .trackerchip,body.projects-collapsed .trackerchip{left:var(--map-inset);right:calc(var(--map-inset) + 44px)}
  .dpull{padding:var(--sp-2) var(--sp-4)}.dhead h2{font-size:20px}
  .scrim{top:60px;height:calc(100% - 60px)}  /* below the 60px phone topbar */
}
@media(prefers-reduced-motion:reduce){.detail{transition:none}}
@media(max-width:359px){
  .project-toolbar.filters-minimal .searchbox{padding:0 var(--sp-1)}
  .project-toolbar.filters-minimal .searchbox>svg{display:none}
}

#map .leaflet-right .leaflet-control:not(.leaflet-control-attribution){margin-right:var(--map-inset)}
#map .leaflet-bottom .leaflet-control:not(.leaflet-control-attribution){margin-bottom:var(--map-inset)}

/* ---- Upcoming meetings (assets/meetings.js). Classes prefixed mtg-. ---- */
/* Projects / Meetings tabs atop the list */
.mtg-tabs{display:flex;gap:4px;padding:8px 12px 0;border-bottom:1px solid var(--line);flex:none}
.mtg-tabs button{display:flex;align-items:center;gap:6px;padding:8px 10px;border:0;border-bottom:2px solid transparent;background:none;font:inherit;font-size:13px;font-weight:600;color:var(--ink-2);cursor:pointer}
.mtg-tabs button[aria-selected="true"]{color:var(--ink);border-bottom-color:var(--accent)}

.mtg-count{min-width:18px;padding:1px 5px;border-radius:9px;background:var(--accent);color:#fff;font-size:11px;font-weight:700;text-align:center;line-height:16px}

/* Map Key row: a mini calendar tile in place of the stage dot */
.mtg-keytile{width:11px;height:11px;flex:none;border:1.5px solid var(--accent);border-radius:2px;background:linear-gradient(var(--accent) 0 35%,#fff 35%);box-sizing:border-box}
.mtg-keyrow.off .mtg-keytile{background:transparent;border-color:var(--ink-3)}

/* The wrapper makes the heading a :first-child, which the app's .mk-h rule zeroes; restore its top space. */
.mtg-keysec .mk-h:first-child{margin-top:var(--sp-2)}

/* List swap */
body.mtg-on .browse > .listhead, body.mtg-on .browse > #list{display:none}
.mtg-panel{display:flex;flex-direction:column;min-height:0;flex:1}
.mtg-panel[hidden]{display:none}
.mtg-head{display:flex;flex-direction:column;gap:4px;padding:var(--sp-3);border-bottom:1px solid var(--line);flex:none}
.mtg-head h2{margin:0;font-size:16px;font-weight:700;line-height:1.25;letter-spacing:-.4px}
.mtg-list{overflow:auto;padding:8px;display:flex;flex-direction:column;gap:6px}
.mtg-row{display:flex;gap:12px;align-items:center;padding:10px;border:1px solid var(--line);border-radius:10px;background:#fff;font:inherit;text-align:left;cursor:pointer}
.mtg-row:hover,.mtg-row:focus-visible{border-color:var(--accent);background:var(--accent-soft)}
.mtg-txt{display:flex;flex-direction:column;gap:2px;min-width:0}
.mtg-addr{font-weight:700;font-size:14px;color:var(--ink)}
.mtg-when{font-size:13px;color:var(--ink);font-weight:500}
.mtg-nb{font-size:12px;color:var(--ink-3)}
.mtg-empty{padding:32px 16px;text-align:center;color:var(--ink-2);font-size:13px}
.mtg-empty svg{width:28px;height:28px;color:var(--ink-3)}
.mtg-empty p{margin:6px 0}

/* Calendar tile: list rows and map pins */
.mtg-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:none;width:30px;height:32px;border:1.5px solid var(--accent);border-radius:6px;background:#fff;overflow:hidden;line-height:1}
.mtg-tile b{display:block;width:100%;padding:2px 0;background:var(--accent);color:#fff;font-size:8px;font-weight:700;text-transform:uppercase;text-align:center;letter-spacing:.04em}
.mtg-tile i{font-style:normal;font-weight:800;font-size:14px;color:var(--ink);padding-top:2px}
.mtg-tile.big{width:44px;height:46px;border-radius:8px}
.mtg-tile.big b{font-size:10px;padding:3px 0}
.mtg-tile.big i{font-size:19px;padding-top:4px}
.mtg-pin{background:none;border:0}
.mtg-pin .mtg-tile{box-shadow:0 2px 6px rgba(20,22,28,.3)}
.mtg-tip{font-size:12px;line-height:1.4}
.mtg-row{cursor:pointer}
.mtg-row:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.mtg-txt{flex:1}
.mtg-line1{display:flex;align-items:flex-start;gap:8px}
.mtg-tag{flex:none;margin-left:auto;margin-top:-1px;white-space:nowrap}   /* shape/font from the project-card .tag; placed like its stage pill */
.mtg-tag.pb{color:var(--accent);border-color:color-mix(in srgb,var(--accent) 35%,transparent);background:var(--accent-soft)}
.mtg-list{flex:1}
.mtg-foot{flex:none;padding:var(--sp-2) var(--sp-3);border-top:1px solid var(--line);font-size:11px;line-height:1.4;color:var(--ink-3)}
.mtg-foot a{color:var(--ink-2)}
.mtg-links{display:flex;flex-wrap:wrap;gap:4px 12px;font-size:12px;margin-top:2px}
.mtg-links a{color:var(--accent);font-weight:600;text-decoration:none}
.mtg-links a:hover{text-decoration:underline}
