/* =============================================================================
   ryderkatz.com — Places (PLACES-BUILD-BRIEF.md)
   -----------------------------------------------------------------------------
   A wide, dynamic surface — not a centered prose column. The unified Places page
   breaks out of the narrow <main> container to use the viewport: map left, list
   right. Reuses global tokens (--c-*, --bg-*, --fg-*, --radius*, --shadow*).
============================================================================= */

/* Full-bleed breakout from the centered <main> (canonical centered-container
   formula). Gives Places the screen instead of a 1240px column. */
.places-wide {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 0 var(--pad-x);
  box-sizing: border-box;
}
/* In the portal app, main carries a slim gutter (--pad-x). Places is edgeless
   ([RYDER-VERDICT] 2026-07-04: "I don't want the portal gutter"): it escapes the
   gutter with the established negative-margin bleed (same as .dash-strip /
   #portal-hub) so the map + list run flush to the screen edges. */
body[data-portal] .places-wide { width: auto; margin-inline: calc(-1 * var(--pad-x)); padding: 0; }
/* --- toolbar (one control strip, shared with Potential Places) ----------- */
/* The hero title is gone (the green nav highlight carries location). ONE row
   carries every page-level control — search + filters + count reading left to
   right, actions pinned right — all on a single control height (--ctl-h), so
   the panes below start on one shared horizon instead of three. */
/* Filter-first toolbar: colored family chips fill the strip; actions are compact
   icons pinned right; search hides until summoned. --ctl-h sizes the icon row. */
.places-toolbar { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .7rem 0; --ctl-h: 2.15rem; }
/* Shared with the Potential Places toolbar (which still uses a spacer + buttons). */
.places-toolbar .grow { flex: 1 1 0; min-width: 0; }
.places-toolbar .btn { height: var(--ctl-h); padding: 0 .95rem; font-size: 13px; border-radius: 10px; }
.places-toolbar .btn:hover { transform: none; }
/* A real toolbar: one flush strip running the full width, edge to edge. NO panel
   fill, NO floating rounded containers — the controls sit directly on it and a
   single hairline base is its only edge (the top of one continuous surface). */
body[data-portal] .places-toolbar { padding: .5rem var(--pad-x); border-bottom: 1px solid var(--border); background: transparent; }

/* --- family filter chips + contextual sub-filters ------------------------ */
/* Two stacked rows: families, then (contextual) open-now + the selected family's
   attributes. Each row scrolls horizontally on overflow rather than wrapping. */
/* The filter section sits directly ON the toolbar — no box, no fill, no radius.
   A leading mono FILTER label (divided by a hairline) heads two stacked rows:
   families, then contextual refinements. The eyebrow mirrors the REGIONS panel. */
.places-filterbar {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: row; align-items: stretch; gap: .6rem;
  background: transparent; border: 0; border-radius: 0; padding: 0;
}
.filter-lead {
  flex: none; align-self: stretch; display: flex; align-items: center;
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--fg-mute);
  padding: 0 .7rem 0 0; border-right: 1px solid var(--border);
}
.filter-stack { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: .32rem; }
.filter-row { display: flex; align-items: center; gap: .4rem; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { height: 0; }
/* The sub-row is a quieter refinement line, divided from the family row. */
.filter-sub { padding-top: .32rem; border-top: 1px solid var(--hairline); }
.filter-sub:empty { display: none; }
.sub-chip {
  flex: none; display: inline-flex; align-items: center; gap: .3rem;
  height: 1.7rem; padding: 0 .6rem; border-radius: 999px;
  font: inherit; font-size: 11.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
  color: var(--fg-mute); background: transparent; border: 1px solid transparent;
  transition: border-color .12s, background .12s, color .12s;
}
.sub-chip .sc-ic { font-size: 11px; line-height: 1; }
.sub-chip:hover { background: var(--bg-soft); color: var(--fg-dim); }
.sub-chip.active { color: var(--fg); border-color: var(--accent); background: var(--accent-soft); }
/* Open-now reads green when engaged (matches the live open status color). */
.sub-chip[data-status].active { color: var(--c-mint-2); border-color: color-mix(in srgb, var(--c-mint-1) 55%, var(--border)); background: color-mix(in srgb, var(--c-mint-1) 15%, transparent); }
.fam-chip {
  flex: none; display: inline-flex; align-items: center; gap: .4rem;
  height: 1.95rem; padding: 0 .8rem; border-radius: 999px;
  font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
  color: var(--fg-dim); background: transparent; border: 1px solid transparent;
  transition: border-color .12s, background .12s, color .12s;
}
.fam-chip .fc-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--fam, var(--fg-mute)); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--fam, transparent) 18%, transparent); }
.fam-chip:hover { background: var(--bg-soft); border-color: var(--border); color: var(--fg); }
/* Active chip is tinted in its OWN family color — the strip reads as a live key. */
.fam-chip.active { color: var(--fg); border-color: color-mix(in srgb, var(--fam, var(--accent)) 55%, var(--border)); background: color-mix(in srgb, var(--fam, var(--accent)) 15%, var(--bg-soft)); }
.fam-chip.active .fc-dot { box-shadow: 0 0 8px var(--fam); }

/* --- actions: a right-hand toolbar section — count · icons · + ------------- */
/* No box: the actions sit on the toolbar, fenced off by a full-height hairline
   on the left so the strip reads as sectioned (filters | actions), not floating. */
.places-actions {
  flex: none; align-self: stretch; display: flex; align-items: center; gap: .35rem;
  background: transparent; border: 0; border-left: 1px solid var(--border);
  border-radius: 0; padding: 0 0 0 .8rem; margin-left: .2rem;
}
.places-icon {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 1.95rem; height: 1.95rem; border-radius: 9px;
  font-size: 16px; line-height: 1; cursor: pointer; text-decoration: none;
  color: var(--fg-dim); background: var(--bg-soft); border: 1px solid var(--border);
  transition: border-color .12s, background .12s, color .12s;
}
.places-icon:hover, .places-icon.active { color: var(--fg); border-color: var(--border-hi); background: var(--bg-elev); }
.places-icon-add { margin-left: .1rem; color: var(--accent-fg); background: var(--accent); border-color: var(--accent); font-size: 20px; font-weight: 500; }
.places-icon-add:hover { color: var(--accent-fg); background: color-mix(in srgb, var(--accent) 85%, #fff); border-color: var(--accent); }
.places-search { width: 15rem; max-width: 42vw; height: var(--ctl-h); background: var(--bg-elev); border: 1px solid var(--border-hi); border-radius: 9px; padding: 0 .8rem; color: var(--fg); font: inherit; font-size: 13.5px; outline: none; }
.places-search[hidden] { display: none; }
.places-kind, .places-filter select { height: var(--ctl-h); background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 0 .55rem; color: var(--fg); font: inherit; font-size: 13px; }
.places-filter { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--mono); font-size: 11px; color: var(--fg-mute); }
.places-count { font-family: var(--mono); font-size: 11.5px; color: var(--fg-mute); white-space: nowrap; padding: 0 .5rem 0 .35rem; border-right: 1px solid var(--hairline); }

/* --- regions module (brief §4.2; single-click, fly-to) ------------------- */
/* Regions float ON the map as a foldable frosted module (maps-app layer
   control) instead of costing a page column. Folded: a compact pill showing
   the active selection. Open: the labeled tree, scrolling inside itself,
   never taller than the map. State persists (places.nav.folded). */
.area-overlay {
  position: absolute; top: .6rem; left: .6rem; z-index: 6;
  display: flex; flex-direction: column;
  width: 15.5rem; max-width: calc(100% - 5rem); max-height: calc(100% - 3.6rem);
  border-radius: 12px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px);
  box-shadow: var(--shadow-sm, 0 8px 24px -12px rgba(0,0,0,.35));
  overflow: hidden;
}
.area-overlay.folded { width: auto; }
.area-fold-pill {
  display: inline-flex; align-items: center; gap: .45rem;
  font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  padding: .45rem .8rem; border: none; background: none; color: var(--fg);
}
.area-fold-pill .ac-n { font-family: var(--mono); font-size: 10px; color: var(--fg-mute); }
.area-fold-pill .caret { font-size: 9px; color: var(--fg-mute); }
.area-head { display: flex; align-items: center; gap: .3rem; padding: .45rem .5rem .3rem .75rem; flex: none; }
.area-title { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-mute); flex: 1; }
.area-tree { display: flex; flex-direction: column; gap: .05rem; min-height: 0; overflow-y: auto; padding: 0 .45rem .5rem; }
.area-tree::-webkit-scrollbar, .places-list::-webkit-scrollbar { width: 6px; }
.area-tree::-webkit-scrollbar-thumb, .places-list::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 999px; }
/* Scope pair (All / Arealess) — a connected segment. These are scopes, not
   regions, so they read as one control distinct from the tree below. */
.area-top { display: flex; gap: 0; margin: 0 0 .5rem; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--bg-soft); }
/* Every row is a quiet ghost row (transparent until hover) — an outline, not a
   stack of individually-boxed cards. Active = a soft accent tint + an accent
   edge marker, never a heavy solid block. */
.area-chip, .area-btn {
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: left;
  display: inline-flex; align-items: center; gap: .4rem; width: 100%;
  padding: .32rem .5rem; border-radius: 8px;
  border: 1px solid transparent; background: transparent; color: var(--fg-dim);
  transition: background .12s, color .12s, border-color .12s;
}
.area-top .area-chip { flex: 1 1 0; width: auto; justify-content: center; border-radius: 0; padding: .34rem .5rem; gap: .3rem; font-size: 12px; }
.area-top .area-chip + .area-chip { border-left: 1px solid var(--border); }
.area-top .area-chip .ac-n { margin-left: 0; }
.area-chip:hover, .area-btn:hover { background: var(--bg-soft); color: var(--fg); }
.area-chip.active, .area-btn.active { background: var(--accent-soft); color: var(--fg); border-color: transparent; box-shadow: inset 2px 0 0 var(--accent); }
.area-top .area-chip.active { box-shadow: none; }
.area-chip .ac-n { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--fg-mute); opacity: 1; font-variant-numeric: tabular-nums; }
.area-chip.active .ac-n { color: var(--accent-2); }
.area-chip.region { font-weight: 700; font-size: 13px; letter-spacing: -.01em; }
.area-cog { font-size: 12px; line-height: 1; cursor: pointer; padding: .24rem .4rem; border-radius: 7px; border: 1px solid transparent; background: none; color: var(--fg-mute); }
.area-cog:hover { color: var(--fg); border-color: var(--border-hi); background: var(--bg-soft); }
/* Regions carry top-level weight; hairline separators break the tree into
   region groups (St. Louis's subtree, Europe's, Wisconsin's). */
.area-region { display: flex; flex-direction: column; gap: .05rem; padding: .12rem 0; }
.area-region + .area-region { border-top: 1px solid var(--hairline); margin-top: .1rem; padding-top: .22rem; }
.area-region-head { display: flex; align-items: center; gap: .1rem; }
.area-toggle { flex: none; font: inherit; font-size: 9px; cursor: pointer; width: 1.25rem; height: 1.7rem; display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 6px; background: none; color: var(--fg-mute); transition: background .12s, color .12s; }
.area-toggle.empty { cursor: default; }
.area-toggle:not(.empty):hover { background: var(--bg-soft); color: var(--fg); }
/* Children hang off a vertical guide rail — containment ("part of") made
   visible, and depth legible at a glance (Region › Area › Sub-area). */
.area-kids { display: flex; flex-direction: column; gap: .05rem; margin-left: 1.05rem; padding-left: .55rem; border-left: 1px solid var(--border); }
.area-grand { display: flex; flex-direction: column; gap: .05rem; margin-left: .1rem; padding-left: .55rem; border-left: 1px solid var(--border); }

/* --- area admin overlay (brief §4.2) ----------------------------------- */
.area-admin-back { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.5); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; overflow: auto; }
.area-admin { width: min(760px, 100%); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg, 0 20px 60px rgba(0,0,0,.5)); padding: 1.1rem 1.2rem; }
.area-admin .aa-head { display: flex; align-items: center; justify-content: space-between; }
.area-admin h3 { margin: 0; }
.area-admin .aa-x { font-size: 1.5rem; line-height: 1; background: none; border: none; color: var(--fg-mute); cursor: pointer; }
.area-admin .aa-note { font-size: 12px; color: var(--fg-mute); margin: .3rem 0 .8rem; }
.area-admin .aa-add { display: flex; gap: .5rem; margin-bottom: .9rem; }
.area-admin .aa-add input, .area-admin select, .area-admin .aa-name { border: 1px solid var(--border); background: var(--bg-soft); color: var(--fg); border-radius: var(--radius-xs); padding: .35rem .5rem; font: inherit; font-size: 13px; }
.area-admin .aa-add input { flex: 1; }
.area-admin .aa-list { display: flex; flex-direction: column; gap: .4rem; }
.area-admin .aa-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .35rem .3rem; border-top: 1px solid var(--border); margin-left: calc(var(--d, 0) * 1.2rem); }
.area-admin .aa-name { flex: 1; min-width: 120px; font-weight: 600; }
.area-admin .aa-pl { font-size: 11px; color: var(--fg-mute); display: inline-flex; align-items: center; gap: .25rem; }
.area-admin .aa-count { font-family: var(--mono); font-size: 11px; color: var(--fg-mute); }
.area-admin .btn { padding: .3rem .6rem; font-size: 12px; }

/* --- two-pane split ------------------------------------------------------ */
/* map | list — two matching bordered surfaces sharing one top edge under the
   toolbar. ONE height (--pane-h) rules both panes: sized to the viewport
   (via the measured chrome height), clamped, and NEVER driven by content —
   the list scrolls inside its pane, so 20 places and 2,000 places produce
   the exact same page geometry. */
/* Edgeless + seamless: no inter-pane gap, no outer radius. Map and list butt
   together as one surface split by a single hairline; the whole thing bleeds to
   the screen edges (the toolbar band above shares that width). */
.places-split {
  --pane-h: clamp(24rem, calc(100dvh - var(--portal-chrome-h, 118px) - 5.2rem), 66rem);
  display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(20rem, .8fr);
  gap: 0; align-items: start; margin-bottom: 0;
}
.places-map-pane { position: relative; display: flex; flex-direction: column; min-width: 0; }
#places-map-canvas {
  width: 100%; height: var(--pane-h);
  border: none; border-radius: 0; overflow: hidden; background: var(--bg-soft);
}
/* Status is an overlay chip in the map's own corner — plumbing narration never
   holds a layout row (as a flow row it also stole map height in app-fit). */
.map-fallback-note {
  position: absolute; right: .6rem; bottom: .6rem; z-index: 5;
  display: flex; align-items: center; gap: .4rem; max-width: 46%;
  padding: .32rem .65rem; border-radius: 999px;
  font-size: 10.5px; color: var(--fg-dim); font-family: var(--mono);
  background: color-mix(in srgb, var(--bg) 78%, transparent); border: 1px solid var(--border);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.map-fallback-note .dot { width: 7px; height: 7px; border-radius: 999px; background: var(--c-amber-1); flex: none; }
.map-fallback-note.live .dot { background: var(--c-mint-1); }

/* list pane: ONE bordered surface; rows are quiet hover rows inside it, not a
   stack of individually-bordered cards (40 rows ≠ 160 drawn edges). Fixed to
   the shared pane height — the list scrolls, the page does not. */
.places-list-pane {
  display: flex; flex-direction: column; min-width: 0;
  height: var(--pane-h);
  background: var(--bg-elev); border: none; border-left: 1px solid var(--border-hi); border-radius: 0; overflow: hidden;
}
.places-list { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; padding: .3rem; }
.place-row {
  display: flex; align-items: center; gap: .6rem; text-align: left; cursor: pointer;
  background: none; border: none; border-radius: 9px; padding: .5rem .6rem; font: inherit;
  transition: background .12s, box-shadow .12s;
}
.place-row:hover { background: var(--bg-soft); }
.place-row.active { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.pr-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--k, var(--fg-mute)); flex: none; }
.pr-main { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; min-width: 0; }
.pr-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-loc { font-size: 11px; color: var(--fg-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-tags { display: flex; align-items: center; gap: .3rem; flex: none; }
.pr-kind { font-family: var(--mono); font-size: 9px; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-mute); border: 1px solid var(--border); border-radius: 999px; padding: .1rem .4rem; }
.pr-tag { font-size: 11px; }
.pr-tag.map { color: var(--c-cyan-2); }
.pr-tag.warn { color: var(--c-amber-2); }
.places-empty { color: var(--fg-mute); font-size: 13.5px; padding: 2rem 1rem; text-align: center; }

/* --- Potential Places: researched-place cards (accumulator surface) ------ */
/* The same material system as the main page's list surface. Facet text is
   display-clamped only — the full text always lives in the record/editor. */
.place-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: .8rem; align-items: start; }
.place-card { display: flex; flex-direction: column; gap: .45rem; min-width: 0; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .95rem 1rem 1rem; }
.pc-top { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.pc-name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; min-width: 0; }
.pc-loc { font-size: 12px; color: var(--fg-dim); }
.pc-facet { font-size: 12.5px; line-height: 1.55; color: var(--fg-dim); display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.pc-meta { display: flex; flex-wrap: wrap; gap: .3rem; }
.pc-chip { font-family: var(--mono); font-size: 10px; color: var(--fg-mute); border: 1px solid var(--border); border-radius: 999px; padding: .12rem .5rem; background: var(--bg-soft); }
.place-card .btn { padding: .34rem .7rem; font-size: 12px; border-radius: 9px; }
.place-card .btn:hover { transform: none; }

/* --- place family/type badge (brief §4.1) ------------------------------- */
/* Colors by the PRIMARY family via the inline --fam custom property (the family
   palette mirrors api/places.py FAMILIES). Label is the type. */
.place-kind { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .15rem .45rem; border-radius: 999px; background: color-mix(in srgb, var(--fam, var(--fg-mute)) 14%, transparent); border: 1px solid color-mix(in srgb, var(--fam, var(--border)) 45%, transparent); color: var(--fam, var(--fg-mute)); }
.place-kind .pk-also { opacity: .7; font-weight: 600; text-transform: none; letter-spacing: 0; }

/* --- detail drawer ------------------------------------------------------ */
/* Overlays must sit ABOVE the sticky header stack (banner 120 / nav 100 / subnav
   99) — otherwise the drawer's top tucks under the chrome. */
.place-detail-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); z-index: 300; opacity: 0; pointer-events: none; transition: opacity .2s; }
.place-detail-backdrop.open { opacity: 1; pointer-events: auto; }
.place-detail { position: fixed; top: 0; right: 0; height: 100%; height: 100dvh; width: min(540px, 100%); background: var(--bg-elev); border-left: 1px solid var(--border-hi); box-shadow: var(--shadow-lg); z-index: 301; overflow-y: auto; transform: translateX(100%); transition: transform .25s ease; padding: 1.5rem 1.5rem 4rem; }
.place-detail.open { transform: translateX(0); }
.place-detail .pd-close { position: absolute; top: 1rem; right: 1rem; border: 1px solid var(--border); background: var(--bg-soft); color: var(--fg-dim); border-radius: 999px; width: 34px; height: 34px; cursor: pointer; font-size: 18px; line-height: 1; }
.place-detail .pd-close:hover { color: var(--fg); border-color: var(--border-hi); }
.pd-head h2 { font-size: 23px; margin: 0 2rem .3rem 0; }
.pd-loc { color: var(--fg-dim); font-size: 14px; }
.pc-addr-tag { font-family: var(--mono); font-size: 10px; color: var(--fg-mute); }
.pd-section { margin-top: 1.3rem; }
.pd-section h4 { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-mute); margin: 0 0 .5rem; }
.pd-facet { font-size: 14px; line-height: 1.6; color: var(--fg); white-space: pre-wrap; }
.pd-kv { display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; font-size: 13px; margin: 0; }
.pd-kv dt { color: var(--fg-mute); font-family: var(--mono); font-size: 12px; }
.pd-kv dd { margin: 0; color: var(--fg-dim); }
.pd-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.pd-history { display: flex; flex-direction: column; gap: .35rem; }
.pd-rev { display: flex; align-items: baseline; gap: .6rem; font-size: 12px; padding: .35rem .6rem; background: var(--bg-soft); border-radius: var(--radius-xs); border: 1px solid var(--border); }
.pd-rev .rev-v { font-family: var(--mono); font-weight: 700; color: var(--accent); }
.pd-rev .rev-op { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-mute); }
.pd-rev .rev-when { margin-left: auto; color: var(--fg-mute); font-family: var(--mono); }
.pd-rev.op-promote .rev-op { color: var(--c-mint-2); }
.pd-rev.op-create .rev-op { color: var(--c-cyan-2); }

/* --- containment tree (visual hierarchy) -------------------------------- */
.ct-tree { display: flex; flex-direction: column; gap: .3rem; }
.ct-node { display: flex; align-items: center; gap: .5rem; position: relative; padding: .4rem .7rem; border-radius: var(--radius-xs); background: var(--bg-soft); border: 1px solid var(--border); font-size: 13px; margin-left: calc(var(--d) * 1.6rem); }
.ct-node .ct-rail { width: 8px; height: 8px; border-radius: 2px; background: var(--fg-mute); flex: none; }
.ct-node.current { background: var(--accent-soft); border-color: var(--accent); font-weight: 700; }
.ct-node.current .ct-rail { background: var(--accent); }
.ct-node::before { content: ""; position: absolute; left: -0.9rem; top: 50%; width: .7rem; height: 1px; background: var(--border-hi); }
.ct-node[style*="--d:0"]::before { display: none; }

/* --- place form --------------------------------------------------------- */
.place-form { background: var(--bg-elev); border: 1px solid var(--border-hi); border-radius: var(--radius-sm); padding: 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow-sm); }
.place-form-grid { display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); }
.pf-field { display: flex; flex-direction: column; gap: .25rem; }
.pf-field.full { grid-column: 1 / -1; }
.pf-field label { font-size: 12px; color: var(--fg-mute); font-family: var(--mono); }
.pf-field label.pf-check { display: flex; align-items: center; gap: .4rem; color: var(--fg-dim); }
.pf-field input, .pf-field select, .pf-field textarea { border: 1px solid var(--border); background: var(--bg-soft); color: var(--fg); border-radius: var(--radius-xs); padding: .5rem .7rem; font: inherit; font-size: 14px; }
.pf-field input:focus, .pf-field select:focus, .pf-field textarea:focus { outline: none; border-color: var(--border-hi); }
.pf-field textarea { resize: vertical; min-height: 4rem; }
/* secondary-family cross-listing picker (brief §4.1) */
.pf-secondaries { display: flex; flex-wrap: wrap; gap: .35rem .8rem; }
.pf-sec { display: inline-flex; align-items: center; gap: .35rem; font-size: 13px; color: var(--fg-dim); font-family: var(--mono); }
.pf-sec input { width: auto; }
.pf-sec input:disabled + * , .pf-sec:has(input:disabled) { opacity: .4; }
/* containment editor — "part of" / "contains" (brief §4.3, membership not location) */
.pf-containment { display: flex; flex-direction: column; gap: .7rem; margin: .2rem 0 .9rem; padding-top: .8rem; border-top: 1px dashed var(--border); }
.pf-contain label { font-size: 12px; color: var(--fg-mute); font-family: var(--mono); }
.contain-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .35rem 0; }
.contain-chip { display: inline-flex; align-items: center; gap: .35rem; font-size: 13px; padding: .2rem .2rem .2rem .6rem; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--border); }
.contain-chip .cc-x { border: none; background: none; color: var(--fg-mute); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 .3rem; }
.contain-chip .cc-x:hover { color: var(--c-coral-1, #ff8a5b); }
.contain-empty { font-size: 12px; color: var(--fg-mute); }
.contain-add { display: flex; gap: .4rem; flex-wrap: wrap; }
.contain-add select { flex: 1; min-width: 160px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--fg); border-radius: var(--radius-xs); padding: .4rem .6rem; font: inherit; font-size: 13px; }
.pf-geocode { display: flex; gap: .4rem; }
.pf-geocode input { flex: 1 1 auto; }
.place-form-actions { display: flex; gap: .6rem; margin-top: 1rem; }

/* --- map markers + labels ----------------------------------------------- */
.rk-marker { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.rk-label {
  font-family: var(--sans); font-weight: 600; font-size: 11px; line-height: 1; color: var(--fg);
  background: color-mix(in srgb, var(--bg-elev) 84%, transparent); padding: 2px 6px; border-radius: 6px;
  white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.35); border: 1px solid var(--border);
  pointer-events: none; max-width: 11rem; overflow: hidden; text-overflow: ellipsis;
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
/* family legend overlay on the map (brief §4.1) — same frosted material as the
   status chip so the two corner overlays read as one system. */
.map-legend { position: absolute; left: .6rem; bottom: .6rem; z-index: 5; display: flex; flex-wrap: wrap; gap: .2rem .55rem; max-width: 50%; padding: .4rem .6rem; border-radius: 10px; background: color-mix(in srgb, var(--bg) 78%, transparent); border: 1px solid var(--border); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.map-legend .ml-item { display: inline-flex; align-items: center; gap: .3rem; font-size: 10px; color: var(--fg-dim); font-family: var(--mono); }
.map-legend .ml-dot { width: 8px; height: 8px; border-radius: 999px; flex: none; }

/* Pin fill is set inline per place by its primary family color (brief §4.1). */
.rk-pin { flex: none; width: 16px; height: 16px; border-radius: 999px 999px 999px 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.45); background: var(--c-cyan-1); cursor: pointer; }

/* --- Store Map: pop-up modal + floorplan -------------------------------- */
.sm-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.62); backdrop-filter: blur(6px); z-index: 320; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .2s; padding: 2vh 2vw; }
.sm-modal-backdrop.open { opacity: 1; pointer-events: auto; }
.sm-modal { width: min(1200px, 96vw); max-height: 94vh; background: var(--bg-elev); border: 1px solid var(--border-hi); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; position: relative; }
.sm-modal-close { position: absolute; top: .9rem; right: .9rem; z-index: 2; border: 1px solid var(--border); background: var(--bg-soft); color: var(--fg-dim); border-radius: 999px; width: 34px; height: 34px; cursor: pointer; font-size: 18px; }
.sm-modal-close:hover { color: var(--fg); border-color: var(--border-hi); }
.sm-modal-head { padding: 1.1rem 1.3rem .6rem; }
.sm-modal-head h3 { margin: 0; font-size: 20px; }
.sm-modal-sub { font-family: var(--mono); font-size: 11px; color: var(--fg-mute); }
.sm-modal-body { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 1rem; padding: 0 1.3rem 1.3rem; overflow: auto; }
@media (max-width: 820px) { .sm-modal-body { grid-template-columns: 1fr; } }
.sm-canvas-wrap { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .5rem; }
#sm-modal-svg, #storemap-svg { width: 100%; height: auto; display: block; }
.sm-modal-side { display: flex; flex-direction: column; gap: .9rem; }
.sm-panel { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem; }
.sm-panel h4 { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-mute); margin: 0 0 .55rem; }
.sm-list-textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border); background: var(--bg-elev); color: var(--fg); border-radius: var(--radius-xs); padding: .55rem; font: inherit; font-size: 14px; min-height: 5rem; resize: vertical; }
.sm-panel-actions { display: flex; gap: .5rem; margin-top: .6rem; }
.sm-route-result { margin-top: .7rem; font-size: 13px; }
.sm-route-summary { color: var(--fg-dim); }
.sm-route-result ol { margin: .4rem 0; padding-left: 1.3rem; color: var(--fg-dim); }
.sm-route-result .stk, .sm-unmatched { color: var(--c-coral-2); font-size: 12px; font-family: var(--mono); }
.sm-stocking-row { display: flex; justify-content: space-between; gap: .6rem; font-size: 13px; padding: .35rem 0; border-bottom: 1px solid var(--border); }
.sm-stocking-row:last-child { border-bottom: 0; }
.sm-stocking-row .stk { color: var(--c-coral-2); font-size: 12px; font-family: var(--mono); text-align: right; }
.sm-muted { color: var(--fg-mute); font-size: 13px; }

/* floorplan SVG primitives — coordinates are GRID UNITS (~16 wide), so strokes
   are sub-unit. Departments are tiled zone boxes. */
.sm-outline { fill: color-mix(in srgb, var(--fg) 4%, transparent); stroke: var(--border-hi); stroke-width: .08; stroke-linejoin: round; }
.sm-zone rect { fill: color-mix(in srgb, var(--c-cyan-1) 18%, var(--bg-elev)); stroke: color-mix(in srgb, var(--c-cyan-1) 50%, transparent); stroke-width: .05; }
.sm-zone.cat-grocery rect { fill: color-mix(in srgb, var(--c-mint-1) 22%, var(--bg-elev)); stroke: color-mix(in srgb, var(--c-mint-1) 55%, transparent); }
.sm-zone.cat-apparel rect { fill: color-mix(in srgb, var(--c-violet-1) 20%, var(--bg-elev)); stroke: color-mix(in srgb, var(--c-violet-1) 52%, transparent); }
.sm-zone.cat-home rect, .sm-zone.cat-household rect { fill: color-mix(in srgb, var(--c-amber-1) 20%, var(--bg-elev)); stroke: color-mix(in srgb, var(--c-amber-1) 52%, transparent); }
.sm-zone.cat-beauty rect, .sm-zone.cat-toys rect { fill: color-mix(in srgb, var(--c-coral-1) 18%, var(--bg-elev)); stroke: color-mix(in srgb, var(--c-coral-1) 50%, transparent); }
.sm-zone.cat-health rect { fill: color-mix(in srgb, var(--c-cyan-1) 18%, var(--bg-elev)); }
.sm-zone.unreliable rect { stroke: var(--c-coral-2); stroke-width: .09; stroke-dasharray: .25 .18; }
.sm-zone text { fill: var(--fg); font-family: var(--sans); font-weight: 600; paint-order: stroke; stroke: var(--bg-elev); stroke-width: .07; }
.sm-zone.on-route rect { fill: color-mix(in srgb, var(--c-cyan-1) 42%, var(--bg-elev)); stroke: var(--c-cyan-1); stroke-width: .11; }
.sm-stopnum { fill: var(--c-cyan-2); }
.sm-stopnum-t { fill: #fff; font-family: var(--mono); font-weight: 700; paint-order: normal; stroke: none; }
.sm-fixture circle { fill: var(--fg-mute); }
.sm-fixture.kind-entrance circle, .sm-fixture.kind-checkout circle, .sm-fixture.kind-selfcheckout circle { fill: var(--c-coral-1); }
.sm-fixture.kind-starbucks circle, .sm-fixture.kind-cafe circle { fill: var(--c-mint-2); }
.sm-fixture text { fill: var(--fg); font-family: var(--mono); font-weight: 700; paint-order: stroke; stroke: var(--bg-elev); stroke-width: .08; }
.sm-route-path { fill: none; stroke: var(--c-cyan-1); stroke-width: .14; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: .35 .25; }
.sm-route-end { fill: var(--c-cyan-1); stroke: #fff; stroke-width: .06; }

/* --- standalone store-map.html page wrap (deep-link fallback) ------------ */
.sm-mapselect { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.sm-mapselect a { font-size: 13px; padding: .4rem .8rem; border-radius: var(--radius-xs); border: 1px solid var(--border); background: var(--bg-soft); color: var(--fg-dim); text-decoration: none; }
.sm-mapselect a.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* --- hours: live status badge + week grid ------------------------------- */
.hours-badge { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--mono); font-size: 11.5px; font-weight: 700;
  padding: .28rem .65rem; border-radius: 999px; }
.hb-dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; box-shadow: 0 0 7px currentColor; }
.hours-badge.st-open    { color: var(--c-mint-2);  background: color-mix(in srgb, var(--c-mint-1) 15%, transparent); }
.hours-badge.st-closing { color: var(--c-amber-2); background: color-mix(in srgb, var(--c-amber-1) 17%, transparent); }
.hours-badge.st-closed  { color: var(--c-coral-2); background: color-mix(in srgb, var(--c-coral-1) 15%, transparent); }
.hours-badge.st-pre     { color: var(--c-cyan-2);  background: color-mix(in srgb, var(--c-cyan-1) 15%, transparent); }

.hours-grid { display: flex; flex-direction: column; gap: 1px; }
.hours-row { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem .55rem; border-radius: 8px; font-size: 13px; }
.hours-row.today { background: color-mix(in srgb, var(--accent) 11%, transparent); }
.hours-day { font-family: var(--mono); font-size: 11.5px; color: var(--fg-mute); width: 2.6rem; flex: none; }
.hours-row.today .hours-day { color: var(--accent); font-weight: 700; }
.hours-val { color: var(--fg-dim); font-variant-numeric: tabular-nums; }
.hours-row.today .hours-val { color: var(--fg); font-weight: 600; }
.hours-val.closed { color: var(--fg-mute); }

/* --- place pop-up (Apple-Maps-style human card) ------------------------- */
.place-pop { width: min(420px, 96vw); padding: 0; overflow: hidden; }
.place-pop .dash-modal-close { position: absolute; top: .7rem; right: .7rem; z-index: 2;
  background: rgba(18,22,30,.5); color: #fff; border: none; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.place-pop .dash-modal-close:hover { background: rgba(18,22,30,.78); color: #fff; }
.pop-map { width: 100%; height: 170px; background: var(--bg-soft); }
.pop-map img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pop-map-none { height: 0; }
.pop-body { padding: 1rem 1.25rem 1.25rem; }
.pop-titlerow { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.pop-titlerow h3 { margin: 0; font-size: 1.32rem; font-weight: 800; letter-spacing: -.02em; }
.pop-fav { color: var(--c-amber-1); font-size: 1.05rem; line-height: 1; }
.pop-addr { display: flex; align-items: flex-start; gap: .45rem; margin: .55rem 0 .1rem; font-size: 14.5px; color: var(--fg); }
.pop-pin { color: var(--accent); flex: none; line-height: 1.4; }
.pop-status, .pop-statusline { margin: .6rem 0 .2rem; }
.place-pop .pd-section { margin-top: 1rem; }
.pop-actions { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }

/* --- hours editor (place form) ------------------------------------------ */
.hours-editor { display: flex; flex-direction: column; gap: .35rem; }
.he-row { display: flex; align-items: center; gap: .6rem; }
.he-day { font-family: var(--mono); font-size: 12px; color: var(--fg-mute); width: 2.6rem; flex: none; }
.he-open, .he-close { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--fg); font: inherit; font-size: 13px; padding: .3rem .5rem; }
.he-open:disabled, .he-close:disabled { opacity: .38; }
.he-sep { color: var(--fg-mute); }
.he-closed { display: inline-flex; align-items: center; gap: .35rem; font-size: 12px; color: var(--fg-mute); font-family: var(--mono); margin-left: auto; }

/* --- dashboard map widget ----------------------------------------------- */
#dash-places-map { width: 100%; height: 220px; border-radius: var(--radius-sm); border: 1px solid var(--border); overflow: hidden; background: var(--bg-soft); }
/* Inside the bento the map is the widget's flexible body: it fills whatever
   height the widget is resized to (220px is only the static default; the
   map controller's ResizeObserver keeps the GL canvas matched). */
.dash-board #dash-places-map { flex: 1 1 auto; height: auto; min-height: 8rem; }
.dash-places-tag { font-family: var(--mono); font-size: 10.5px; color: var(--fg-mute); margin-top: .4rem; display: block; }

/* --- app-mode fit (the Places module owns one viewport) ------------------ */
/* The pane height is a computed constant (--pane-h above), not a flex fill —
   flex-fill let the list's content set the grid track, which stretched the
   map and the page to match every row. Nothing here depends on content. */

/* --- nested list (containment hierarchy) -------------------------------- */
/* Rows stair-step right by containment depth (City Lofts ⊃ penthouse ⊃ bedroom),
   with a connector tick so multi-level nesting reads at a glance. */
.place-row { position: relative; margin-left: calc(var(--depth, 0) * 1.4rem); }
.place-row[data-depth]:not([data-depth="0"])::before {
  content: ""; position: absolute; left: -0.85rem; top: 50%; width: .6rem; height: 1px;
  background: var(--border-hi);
}
.place-row[data-depth]:not([data-depth="0"])::after {
  content: ""; position: absolute; left: -0.85rem; top: -0.3rem; bottom: 50%; width: 1px;
  background: var(--border-hi);
}

/* =============================================================================
   Richness layer (2026-07-04): live status dots, family-scoped amenity chips,
   family-color accents, and the structured attribute editor. "Rich, very rich"
   — but spent on the family-color signature + amenities, quiet everywhere else.
============================================================================= */

/* Live open/closed status is a colored WORD tag on the row's right (judged in the
   place's own tz) — not a circle, not a glow. Open pops green; closed recedes to a
   quiet grey so the eye lands on what's open. Tooltip carries the close time. */
.pr-st { flex: none; font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; padding: .12rem .38rem; border-radius: 5px; white-space: nowrap; }
.pr-st.st-open    { color: var(--c-mint-2);  background: color-mix(in srgb, var(--c-mint-1) 17%, transparent); }
.pr-st.st-closing { color: var(--c-amber-2); background: color-mix(in srgb, var(--c-amber-1) 18%, transparent); }
.pr-st.st-pre     { color: var(--c-cyan-2);  background: color-mix(in srgb, var(--c-cyan-1) 16%, transparent); }
.pr-st.st-closed  { color: var(--fg-mute);   background: color-mix(in srgb, var(--fg-mute) 12%, transparent); }
/* Amenity micro-glyphs in the row's tag cluster (first few set attributes). */
.pr-amenities { display: inline-flex; align-items: center; gap: .18rem; margin-right: .1rem; }
.pr-amenity { font-size: 11px; line-height: 1; opacity: .82; }

/* Amenity chips — the shared unit across popup, detail, and potential cards. */
.pop-amenities, .pd-amenities, .place-card .pop-amenities { display: flex; flex-wrap: wrap; gap: .35rem; margin: .7rem 0 .1rem; }
.amenity-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: 12px; font-weight: 600; color: var(--fg-dim);
  padding: .22rem .55rem; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--border);
}
.amenity-chip .ac-ic { font-size: 12.5px; line-height: 1; }
.pd-amenities .amenity-chip { background: var(--bg-elev); }

/* Missing-hours placeholder + one-click flag (→ Build Queue). */
.hours-none { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-size: 13px; color: var(--fg-mute); }
.hours-none .hn-label { font-style: italic; }
.btn.hours-flag { padding: .3rem .6rem; font-size: 12px; border-radius: 8px; }
.btn.hours-flag:hover { transform: none; border-color: var(--c-amber-1); color: var(--c-amber-2); }
.btn.hours-flag.done { color: var(--c-mint-2); border-color: color-mix(in srgb, var(--c-mint-1) 45%, var(--border)); cursor: default; }

/* Popup: family-color accent under the map + secondary "also" tag. */
.pop-map { position: relative; }
.pop-accent { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--fam, var(--accent)); z-index: 1; }
.pop-map-none { height: 3px; }
.pop-map-none .pop-accent { position: absolute; }
.pop-also { font-family: var(--mono); font-size: 10px; color: var(--fg-mute); }
.pop-actions .btn { flex: 1 1 auto; justify-content: center; text-align: center; }

/* Detail: family-color spine beside the title. */
.place-detail .pd-head { position: relative; padding-left: .9rem; }
.pd-accent { position: absolute; left: 0; top: .2rem; bottom: .2rem; width: 4px; border-radius: 999px; background: var(--fam, var(--accent)); }

/* Structured attribute editor (place form). Bool → a pill that lights up when
   on; enum/text → an inline labeled control. Family-scoped: the set re-renders
   when the family changes. */
.pf-hint { font-weight: 400; font-size: 11px; color: var(--fg-mute); }
.pf-attrs { display: flex; flex-wrap: wrap; gap: .4rem; }
.pf-attr {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: 12.5px; color: var(--fg-dim); cursor: pointer; user-select: none;
  padding: .32rem .6rem; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--border);
  transition: border-color .12s, background .12s, color .12s;
}
.pf-attr:hover { border-color: var(--border-hi); }
.pf-attr .pfa-ic { font-size: 13px; line-height: 1; }
.pf-attr-bool input { position: absolute; opacity: 0; width: 0; height: 0; }
.pf-attr-bool:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--fg); }
.pf-attr-enum, .pf-attr-text { border-radius: 9px; cursor: default; }
.pf-attr-enum select, .pf-attr-text input {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 7px;
  color: var(--fg); font: inherit; font-size: 12px; padding: .12rem .35rem;
}
.pf-attr-empty { font-size: 12.5px; color: var(--fg-mute); font-style: italic; margin: .2rem 0; }
.pf-advanced { border: 1px dashed var(--border); border-radius: var(--radius-xs); padding: .5rem .7rem; }
.pf-advanced summary { cursor: pointer; font-size: 12px; color: var(--fg-mute); font-family: var(--mono); }
.pf-advanced textarea { margin-top: .5rem; }

@media (max-width: 920px) {
  .places-split { grid-template-columns: 1fr; }
  #places-map-canvas { height: 56vh; }
  /* Stacked: the divider moves from the pane's left edge to its top edge. */
  .places-list-pane { height: 52vh; border-left: none; border-top: 1px solid var(--border-hi); }
}
