/* ── Compare Homes (compare.html) ─────────────────────────────────────────
   Part 1 is the comp-card look copied from cma.html (Pick Your Comps), so
   the two pages read as one site: .comp, .photo, .strip, .nav, .count,
   .src-tag, .ph-kind, .tick, .stpill, .facts, .trail, .why, .details-btn,
   .cmodal, .pair, .side, .pair-facts, .cmp-toggle, .cprog, .sample-flag, .recent
   chips. Part 2 is what this page adds: the letter badge (in place of the
   match ring), the favorite star, pros/cons chips, notes and the sticky
   selection bar. A change to a comp card on cma.html belongs here too.
   ------------------------------------------------------------------------ */

/* ======================= Part 1 — from cma.html ======================== */

/* The picker is wide from the start here: the cards are the page. */
#hc-card { max-width: 1000px; }

/* Recent-style chips (the homes on the page, under the address box) */
.recent { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-top: -0.35rem; }
.recent[hidden] { display: none; }
.recent-label { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-right: 0.1rem; }
.recent-item { display: inline-flex; align-items: center; border-radius: 999px; background: var(--soft);
  border: 1px solid var(--soft-line); max-width: min(17rem, 100%); min-width: 0; }
.recent-item:hover { border-color: var(--accent); }
.recent-chip { display: inline-flex; align-items: center; gap: 0.35rem; width: auto; margin: 0;
  padding: 0.3rem 0.15rem 0.3rem 0.35rem;
  border-radius: 999px 0 0 999px; font-size: 0.78rem; font-weight: 600; line-height: 1.2; background: none;
  color: var(--ink); border: none; min-width: 0; }
.recent-x { display: inline-flex; align-items: center; width: auto; margin: 0; padding: 0.3rem 0.55rem 0.3rem 0.3rem;
  border: none; border-radius: 0 999px 999px 0; background: none; color: var(--muted); line-height: 1; flex-shrink: 0; }
.recent-x svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; }
.recent-x:hover:not(:disabled) { background: none; color: var(--danger); }
.recent-addr { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-chip:hover:not(:disabled) { background: none; color: var(--accent); }

/* Comp cards */
.comp-grid { display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem; margin: 0.25rem 0 1rem; }
@media (max-width: 700px) { .comp-grid { grid-template-columns: 1fr; } }
.comp { position: relative; text-align: left; border-radius: 8px;
  border: 1.5px solid var(--panel-line); background: var(--panel);
  overflow: hidden; cursor: pointer; transition: transform 0.12s ease;
  padding: 0; }
.comp:hover { transform: translateY(-2px); }
.comp.sel { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); }
.comp .photo { position: relative; height: 130px; background: var(--soft);
  display: flex; align-items: center; justify-content: center; }
.comp .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.comp .photo > svg { width: 44px; height: 44px; stroke: var(--accent);
  fill: none; stroke-width: 1.3; opacity: 0.7; }
/* Overlays sit on PHOTOS, which ignore the theme — fixed colours, as on the
   comps page, so they read in both themes. */
.src-tag { position: absolute; left: 0.5rem; bottom: 0.4rem;
  max-width: calc(100% - 5rem); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; box-sizing: border-box;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: #F2ECE2;
  background: rgba(20,16,13,0.82); padding: 0.15rem 0.45rem;
  border-radius: 4px; z-index: 1; }
/* A Street View picture says so: the corner tag names where the home's
   figures came from, and this picture isn't its listing photo. */
.ph-kind { position: absolute; right: 0.5rem; bottom: 0.4rem;
  white-space: nowrap; font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; color: #F2ECE2;
  background: rgba(20,16,13,0.82); padding: 0.15rem 0.45rem;
  border-radius: 4px; z-index: 1; }
.ph-kind ~ .src-tag { max-width: calc(100% - 7rem); }
.comp .tick { position: absolute; top: 0.55rem; left: 0.55rem;
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid rgba(42,37,34,0.35);
  background: rgba(255,255,255,0.92);
  color: rgba(42,37,34,0.4);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 5px rgba(0,0,0,0.4); z-index: 2; }
.comp .tick svg { width: 14px; height: 14px; stroke: currentColor; fill: none;
  stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.comp.sel .tick { background: var(--accent); border-color: var(--accent);
  color: var(--on-accent); }
/* The card's × (owner 2026-09-27): takes one home off the list. Beside the
   letter badge, in the tick's white disc. */
.comp .card-x { position: absolute; top: 0.55rem; right: calc(0.45rem + 36px + 0.45rem);
  width: 26px; height: 26px; min-width: 0; margin: 0; padding: 0; border-radius: 50%;
  border: 1.5px solid rgba(42,37,34,0.35); background: rgba(255,255,255,0.92);
  color: rgba(42,37,34,0.65); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 5px rgba(0,0,0,0.4); z-index: 2; cursor: pointer; }
.comp .card-x svg { width: 12px; height: 12px; stroke: currentColor; fill: none;
  stroke-width: 2.6; stroke-linecap: round; }
.comp .card-x:hover:not(:disabled) { background: #fff; color: var(--danger); border-color: var(--danger); }

.comp .body { display: block; padding: 0.7rem 0.8rem 0.75rem; }
.comp .addr { display: block; font-weight: 700; font-size: 0.85rem; color: var(--ink);
  margin-bottom: 0.25rem; }
.comp .facts { display: block; font-size: 0.78rem; color: var(--muted); }
.comp .price { font-weight: 800; color: var(--ink); }
.comp .trail { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 0.2rem; }
.comp .why { display: block; font-size: 0.72rem; color: var(--faint); margin-top: 0.35rem;
  line-height: 1.4; }
.stpill { display: inline-block; font-size: 0.6rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.12rem 0.4rem; border-radius: 999px; margin-left: 0.3rem;
  vertical-align: middle; background: var(--pill); color: var(--pill-fg); }
.stpill.sold { background: var(--accent); color: var(--on-accent); }

/* Expand View: a footer bar on the card */
.comp .details-btn { display: block; width: 100%; border: none;
  border-top: 1px solid var(--soft-line); border-radius: 0;
  background: var(--soft); color: var(--accent); cursor: pointer;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 0.55rem 0.8rem; text-align: center; }
.comp .details-btn:hover:not(:disabled) { background: var(--pill); }

/* MLS photo carousel: a scroll-snapped strip with arrows and "n / N" */
.photo .strip, .bigphoto .strip { display: flex; width: 100%; height: 100%;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  overscroll-behavior-x: contain; }
.bigphoto .strip { height: 300px; }
.strip::-webkit-scrollbar { display: none; }
.comp .photo .strip img, .cmodal .bigphoto .strip img { flex: 0 0 100%;
  width: 100%; height: 100%; max-height: none; object-fit: cover;
  scroll-snap-align: center; display: block; }
.photo .nav, .bigphoto .nav { position: absolute; top: 50%;
  transform: translateY(-50%); width: 30px; height: 30px; padding: 0;
  border-radius: 50%; border: none; background: rgba(255,255,255,0.92);
  color: #2A2522; display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 1px 5px rgba(0,0,0,0.35); opacity: 0;
  transition: opacity 0.15s; z-index: 2; }
.nav svg { width: 16px; height: 16px; stroke: currentColor; fill: none;
  stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.photo .nav:hover:not(:disabled), .bigphoto .nav:hover:not(:disabled) {
  background: #fff; }
.comp:hover .nav, .bigphoto:hover .nav, .nav:focus-visible { opacity: 1; }
@media (hover: none) { .photo .nav, .bigphoto .nav { opacity: 0.85; } }
.nav.prev { left: 0.45rem; } .nav.next { right: 0.45rem; }
.comp .photo .nav { top: 62%; }        /* clear of the corner badges */
.photo .nav[disabled], .bigphoto .nav[disabled] { visibility: hidden; }
.photo .count, .bigphoto .count { position: absolute; right: 0.5rem;
  bottom: 0.45rem; font-size: 0.65rem; font-weight: 700; color: #F2ECE2;
  background: rgba(20,16,13,0.78); padding: 0.12rem 0.45rem;
  border-radius: 999px; z-index: 1; }

/* Repliers' test data: never mistaken for real listings. */
.sample-flag { display: block; margin: 0.2rem 0 0.8rem; padding: 0.4rem 0.6rem;
  border-radius: 6px; border: 1px solid var(--danger); color: var(--danger);
  font-weight: 700; font-size: 0.78rem; text-align: left; }
.pick-note { font-size: 0.75rem; color: var(--faint); margin: 0.9rem 0 0;
  text-align: left; line-height: 1.5; }

/* Popups — the comps page's Expand View */
.cmodal-ov { position: fixed; inset: 0; z-index: 900; background: var(--overlay);
  display: flex; align-items: center; justify-content: center; padding: 1rem; }
.cmodal { position: relative; background: var(--panel); border-radius: 10px;
  width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto;
  text-align: left; box-shadow: 0 24px 60px rgba(0,0,0,0.5); }
/* flow-root: the fallback house icon's margins stay inside the photo box
   (without it they collapse through, leaving a thin band of colour). */
.cmodal .bigphoto { position: relative; background: var(--soft); display: flow-root; }
.cmodal .bigphoto > img { width: 100%; max-height: 340px; object-fit: cover; display: block; }
.cmodal .bigphoto > svg { width: 64px; height: 64px; stroke: var(--accent);
  fill: none; stroke-width: 1.3; opacity: 0.7; display: block; margin: 3.5rem auto; }
.cmodal .inner { padding: 1rem 1.2rem 1.2rem; }
.cmodal h3 { margin: 0 0 0.2rem; font-family: var(--serif); font-weight: 400;
  font-size: 1.2rem; color: var(--ink); }
.cmodal .head-price { font-weight: 800; color: var(--ink); font-size: 1.05rem; }
/* minmax(0, 1fr) and min-width 0: a long value wraps inside its column
   instead of pushing the right column off the popup (iPhone Duo review
   2026-10-13, the CMA's popup had it). */
.cmodal .fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.3rem 1.25rem; margin: 0.9rem 0; font-size: 0.86rem; }
.cmodal .fgrid div { display: flex; justify-content: space-between; min-width: 0;
  gap: 0.75rem; border-bottom: 1px solid var(--soft-line); padding: 0.3rem 0; }
.cmodal .fgrid dt { color: var(--muted); }
.cmodal .fgrid dd { margin: 0; color: var(--ink); font-weight: 700; text-align: right;
  min-width: 0; overflow-wrap: anywhere; }
.cmodal .why-title { font-size: 0.72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted);
  margin: 1rem 0 0.4rem; }
.cmodal .factor { display: flex; justify-content: space-between; gap: 1rem;
  font-size: 0.84rem; padding: 0.3rem 0; border-bottom: 1px solid var(--soft-line); }
.cmodal .factor span { color: var(--muted); flex-shrink: 0; }
/* A whole MLS list (lot features up to ~350 characters, sweep 5 S5-046)
   wraps beside its label, never past a phone's edge. */
.cmodal .factor b { color: var(--ink); font-weight: 700; text-align: right;
  min-width: 0; overflow-wrap: anywhere; }
/* The popup's foot — its message line and buttons — stays in view while the
   popup scrolls: stuck to the bottom edge on the panel's own colour (the
   content slides under it), back in the flow once the end is reached. Above
   the photo overlays (z-index 2), which would otherwise show through. */
.cmodal .foot { position: sticky; bottom: 0; z-index: 3; background: var(--panel);
  margin: 0.5rem 0 -0.6rem; padding: 0.6rem 0; }
.cmodal .actions { display: flex; gap: 0.6rem; }
.cmodal .actions > * { flex: 1; }
.cmodal .actions .ghost, .sel-bar .ghost { background: var(--pill); color: var(--pill-fg); }
.cmodal .actions .ghost:hover:not(:disabled), .sel-bar .ghost:hover:not(:disabled) {
  background: var(--soft-line); color: var(--pill-fg); }
/* No × in a popup's corner (owner decision 2026-09-25): the Close button,
   Escape and a tap outside close it — so the Close button is kept in view
   (the sticky foot above) rather than below the fold of a tall popup. */

/* The Compare view: two whole cards side by side, facts lined up beneath */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pair .side { border: 1px solid var(--soft-line); border-radius: 10px; overflow: hidden;
  background: var(--panel); min-width: 0; }
.pair .bigphoto .strip, .pair .bigphoto > img { height: 260px; }
.pair .bigphoto > img { width: 100%; object-fit: cover; display: block; }
.pair .bigphoto > svg { margin: 98px auto; }
.cmodal .pair h3 { margin: 0.6rem 0.8rem 0.15rem; font-size: 1.1rem; }
.pair .side-sub { margin: 0 0.8rem 0.7rem; display: flex; align-items: center;
  flex-wrap: wrap; gap: 0.1rem 0.2rem; }
.pair-title { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); }
.pair-facts { width: 100%; border-collapse: collapse; margin: 0.8rem 0 0.6rem; font-size: 0.9rem; }
.pair-facts th { width: 34%; text-align: center; font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted); font-weight: 800; }
.pair-facts td { width: 33%; text-align: center; font-weight: 700; color: var(--ink); }
.pair-facts th, .pair-facts td { padding: 0.4rem 0.3rem; border-bottom: 1px solid var(--soft-line); }
.pair-facts td.better { color: var(--success); font-weight: 800; }
.pair-facts td.worse { color: var(--danger); font-weight: 800; }
.cmp-toggle { display: inline-flex; align-items: center; gap: 0.35rem;
  background: none; border: 1.5px solid var(--accent); color: var(--accent);
  border-radius: 999px; padding: 0.3rem 0.9rem; font-weight: 800; font-size: 0.78rem; cursor: pointer; }
.cmp-toggle svg { width: 15px; height: 15px; stroke: currentColor; fill: none;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
/* styles.css paints every hovered button dark: keep this one readable */
.cmp-toggle:hover:not(:disabled) { background: var(--soft); color: var(--accent); }

/* Progress — the comps page's bar, brass fill with a sheen */
.cprog { margin: 0.9rem 0 0.4rem; text-align: left; }
.cprog-track { height: 8px; border-radius: 999px; background: var(--pill); overflow: hidden; }
.cprog-fill { position: relative; height: 100%; width: 0%;
  border-radius: 999px; background: var(--accent);
  transition: width 0.6s ease; overflow: hidden; }
.cprog-fill::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: cprog-sheen 1.8s linear infinite; }
@keyframes cprog-sheen { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .cprog-fill::after { animation: none; } }
.cprog-msg { font-size: 0.8rem; color: var(--muted); margin: 0.5rem 0 0; }

/* ===================== Part 2 — this page's additions ================== */

.back-row { text-align: left; margin-bottom: 0.5rem; }
.back { color: var(--muted); text-decoration: none; font-size: 0.85rem; }
.back:hover { color: var(--ink); }

/* The form: address + Add home on one line, then the homes, then the client */
.hc-form { margin-bottom: 1.1rem; text-align: left; }
.add-row { display: flex; gap: 0.5rem; }
.add-row input { flex: 1; min-width: 0; }
/* address.js wraps the box (for its suggestions list): the wrap takes the row */
.add-row .addr-wrap { flex: 1; min-width: 0; }
.add-btn { display: inline-flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }
.add-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none;
  stroke-width: 2.4; stroke-linecap: round; }
.form-status { margin: -0.2rem 0 0; font-size: 0.8rem; color: var(--muted); }

/* Letter badges — A to E. On a photo: fixed cream-and-brass (photos ignore
   the theme), in the ring's corner. Off a photo: theme tokens. */
.letter { position: absolute; top: 0.45rem; right: 0.45rem; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #FBF9F4; color: #82632B; border: 2.5px solid #82632B;
  font-family: var(--serif); font-size: 1.05rem; font-weight: 700; line-height: 1;
  box-shadow: 0 1px 5px rgba(0,0,0,0.35); }
.cmodal .bigphoto .letter { top: 0.6rem; right: 0.6rem; width: 44px; height: 44px; font-size: 1.3rem; }
.lb { display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: var(--on-accent);
  font-family: var(--serif); font-size: 0.72rem; font-weight: 700; line-height: 1; }

/* The favorite star — a stroked line icon; filled brass when on. */
.star { display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; margin: -0.3rem -0.35rem 0 0;
  flex-shrink: 0; border: none; border-radius: 50%; background: none;
  color: var(--muted); cursor: pointer; }
.star svg { width: 19px; height: 19px; stroke: currentColor; fill: none;
  stroke-width: 1.7; stroke-linejoin: round; }
.star:hover:not(:disabled) { background: var(--soft); color: var(--accent); }
.star[aria-pressed="true"] { color: var(--accent); }
.star[aria-pressed="true"] svg { fill: var(--accent); }

/* Cards: a column, so Expand View sits at the bottom of every card in a row */
.comp-grid.homes { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
@media (max-width: 1023px) { .comp-grid.homes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px)  { .comp-grid.homes { grid-template-columns: 1fr; } }
.comp.home { display: flex; flex-direction: column; }
.comp.home .photo { height: 160px; flex-shrink: 0; }
.comp.home .body { flex: 1; }
.comp.home .details-btn { margin-top: auto; }
.addr-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.4rem; }
.addr-row .addr { min-width: 0; }
.comp.fav { border-color: color-mix(in srgb, var(--accent) 45%, var(--panel-line)); }
.comp.sel.fav { border-color: var(--accent); }
/* A sixth tap: a gentle nudge on the card, the message in the bar */
.comp.full { animation: nudge 0.4s ease; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .comp.full { animation: none; } }

/* Pros (green +) and cons (red −), each removable; "+ Add your own" */
.pc { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.25rem; margin-top: 0.6rem; }
.chip { display: inline-flex; align-items: center; gap: 0.2rem; max-width: 100%;
  font-size: 0.7rem; font-weight: 600; line-height: 1.25; color: var(--ink);
  padding: 0.18rem 0.15rem 0.18rem 0.4rem; border-radius: 999px; border: 1px solid; cursor: default; }
.chip.pro { background: color-mix(in srgb, var(--success) 9%, var(--panel));
  border-color: color-mix(in srgb, var(--success) 38%, transparent); }
.chip.con { background: color-mix(in srgb, var(--danger) 8%, var(--panel));
  border-color: color-mix(in srgb, var(--danger) 38%, transparent); }
.chip .sign { display: inline-flex; flex-shrink: 0; }
.chip .sign svg { width: 11px; height: 11px; fill: none; stroke-width: 3.2; stroke-linecap: round; }
.chip.pro .sign svg { stroke: var(--success); }
.chip.con .sign svg { stroke: var(--danger); }
.chip .t { min-width: 0; }
.chip .x { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 16px; height: 18px; padding: 0; border: none; border-radius: 50%;
  background: none; color: var(--muted); cursor: pointer; }
.chip .x svg { width: 10px; height: 10px; stroke: currentColor; fill: none; stroke-width: 2.6; stroke-linecap: round; }
.chip .x:hover:not(:disabled) { background: var(--pill); color: var(--danger); }
.pc-addlink { display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.2rem 0.3rem;
  border: none; background: none; color: var(--accent); font-size: 0.72rem; font-weight: 700;
  border-radius: 4px; cursor: pointer; }
.pc-addlink svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; }
.pc-addlink:hover:not(:disabled) { background: var(--soft); color: var(--accent); text-decoration: underline; }
.pc-empty { font-size: 0.72rem; color: var(--faint); }
/* Pros on one line (wrapping), cons start a fresh line */
.pc-br { flex: 0 0 100%; height: 0; }
.pc-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; width: 100%; margin-top: 0.1rem; }
/* On a card the box takes the full width, the Pro / Con buttons sit under it */
.pc-form input { flex: 1 1 100%; min-width: 0; padding: 0.4rem 0.55rem; font-size: 0.8rem; border-radius: 6px; }
.home-modal .pc-form input { flex: 1 1 14rem; }
.pc-form .pcb { display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.38rem 0.6rem;
  font-size: 0.74rem; font-weight: 800; border-radius: 999px; background: none; border: 1.5px solid; }
.pc-form .pcb svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; }
.pc-form .pcb.pro { color: var(--success); border-color: var(--success); }
.pc-form .pcb.con { color: var(--danger); border-color: var(--danger); }
.pc-form .pcb:hover:not(:disabled) { background: var(--soft); }
.pc-form .pcb.pro:hover:not(:disabled) { color: var(--success); }
.pc-form .pcb.con:hover:not(:disabled) { color: var(--danger); }
.pc-form .x { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 26px; height: 26px; padding: 0; border: none; border-radius: 50%; background: none; color: var(--muted); }
.pc-form .x svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2.6; stroke-linecap: round; }
.pc-form .x:hover:not(:disabled) { background: var(--pill); color: var(--danger); }

/* The agent's notes on the card (owner 2026-09-25) — the same notes Expand
   View edits. Closed: "+ Your notes", or the words (three lines, then
   "…more") with Edit. Open: the box, Done, and a counter near the limit. */
.note { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: flex-start; margin-top: 0.5rem;
  font-size: 0.74rem; color: var(--muted); line-height: 1.35; }
.note > svg { width: 13px; height: 13px; flex-shrink: 0; margin-top: 0.15rem;
  stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.note-body { flex: 1; min-width: 0; }
.note-text { display: block; font-style: italic; white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 4.05em; overflow: hidden; }              /* three lines of 1.35 */
.note.all .note-text { max-height: none; }
.note-links { display: flex; flex-wrap: wrap; gap: 0 0.1rem; margin: 0.1rem 0 0 -0.3rem; }
.note-links .pc-addlink[hidden] { display: none; }
.note .card-notes { flex: 1 1 100%; min-height: 64px; font-size: 0.8rem; padding: 0.5rem 0.6rem; }
.note-foot { flex: 1 1 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; margin: -0.1rem 0 0 -0.3rem; }
.notes-count { font-size: 0.7rem; color: var(--faint); font-variant-numeric: tabular-nums; margin-left: auto; }
.notes-count:empty { display: none; }
.notes-hint .notes-count { float: right; }

/* The sticky selection bar */
.sel-bar { position: sticky; bottom: 0.9rem; z-index: 50; margin-top: 0.4rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.7rem 0.8rem 0.7rem 1rem; text-align: left;
  background: var(--panel); border: 1.5px solid var(--panel-line); border-radius: 10px;
  box-shadow: 0 6px 24px rgba(42,37,34,0.18); transition: border-color 0.15s; }
.sel-bar.ready { border-color: var(--accent); }
.sb-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.sb-count { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem;
  font-size: 0.9rem; color: var(--ink); }
.sb-count b { margin-left: 0.2rem; }
.sb-lead { font-size: 0.88rem; color: var(--muted); display: inline-flex; gap: 0.45rem; align-items: center; }
.sb-lead svg { width: 18px; height: 18px; flex-shrink: 0; stroke: var(--accent); fill: none;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sb-hint { font-size: 0.78rem; color: var(--muted); }
.sb-hint:empty { display: none; }
.sb-hint.flash { color: var(--ink); font-weight: 700; display: inline-flex; gap: 0.35rem; align-items: center; }
.sb-hint.flash svg { width: 15px; height: 15px; flex-shrink: 0; stroke: var(--accent); fill: none;
  stroke-width: 2; stroke-linecap: round; }
/* An error from out of sight (a save or a removal that failed) */
.sb-hint.flash.error { color: var(--danger); }
.sb-hint.flash.error svg { stroke: var(--danger); }
.sb-actions { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }
.sb-actions:empty { display: none; }
.sb-actions .primary { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.7rem 1.1rem; font-size: 0.92rem; font-weight: 700; }
.sb-actions .primary svg { width: 17px; height: 17px; stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.linkish { padding: 0.5rem 0.55rem; background: none; border: none; font-size: 0.84rem;
  font-weight: 700; color: var(--accent); border-radius: 6px; }
.linkish:hover:not(:disabled) { background: var(--soft); color: var(--accent); text-decoration: underline; }
.linkish.quiet { color: var(--muted); font-weight: 600; }
.linkish.quiet:hover:not(:disabled) { color: var(--ink); }

/* Expand View (a home's own popup) */
.home-modal .hm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.home-modal .hm-head .star { margin: -0.1rem -0.3rem 0 0; width: 36px; height: 36px; }
.home-modal .hm-head .star svg { width: 22px; height: 22px; }
.home-modal .hood { color: var(--muted); font-size: 0.86rem; margin-top: 0.15rem; }
.home-modal .pc { margin-top: 0.2rem; }
.home-modal .chip { font-size: 0.8rem; padding: 0.24rem 0.2rem 0.24rem 0.5rem; }
.home-modal .pc-addlink { font-size: 0.8rem; }
.notes { width: 100%; min-height: 78px; resize: vertical; font: inherit; font-size: 0.9rem;
  padding: 0.65rem 0.8rem; border: 1.5px solid var(--field-line); border-radius: 6px;
  background: var(--field); color: var(--ink); outline: none; box-sizing: border-box; }
.notes:focus { border-color: var(--accent); }
.notes-hint { font-size: 0.72rem; color: var(--faint); margin: 0.3rem 0 0; }
/* The message line sits in the foot, just above the buttons */
.m-msg { font-size: 0.8rem; color: var(--ink); font-weight: 700; margin: 0 0 0.6rem; text-align: center; }
.m-msg.error { color: var(--danger); }
/* …and "Remove from list" under the foot (its negative margin taken up) */
.remove-home { display: block; margin: 0.7rem auto 0; }

/* The Compare view (side by side): its title on the left, Swap sides flush
   right (the corner × it once made room for is gone). */
.pair-modal { max-width: 1000px; }
.pair-modal .inner { padding-top: 0.75rem; }
.pm-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  margin-bottom: 0.8rem; min-height: 34px; }
.pair .side-sub .star { margin: 0 0 0 auto; }
.pair .stpill { margin-left: 0.15rem; }
.pair-key { font-size: 0.74rem; color: var(--faint); margin: 0.2rem 0 0; }
.pair-key .g { color: var(--success); font-weight: 800; }
.pair-key .r { color: var(--danger); font-weight: 800; }
.pair-facts.stack { display: table; }   /* opt out of styles.css's phone scroll-table */

body.modal-open { overflow: hidden; }

/* Why the tool isn't here (no plan, MLS not switched on, signed out), or a
   "wait a few minutes" over a list that stays usable. */
.hc-gate { margin: 0 0 1.1rem; padding: 0.85rem 1rem; border-radius: 8px;
  background: var(--soft); border: 1px solid var(--soft-line);
  color: var(--ink); font-size: 0.9rem; line-height: 1.5; text-align: left; }
.hc-gate a { color: var(--accent); font-weight: 700; text-decoration: none; }

/* Cards the MLS couldn't refresh (owner 2026-10-11, "no report is ever
   missing information"): at the top of the list, until a refresh lands. */
.stale-note { margin: 0.2rem 0 0.8rem; padding: 0.6rem 0.8rem; border-radius: 8px;
  background: var(--soft); border: 1px solid var(--soft-line); border-left: 3px solid var(--warn);
  color: var(--ink); font-size: 0.86rem; line-height: 1.5; text-align: left; }
.stale-note[hidden] { display: none; }
.stale-note .linkish { padding: 0 0.2rem; font-size: inherit; text-decoration: underline; }
.stale-note .trying { color: var(--muted); font-weight: 600; }

/* An error under the address box stays until the next try; news fades. */
.form-status.error { color: var(--danger); font-weight: 600; }
.form-status a { color: var(--accent); font-weight: 700; text-decoration: none; }

/* No homes yet: what the page is for, where the cards will be. */
.hc-empty { grid-column: 1 / -1; display: flex; align-items: center; gap: 0.9rem;
  padding: 1.4rem 1.2rem; border: 1.5px dashed var(--panel-line); border-radius: 8px;
  color: var(--muted); font-size: 0.88rem; line-height: 1.5; text-align: left; }
.hc-empty svg { width: 36px; height: 36px; flex-shrink: 0; stroke: var(--accent);
  fill: none; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; opacity: 0.8; }
.hc-empty b { color: var(--ink); }

/* The card that stands in while a home is looked up in the MLS */
.comp.loading { cursor: default; }
.comp.loading:hover { transform: none; }
.comp.loading .photo > svg { animation: hc-pulse 1.4s ease-in-out infinite; }
@keyframes hc-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.8; } }
.comp.loading .cprog, .comp.loading .cprog-track, .comp.loading .cprog-fill { display: block; }
.comp.loading .cprog { margin: 0.7rem 0 0.1rem; }
.comp.loading .cprog-fill { width: 38%; animation: hc-slide 1.3s ease-in-out infinite; }
@keyframes hc-slide { from { transform: translateX(-100%); } to { transform: translateX(270%); } }
@media (prefers-reduced-motion: reduce) {
  .comp.loading .photo > svg, .comp.loading .cprog-fill { animation: none; }
}

/* ---- Phones --------------------------------------------------------------- */
@media (max-width: 700px) {
  /* Still side by side on a phone: two photo thumbnails, address and price
     under each, and the three-column table (A | label | B). */
  .pair { gap: 0.5rem; }
  .pair .bigphoto .strip, .pair .bigphoto > img { height: 118px; }
  .pair .bigphoto > svg { width: 44px; height: 44px; margin: 37px auto; }
  .cmodal .pair h3 { font-size: 0.86rem; margin: 0.45rem 0.5rem 0.1rem; line-height: 1.25; }
  .pair .side-sub { margin: 0 0.5rem 0.5rem; }
  .pair .head-price { font-size: 0.9rem; }
  .pair .stpill { font-size: 0.55rem; }
  /* The star rides on the photo's top-left corner (fixed colours — photos
     ignore the theme), so it doesn't take a line of its own under the price. */
  .pair .side { position: relative; }
  .pair .side-sub .star { position: absolute; top: 0.35rem; left: 0.35rem; z-index: 3;
    width: 28px; height: 28px; margin: 0; background: rgba(255,255,255,0.92); color: #2A2522;
    box-shadow: 0 1px 5px rgba(0,0,0,0.35); }
  .pair .side-sub .star:hover:not(:disabled) { background: #fff; color: #82632B; }
  .pair .side-sub .star[aria-pressed="true"] { color: #82632B; }
  .pair .side-sub .star[aria-pressed="true"] svg { fill: #82632B; }
  .pair .side-sub .star svg { width: 16px; height: 16px; }
  .cmodal .pair .bigphoto .letter { width: 30px; height: 30px; font-size: 0.95rem; top: 0.35rem; right: 0.35rem; }
  .pair .bigphoto .nav { width: 24px; height: 24px; opacity: 0.85; }
  .pair .bigphoto .nav svg { width: 13px; height: 13px; }
  .pair .bigphoto .nav.prev { left: 0.25rem; } .pair .bigphoto .nav.next { right: 0.25rem; }
  .pair .src-tag { font-size: 0.5rem; left: 0.3rem; bottom: 0.3rem; max-width: calc(100% - 3.2rem); }
  /* A Street View picture: its tag the source tag's size, both a touch
     narrower, and the source's room beside it sized to match */
  .pair .ph-kind { font-size: 0.5rem; right: 0.3rem; bottom: 0.3rem; }
  .pair .ph-kind, .pair .ph-kind ~ .src-tag { padding: 0.15rem 0.35rem; letter-spacing: 0.03em; }
  .pair .ph-kind ~ .src-tag { max-width: calc(100% - 5.3rem); }
  .pair .count { font-size: 0.55rem; right: 0.3rem; bottom: 0.3rem; }
  .pair-facts { font-size: 0.84rem; }
  .pair-facts th { font-size: 0.6rem; letter-spacing: 0.04em; }
  .pair-modal .inner { padding: 0.7rem 0.75rem 1rem; }
  .pm-head .cmp-toggle .wide-only { display: none; }
}
@media (max-width: 560px) {
  body { padding: 0.75rem 0.6rem; }
  .card#hc-card { padding: 1.4rem 1rem 1.2rem; }
  h1 { font-size: 1.7rem; }
  .tagline { margin-bottom: 1.25rem; }
  .cmodal-ov { padding: 0.5rem; }
  .cmodal { max-height: 96vh; }
  .cmodal .fgrid { grid-template-columns: minmax(0, 1fr); }
  .sel-bar { flex-wrap: wrap; bottom: 0.5rem; padding: 0.65rem 0.7rem; }
  .sb-actions { flex: 1 1 100%; justify-content: flex-end; }
  .sb-actions .primary { flex: 1 1 auto; }
  .add-btn { padding-left: 0.85rem; padding-right: 0.85rem; }
}

/* "Prepared for" keeps its label once filled in */
.field-l { display: flex; align-items: center; gap: 0.6rem; padding: 0 0 0 1rem;
  border: 1.5px solid var(--field-line); border-radius: 6px; background: var(--field);
  cursor: text; transition: border-color 0.15s; }
.field-l:focus-within { border-color: var(--accent); }
.field-l > span { font-size: 0.8rem; font-weight: 700; color: var(--muted); white-space: nowrap;
  letter-spacing: 0.02em; }
.field-l input { flex: 1; min-width: 0; border: none; padding-left: 0; background: none; }
.comp .why .nw { white-space: nowrap; }
.sb-count .sb-clear { padding: 0.2rem 0.4rem; margin-left: 0.3rem; font-size: 0.78rem; }
.sb-actions button { white-space: nowrap; }
/* Two selected: Compare side by side and Create report, equally prominent —
   the same button, the same width. */
.sb-actions.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.narrow-only { display: none; }
@media (max-width: 560px) {
  .sb-actions { gap: 0.2rem; }
  .sb-actions .primary { padding: 0.7rem 0.8rem; font-size: 0.88rem; }
  .sb-actions .primary svg { display: none; }
  .sb-actions .linkish { padding: 0.5rem 0.35rem; font-size: 0.82rem; }
  .sb-actions.duo { gap: 0.4rem; }
  .sb-actions.duo .primary { padding-left: 0.4rem; padding-right: 0.4rem; }
  .sb-actions .wide-only { display: none; }
  .sb-actions .narrow-only { display: inline; }
  /* The side-by-side popup's Create report while a report is being made:
     "Making report…" — the long form wrapped onto two lines there. */
  .cmodal .actions .wide-only { display: none; }
  .cmodal .actions .narrow-only { display: inline; }
}
/* "New list" — a fresh list for the next buyer, this one kept in My
   Reports. It shares a wrapper with the label: on a desktop the wrapper
   dissolves (display: contents) and the button goes last, pushed to the
   right of the chips' last row; on a phone the wrapper is the label's own
   row, the button at its right. */
.homes-list .recent-head { display: contents; }
.homes-list .new-list { display: inline-flex; align-items: center; gap: 0.2rem; order: 1; margin-left: auto;
  padding: 0.3rem 0.5rem; font-size: 0.78rem; white-space: nowrap; }
.homes-list .new-list svg { width: 12px; height: 12px; stroke: currentColor; fill: none;
  stroke-width: 2.6; stroke-linecap: round; }
@media (max-width: 560px) {
  /* Two chips a row on a phone; the label's row is its own, New list at its right */
  .homes-list .recent-head { display: flex; flex: 1 1 100%; align-items: center; justify-content: space-between; }
  .homes-list .new-list { order: 0; }
  .homes-list .recent-item { max-width: calc(50% - 0.2rem); }
}

/* The comparison report under the bar: how it's going, then (styles.css)
   the preview, the "I have reviewed" box and the download — as on every
   report page. */
.report-area .status a { color: var(--accent); font-weight: 700; text-decoration: none; }
.report-area .status a:hover { text-decoration: underline; }
/* "Clear the rest" (owner 2026-09-25): a quiet second button before the
   report's while some homes are selected and others aren't. Beside two
   equal primaries it takes its own width (the trio grid); on a phone it has
   the row above them. The bar asks first, on the hint's line. */
.sb-actions .sb-prune { display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.7rem 0.9rem; font-size: 0.86rem; font-weight: 700; }
.sb-actions .sb-prune svg { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sb-actions.duo.trio { grid-template-columns: auto 1fr 1fr; }
.sb-hint.ask { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.1rem 0.3rem;
  color: var(--ink); font-weight: 600; }
.sb-hint.ask .linkish { padding: 0.2rem 0.3rem; font-size: 0.8rem; }
.sb-hint.ask .sb-go { color: var(--danger); }
.sb-hint.ask .sb-go:hover:not(:disabled) { color: var(--danger); }
.sb-dot { color: var(--faint); }
@media (max-width: 560px) {
  .sb-actions { flex-wrap: wrap; }
  .sb-actions .sb-prune { flex: 1 1 100%; justify-content: center; padding: 0.6rem 0.8rem; font-size: 0.84rem; }
  .sb-actions.duo.trio { grid-template-columns: 1fr 1fr; }
  .sb-actions.duo .sb-prune { grid-column: 1 / -1; }
}

/* A report being made: its button waits, working rather than greyed out */
.sb-actions .primary[aria-busy="true"] { opacity: 0.85; cursor: progress; }
.sb-actions .spin { width: 14px; height: 14px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: hc-spin 0.8s linear infinite; }
@keyframes hc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sb-actions .spin { animation: none; } }

/* "Before your report" (owner 2026-09-25): the client's name, then a row per
   selected home in the report's order — letter, photo, address and price,
   the star, and its commentary box (the card's notes). Back and Make report
   ride in the sticky foot like every popup's buttons. */
.before-modal .bh-lead { margin: 0.2rem 0 0.9rem; font-size: 0.86rem; color: var(--muted); line-height: 1.45; }
.before-modal .bh-client { margin: 0 0 0.2rem; }
.before-modal .bh-client input { font-size: 0.95rem; padding: 0.7rem 0.8rem 0.7rem 0; }
.before-modal .why-title { margin-top: 0.9rem; }
.bh-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  grid-template-areas: "lb photo who price star" "notes notes notes notes notes" "count count count count count";
  align-items: center; gap: 0.35rem 0.6rem; padding: 0.65rem 0; border-top: 1px solid var(--soft-line); }
.bh-row > .lb { grid-area: lb; width: 24px; height: 24px; font-size: 0.82rem; }
.bh-photo { grid-area: photo; width: 64px; height: 46px; border-radius: 5px; overflow: hidden;
  background: var(--soft); display: flex; align-items: center; justify-content: center; }
.bh-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bh-photo > svg { width: 24px; height: 24px; stroke: var(--accent); fill: none; stroke-width: 1.3; opacity: 0.7; }
.bh-who { grid-area: who; min-width: 0; display: flex; flex-direction: column; gap: 0.05rem; }
.bh-street { font-weight: 700; color: var(--ink); font-size: 0.9rem; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.bh-city { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bh-price { grid-area: price; font-weight: 800; color: var(--ink); font-size: 0.9rem; white-space: nowrap; }
.bh-row .star { grid-area: star; margin: 0; }
.bh-row .bh-notes { grid-area: notes; min-height: 58px; font-size: 0.88rem; padding: 0.55rem 0.7rem; }
.bh-row .notes-count { grid-area: count; text-align: right; margin-top: -0.2rem; }
@media (max-width: 560px) {
  /* The price under the address, so the street keeps its room */
  .bh-row { grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "lb photo who star" "lb photo price star" "notes notes notes notes" "count count count count";
    gap: 0.1rem 0.5rem; }
  .bh-row .bh-notes { margin-top: 0.4rem; }
  .bh-price { font-size: 0.84rem; }
}

/* For sale / For lease (owner 2026-10-12, rental mode): the site's segmented
   toggle (cma.html, mortgage.html). Once the list has homes it shows the
   list's kind and the other side dims — New list is the way to switch. */
.mode-toggle { display: flex; padding: 3px; margin-bottom: 1.1rem;
  border: 1.5px solid var(--field-line); border-radius: 999px;
  background: var(--field); }
.mode-toggle button { flex: 1; border: none; background: transparent;
  color: var(--muted); font-weight: 700; font-size: 0.85rem;
  padding: 0.55rem 0.5rem; border-radius: 999px; cursor: pointer; }
.mode-toggle button.active { background: var(--btn-bg); color: var(--btn-fg); }
.kind-toggle { margin-bottom: 0.8rem; }
.kind-toggle.locked button:not(.active) { opacity: 0.5; }
/* A leased home reads closed, like a sold one. */
.stpill.leased { background: var(--accent); color: var(--on-accent); }

/* ============ Part 3 — List | Map and Places that matter ============== */
/* Owner 2026-10-13, after the mockups ("yes that looks great"; beta
   "compare_places"). The List | Map switch and the map box are the CMA
   page's (cma.html); the map itself and its marks are the shared module's
   (maps.css: the lettered pins, the place marks, the legend, the popup and
   the phone's sheet — fixed cream / ink / brass, as the basemap ignores the
   theme). The "Add a place" control, a pin's and a place's card, the places
   list under the map and the Add-a-place form use the theme's tokens. */

/* ---- List | Map (as cma.html) ------------------------------------------ */
.view-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 0.4rem 1rem; margin: 0.15rem 0 0.65rem; text-align: left; }
.view-row[hidden], #map-view[hidden], #home-grid[hidden], #places[hidden] { display: none; }
.view-toggle { display: inline-flex; padding: 3px; border: 1.5px solid var(--field-line);
  border-radius: 999px; background: var(--field); }
.view-toggle button { width: auto; margin: 0; border: none; background: transparent;
  color: var(--muted); font-weight: 700; font-size: 0.82rem; padding: 0.42rem 0.95rem;
  border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem;
  line-height: 1; }
.view-toggle button.active { background: var(--btn-bg); color: var(--btn-fg); }
.view-toggle button:hover:not(.active) { background: transparent; color: var(--ink); }
.view-toggle svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.view-note { font-size: 0.78rem; color: var(--muted); }
.hc-map { position: relative; height: 480px; border-radius: 10px; border: 1.5px solid var(--panel-line);
  overflow: hidden; background: var(--soft); margin: 0 0 0.7rem; z-index: 0; }
/* On a phone the map runs to the card's edges (the card has 1rem sides
   there, above) — as the CMA's map does. */
@media (max-width: 560px) {
  .hc-map { height: 430px; margin-left: -1rem; margin-right: -1rem; border-radius: 0;
    border-left: 0; border-right: 0; }
}

/* ---- the type's icon in an ink square (the module draws it: AgentMaps.placeIconSvg) ---- */
.plc-pin { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 7px; background: #2A2522; border: 2px solid #FBF9F4; box-sizing: border-box;
  box-shadow: 0 1px 4px rgba(0,0,0,0.38); color: #FBF9F4; flex-shrink: 0; }
.plc-pin svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.1;
  stroke-linecap: round; stroke-linejoin: round; display: block; }
.plc-pin svg.thick { stroke-width: 3; }

/* ---- "Add a place" on the map (top right, in the zoom control's dress) ---- */
.plc-addbtn { display: inline-flex; align-items: center; gap: 0.4rem; width: auto; margin: 0;
  padding: 0.5rem 0.8rem 0.5rem 0.65rem; border: 0; border-radius: 6px; background: #FBF9F4; color: #2A2522;
  font: 700 12.5px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; cursor: pointer; }
.plc-addbtn:hover:not(:disabled) { background: #F2EDE2; color: #2A2522; }
.plc-addbtn svg { width: 16px; height: 16px; stroke: #82632B; fill: none; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round; }
.hc-map.plc-adding .plc-addbtn { display: none; }     /* while the Add-a-place form is up */

/* ---- a pin's card (the module's popup, or its sheet on a phone) — cma.html's look ---- */
.mapcard { text-align: left; width: 238px; max-width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; }
.mapcard .mc-photo { position: relative; height: 122px; background: var(--soft); overflow: hidden;
  display: flex; align-items: center; justify-content: center; }
.mapcard .mc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mapcard .mc-photo > svg { width: 44px; height: 44px; stroke: var(--accent); fill: none; stroke-width: 1.3; opacity: 0.7; }
.mapcard .mc-body { padding: 0.6rem 0.7rem 0.65rem; }
.mapcard .mc-addr { display: block; font-weight: 700; font-size: 0.84rem; color: var(--ink);
  margin-bottom: 0.2rem; padding-right: 0.5rem; }
.mapcard .mc-facts { display: block; font-size: 0.76rem; color: var(--muted); }
.mapcard .mc-price { font-weight: 800; color: var(--ink); font-size: 0.86rem; }
.mapcard .mc-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  margin-top: 0.55rem; }
.mapcard .mc-link { width: auto; margin: 0; padding: 0; background: none; border: 0; font-size: 0.74rem;
  font-weight: 700; color: var(--accent); text-decoration: underline; cursor: pointer; }
.mapcard .mc-link:hover:not(:disabled) { background: none; color: var(--ink); }
/* a home's card: its letter on the photo */
.mapcard .mc-photo .letter { top: 0.45rem; left: 0.45rem; right: auto; width: 30px; height: 30px;
  font-size: 0.95rem; }
@media (max-width: 480px) {
  .mapcard { width: auto; }
  .mapcard .mc-photo { height: 100px; }
}

/* ---- a place's card: name, type, the distance to every home ---- */
.plc-card .plc-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 0.8rem 0.5rem; }
.plc-card .plc-head .plc-pin { width: 32px; height: 32px; border-radius: 8px; }
.plc-card .plc-head .plc-pin svg { width: 18px; height: 18px; }
.plc-title { display: flex; flex-direction: column; min-width: 0; gap: 0.1rem; }
.plc-card .mc-addr { margin: 0; font-size: 0.92rem; padding-right: 1.1rem; }
.plc-type, .place-type { font-size: 0.64rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted); }
/* a place over 10 miles from the homes: listed, not drawn (S5-048) — as the report's "(not on the map)" */
.place-off { font-size: 0.72rem; font-weight: 600; font-style: italic; letter-spacing: 0; text-transform: none;
  color: var(--muted); white-space: nowrap; }
.plc-dist { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 0.6rem; margin: 0.15rem 0.8rem 0;
  padding: 0.6rem 0 0.2rem; border-top: 1px solid var(--soft-line); }
.pd { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.86rem; font-weight: 600;
  color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pd.near { font-weight: 800; }
.pd .lb { font-style: normal; }
/* a home the MLS gave no map point: its letter, a dash, and the note under the distances */
.pd.none { color: var(--muted); }
.pd-note { grid-column: 1 / -1; font-size: 0.72rem; color: var(--faint); }
.plc-card .mc-row { padding: 0.45rem 0.8rem 0.7rem; margin-top: 0.25rem; }
.plc-foot { font-size: 0.7rem; color: var(--faint); }

/* ---- the places under the map ---- */
.places { margin: 0 0 1rem; text-align: left; border: 1.5px solid var(--panel-line); border-radius: 10px;
  background: var(--panel); padding: 0.75rem 1rem 0.55rem; }
.places-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem;
  flex-wrap: wrap; margin-bottom: 0.45rem; }
.places-note { font-size: 0.74rem; color: var(--faint); }
.place-row { display: flex; align-items: center; gap: 0.65rem; padding: 0.55rem 0;
  border-top: 1px solid var(--soft-line); }
.place-name { display: flex; flex-direction: column; gap: 0.1rem; flex: 1 1 11rem; min-width: 0;
  font-weight: 700; font-size: 0.88rem; color: var(--ink); line-height: 1.25; }
/* the name is a button: a tap renames it in place */
.place-rename { display: block; width: auto; max-width: 100%; margin: 0; padding: 0.1rem 0.3rem 0.1rem 0;
  border: 0; border-radius: 4px; background: none; color: var(--ink); font: inherit; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: text; }
.place-rename:hover:not(:disabled) { background: var(--soft); color: var(--ink); text-decoration: underline; }
.place-edit { width: 100%; max-width: 18rem; box-sizing: border-box; padding: 0.3rem 0.5rem;
  font: inherit; font-weight: 700; }
.place-dists { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; margin-left: auto; }
.place-row .recent-x { padding: 0.35rem; border-radius: 50%; }
.place-row .recent-x:hover:not(:disabled) { background: var(--pill); color: var(--danger); }
.plc-addlink { margin: 0.45rem 0 0.15rem; font-size: 0.82rem; }
.places-empty { font-size: 0.82rem; color: var(--muted); padding: 0.4rem 0 0.5rem; line-height: 1.5; }
.plc-full { padding: 0.45rem 0 0.2rem; }
@media (max-width: 700px) {
  /* the icon, the name and × on one line; the distances under them */
  .place-row { flex-wrap: wrap; }
  .place-dists { order: 3; flex: 1 1 100%; margin-left: 0; padding-left: calc(26px + 0.65rem); }
  .place-row .recent-x { margin-left: auto; }
}

/* ---- Add a place: the sheet (a phone) or the panel on the map ---- */
.plc-sheet .aiv-sheet-body { padding: 0 1.05rem 1.05rem; }
/* The panel sits in the map's top-right corner (the module's addControl), so
   the map stays there to tap and the pin to drag; it scrolls when the map
   is shorter than the form. */
.plc-panel { width: min(330px, calc(100vw - 4rem)); max-height: min(440px, calc(100vh - 6rem)); overflow: auto;
  padding: 0.9rem 1rem 1rem; box-sizing: border-box; background: var(--panel); color: var(--ink);
  border-radius: 6px; text-align: left; }
.plc-h { margin: 0.1rem 0 0.55rem; font-family: var(--serif); font-weight: 400; font-size: 1.3rem;
  color: var(--ink); line-height: 1.2; }
.plc-panel .plc-h { font-size: 1.15rem; margin-bottom: 0.4rem; }
.plc-form { display: flex; flex-direction: column; gap: 0.62rem; text-align: left; }
.plc-panel .plc-form { gap: 0.5rem; }
.plc-l { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.plc-l input { font-size: 1rem; font-weight: 400; letter-spacing: 0; text-transform: none;
  padding: 0.7rem 0.85rem; width: 100%; box-sizing: border-box; }
.plc-panel .plc-l input { font-size: 0.92rem; padding: 0.55rem 0.7rem; }
.plc-types { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.plc-chip { display: inline-flex; align-items: center; gap: 0.4rem; width: auto; margin: 0;
  padding: 0.26rem 0.75rem 0.26rem 0.32rem; border-radius: 999px; border: 1.5px solid var(--field-line);
  background: var(--field); color: var(--ink); font-size: 0.82rem; font-weight: 700; letter-spacing: 0;
  text-transform: none; line-height: 1; cursor: pointer; }
.plc-chip .plc-pin { width: 24px; height: 24px; border-radius: 6px; border-width: 1.5px; box-shadow: none; }
.plc-chip .plc-pin svg { width: 14px; height: 14px; }
.plc-chip:hover:not(:disabled) { background: var(--soft); color: var(--ink); }
.plc-chip[aria-checked="true"] { border-color: var(--accent); background: var(--soft);
  box-shadow: 0 0 0 1.5px var(--accent); color: var(--ink); }
.plc-panel .plc-chip { font-size: 0.78rem; padding: 0.2rem 0.6rem 0.2rem 0.26rem; }
.plc-where { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
.plc-choice { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; width: 100%;
  margin: 0; padding: 0.65rem 0.4rem; border-radius: 8px; border: 1.5px solid var(--field-line);
  background: var(--field); color: var(--ink); font-size: 0.78rem; font-weight: 700; letter-spacing: 0;
  text-transform: none; line-height: 1.15; cursor: pointer; }
.plc-choice svg { width: 16px; height: 16px; flex-shrink: 0; stroke: var(--accent); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.plc-choice:hover:not(:disabled) { background: var(--soft); color: var(--ink); }
.plc-choice[aria-checked="true"] { border-color: var(--accent); background: var(--soft);
  box-shadow: 0 0 0 1.5px var(--accent); }
.plc-panel .plc-choice { padding: 0.5rem 0.3rem; font-size: 0.74rem; }
.plc-hint { margin: 0; font-size: 0.82rem; font-weight: 400; letter-spacing: 0; text-transform: none;
  color: var(--muted); line-height: 1.45; display: flex; gap: 0.4rem; align-items: flex-start; }
.plc-hint svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 0.1rem; stroke: var(--accent);
  fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.plc-hint[hidden], .plc-addr[hidden], .plc-msg[hidden] { display: none; }
.plc-msg { margin: 0; font-size: 0.82rem; font-weight: 600; color: var(--danger); line-height: 1.4; }
.plc-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.6rem; margin-top: 0.15rem; }
.plc-actions .primary { width: auto; padding: 0.72rem 1.25rem; font-size: 0.92rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: 0.4rem; }
.plc-actions .primary svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round; }
.plc-panel .plc-actions .primary { padding: 0.55rem 1rem; font-size: 0.86rem; }
