/* rents — page-local rules for /rents and /rents/:community, in the v2 design language (8 Nov).
   Loaded AFTER v2.css (hero stage, aurora, reveals, bottom nav, glass tokens live there); every v2 rule is scoped under
   body.v2-rents. Token-only (no colour literals). ONE template serves both routes: on /rents/:community #rentsDirectory is
   `hidden` and <!--RENTS_COMMUNITY_SSR--> carries the community card + chart, so the community look hangs off
   .rents-community-intro-section and `:has(#rentsDirectory[hidden])`.
   Everything below styles classes the SERVER emits inside #rentsDirectory (rents-filter.js swaps its innerHTML), so it survives the swap.
   .section-title/.section-intro are page-local site-wide (D3 divergent copies; chrome.css scopes them only under .faq-cta).
   .card/.op-card/.rent-or-buy mirror community.css so the reused renderCommunityRentsCard renders as it does on the community page.
   No universal reset (D3). */
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.section-sub { font-size: var(--fs-2); color: var(--text-muted); }
.section-title { font-family: 'Inter Tight', 'Inter', sans-serif; font-size: var(--fs-6); font-weight: 700; letter-spacing: -.025em; color: var(--text); margin: 0 0 8px; }
.section-intro { color: var(--text-muted); font-size: var(--fs-3); line-height: 1.65; margin: 0 0 16px; max-width: 60ch; }
.card { background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius-xl); padding: 22px; box-shadow: var(--shadow), var(--highlight); }
.op-card { padding: 0; overflow: hidden; }

.rent-or-buy { border-top: 1px solid var(--border); padding: 14px 20px 0; }
.rent-or-buy .op-sub-title { font-size: var(--fs-2); font-weight: 600; margin: 0 0 6px; color: var(--text); }
.rent-or-buy p { margin: 0 0 10px; line-height: 1.55; }
.rent-or-buy .op-foot { border-top: 0; padding: 0 0 12px; }

.rents-community-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; font-size: var(--fs-2); font-weight: 600; }
.rent-check-form { margin-top: 4px; }
.rent-check-result { margin-top: 16px; }
.rent-check-result p { font-size: var(--fs-3); line-height: 1.65; color: var(--text-muted); margin: 0 0 10px; }
.rent-check-result p:last-child { margin-bottom: 0; }
.rent-check-pct strong { color: var(--text); }

/* Structure that is not v2-specific: the find block, bedroom chips (real checkboxes, visually hidden but focusable, never display:none) */
.rents-find { margin: 0; }
.rents-find-label { display: block; }
.rents-find .autocomplete-wrap { max-width: 760px; }
.rents-find input[type="text"] { display: block; width: 100%; box-sizing: border-box; outline: none; }
.rents-form .filter-row { align-items: center; }
.bed-chips { display: flex; flex-wrap: wrap; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.bed-chip { position: relative; display: inline-flex; align-items: center; line-height: 1.2; font-weight: 600; cursor: pointer; user-select: none; border-radius: var(--radius-pill); }
.bed-chip input { position: absolute; opacity: 0; width: 100%; height: 100%; inset: 0; margin: 0; cursor: pointer; }
.rents-trend { margin: 0 0 32px; }
.rent-trend-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 8px; }
.rent-trend-scope[hidden] { display: none; }
.rent-trend-see { font-size: var(--fs-2); font-weight: 600; }
@media (pointer: coarse) {
  .rent-trend-scope .page-btn, .rent-trend-see { display: inline-flex; align-items: center; min-height: 44px; }
}

/* In-place filter updates (rents-filter.js): dim what is about to change while the new view loads */
#rentsDirectory[aria-busy="true"] .rents-trend,
#rentsDirectory[aria-busy="true"] .data-meta,
#rentsDirectory[aria-busy="true"] .data-table-wrap { opacity: .55; transition: opacity .12s ease-out; }

/* ── v2: hero sub (the server's <p id="rentsHeroSub"> sits in a .v2-sub wrapper) ── */
.v2-rents #rentsHeroSub { margin: 0; font-size: inherit; line-height: inherit; color: inherit; }
.v2-rents .v2-rents-body { padding-bottom: var(--v2-sec); }

/* ── v2: "Find your area" + filters ARE the stage on /rents: the form carries the ink full-bleed and fades into the page ── */
.v2-rents .rents-form { position: relative; isolation: isolate; margin: 0 0 88px; padding: 0 0 var(--v2-sec); }
.v2-rents .rents-form::before {
  content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: 50%; width: 100vw; margin-left: -50vw; background: var(--chrome);
}
.v2-rents .rents-form::after {
  content: ""; position: absolute; z-index: -1; top: 100%; left: 50%; width: 100vw; height: 88px; margin-left: -50vw; pointer-events: none;
  background: linear-gradient(to bottom, var(--chrome), var(--bg));
}
.v2-rents .rents-find-label { color: var(--v2-on-ink-mute); font-size: var(--fs-2); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 12px; }
.v2-rents .rents-find input[type="text"] {
  max-width: 760px; height: 64px; padding: 0 28px; border-radius: 999px; font-family: 'Inter', sans-serif; font-size: 1.05rem;   /* 16px floor: iOS zooms any input under 16px (59·M10) */
  color: var(--v2-on-ink); background: var(--v2-glass-fill); border: 1px solid var(--v2-glass-line);
  -webkit-backdrop-filter: var(--v2-glass-blur); backdrop-filter: var(--v2-glass-blur);
  box-shadow: 0 18px 50px color-mix(in srgb, var(--chrome) 55%, transparent);
  transition: border-color 200ms var(--v2-out), background-color 200ms var(--v2-out), box-shadow 200ms var(--v2-out);
}
.v2-rents .rents-find input[type="text"]::placeholder { color: var(--v2-on-ink-mute); }
.v2-rents .rents-find input[type="text"]:focus {
  border-color: var(--v2-hl); background: color-mix(in srgb, var(--text-on-dark) 15%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 22%, transparent), 0 18px 50px color-mix(in srgb, var(--chrome) 55%, transparent);
}
.v2-rents .rents-find .autocomplete-list {
  top: calc(100% + 10px); border: 1px solid var(--border); border-radius: 22px; padding: 6px; z-index: 60;
  box-shadow: 0 30px 70px color-mix(in srgb, var(--chrome) 60%, transparent);
}
.v2-rents .rents-find .autocomplete-item { border-bottom: 0; border-radius: 14px; padding: 12px 14px; }
.v2-rents .rents-find .autocomplete-item:hover, .v2-rents .rents-find .autocomplete-item.selected { background: var(--accent-tint); }
.v2-rents .rents-form .filter-row { justify-content: flex-start; gap: 12px; margin-top: 22px; }
.v2-rents .rents-form .filter-row select,
.v2-rents .rents-form .filter-row input[type="number"] {
  height: 48px; padding: 0 20px; border-radius: 999px; font-size: var(--fs-3); width: auto; min-width: 150px;
  color: var(--v2-on-ink); background: var(--v2-glass-fill); border: 1px solid var(--v2-glass-line);
  -webkit-backdrop-filter: var(--v2-glass-blur-md); backdrop-filter: var(--v2-glass-blur-md);
}
.v2-rents .rents-form .filter-row input[type="number"] { min-width: 210px; }
.v2-rents .rents-form .filter-row input::placeholder { color: var(--v2-on-ink-mute); }
.v2-rents .rents-form .filter-row select option { color: var(--text); background: var(--surface); }
.v2-rents .rents-form .filter-row select:focus, .v2-rents .rents-form .filter-row input:focus { border-color: var(--v2-hl); outline: none; }
.v2-rents .rents-form :focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
.v2-rents .bed-chip {
  min-height: 44px; padding: 0 18px; font-size: var(--fs-3);
  color: var(--v2-on-ink); background: var(--v2-glass-fill); border: 1px solid var(--v2-glass-line);
  -webkit-backdrop-filter: var(--v2-glass-blur-sm); backdrop-filter: var(--v2-glass-blur-sm);
  transition: transform 160ms var(--v2-out), background-color 160ms var(--v2-out), border-color 160ms var(--v2-out), color 160ms var(--v2-out);
}
.v2-rents .bed-chip:active { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) { .v2-rents .bed-chip:hover { border-color: var(--v2-hl); } }
.v2-rents .bed-chip:has(input:checked) { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.v2-rents .bed-chip:has(input:focus-visible) { outline: 2px solid var(--lime); outline-offset: 3px; }
.v2-rents .rents-form .page-btn {
  height: 48px; padding: 0 30px; border: 0; border-radius: 999px; font-weight: 700; font-size: var(--fs-3);
  background: var(--lime); color: var(--lime-ink); cursor: pointer;
  transition: transform 160ms var(--v2-out), background-color 160ms var(--v2-out);
}
.v2-rents .rents-form .page-btn:hover:not(:disabled) { background: var(--lime-hover); color: var(--lime-ink); border: 0; }
.v2-rents .rents-form .page-btn:active { transform: scale(.97); }

/* ── v2: chart card + section headings ── */
.v2-rents .rents-trend { margin: 0 0 var(--v2-sec); }
.v2-rents .rents-trend .section-title, .v2-rents #rentCheck .section-title, .v2-rents .rents-community-intro-section > .section-header .section-title {
  font-family: 'Inter Tight', Inter, sans-serif; font-weight: 800; font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  letter-spacing: -0.04em; line-height: 1.05; margin: 0 0 10px; text-wrap: balance;
}
.v2-rents .section-sub { font-size: var(--fs-3); color: var(--text-muted); max-width: 52em; }
.v2-rents .section-header { margin-bottom: 22px; align-items: end; }
.v2-rents .rents-trend .card, .v2-rents .rents-community-intro-section > .card {
  border: 0; border-radius: 28px; padding: clamp(18px, 3vw, 36px);
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
}
.v2-rents .rent-trend-scope .page-btn {
  border-radius: 999px; min-height: 40px; padding: 0 18px; background: var(--accent); color: var(--on-accent); border: 0;
}
.v2-rents .data-note { font-size: var(--fs-2); color: var(--text-muted); line-height: 1.6; max-width: 60em; }
.v2-rents .data-meta { margin: 0 0 18px; }
.v2-rents .results-count { font-size: var(--fs-3); color: var(--text-muted); font-weight: 600; }

/* ── v2: table ── */
.v2-rents .data-table-wrap { border: 0; border-radius: 28px; box-shadow: var(--shadow); }
.v2-rents .data-table { font-size: var(--fs-3); }
.v2-rents .data-table th {
  padding: 20px 18px; background: var(--surface); color: var(--text-muted); font-size: var(--fs-1); letter-spacing: .1em;
  border-bottom: 1px solid var(--border);
}
.v2-rents .data-table td { padding: 22px 18px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.v2-rents .data-table td.cell-title, .v2-rents .data-table td.cell-title a { font-weight: 700; font-size: var(--fs-4); color: var(--text); }
.v2-rents .data-table td.cell-lead {
  font-family: 'Inter Tight', Inter, sans-serif; font-weight: 800; font-size: var(--v2-fs-cell-lead); letter-spacing: -0.03em;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.v2-rents .data-table td.cell-lead .num-affix { font-size: .55em; }   /* em by design: sized to the figure (59·M10) */
.v2-rents .data-table tbody tr { transition: background-color 160ms var(--v2-out); }
.v2-rents .data-table tbody tr:hover td { background: var(--accent-tint); }
.v2-rents .data-table tbody tr:last-child td { border-bottom: 0; }
.v2-rents .show-all-btn { border-radius: 999px; background: var(--accent); color: var(--on-accent); border: 0; min-height: 44px; padding: 0 24px; }
@media (min-width: 900px) {
  .v2-rents .data-table-wrap { overflow: clip; }
  .v2-rents .data-table thead th { position: sticky; top: 72px; z-index: 2; }
}

/* ── v2: rent check as a light card ── */
.v2-rents #rentCheck {
  margin-top: 0; padding: clamp(24px, 4vw, 48px); border-radius: 28px;
  background: var(--surface); box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
}
.v2-rents #rentCheck .filter-row { justify-content: flex-start; gap: 12px; margin-top: 4px; }
.v2-rents #rentCheck select, .v2-rents #rentCheck input[type="number"] {
  height: 48px; padding: 0 20px; border-radius: 999px; font-size: var(--fs-3); width: auto; min-width: 150px;
  color: var(--text); background: var(--surface); border: 1px solid var(--border-ui);
  transition: border-color 160ms var(--v2-out), box-shadow 160ms var(--v2-out);
}
.v2-rents #rentCheck input[type="number"] { min-width: 220px; }
.v2-rents #rentCheck select:focus, .v2-rents #rentCheck input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); outline: none; }
.v2-rents #rentCheck .page-btn {
  height: 48px; padding: 0 28px; border: 0; border-radius: 999px; font-weight: 700; background: var(--accent); color: var(--on-accent); cursor: pointer;
}
.v2-rents #rentCheck .page-btn:active { transform: scale(.97); }
.v2-rents .rent-check-result { padding: 18px 20px; border-radius: 20px; background: var(--accent-tint); }

/* ── v2: /rents/:community (the directory is `hidden`) — the hero has no form to continue it, so it fades out itself ── */
.v2-rents:has(#rentsDirectory[hidden]) .v2-hero-short::after {
  content: ""; position: absolute; z-index: -1; top: 100%; left: 0; right: 0; height: 88px; pointer-events: none;
  background: linear-gradient(to bottom, var(--chrome), var(--bg));
}
.v2-rents:has(#rentsDirectory[hidden]) .v2-rents-body { padding-top: 72px; }
.v2-rents .rents-community-intro-section > .card + .section-header { margin-top: var(--v2-sec); }
/* The registered-rents card is a <section class="section" id="rents"> (renderCommunityRentsCard), not a bare .card, so the rule above never matched it:
   the "Rent per sqft" heading sat flush under it. Same v2 section gap, keyed on what actually precedes the trend heading. */
.v2-rents .rents-community-intro-section > .section + .section-header { margin-top: var(--v2-sec); }
.v2-rents .rents-community-intro-section > .section { margin-top: 0; }
/* The shared card's table headers: one style (same size, case, weight, tracking; the Gross yield one used to wrap and carry its own face),
   one line each. On phones the type steps down so "Median rent / yr" fits its column; nowrap + clip is the no-overflow backstop. */
.v2-rents .rents-card .op-head > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-rents .rents-card .op-head .op-gap { white-space: nowrap; line-height: inherit; font-family: inherit; font-weight: inherit; font-size: inherit; color: inherit; }
@media (max-width: 560px) {
  .v2-rents .rents-card .op-head, .v2-rents .rents-card .op-row { grid-template-columns: 44px minmax(0, 1.12fr) minmax(0, 1fr) 72px; gap: 4px; }
  .v2-rents .rents-card .op-head > *, .v2-rents .rents-card .op-head .op-gap { font-size: .625rem; letter-spacing: 0; }   /* fit-to-width phone table head: literal by design (59·M10) */
}
@media (max-width: 380px) {
  .v2-rents .rents-card .op-head > *, .v2-rents .rents-card .op-head .op-gap { font-size: .58rem; }   /* fit-to-width phone table head: literal by design (59·M10) */
}
.v2-rents .rents-card { border: 0; border-radius: 28px; box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent); }
.v2-rents .rents-community-links { margin-top: 28px; }
.v2-rents .rents-community-links a { display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 640px) {
  .v2-rents .rents-form .filter-row select, .v2-rents .rents-form .filter-row input[type="number"], .v2-rents .rents-form .page-btn { flex: 1 1 100%; }
  .v2-rents .rents-find input[type="text"] { height: 56px; padding: 0 22px; }
  .v2-rents .bed-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; padding-bottom: 2px; }
  .v2-rents .bed-chips::-webkit-scrollbar { display: none; }
  .v2-rents .bed-chip { flex: none; }
  .v2-rents .data-table-wrap { background: transparent; box-shadow: none; border-radius: 0; overflow: visible; }
  .v2-rents .data-table.is-stacked thead tr { background: transparent; border: 0; padding: 0 0 14px; }
  .v2-rents .data-table.is-stacked thead th.is-sortable { border-color: var(--border-ui); }
  .v2-rents .data-table.is-stacked tbody tr {
    margin-bottom: 14px; padding: 18px; gap: 12px 16px; border: 1px solid var(--border); border-radius: 24px;
    background: var(--surface); box-shadow: var(--shadow);
  }
  .v2-rents .data-table.is-stacked tbody tr:last-child { border-bottom: 1px solid var(--border); }
  .v2-rents .data-table.is-stacked td { padding: 0; border: 0; }
  .v2-rents .data-table.is-stacked td.cell-title { font-size: var(--fs-4); }
  .v2-rents .data-table.is-stacked td.cell-lead { font-size: var(--v2-fs-cell-lead-lg); }
  .v2-rents .data-table tbody tr:hover td { background: transparent; }
  .v2-rents #rentCheck select, .v2-rents #rentCheck input[type="number"], .v2-rents #rentCheck .page-btn { flex: 1 1 100%; }
  /* the full intro pushed "Find your area" below the first screen: smaller copy here (the text stays) */
  .v2-rents #rentsHeroSub { font-size: var(--fs-3); line-height: 1.5; }
  .v2-rents:has(#rentsDirectory[hidden]) .v2-rents-body { padding-top: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .v2-rents .rents-find input[type="text"], .v2-rents .bed-chip, .v2-rents .rents-form .page-btn,
  .v2-rents .data-table tbody tr, .v2-rents #rentCheck select, .v2-rents #rentCheck input, #rentsDirectory[aria-busy="true"] .rents-trend { transition: none; }
  .v2-rents .bed-chip:active, .v2-rents .rents-form .page-btn:active, .v2-rents #rentCheck .page-btn:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .v2-rents .rents-find input[type="text"], .v2-rents .rents-form .filter-row select, .v2-rents .rents-form .filter-row input[type="number"], .v2-rents .bed-chip {
    background: color-mix(in srgb, var(--chrome) 82%, var(--text-on-dark)); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}

/* The v2 body wrapper replaced `.page-content`, which carried the site's link, sort-header and
   data-note rules (chrome.css ~641 and ~1595-1600). Same values here, scoped to the rents body, so
   links and the table's sort headers keep their look (rendered 8 Nov: they had fallen back to
   default blue underlined links). */
.v2-rents-body a:not(.page-cta):not(.page-btn) { color: var(--accent); text-decoration: none; }
.v2-rents-body a:not(.page-cta):not(.page-btn):hover { text-decoration: underline; }
.v2-rents-body .data-table th a.th-sort { color: inherit; font-weight: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.v2-rents-body .data-table th a.th-sort:hover, .v2-rents-body .data-table th[aria-sort] a.th-sort { color: var(--accent); }
.v2-rents-body .data-table a:not(.page-cta) { color: var(--text); font-weight: 600; text-decoration: none; }
.v2-rents-body .data-table a:not(.page-cta):hover { color: var(--accent); }
.v2-rents-body .data-note { font-size: var(--fs-1); line-height: 1.55; color: var(--text-subtle); margin: 16px 0 0; }
