/* Free rent check (/tools/rent-calculator/) — widget styles on top of parity.css tokens.
 * Layout: a full-width map with the form / result card floating over its left edge (stacked below 860px). */

.rc-hero { padding-bottom: 8px; }
.rc-hero .p-head { text-align: center; margin-bottom: 0; }
.rc-tool-section { padding-top: 24px; padding-bottom: 48px; }

/* ---- stage: map + floating card ---- */
.rc-stage {
  position: relative;
  height: 620px;
  border-radius: var(--p-radius-xl);
  overflow: hidden;
  box-shadow: var(--p-shadow-card);
  background: #eef5f1;
}
.rc-map { position: absolute; inset: 0; cursor: crosshair; }
.rc-map.rc-map--zoomable { cursor: pointer; } /* zoomed far out, over CY / GB / US: a click zooms there */
.rc-map.leaflet-container { background: #eef5f1; font-family: inherit; }
/* Only CSS filter functions and blend modes on this map: the GPU runs them, while SVG url() filters are redone
   on the CPU every frame of a pan or zoom. The sage duotone of the deal comparables map (#da-map-duotone),
   rebuilt from them: grey → invert → tint → invert → dim is exact for a linear duotone (white comes out a
   neutral 241 rather than sage), the inner brightness raised from 0.59 so streets and blocks stand out under the
   rent colours. */
.rc-map .leaflet-tile-pane {
  filter: grayscale(1) invert(1) sepia(0.418) hue-rotate(287.4deg) saturate(2.131) brightness(1.06) invert(1) brightness(0.946);
}
/* The rent colours are multiplied into the map, so streets, blocks and water keep their contrast under them. */
.rc-map .leaflet-rc-regions-pane { mix-blend-mode: multiply; }
/* Labels with no halo: multiplied, the tiles' white halo vanishes; the chain turns the grey text dark green
   (#174530) and leaves white white. */
.rc-map .leaflet-rc-labels-pane {
  mix-blend-mode: multiply;
  filter: invert(1) sepia(1) saturate(0.72) hue-rotate(280.4deg) brightness(0.96) invert(1);
}
.rc-map .leaflet-control-zoom {
  border: none;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--p-shadow-sm);
}
.rc-map .leaflet-control-zoom a {
  width: 34px; height: 34px; line-height: 34px;
  color: var(--p-ink);
  border-bottom: 1px solid var(--p-border);
}
.rc-map .leaflet-control-zoom a:last-child { border-bottom: none; }

.rc-card-panel {
  position: absolute;
  top: 20px;
  left: 20px;
  bottom: 20px;
  width: 372px;
  z-index: 500; /* above Leaflet panes (400) */
  display: flex;
  flex-direction: column;
  pointer-events: none; /* the empty strip under a short card stays clickable on the map */
}
.rc-step, .rc-result {
  pointer-events: auto;
  max-height: 100%;
  overflow-y: auto;
  background: var(--p-card);
  border-radius: var(--p-radius-lg);
  box-shadow: var(--p-shadow-lg);
  padding: 22px;
}
.rc-step { display: flex; flex-direction: column; gap: 18px; }
.rc-step[hidden], .rc-result[hidden] { display: none; }

/* ---- form ---- */
.rc-label {
  display: block;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--p-muted);
  margin-bottom: 8px;
}
.rc-optional { font-weight: 400; color: var(--p-muted-2); }
.rc-field { border: 0; margin: 0; padding: 0; min-width: 0; }

.rc-search-box { position: relative; }
.rc-search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--p-muted-2); pointer-events: none; }
.rc-search-box input {
  width: 100%;
  height: 48px;
  padding: 0 52px 0 40px;
  border: 1px solid var(--p-border-strong);
  border-radius: var(--p-radius);
  font: inherit;
  font-size: 15px;
  color: var(--p-text);
  background: var(--p-bg-2);
  transition: border-color var(--p-fast), background var(--p-fast);
}
.rc-search-box input::-webkit-search-cancel-button { display: none; }
.rc-find {
  position: absolute;
  right: 6px; top: 6px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 0;
  border-radius: var(--p-radius-sm);
  background: var(--p-accent);
  color: #fff;
  cursor: pointer;
}
.rc-find:hover { background: var(--p-accent-hover); }
.rc-find[disabled] { opacity: 0.55; cursor: wait; }
.rc-hint { margin: 8px 0 0; font-size: 13px; color: var(--p-muted-2); }

.rc-results {
  list-style: none;
  margin: 8px 0 0;
  padding: 4px;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow-sm);
}
.rc-results button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--p-radius-sm);
  background: transparent;
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  color: var(--p-text);
  cursor: pointer;
}
.rc-results button:hover { background: var(--p-accent-tint); }

.rc-options { display: flex; flex-direction: column; gap: 16px; }

/* Segmented pills built on radios — keyboard and form semantics stay native. */
.rc-seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  padding: 3px;
  border-radius: var(--p-radius);
  background: var(--p-bg-2);
  box-shadow: inset 0 0 0 1px var(--p-border);
}
.rc-seg label { position: relative; display: block; }
.rc-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.rc-seg span {
  display: grid;
  place-items: center;
  height: 36px;
  border-radius: calc(var(--p-radius) - 3px);
  font-size: 14px;
  font-weight: 500;
  color: var(--p-muted);
  white-space: nowrap;
  transition: background var(--p-fast), color var(--p-fast);
}
.rc-seg--beds span { font-size: 13px; }
.rc-seg label:hover span { color: var(--p-ink); }
.rc-seg input:checked + span { background: var(--p-card); color: var(--p-accent-deep); font-weight: 600; box-shadow: var(--p-shadow-xs); }
.rc-seg input:focus-visible + span { box-shadow: var(--p-focus-ring); }

.rc-search-box input:focus,
.rc-field input:focus { outline: none; box-shadow: var(--p-focus-ring); border-color: var(--p-accent); background: #fff; }
.rc-field input[inputmode="numeric"] {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--p-border-strong);
  border-radius: var(--p-radius);
  font: inherit;
  font-size: 15px;
  color: var(--p-text);
  background: var(--p-bg-2);
}
.rc-field[hidden] { display: none; }
.rc-field input[aria-invalid="true"] { border-color: #9f2d1f; }
.rc-field input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(159, 45, 31, 0.18); }
.rc-field-error { margin-top: 6px; font-size: 13px; }

.rc-link {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--p-accent-deep);
  cursor: pointer;
}
.rc-link:hover { text-decoration: underline; }
.rc-submit { width: 100%; min-height: 48px; }
.rc-submit[disabled] { opacity: 0.55; cursor: not-allowed; }
.rc-error { color: #9f2d1f; font-size: 14px; margin: 0; }

/* ---- result ---- */
.rc-back { margin-bottom: 14px; color: var(--p-muted); }
.rc-kicker { font-size: 13px; font-weight: 600; color: var(--p-muted); margin: 0 0 2px; }
.rc-figure { font-size: 44px; font-weight: 700; letter-spacing: -0.02em; color: var(--p-ink); line-height: 1.1; margin: 0; }
.rc-figure small { font-size: 16px; font-weight: 500; letter-spacing: 0; color: var(--p-muted); margin-left: 4px; }

/* p25–p75 band: the middle half spans 20–80 % of the track, the dot is the estimate. */
.rc-band { margin: 18px 0 4px; }
.rc-band-track { position: relative; height: 8px; border-radius: 999px; background: var(--p-bg-3); }
.rc-band-mid { position: absolute; left: 20%; right: 20%; top: 0; bottom: 0; border-radius: 999px; background: var(--p-accent); opacity: 0.45; }
.rc-band-dot {
  position: absolute; top: 50%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: #f5b400;
  border: 2px solid var(--p-ink);
}
.rc-band-labels { position: relative; height: 20px; margin-top: 6px; font-size: 13px; color: var(--p-muted); }
.rc-band-labels span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.rc-band-labels span:first-child { left: 20%; }
.rc-band-labels span:last-child { left: 80%; }
.rc-band-caption { margin: 2px 0 0; font-size: 13px; color: var(--p-muted-2); text-align: center; }

.rc-meta { margin: 16px 0 0; font-size: 14px; color: var(--p-text); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.rc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--p-radius-pill);
  font-size: 13px;
  font-weight: 600;
  background: var(--p-accent-tint);
  color: var(--p-accent-deep);
}
.rc-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rc-badge--medium { background: #fff6e5; color: #8a5a00; }
.rc-note { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--p-muted-2); }

.rc-card-cta { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--p-border); }
.rc-card-cta .p-btn { width: 100%; }
.rc-card-cta .rc-note { margin-top: 8px; text-align: center; }
.rc-card-cta .rc-note a { color: var(--p-accent-deep); }

.rc-empty h3 { margin: 0 0 6px; font-size: 19px; color: var(--p-ink); }
.rc-empty p { margin: 0 0 14px; font-size: 14px; color: var(--p-muted); }
.rc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rc-chip {
  padding: 6px 12px;
  border-radius: var(--p-radius-pill);
  border: 1px solid var(--p-border-strong);
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: var(--p-text);
  cursor: pointer;
}
.rc-chip:hover { border-color: var(--p-accent); color: var(--p-accent-deep); }

/* ---- map pin + price tag ---- */
.rc-pin-icon { background: none; border: 0; }
.rc-pin {
  display: block;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #f5b400;
  border: 3px solid var(--p-ink);
  box-shadow: 0 0 0 5px rgba(245, 180, 0, 0.28), 0 3px 8px rgba(0, 0, 0, 0.3);
  cursor: grab;
}
.rc-pin-tag.leaflet-tooltip {
  padding: 4px 10px;
  border: 0;
  border-radius: var(--p-radius-pill);
  background: var(--p-ink);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}
.rc-pin-tag.leaflet-tooltip::before { display: none; }

/* ---- coverage: region tooltip, legend, first-visit hint ---- */
.rc-region-tip {
  position: absolute;
  z-index: 700; /* over the pin (600) */
  padding: 6px 10px;
  border-radius: var(--p-radius-sm);
  background: var(--p-card);
  color: var(--p-ink);
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--p-shadow-sm);
}
.rc-region-tip[hidden] { display: none; }
.rc-region-tip small { display: block; color: var(--p-muted); font-size: 12px; }

.rc-legend {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--p-card);
  box-shadow: var(--p-shadow-sm);
  font-size: 12px;
  color: var(--p-text);
}
.rc-legend-toggle { display: none; }
.rc-legend-body { width: 172px; } /* fixed, so the vs country / vs city switch never resizes the box */
.rc-legend-body p { display: flex; align-items: center; gap: 8px; margin: 0; line-height: 1.7; white-space: nowrap; }
.rc-legend-body .rc-legend-title { font-weight: 600; color: var(--p-muted); margin-bottom: 2px; }
/* Room for the longer of the two notes (three lines), so switching never changes the height either. */
.rc-legend-body .rc-legend-note {
  display: block; min-height: 4.2em; margin-top: 4px;
  font-size: 11px; line-height: 1.4; white-space: normal; color: var(--p-muted-2);
}
.rc-compare {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  margin: 4px 0 6px; padding: 2px;
  border-radius: 8px;
  background: var(--p-bg-2);
  box-shadow: inset 0 0 0 1px var(--p-border);
}
.rc-compare button {
  padding: 4px 0;
  border: 0; border-radius: 6px;
  background: none;
  font: inherit; font-size: 12px;
  color: var(--p-muted);
  cursor: pointer;
}
.rc-compare button[aria-pressed="true"] { background: var(--p-card); color: var(--p-ink); font-weight: 600; box-shadow: var(--p-shadow-xs); }
.rc-compare button:focus-visible { outline: none; box-shadow: var(--p-focus-ring); }
/* The map's scale: the REGION_STOPS colours at their positions (−30 … +30 %), at the bands' opacity. */
.rc-legend-scale {
  height: 10px; margin: 6px 0 2px; border-radius: 5px; opacity: 0.6;
  background: linear-gradient(90deg, #1f7a3c, #7fc045 30%, #f0d03c 50%, #ee862a 70%, #b3241d);
}
.rc-legend-ticks { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 11px; color: var(--p-muted); }
.rc-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; opacity: 0.6; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); } /* ≈ the regions' fill */
.rc-swatch--off { background: #eceef1; border: 1px solid #d1d5db; border-radius: 3px; opacity: 1; }

.rc-map-hint {
  position: absolute;
  top: 16px;
  left: calc(50% + 93px); /* centre of the gap between the 20 + 372px card and the 10 + 196px legend */
  transform: translateX(-50%);
  z-index: 450;
  padding: 7px 14px;
  border-radius: var(--p-radius-pill);
  background: var(--p-ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}
.rc-map-hint[hidden] { display: none; }

/* ---- below the stage ---- */
.rc-disclaimer { max-width: 760px; margin: 18px auto 0; text-align: center; font-size: 14px; color: var(--p-muted-2); }
/* The shared section paddings stack to ~230px between blocks here; keep it ~96px. */
.rc-how-section { padding-top: 48px; padding-bottom: 48px; }
.rc-how-section .p-head { margin-bottom: 24px; }
.rc-faq { padding: 48px 24px 80px; }
.rc-how ol { margin: 0; padding-left: 22px; font-size: 17px; line-height: 1.6; color: var(--p-text); }
.rc-how li + li { margin-top: 10px; }
.rc-cta { text-align: center; }
.rc-cta .p-btn { margin-top: 20px; }

@media (max-width: 860px) {
  /* The whole card first, the map under it. */
  .rc-stage {
    display: flex; flex-direction: column; gap: 14px;
    height: auto; overflow: visible; box-shadow: none; background: none; border-radius: 0;
  }
  .rc-card-panel { position: static; width: auto; order: 1; pointer-events: auto; }
  .rc-map { order: 2; position: relative; height: 340px; border-radius: var(--p-radius-lg); overflow: hidden; box-shadow: var(--p-shadow-ring); }
  .rc-step, .rc-result { max-height: none; box-shadow: var(--p-shadow-card); padding: 18px; }
  /* .p-btn is nowrap; the long CTA label would run past the edge at 360px. */
  .rc-cta .p-btn, .rc-card-cta .p-btn { width: 100%; white-space: normal; line-height: 1.3; text-align: center; padding-left: 20px; padding-right: 20px; }
  .rc-tool-section, .rc-how-section { padding-bottom: 40px; }
  .rc-how-section { padding-top: 40px; }
  .rc-faq { padding: 40px 20px 64px; }
  .rc-map-hint { left: 50%; top: 12px; }
  /* The legend folds into an "i" button; tapping it opens the list. */
  .rc-legend { padding: 0; }
  .rc-legend-toggle {
    display: grid; place-items: center;
    width: 34px; height: 34px;
    border: 0; border-radius: 10px;
    background: var(--p-card);
    font: italic 700 16px Georgia, serif;
    color: var(--p-ink);
    cursor: pointer;
  }
  .rc-legend-body { display: none; padding: 0 12px 10px; }
  .rc-legend.is-open .rc-legend-body { display: block; }
}
