/* =============================================================================
   Airovest design system — tokens + shell
   Prefix: av-*  (reusable across pages; Bootstrap remains for components/modals)
   ============================================================================= */

:root {
  /* Brand */
  --av-blue: #1a87ff;
  --av-green: #2ce093;
  --av-orange: #d8892f;
  --av-purple: #7c3aed;
  --av-gradient: linear-gradient(135deg, #1a87ff 0%, #2ce093 100%);
  --av-gradient-soft: linear-gradient(135deg, rgba(26, 135, 255, 0.18) 0%, rgba(44, 224, 147, 0.18) 100%);

  /* Layout */
  --av-sidebar-width: 16.5rem;
  --av-sidebar-collapsed: 4.5rem;
  --av-header-height: 3.75rem;
  --av-radius-sm: 0.65rem;
  --av-radius-md: 0.9rem;
  --av-radius-lg: 1.15rem;
  --av-radius-control: 0.75rem;
  --av-font: "Plus Jakarta Sans", system-ui, sans-serif;
  --av-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --av-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.18);
  --av-transition: 0.2s ease;

  /* Semantic (light defaults; dark overrides below) */
  --av-bg: #f3f6fb;
  --av-bg-elevated: #ffffff;
  --av-bg-muted: #eef2f7;
  --av-sidebar-bg: #ffffff;
  --av-sidebar-border: #e4eaf2;
  --av-header-bg: rgba(255, 255, 255, 0.86);
  --av-border: #d9e2ec;
  --av-border-strong: #c5d0dc;
  --av-text: #1f2933;
  --av-text-muted: #62748a;
  --av-text-subtle: #8492a6;
  --av-nav-hover: #f0f5fb;
  --av-nav-active-bg: var(--av-gradient-soft);
  --av-nav-active-fg: #0b5ed7;
  --av-input-bg: #f5f8fc;
  --av-danger: #e35d6a;
  --av-success: #2ce093;
  --av-table-head: #f5f7fa;
  --bs-body-font-family: var(--av-font);
  --bs-primary: #1a87ff;
  --bs-link-color: #1a87ff;
}

html[data-theme="dark"] {
  --av-bg: #0f141c;
  --av-bg-elevated: #171d28;
  --av-bg-muted: #1c2431;
  --av-sidebar-bg: #121821;
  --av-sidebar-border: #232b39;
  --av-header-bg: rgba(18, 24, 33, 0.88);
  --av-border: #2a3342;
  --av-border-strong: #3a4558;
  --av-text: #e8eef7;
  --av-text-muted: #9aa8bc;
  --av-text-subtle: #6f7f95;
  --av-nav-hover: #1a2230;
  --av-nav-active-bg: var(--av-gradient-soft);
  --av-nav-active-fg: #7ec2ff;
  --av-input-bg: #1a2230;
  --av-table-head: #1a2230;
  --av-shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45);
  --bs-body-bg: var(--av-bg);
  --bs-body-color: var(--av-text);
  --bs-border-color: var(--av-border);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  font-family: var(--av-font);
  color: var(--av-text);
  background: var(--av-bg);
  -webkit-font-smoothing: antialiased;
}

/* ----- Scrollbars (thin / modern; hide track chrome) ----- */

.av-scroll,
.av-sidebar-nav,
.av-main {
  scrollbar-width: thin;
  scrollbar-color: var(--av-border-strong) transparent;
}

.av-scroll::-webkit-scrollbar,
.av-sidebar-nav::-webkit-scrollbar,
.av-main::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.av-scroll::-webkit-scrollbar-track,
.av-sidebar-nav::-webkit-scrollbar-track,
.av-main::-webkit-scrollbar-track {
  background: transparent;
}

.av-scroll::-webkit-scrollbar-thumb,
.av-sidebar-nav::-webkit-scrollbar-thumb,
.av-main::-webkit-scrollbar-thumb {
  background: var(--av-border-strong);
  border-radius: 999px;
}

.av-scroll::-webkit-scrollbar-thumb:hover,
.av-sidebar-nav::-webkit-scrollbar-thumb:hover,
.av-main::-webkit-scrollbar-thumb:hover {
  background: var(--av-text-subtle);
}

/* Fully hide scrollbars when needed (keep scroll) */
.av-scroll-hidden {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.av-scroll-hidden::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* ----- Shell layout ----- */

.av-shell {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.av-sidebar {
  position: relative;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  flex: 0 0 var(--av-sidebar-width);
  width: var(--av-sidebar-width);
  max-width: var(--av-sidebar-width);
  height: 100%;
  background: var(--av-sidebar-bg);
  border-right: 1px solid var(--av-sidebar-border);
  transition: flex-basis var(--av-transition), width var(--av-transition), max-width var(--av-transition);
}

body.sb-sidenav-toggled .av-sidebar {
  flex-basis: var(--av-sidebar-collapsed);
  width: var(--av-sidebar-collapsed);
  max-width: var(--av-sidebar-collapsed);
}

.av-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

.av-page {
  flex: 1 1 auto;
  padding: 1.25rem 1.5rem 2rem;
}

/* ----- Brand / logo ----- */

.av-sidebar-brand {
  display: flex;
  align-items: center;
  height: var(--av-header-height);
  padding: 0 1rem;
  border-bottom: 1px solid var(--av-sidebar-border);
  overflow: hidden;
}

.av-brand-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  width: 100%;
  height: 2.5rem;
  text-decoration: none;
  color: var(--av-text);
}

.av-brand-mark {
  display: block;
  width: 1.85rem;
  height: 1.85rem;
  flex: 0 0 auto;
  object-fit: contain;
}

html[data-theme="dark"] .av-brand-mark {
  /* Color mark drafts include a black canvas; screen removes it on dark chrome */
  mix-blend-mode: screen;
}

.av-brand-wordmark {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

body.sb-sidenav-toggled .av-brand-link {
  justify-content: center;
  gap: 0;
}

body.sb-sidenav-toggled .av-brand-wordmark {
  display: none;
}

/* ----- Sidebar nav ----- */

.av-sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.85rem 0.65rem 1.25rem;
}

.av-nav-section + .av-nav-section {
  margin-top: 0.85rem;
}

.av-nav-section-label {
  padding: 0.35rem 0.75rem 0.45rem;
  color: var(--av-text-subtle);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

body.sb-sidenav-toggled .av-nav-section-label {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
}

.av-nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  margin-bottom: 0.2rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--av-radius-sm);
  color: var(--av-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--av-transition), color var(--av-transition);
}

.av-nav-item:hover {
  background: var(--av-nav-hover);
  color: var(--av-text);
}

.av-nav-item.active {
  background: var(--av-nav-active-bg);
  color: var(--av-nav-active-fg);
  box-shadow: inset 0 0 0 1px rgba(26, 135, 255, 0.25);
}

.av-nav-item.av-nav-child {
  width: calc(100% - 1.4rem);
  margin-left: 1.4rem;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  font-size: 0.85rem;
}

.av-nav-group-head {
  position: relative;
}

.av-nav-group-head .av-nav-item {
  padding-right: 2rem;
}

.av-nav-caret {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: var(--av-radius-sm);
  background: none;
  color: var(--av-text-muted);
  transform: translateY(-50%);
  cursor: pointer;
}

.av-nav-caret:hover {
  background: var(--av-nav-hover);
  color: var(--av-text);
}

.av-nav-caret svg {
  width: 0.95rem;
  height: 0.95rem;
  transition: transform var(--av-transition);
}

.av-nav-caret[aria-expanded="true"] svg {
  transform: rotate(90deg);
}

.av-nav-group.is-collapsed .av-nav-group-children {
  display: none;
}

body.sb-sidenav-toggled .av-nav-caret {
  display: none;
}

body.sb-sidenav-toggled .av-nav-group-head .av-nav-item {
  padding-right: 0.55rem;
}

.av-nav-item.is-disabled {
  color: var(--av-text-subtle);
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.av-nav-icon {
  display: inline-flex;
  flex: 0 0 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  align-items: center;
  justify-content: center;
}

.av-nav-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.av-nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

body.sb-sidenav-toggled .av-nav-item {
  justify-content: center;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

body.sb-sidenav-toggled .av-nav-item.av-nav-child {
  width: 100%;
  margin-left: 0;
}

body.sb-sidenav-toggled .av-nav-label {
  display: none;
}

/* ----- Header ----- */

.av-header {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  height: var(--av-header-height);
  padding: 0 1.25rem 0 1rem;
  background: var(--av-header-bg);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(10px);
  flex: 0 0 auto;
}

.av-header-left,
.av-header-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.av-header-right {
  justify-content: flex-end;
}

.av-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  color: var(--av-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.av-breadcrumb-sep {
  color: var(--av-text-subtle);
}

.av-breadcrumb-current {
  overflow: hidden;
  color: var(--av-text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ----- Icon button / theme ----- */

.av-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius-sm);
  background: var(--av-bg-elevated);
  color: var(--av-text-muted);
  cursor: pointer;
  transition: background var(--av-transition), color var(--av-transition), border-color var(--av-transition);
}

.av-icon-btn:hover {
  background: var(--av-nav-hover);
  color: var(--av-text);
  border-color: var(--av-border-strong);
}

.av-icon-btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

#av-theme-toggle,
#av-auth-theme-toggle,
#sidebarToggle {
  border: none;
  background: transparent;
}

#av-theme-toggle:hover,
#av-auth-theme-toggle:hover,
#sidebarToggle:hover {
  background: var(--av-nav-hover);
  border: none;
}

.av-theme-icon {
  display: none;
}

html[data-theme="dark"] .av-theme-icon--sun {
  display: block;
}

html[data-theme="light"] .av-theme-icon--moon {
  display: block;
}

/* ----- Profile ----- */

.av-profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: 18rem;
  height: 2.5rem;
  padding: 0.2rem 0.55rem 0.2rem 0.25rem;
  border: 1px solid var(--av-border);
  border-radius: 999px;
  background: var(--av-bg-elevated);
  color: var(--av-text);
  cursor: pointer;
  transition: border-color var(--av-transition), background var(--av-transition);
}

.av-profile-trigger:hover,
.av-profile-trigger[aria-expanded="true"] {
  border-color: var(--av-border-strong);
  background: var(--av-nav-hover);
}

.av-profile-avatar {
  display: inline-flex;
  flex: 0 0 1.9rem;
  width: 1.9rem;
  height: 1.9rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--av-gradient);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.av-profile-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.15;
  text-align: left;
}

.av-profile-name {
  overflow: hidden;
  max-width: 11rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.av-profile-role {
  color: var(--av-text-subtle);
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
}

.av-profile-caret {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--av-text-subtle);
}

.av-profile-menu {
  min-width: 17rem;
  margin-top: 0.4rem !important;
  padding: 0.4rem;
  border: 1px solid var(--av-border) !important;
  border-radius: var(--av-radius-md) !important;
  background: var(--av-bg-elevated) !important;
  box-shadow: var(--av-shadow-md);
}

.av-profile-credit {
  padding: 0.55rem 0.65rem;
  pointer-events: none;
}

.av-credit-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
}

.av-credit-toggle-end {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
}

.av-credit-caret {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--av-text-muted);
  transition: transform 0.15s ease;
}

.av-credit-toggle[aria-expanded="true"] .av-credit-caret {
  transform: rotate(90deg);
}

.av-credit-details {
  margin-top: 0.55rem;
}

.av-credit-heading {
  color: var(--av-text);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.av-credit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
  color: var(--av-text-muted);
  font-size: 0.78rem;
}

.av-credit-row strong {
  color: var(--av-text);
  font-weight: 600;
}

.av-credit-available {
  color: var(--av-green) !important;
}

.av-credit-track {
  display: flex;
  overflow: hidden;
  width: 100%;
  height: 0.55rem;
  margin: 0.55rem 0 0.4rem;
  border-radius: 999px;
  background: var(--av-bg-muted);
}

.av-credit-fill {
  height: 100%;
}

.av-credit-fill--used {
  background: var(--av-blue);
}

.av-credit-fill--available {
  background: rgba(44, 224, 147, 0.55);
}

.av-credit-fill--over {
  background: var(--av-danger);
}

.av-credit-legend {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 0.65rem;
  color: var(--av-text-subtle);
  font-size: 0.7rem;
  font-weight: 500;
}

.av-credit-swatch {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.3rem;
  border-radius: 999px;
  vertical-align: middle;
}

.av-credit-swatch--used {
  background: var(--av-blue);
}

.av-credit-swatch--available {
  background: rgba(44, 224, 147, 0.75);
}

.av-credit-overusage {
  padding-top: 0.45rem;
  border-top: 1px solid var(--av-border);
}

.av-credit-track--over {
  margin-top: 0.4rem;
  margin-bottom: 0;
  background: var(--av-bg-muted);
}

.av-profile-menu .dropdown-divider {
  border-color: var(--av-border);
  opacity: 1;
}

.av-profile-item {
  display: flex !important;
  align-items: center;
  gap: 0.6rem;
  border-radius: 0.45rem;
  color: var(--av-text) !important;
  font-size: 0.875rem;
  font-weight: 500;
}

.av-profile-item svg {
  width: 1rem;
  height: 1rem;
  color: var(--av-text-muted);
}

.av-profile-item:hover,
.av-profile-item:focus {
  background: var(--av-nav-hover) !important;
}

.av-profile-item--danger {
  color: var(--av-danger) !important;
}

.av-profile-item--danger svg {
  color: var(--av-danger);
}

/* ----- Reusable buttons ----- */

.btn,
.form-control,
.form-select {
  border-radius: var(--av-radius-control) !important;
}

/* Reconnect Bootstrap input-group corners (global radius uses !important). */
.input-group > :first-child:not(:last-child) {
  border-top-left-radius: var(--av-radius-control) !important;
  border-bottom-left-radius: var(--av-radius-control) !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.input-group > :last-child:not(:first-child) {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  border-top-right-radius: var(--av-radius-control) !important;
  border-bottom-right-radius: var(--av-radius-control) !important;
}

.input-group > :not(:first-child):not(:last-child) {
  border-radius: 0 !important;
}

.btn-primary,
.av-btn-primary {
  border: none !important;
  background-image: none !important;
  background-color: var(--av-blue) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(26, 135, 255, 0.22);
}

.btn-primary:hover,
.btn-primary:focus,
.av-btn-primary:hover,
.av-btn-primary:focus {
  background-color: #1576e0 !important;
  background-image: none !important;
  color: #fff !important;
  filter: none;
}

.btn-primary:active,
.av-btn-primary:active {
  background-color: #1266c4 !important;
}

.btn-outline-primary {
  color: var(--av-blue) !important;
  border-color: rgba(26, 135, 255, 0.45) !important;
}

.btn-outline-primary:hover {
  background: rgba(26, 135, 255, 0.12) !important;
  color: var(--av-nav-active-fg) !important;
}

/* .btn-outline-primary's own color:!important above would otherwise win
   over Bootstrap's .btn-check:checked+.btn-outline-primary rule, leaving
   checked-state text the same blue as the now-solid-blue background it
   sits on (e.g. Property Scout's LTR/Flip job-type toggle) -- matches
   .btn-primary's own white-on-blue treatment above. */
.btn-check:checked + .btn-outline-primary {
  color: #fff !important;
  background-color: var(--av-blue) !important;
  border-color: var(--av-blue) !important;
}

/* Same fix, for plain (non btn-check) toggle buttons using Bootstrap's
   .active class directly -- e.g. the "both" job results page's Flip/LTR
   view toggle. */
.btn-outline-primary.active {
  color: #fff !important;
  background-color: var(--av-blue) !important;
  border-color: var(--av-blue) !important;
}

/* Solid green primary variant when needed */
.av-btn-green,
.btn-success.av-btn-green {
  border: none !important;
  background-image: none !important;
  background-color: var(--av-green) !important;
  color: #0a1f14 !important;
}

.av-btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.av-btn-icon svg {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.ps-row-attention td:first-child {
  box-shadow: inset 3px 0 0 #f5a524;
}

.ps-attention {
  display: inline-flex;
  margin-right: 0.35rem;
  color: #f5a524;
  vertical-align: -0.15rem;
}

.ps-attention svg {
  width: 1rem;
  height: 1rem;
}

/* ----- Surfaces used by pages (theme-aware) ----- */

.realsearch-page {
  color: var(--av-text);
}

.realsearch-filter-bar,
.realsearch-fetch-panel,
.realsearch-results {
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius-md);
  background: var(--av-bg-elevated);
  padding: 1rem;
  box-shadow: var(--av-shadow-sm);
}

.realsearch-filter-bar .form-label,
.realsearch-fetch-panel .form-label {
  margin-bottom: 0.25rem;
  color: var(--av-text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.realsearch-table-wrap {
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius-sm);
  max-height: 62vh;
  background: var(--av-bg-elevated);
}

.realsearch-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--av-table-head);
  color: var(--av-text-muted);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
}

.realsearch-table-wrap tbody td {
  font-size: 0.875rem;
  white-space: nowrap;
  color: var(--av-text);
  border-color: var(--av-border);
}

.realsearch-address {
  min-width: 18rem;
  white-space: normal !important;
}

.realsearch-pagination,
.av-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  min-height: 2.5rem;
  margin-top: 0.85rem;
  padding: 0;
  border: none;
  background: transparent;
}

.av-pagination-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.av-pagination-status {
  color: var(--av-text);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}

.av-pagination-hint {
  color: var(--av-text-subtle);
  font-size: 0.75rem;
  font-weight: 500;
}

.av-pagination-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.av-pagination-per-page {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--av-text-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.av-pagination-per-page .form-control,
.av-pagination-per-page .form-select {
  width: 4.75rem;
  height: 2.15rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
}

.av-pagination-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem;
  border: 1px solid var(--av-border);
  border-radius: 999px;
  background: var(--av-bg-muted);
}

.av-pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 2.15rem;
  height: 2.15rem;
  padding: 0 0.75rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--av-text);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--av-transition), color var(--av-transition), opacity var(--av-transition);
}

.av-pagination-btn svg {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.av-pagination-btn:hover:not(:disabled) {
  background: var(--av-bg-elevated);
  color: var(--av-blue);
}

.av-pagination-btn:disabled {
  color: var(--av-text-subtle);
  cursor: not-allowed;
  opacity: 0.55;
}

.av-pagination-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  height: 2.15rem;
  padding: 0 0.65rem;
  border-radius: 999px;
  background: var(--av-bg-elevated);
  color: var(--av-text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: var(--av-shadow-sm);
}

/* ----- Listing tables (Patch-inspired open style) ----- */

.av-listing-wrap {
  overflow-x: auto;
}

.av-listing-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.75rem;
}

.av-listing-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.av-listing-section-title {
  margin: 0;
  color: var(--av-text);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.av-listing-section-count {
  color: var(--av-text-subtle);
  font-weight: 600;
}

.av-listing-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--av-text);
  background: transparent;
}

.av-listing-table > :not(caption) > * > * {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.av-listing-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.7rem 0.85rem;
  border-bottom: none !important;
  background: var(--av-bg-muted) !important;
  color: var(--av-text-subtle) !important;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.av-listing-table tbody td {
  padding: 1rem 0.85rem;
  border-bottom: 1px solid var(--av-border) !important;
  vertical-align: middle;
  white-space: nowrap;
}

.av-listing-table tbody tr:last-child td {
  border-bottom-color: transparent !important;
}

.av-listing-table.table-hover > tbody > tr:hover > * {
  --bs-table-bg-state: transparent;
  background: color-mix(in srgb, var(--av-nav-hover) 70%, transparent) !important;
}

.av-listing-table tbody tr.av-listing-row {
  cursor: default;
}

.av-listing-prop {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 14rem;
  white-space: normal;
}

.av-listing-prop-title {
  color: var(--av-text);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.av-listing-prop-title-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.av-listing-prop-title:hover {
  color: var(--av-blue);
}

.av-listing-prop-meta {
  color: var(--av-text-subtle);
  font-size: 0.75rem;
  line-height: 1.35;
}

.av-listing-prop-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

/* Row wrapper so a .av-photo-thumb sits beside .av-listing-prop instead of
   stacking above it -- .av-listing-prop itself is flex-direction: column. */
.av-listing-prop-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

/* Favorites/Property Comps rows only (not Scout Results, which shares
   .av-listing-prop-row but keeps the base 1rem cell padding and a
   smaller 72px thumbnail) -- bumping the thumbnail to 96px made the
   shared padding read as oversized, and flex-start left the address
   block sitting flush with the photo's top edge instead of centered
   alongside it. */
.av-listing-table tbody td.av-listing-photo-cell {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.av-listing-photo-cell .av-listing-prop-row {
  align-items: center;
}

/* Lazy property-photo thumbnail (docs/propthumb-webapp-handoff.md) --
   js/utils.js's propertyPhotoThumbHtml/initPropertyPhotoThumbs fill the
   <img> src and attribution in only once it scrolls into view. */
.av-photo-thumb {
  position: relative;
  display: inline-block;
  overflow: hidden;
  border-radius: 3px;
  background: var(--av-bg-muted);
  border: 1px solid var(--av-border);
  flex-shrink: 0;
}

.av-photo-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.av-photo-thumb-attribution {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.55rem;
  line-height: 1.3;
  padding: 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.av-listing-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  line-height: 1.2;
}

.av-listing-stack--center {
  align-items: center;
  text-align: center;
}

.av-listing-stack-value {
  color: var(--av-text);
  font-size: 0.9rem;
  font-weight: 700;
}

.av-listing-stack-value.is-positive {
  color: var(--av-green);
}

.av-listing-stack-value.is-warn {
  color: #d8892f;
}

.av-listing-stack-value.is-negative {
  color: var(--av-danger);
}

.av-listing-stack-label {
  color: var(--av-text-subtle);
  font-size: 0.68rem;
  font-weight: 500;
}

/* Favorites table's Type column legend -- Flip is its own favorites scope
   now (2026-09-11 split: a property analyzed both ways is two independent
   rows, not one row stacking both workflows' values), so this is the one
   badge that tells the two apart at a glance. LTR uses the app's own blue
   accent; Flip keeps the existing orange. Also reused on Property Notes'
   own list (favorite_scopes badges) since a note's property can carry any
   combination of the three scopes now. */
.rs-fav-type-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.rs-fav-type-badge--flip {
  background: rgba(217, 119, 6, 0.14);
  color: #92400e;
}

.rs-fav-type-badge--ltr {
  background: rgba(26, 135, 255, 0.14);
  color: var(--av-blue);
}

/* Same purple as Favorites' own Comps stat card (.rs-stat-card--purple,
   #8b7cf6) -- matches reports.js's own SCOPE_BADGE.comps. */
.rs-fav-type-badge--comps {
  background: rgba(139, 124, 246, 0.14);
  color: #8b7cf6;
}

.rs-fav-dual-value {
  color: var(--av-text);
  font-size: 0.78rem;
  font-weight: 700;
}

.rs-fav-dual-value.is-positive {
  color: var(--av-green);
}

.rs-fav-dual-value.is-negative {
  color: var(--av-danger);
}

.av-listing-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.av-listing-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--av-text-subtle);
  cursor: pointer;
  transition: background var(--av-transition), color var(--av-transition);
}

.av-listing-icon-btn:hover {
  background: var(--av-nav-hover);
  color: var(--av-text);
}

.av-listing-icon-btn.is-active {
  color: var(--av-blue);
}

.av-listing-icon-btn.is-danger {
  color: var(--av-danger);
}

.av-listing-icon-btn svg {
  width: 0.95rem;
  height: 0.95rem;
}

.av-listing-chevron {
  color: var(--av-text-subtle);
  font-size: 1rem;
  line-height: 1;
}

/* Active/pressed state for the Property Search location bar (Clear, Search,
   Filters) and the map overlay toggle buttons (layer + DOM) — !important
   because several of these buttons also carry their own inline background
   (e.g. the DOM toggle's white "off" background), which would otherwise
   win. Reuses the brand gradient token rather than a one-off color pair.
   Opacity is deliberately NOT set here — each of these buttons needs a
   different value (see their inline styles / properties.js), so it's
   controlled per-element instead of forced by this shared class.
   Class chained 3x (not a typo) so specificity (0,3,0) beats compound
   Bootstrap override selectors like `.btn-outline-secondary:focus` (0,2,0)
   — the Filters button is still `.btn-outline-secondary` underneath, and
   without this a mere :focus/:hover after clicking it silently wins back
   over the gradient regardless of source order in this file. */
.rs-gradient-btn.rs-gradient-btn.rs-gradient-btn {
  background: var(--av-gradient) !important;
  border-color: transparent !important;
  color: #fff !important;
}

.av-listing-row--qualified > td {
  background: color-mix(in srgb, var(--av-green) 7%, transparent) !important;
}

.av-listing-row--pinned > td {
  background: color-mix(in srgb, var(--av-blue) 7%, transparent) !important;
}

.av-listing-row--disqualified > td {
  background: color-mix(in srgb, var(--av-orange) 7%, transparent) !important;
}

.av-listing-row--template > td {
  background: color-mix(in srgb, var(--av-purple) 7%, transparent) !important;
}

.av-listing-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(26, 135, 255, 0.12);
  color: var(--av-blue);
  font-size: 0.65rem;
  font-weight: 700;
}

.av-listing-tag--success {
  background: rgba(44, 224, 147, 0.16);
  color: #1aa86a;
}

.av-listing-tag--warn {
  background: rgba(240, 160, 75, 0.16);
  color: #d8892f;
}

.av-listing-tag--muted {
  background: var(--av-bg-muted);
  color: var(--av-text-subtle);
}

.rs-fav-section-header > td {
  padding: 0.45rem 0.75rem !important;
  border-color: var(--av-border) !important;
  background: var(--av-bg-muted) !important;
  color: var(--av-text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: default;
}

.rs-fav-section-header--muted > td {
  color: var(--av-text-subtle);
  cursor: default;
}

.rs-fav-section-header.rs-fav-qualified-header > td,
.rs-fav-section-header.rs-fav-disqualified-header > td {
  cursor: pointer;
}

.rs-fav-section-caret {
  display: inline-block;
  width: 0.85rem;
}

.rs-conf-badge {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--av-border);
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 600;
  white-space: nowrap;
}

.rs-conf-badge--strong {
  background: rgba(44, 224, 147, 0.16);
  color: #1aa86a;
  border-color: rgba(44, 224, 147, 0.35);
}

.rs-conf-badge--marginal {
  background: rgba(240, 160, 75, 0.16);
  color: #d8892f;
  border-color: rgba(240, 160, 75, 0.35);
}

.rs-conf-badge--low,
.rs-conf-badge--none {
  background: var(--av-bg-muted);
  color: var(--av-text-subtle);
}

/* Welcome / page title */
.rs-home {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.rs-home-welcome {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.rs-home-welcome-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.rs-home-welcome-copy {
  min-width: min(100%, 16rem);
  flex: 1 1 auto;
}

.rs-home-date {
  margin-bottom: 0.55rem;
  color: var(--av-text-subtle);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rs-home-title {
  margin: 0;
  color: var(--av-text);
  font-size: clamp(1.75rem, 2.4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.rs-home-title-accent {
  color: var(--av-blue);
}

.rs-home-lead {
  margin: 0;
  width: 100%;
  max-width: none;
  color: var(--av-text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.rs-home-lead strong {
  color: var(--av-text);
  font-weight: 600;
}

.rs-home-welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  flex: 0 0 auto;
}

/* Feature guide — Property Search / Property Scout intro cards */
.rs-home-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.rs-feature-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius-lg);
  background: var(--av-bg-elevated);
  padding: 1.25rem 1.35rem 1.35rem;
  box-shadow: var(--av-shadow-sm);
}

.rs-feature-card-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.65rem;
  color: #fff;
}

.rs-feature-card-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.rs-feature-card--blue .rs-feature-card-icon { background: var(--av-blue); }
.rs-feature-card--purple .rs-feature-card-icon { background: #8b7cf6; }
.rs-feature-card--orange .rs-feature-card-icon { background: var(--av-orange); }

.rs-feature-card-title {
  margin: 0;
  color: var(--av-text);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.rs-feature-card-desc {
  margin: 0;
  flex: 1 1 auto;
  color: var(--av-text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.rs-feature-card-cta {
  align-self: flex-start;
}

/* Property Search / Property Scout CTA buttons — distinct colors per card
   (previously both plain Bootstrap primary blue, no differentiation).
   !important because .btn-primary's own background-color is !important
   (see its rule above) and would otherwise win regardless of specificity. */
.rs-feature-card--blue .rs-feature-card-cta { background: #1a87ff !important; border-color: #1a87ff !important; }
.rs-feature-card--purple .rs-feature-card-cta { background: #2ce093 !important; border-color: #2ce093 !important; }
.rs-feature-card--orange .rs-feature-card-cta { background: var(--av-orange) !important; border-color: var(--av-orange) !important; }

/* Shared card chrome */
.av-card {
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius-lg);
  background: var(--av-bg-elevated);
  padding: 1.15rem 1.25rem 1.25rem;
  box-shadow: var(--av-shadow-sm);
}

.rs-client-records {
  padding-top: 0.35rem;
}

.rs-client-tabs {
  display: flex;
  gap: 0.15rem;
  margin: 0 -0.35rem 0.9rem;
  border-bottom: 1px solid var(--av-border);
}

.rs-client-tab {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.7rem 0.85rem 0.65rem;
  color: var(--av-text-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.rs-client-tab:hover,
.rs-client-tab:focus-visible {
  color: var(--av-text);
  outline: none;
}

.rs-client-tab.active {
  color: var(--av-text);
  border-bottom-color: var(--av-blue);
}

.rs-client-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--av-bg-muted);
  color: var(--av-text-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.rs-client-tab.active .rs-client-tab-count {
  background: var(--av-nav-active-bg);
  color: var(--av-nav-active-fg);
}

.av-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.av-card-eyebrow {
  margin-bottom: 0.3rem;
  color: var(--av-text-subtle);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.av-card-title {
  margin: 0;
  color: var(--av-text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
}

.av-card-meta {
  color: var(--av-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.av-card-desc {
  margin: 0 0 1rem;
  color: var(--av-text-muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.rs-home-section {
  min-width: 0;
}

/* Stat counters — each its own container */
.rs-home-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
}

.rs-fav-stats {
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
}

.rs-stat-card {
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius-lg);
  background: var(--av-bg-elevated);
  padding: 1rem 1.05rem 1.1rem;
  box-shadow: var(--av-shadow-sm);
  min-width: 0;
}

.rs-stat-card-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  min-width: 0;
}

.rs-stat-card-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 0.55rem;
  color: #fff;
}

.rs-stat-card-icon svg {
  width: 1rem;
  height: 1rem;
}

.rs-stat-card--blue .rs-stat-card-icon { background: var(--av-blue); }
.rs-stat-card--green .rs-stat-card-icon { background: var(--av-green); color: #0a1f14; }
.rs-stat-card--purple .rs-stat-card-icon { background: #8b7cf6; }
.rs-stat-card--orange .rs-stat-card-icon { background: #f0a04b; color: #1f1408; }

/* Sale/sold/rental/rented tones — dedicated rather than reusing the generic
   blue/green/purple/orange above (those are shared with other features,
   e.g. Favorites' disqualified tab), matching LISTING_TYPE_COLORS
   (properties-core.js) so Home's icons mean the same thing the map dots do. */
.rs-stat-card--sale   .rs-stat-card-icon { background: #7eb8ff; color: #0a2540; }
.rs-stat-card--sold   .rs-stat-card-icon { background: #1a87ff; }
.rs-stat-card--rental .rs-stat-card-icon { background: #8aefc3; color: #0a1f14; }
.rs-stat-card--rented .rs-stat-card-icon { background: #1fae75; }

.rs-stat-card-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--av-text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Home page's own stat cards -- the label doubles as a shortcut to the page
   it summarizes (see home.js). Same look as the plain (non-link) label
   elsewhere; only the hover state signals it's clickable. */
.rs-stat-card-label-link {
  text-decoration: none;
}
.rs-stat-card-label-link:hover,
.rs-stat-card-label-link:focus-visible {
  color: var(--av-blue);
  text-decoration: underline;
}

.rs-stat-card-badge {
  flex: 0 0 auto;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--av-bg-muted);
  color: var(--av-text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.rs-stat-card--blue .rs-stat-card-badge { background: rgba(26, 135, 255, 0.14); color: var(--av-blue); }
.rs-stat-card--green .rs-stat-card-badge { background: rgba(44, 224, 147, 0.16); color: #1aa86a; }
.rs-stat-card--purple .rs-stat-card-badge { background: rgba(139, 124, 246, 0.16); color: #8b7cf6; }
.rs-stat-card--orange .rs-stat-card-badge { background: rgba(240, 160, 75, 0.18); color: #d8892f; }

.rs-stat-card--sale   .rs-stat-card-badge { background: rgba(126, 184, 255, 0.20); color: #1a87ff; }
.rs-stat-card--sold   .rs-stat-card-badge { background: rgba(26, 135, 255, 0.14); color: #1a87ff; }
.rs-stat-card--rental .rs-stat-card-badge { background: rgba(138, 239, 195, 0.24); color: #1fae75; }
.rs-stat-card--rented .rs-stat-card-badge { background: rgba(31, 174, 117, 0.16); color: #1fae75; }

/* Comps/Flip/LTR cards' own report count doubles as a shortcut into
   Reports, pre-filtered to that scope (see home.js's own badgeReportType) --
   inherits its tone's own badge coloring above, only the hover/focus state
   signals it's clickable. */
a.rs-stat-card-badge-link {
  cursor: pointer;
  text-decoration: none;
}
a.rs-stat-card-badge-link:hover,
a.rs-stat-card-badge-link:focus-visible {
  text-decoration: underline;
}

.rs-stat-card-value {
  margin-bottom: 0.45rem;
  color: var(--av-text);
  font-size: clamp(2.1rem, 3vw, 2.65rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

/* The big number itself doubles as a shortcut into Favorites for cards with
   no Active/Qualified/Disqualified breakdown of their own (Property Comps)
   -- see home.js's own valueFavTab. `<a>` needs display:block to keep the
   plain <div> version's own block layout/spacing. */
a.rs-stat-card-value-link {
  display: block;
  text-decoration: none;
}
a.rs-stat-card-value-link:hover,
a.rs-stat-card-value-link:focus-visible {
  color: var(--av-blue);
  text-decoration: underline;
}

.rs-stat-card-detail {
  margin: 0;
  color: var(--av-text-subtle);
  font-size: 0.78rem;
  line-height: 1.45;
}

/* Flip/LTR cards' own Active/Qualified/Disqualified breakdown -- each
   number links into the matching Favorites tab (see home.js's favTabLink). */
.rs-stat-card-metric-link {
  color: inherit;
  text-decoration: none;
}
.rs-stat-card-metric-link:hover,
.rs-stat-card-metric-link:focus-visible {
  color: var(--av-blue);
  text-decoration: underline;
}

.rs-stat-card-detail strong {
  color: var(--av-text-muted);
  font-weight: 600;
}

.rs-stat-card--clickable {
  cursor: pointer;
  transition: border-color var(--av-transition), box-shadow var(--av-transition);
}

.rs-stat-card--clickable:hover {
  border-color: var(--av-border-strong, var(--av-border));
  box-shadow: var(--av-shadow-md);
}

.rs-stat-card--clickable:focus-visible {
  outline: 2px solid var(--av-blue);
  outline-offset: 2px;
}

.rs-stat-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.85rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--av-border);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--av-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background var(--av-transition), color var(--av-transition), border-color var(--av-transition);
}

.rs-stat-card-action:hover {
  background: var(--av-nav-hover);
  color: var(--av-text);
  border-color: var(--av-border-strong, var(--av-border));
}

.rs-stat-card.is-active {
  border-color: color-mix(in srgb, var(--av-blue) 45%, var(--av-border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--av-blue) 25%, transparent);
}

.rs-stat-card--green.is-active {
  border-color: color-mix(in srgb, var(--av-green) 45%, var(--av-border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--av-green) 25%, transparent);
}

.rs-stat-card--orange.is-active {
  border-color: color-mix(in srgb, #f0a04b 45%, var(--av-border));
  box-shadow: 0 0 0 1px color-mix(in srgb, #f0a04b 25%, transparent);
}

.rs-stat-card.is-active .rs-stat-card-action {
  background: color-mix(in srgb, var(--av-blue) 12%, transparent);
  border-color: color-mix(in srgb, var(--av-blue) 35%, var(--av-border));
  color: var(--av-blue);
}

.rs-stat-card--green.is-active .rs-stat-card-action {
  background: color-mix(in srgb, var(--av-green) 14%, transparent);
  border-color: color-mix(in srgb, var(--av-green) 35%, var(--av-border));
  color: #1aa86a;
}

.rs-stat-card--purple.is-active {
  border-color: color-mix(in srgb, #8b7cf6 45%, var(--av-border));
  box-shadow: 0 0 0 1px color-mix(in srgb, #8b7cf6 25%, transparent);
}

.rs-stat-card--purple.is-active .rs-stat-card-action {
  background: color-mix(in srgb, #8b7cf6 14%, transparent);
  border-color: color-mix(in srgb, #8b7cf6 35%, var(--av-border));
  color: #8b7cf6;
}

.rs-stat-card--green.is-active .rs-stat-card-action {
  background: color-mix(in srgb, var(--av-green) 14%, transparent);
  border-color: color-mix(in srgb, var(--av-green) 35%, var(--av-border));
  color: #1aa86a;
}

.rs-stat-card--orange.is-active .rs-stat-card-action {
  background: color-mix(in srgb, #f0a04b 14%, transparent);
  border-color: color-mix(in srgb, #f0a04b 35%, var(--av-border));
  color: #d8892f;
}

.av-listing-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.25rem 0 1rem;
  padding: 0.3rem;
  border: 1px solid var(--av-border);
  border-radius: 0.75rem;
  background: var(--av-bg-muted);
}

.av-listing-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border: none;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--av-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background var(--av-transition), color var(--av-transition);
}

.av-listing-tab:hover {
  color: var(--av-text);
  background: color-mix(in srgb, var(--av-bg-elevated) 70%, transparent);
}

.av-listing-tab.is-active {
  background: var(--av-bg-elevated);
  color: var(--av-text);
  box-shadow: var(--av-shadow-sm);
}

.av-listing-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--av-text) 8%, transparent);
  color: var(--av-text-subtle);
  font-size: 0.7rem;
  font-weight: 700;
}

.av-listing-tab.is-active .av-listing-tab-count {
  background: color-mix(in srgb, var(--av-blue) 14%, transparent);
  color: var(--av-blue);
}

.av-listing-tab-panels {
  min-width: 0;
}

.av-listing-tab-panel[hidden] {
  display: none !important;
}

/* App-wide toast stack */
.av-toast-container {
  top: auto;
  bottom: 1.25rem;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  z-index: 1090;
  width: min(26rem, calc(100vw - 2rem));
  pointer-events: none;
}

.av-toast-container .toast {
  pointer-events: auto;
  width: 100%;
  box-shadow: var(--av-shadow-md, 0 0.5rem 1.25rem rgba(0, 0, 0, 0.28));
}

.av-toast .toast-body {
  font-size: 0.9rem;
  font-weight: 500;
}

.av-toast--warning .btn-close {
  filter: none;
}

.rs-coverage-table {
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius-md);
  max-height: 26rem;
  background: var(--av-bg-elevated);
}

.rs-coverage-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--av-table-head);
  color: var(--av-text-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.rs-coverage-table tbody td {
  color: var(--av-text-muted);
  font-size: 0.875rem;
  white-space: nowrap;
  border-color: var(--av-border);
}

/* Bootstrap surfaces — theme-aware (light + dark) */
.table,
.form-control,
.form-select,
.modal-content,
.card,
.list-group-item,
.offcanvas,
.dropdown-menu {
  color: var(--av-text);
  background-color: var(--av-bg-elevated);
  border-color: var(--av-border);
}

.form-control,
.form-select {
  background-color: var(--av-input-bg);
}

.form-control:focus,
.form-select:focus {
  background-color: var(--av-input-bg);
  color: var(--av-text);
  border-color: rgba(26, 135, 255, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(26, 135, 255, 0.2);
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly],
.rs-readonly-input {
  background-color: var(--av-bg-muted) !important;
  color: var(--av-text-muted) !important;
  cursor: default;
  opacity: 1;
}

.input-group-text {
  color: var(--av-text-muted);
  background-color: var(--av-bg-muted);
  border-color: var(--av-border);
}

.sp-min-coc-group {
  width: auto;
  flex-wrap: nowrap;
}

.sp-min-coc-group > .btn {
  z-index: 1;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.sp-min-coc-group > .form-control {
  width: 3.5rem;
  min-width: 3.5rem;
  border-radius: 0 !important;
}

.sp-min-coc-group > .input-group-text {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

.sp-min-coc-group > .btn:focus,
.sp-min-coc-group > .form-control:focus {
  z-index: 3;
}

.table > :not(caption) > * > * {
  background-color: transparent;
  color: var(--av-text);
  border-color: var(--av-border);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-bg-type: var(--av-bg-muted);
  color: var(--av-text);
}

.table-hover > tbody > tr:hover > * {
  --bs-table-bg-state: var(--av-nav-hover);
  color: var(--av-text);
}

.table thead th {
  color: var(--av-text-muted);
  background: var(--av-table-head);
  border-color: var(--av-border);
}

.modal-header,
.modal-footer,
.card-header,
.card-footer,
.offcanvas-header {
  color: var(--av-text);
  background-color: var(--av-bg-elevated);
  border-color: var(--av-border);
}

.modal-body,
.offcanvas-body,
.card-body {
  color: var(--av-text);
  background-color: var(--av-bg-elevated);
}

.modal-title,
.offcanvas-title {
  color: var(--av-text);
  font-weight: 700;
}

.btn-close {
  filter: none;
  opacity: 0.65;
}

html[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%);
}

.text-muted,
.form-text {
  color: var(--av-text-muted) !important;
}

.bg-light,
.bg-white {
  background-color: var(--av-bg-elevated) !important;
}

.border,
.border-bottom,
.border-top,
.border-end,
.border-start {
  border-color: var(--av-border) !important;
}

.alert-secondary {
  color: var(--av-text);
  background-color: var(--av-bg-muted);
  border-color: var(--av-border);
}

.alert-danger {
  color: #9b2433;
  background-color: rgba(227, 93, 106, 0.12);
  border-color: rgba(227, 93, 106, 0.4);
}

html[data-theme="dark"] .alert-danger {
  color: #fff;
  background-color: rgba(227, 93, 106, 0.2);
  border-color: rgba(227, 93, 106, 0.45);
}

.btn-outline-secondary {
  color: var(--av-text-muted) !important;
  border-color: var(--av-border-strong) !important;
  background: transparent !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  color: var(--av-text) !important;
  background: var(--av-nav-hover) !important;
  border-color: var(--av-border-strong) !important;
}

.btn-secondary {
  color: var(--av-text) !important;
  background-color: var(--av-bg-muted) !important;
  border-color: var(--av-border) !important;
}

.btn-secondary:hover {
  background-color: var(--av-nav-hover) !important;
  color: var(--av-text) !important;
}

.progress {
  background-color: var(--av-bg-muted);
}

.dropdown-item {
  color: var(--av-text);
}

.dropdown-item:hover,
.dropdown-item:focus {
  color: var(--av-text);
  background-color: var(--av-nav-hover);
}

.rs-property-scout {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: var(--av-text);
}

#sp-view-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sp-tips-modal-content .modal-header {
  align-items: flex-start;
}

.sp-tips-step-title {
  margin: 0 0 0.55rem;
  color: var(--av-text);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sp-tips-step-body {
  color: var(--av-text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.sp-tips-dots {
  display: flex;
  justify-content: flex-start;
  gap: 0.4rem;
  margin-top: 1.15rem;
}

.sp-tips-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--av-border-strong);
  transition: background var(--av-transition), transform var(--av-transition);
}

.sp-tips-dot.is-active {
  background: var(--av-blue);
  transform: scale(1.15);
}

.sp-tips-footer {
  flex-wrap: wrap;
  gap: 0.45rem;
}

.sp-tips-footer .btn-link {
  text-decoration: none;
}

.sp-tips-footer .btn-link:hover {
  text-decoration: underline;
}

.sp-rerun-modal-content .modal-header {
  align-items: flex-start;
}

.sp-rerun-points {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sp-rerun-point {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius-md);
  background: var(--av-bg-muted);
}

.sp-rerun-point--danger {
  border-color: color-mix(in srgb, var(--av-danger) 35%, var(--av-border));
  background: color-mix(in srgb, var(--av-danger) 10%, var(--av-bg-elevated));
}

.sp-rerun-point-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  background: color-mix(in srgb, var(--av-blue) 14%, transparent);
  color: var(--av-blue);
}

.sp-rerun-point--danger .sp-rerun-point-icon {
  background: color-mix(in srgb, var(--av-danger) 16%, transparent);
  color: var(--av-danger);
}

.sp-rerun-point-icon svg {
  width: 1rem;
  height: 1rem;
}

.sp-rerun-point-title {
  margin: 0 0 0.2rem;
  color: var(--av-text);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sp-rerun-point--danger .sp-rerun-point-title {
  color: var(--av-danger);
}

.sp-rerun-point-body {
  color: var(--av-text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.sp-rerun-footer {
  gap: 0.5rem;
}

#sp-view-list > .rs-home-welcome {
  margin-bottom: 0.5rem;
}

#sp-view-wizard,
#sp-view-running,
#sp-view-results,
#sp-view-history {
  color: var(--av-text);
}

#sp-view-wizard .card {
  border: 1.5px solid rgba(26, 135, 255, 0.32);
  border-radius: var(--av-radius-lg);
  background: var(--av-bg-elevated);
  box-shadow: var(--av-shadow-sm);
  overflow: hidden;
}

/* Step 2's not-yet-reached cards, before their Next button is clicked --
   header stays visible (so the walkthrough's shape is legible up front),
   body is hidden rather than just dimmed so there's nothing to interact
   with before its own Next button reveals it. */
#sp-view-wizard .card.sp-step2-locked {
  border-color: var(--av-border);
  box-shadow: none;
}

#sp-view-wizard .card.sp-step2-locked > .card-header {
  color: var(--av-text-muted);
}

#sp-view-wizard .card.sp-step2-locked > .card-body {
  display: none;
}

.sp-wizard-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--av-border);
}

/* Pins Save as Template to the footer's left edge -- everything after it
   (Back/Next/Save/Save & Run) still flex-end's to the right as a group. */
#sp-wizard-save-template-btn {
  margin-right: auto;
}

/* Back/Next (header copies and footer) are a matched dark-grey-outlined
   pair -- .btn-outline-secondary's app-wide grey (--av-text-muted/
   --av-border-strong) read too washed out, plain black read too distinct;
   this is the middle ground, applied to both Back's existing class and
   Next's .btn-primary so .btn-primary's own solid blue fill loses it too.
   Save/Save & Run are the blue-outlined pair instead (see their own
   .btn-outline-primary below), so color is what separates "navigate"
   from "persist" here, not fill vs. outline. */
.sp-wizard-nav-btn.btn-outline-secondary,
.sp-wizard-nav-btn.btn-primary {
  color: #475569 !important;
  border: 1.5px solid #475569 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.sp-wizard-nav-btn.btn-outline-secondary:hover,
.sp-wizard-nav-btn.btn-outline-secondary:focus,
.sp-wizard-nav-btn.btn-primary:hover,
.sp-wizard-nav-btn.btn-primary:focus,
.sp-wizard-nav-btn.btn-primary:active {
  color: #334155 !important;
  background: var(--av-nav-hover) !important;
  border-color: #334155 !important;
  box-shadow: none !important;
}

/* Save as Template is the purple-outlined odd one out -- id selector for
   specificity over .btn-outline-primary's own blue (used as-is by
   Save/Save & Run below). */
#sp-wizard-save-template-btn {
  color: var(--av-purple) !important;
  border-color: var(--av-purple) !important;
}

#sp-wizard-save-template-btn:hover,
#sp-wizard-save-template-btn:focus {
  color: var(--av-purple) !important;
  background: color-mix(in srgb, var(--av-purple) 12%, transparent) !important;
  border-color: var(--av-purple) !important;
}

.sp-review-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sp-review-row {
  padding: 0.55rem 0.75rem;
  border-radius: var(--av-radius-control);
  background: var(--av-bg-muted);
}

html[data-theme="dark"] .sp-review-row {
  background: color-mix(in srgb, var(--av-bg-muted) 88%, var(--av-border));
}

.sp-radius-limit-banner {
  padding: 0.75rem 0.9rem;
  border-radius: var(--av-radius-control);
  border: 1px solid rgba(202, 138, 4, 0.45);
  background: #fef9c3;
  color: #713f12;
  font-size: 0.875rem;
  line-height: 1.45;
}

.sp-radius-limit-banner a {
  color: #92400e;
  font-weight: 700;
  text-decoration: underline;
}

.sp-radius-limit-banner a:hover {
  color: #78350f;
}

html[data-theme="dark"] .sp-radius-limit-banner {
  background: rgba(250, 204, 21, 0.16);
  border-color: rgba(250, 204, 21, 0.4);
  color: #fde68a;
}

html[data-theme="dark"] .sp-radius-limit-banner a {
  color: #fef08a;
}

html[data-theme="dark"] .sp-radius-limit-banner a:hover {
  color: #fef9c3;
}

.rs-freshness-panel {
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius-lg);
  background: var(--av-bg-muted);
  padding: 0.85rem 1rem;
  box-shadow: none;
}

.sp-results-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.av-btn-ink,
.sp-results-back-btn {
  border: none;
  background: #111827;
  color: #fff;
}

.av-btn-ink:hover,
.av-btn-ink:focus,
.sp-results-back-btn:hover,
.sp-results-back-btn:focus {
  background: #000;
  color: #fff;
}

html[data-theme="dark"] .av-btn-ink,
html[data-theme="dark"] .sp-results-back-btn {
  background: #fff;
  color: #111827;
}

html[data-theme="dark"] .av-btn-ink:hover,
html[data-theme="dark"] .av-btn-ink:focus,
html[data-theme="dark"] .sp-results-back-btn:hover,
html[data-theme="dark"] .sp-results-back-btn:focus {
  background: #e8eef7;
  color: #111827;
}

.sp-job-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--av-text-subtle);
}

.sp-job-menu-btn:hover,
.sp-job-menu-btn:focus,
.sp-job-menu-btn.show {
  background: var(--av-nav-hover) !important;
  color: var(--av-text);
}

.sp-job-menu-btn svg {
  width: 1rem;
  height: 1rem;
}

.sp-job-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  padding: 0.3rem 0.85rem;
}

.sp-job-menu .dropdown-item svg {
  width: 0.85rem;
  height: 0.85rem;
  flex: 0 0 auto;
}

.sp-job-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 12rem;
  white-space: normal;
}

.sp-job-name {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--av-text);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.sp-job-name:hover,
.sp-job-name:focus {
  color: var(--av-blue);
  text-decoration: underline;
}

.sp-job-meta {
  color: var(--av-text-subtle);
  font-size: 0.75rem;
  line-height: 1.35;
}

.sp-job-icon-btn,
.sp-run-btn {
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0 !important;
  gap: 0;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.sp-job-icon-btn:hover,
.sp-job-icon-btn:focus,
.sp-run-btn:hover,
.sp-run-btn:focus {
  background: var(--av-nav-hover) !important;
}

.sp-run-btn,
.sp-run-btn:hover,
.sp-run-btn:focus {
  color: var(--av-blue) !important;
}

.sp-job-icon-btn svg,
.sp-run-btn svg {
  width: 0.9rem;
  height: 0.9rem;
}

/* Jobs list: allow ⋮ menus to escape the wrap; results table must scroll horizontally */
#sp-view-list .av-listing-wrap {
  overflow: visible;
}

#sp-view-results .av-listing-wrap {
  overflow-x: auto;
  max-width: 100%;
}

/* Page chrome */
.realsearch-page,
.av-page-section {
  color: var(--av-text);
}

.av-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.av-page-header h1,
.realsearch-page > .d-flex > div > h1.h3,
.realsearch-page h1.h3 {
  margin-bottom: 0.25rem;
  color: var(--av-text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.rs-info-hint {
  color: var(--av-text-subtle) !important;
  cursor: default;
  font-size: 0.75rem;
  font-weight: normal;
}

/* Moves a number input's native up/down spinner to the left side of the
   field (e.g. Property Scout's Beds/Baths) -- direction:rtl is what
   actually relocates the spin button in both Chrome and Firefox;
   text-align overrides the alignment that direction:rtl would otherwise
   also apply to the typed value, keeping the number itself reading
   left-to-right as normal. */
.wiz-spin-left {
  direction: rtl;
  text-align: left;
  /* The spin button sits inside the field's own left padding now that
     it's relocated there -- push the typed value further right so the
     first digit doesn't crowd right up against the arrows. */
  padding-left: 1.25rem;
}

/* Safari only shows a number input's spin button on hover/focus by
   default -- force it always-visible so the field reads as a spinner
   at rest, not just plain text (Chrome/Firefox already show it always). */
.wiz-spin-left::-webkit-inner-spin-button,
.wiz-spin-left::-webkit-outer-spin-button {
  opacity: 1;
}

/* Reserves 2 lines of height for a %/$-toggle field's label+toggle row
   (LTR Costs card) regardless of whether THIS field's own label actually
   wraps -- at narrower viewports the longest labels (e.g. "Property
   Management Monthly Fee (Tenant-Occupied)") wrap the toggle buttons
   onto a second line while a shorter row-neighbor doesn't, which without
   this would push that column's own input down relative to the other
   column in the same row. Reserving the same height on every such row
   keeps every input in that row starting at the same Y position either
   way -- a shorter label just leaves visible space under it instead. */
.wiz-fee-label-row {
  min-height: 2.4rem;
}

/* An empty left-side affix matching the "$" prefix's own width, for a
   %/$-toggle field's percent mode (which otherwise has no left prefix at
   all) -- keeps the input's left edge the same shape in both modes, so
   toggling %/$ doesn't visibly shift where the field itself starts. */
.wiz-affix-blank {
  min-width: 1.9rem;
}

/* Map frames */
.rs-map-frame {
  border: 1px solid var(--av-border) !important;
  border-radius: var(--av-radius-md) !important;
  background: var(--av-bg-muted);
}

/* Scout wizard stepper */
.sp-stepper {
  --sp-step-accent: var(--av-blue);
  --sp-step-accent-soft: rgba(26, 135, 255, 0.14);
  --sp-step-track: var(--av-border);
  --sp-step-upcoming: #d7dee8;
  padding: 0.25rem 0 0.35rem;
}

[data-theme="dark"] .sp-stepper {
  --sp-step-accent: var(--av-blue);
  --sp-step-accent-soft: rgba(26, 135, 255, 0.2);
  --sp-step-upcoming: #3a4558;
}

.sp-stepper-list {
  display: flex;
  align-items: flex-start;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.sp-stepper-item {
  position: relative;
  flex: 1;
  min-width: 0;
  color: inherit;
  background: transparent;
  border: 0;
}

.sp-stepper-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 0.95rem;
  left: calc(50% + 1.15rem);
  width: calc(100% - 2.3rem);
  height: 2px;
  background: var(--sp-step-track);
  pointer-events: none;
  z-index: 0;
}

.sp-stepper-item.is-complete:not(:last-child)::after {
  background: var(--sp-step-accent);
}

.sp-stepper-btn {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: center;
}

.sp-stepper-marker {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 0.55rem;
  border: 2px solid var(--sp-step-upcoming);
  background: var(--sp-step-upcoming);
  color: #fff;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.sp-stepper-check,
.sp-stepper-dot {
  grid-area: 1 / 1;
}

.sp-stepper-check {
  display: none;
  width: 0.95rem;
  height: 0.95rem;
}

.sp-stepper-check svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sp-stepper-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #fff;
}

.sp-stepper-item.is-complete .sp-stepper-marker {
  background: var(--sp-step-accent);
  border-color: var(--sp-step-accent);
}

.sp-stepper-item.is-complete .sp-stepper-check {
  display: block;
}

.sp-stepper-item.is-complete .sp-stepper-dot {
  display: none;
}

.sp-stepper-item.is-active .sp-stepper-marker {
  background: var(--sp-step-accent);
  border-color: var(--sp-step-accent);
  box-shadow: 0 0 0 4px var(--sp-step-accent-soft);
}

.sp-stepper-item.is-upcoming .sp-stepper-marker {
  background: var(--sp-step-upcoming);
  border-color: var(--sp-step-upcoming);
}

.sp-stepper-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 0;
  max-width: 100%;
  padding: 0 0.35rem;
}

.sp-stepper-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--av-text);
}

.sp-stepper-desc {
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--av-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.sp-stepper-btn:hover .sp-stepper-title,
.sp-stepper-btn:focus-visible .sp-stepper-title {
  color: var(--sp-step-accent);
}

.sp-stepper-btn:focus-visible {
  outline: none;
}

.sp-stepper-btn:focus-visible .sp-stepper-marker {
  box-shadow: 0 0 0 4px var(--sp-step-accent-soft);
}

@media (max-width: 767.98px) {
  .sp-stepper {
    padding: 0.15rem 0 0.25rem;
  }

  .sp-stepper-desc {
    display: none;
  }

  .sp-stepper-title {
    font-size: 0.78rem;
  }

  .sp-stepper-item:not(:last-child)::after {
    top: 0.85rem;
    left: calc(50% + 1rem);
    width: calc(100% - 2rem);
  }

  .sp-stepper-marker {
    width: 1.7rem;
    height: 1.7rem;
  }
}

/* Scout wizard tip card */
.sp-step-tip {
  min-width: 0;
}

.wiz-area-search-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch;
  gap: 0.55rem;
  width: 100%;
}

.wiz-area-search-row > #wiz-area-search {
  flex: 1 1 0 !important;
  width: auto !important;
  min-width: 0 !important;
}

.wiz-radius-group {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  flex-wrap: nowrap;
}

.wiz-radius-group > .form-control {
  width: 4rem !important;
  max-width: 4rem !important;
  flex: 0 0 4rem !important;
  border-radius: 0 !important;
}

.wiz-radius-group > .input-group-text:first-child {
  border-radius: var(--av-radius-control) 0 0 var(--av-radius-control) !important;
}

.wiz-radius-group > .input-group-text:last-child {
  border-radius: 0 var(--av-radius-control) var(--av-radius-control) 0 !important;
}

.wiz-affix-group > .input-group-text:first-child {
  border-radius: var(--av-radius-control) 0 0 var(--av-radius-control) !important;
}

.wiz-affix-group > .input-group-text:last-child {
  border-radius: 0 var(--av-radius-control) var(--av-radius-control) 0 !important;
}

.wiz-affix-group > .input-group-text:not(:first-child):not(:last-child) {
  border-radius: 0 !important;
}

/* Prefix only: [$][input] */
.wiz-affix-group > .form-control:last-child {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  border-top-right-radius: var(--av-radius-control) !important;
  border-bottom-right-radius: var(--av-radius-control) !important;
}

/* Postfix only: [input][mi] */
.wiz-affix-group > .form-control:first-child {
  border-top-left-radius: var(--av-radius-control) !important;
  border-bottom-left-radius: var(--av-radius-control) !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

/* Both sides: [$][input][/mo] */
.wiz-affix-group > .form-control:not(:first-child):not(:last-child) {
  border-radius: 0 !important;
}

.wiz-area-search-row > #wiz-area-search-btn {
  flex: 0 0 auto !important;
  width: auto !important;
  white-space: nowrap;
}

#wiz-area-search.is-invalid ~ .invalid-feedback,
#wiz-area-search-feedback.d-block {
  display: block;
}

/* When area input is invalid, keep feedback visible below the row */
.mb-2:has(#wiz-area-search.is-invalid) #wiz-area-search-feedback {
  display: block;
}

.sp-step-tip-num {
  font-size: 0.7rem;
  line-height: 1.2;
  color: var(--av-text-muted);
  margin-bottom: 0.15rem;
}

.sp-step-tip-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--av-text);
  margin-bottom: 0.25rem;
}

.sp-step-tip-body {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--av-text-muted);
}

/* Analysis workflow accent buttons (keep semantic colors) — sales/rental
   colors match LISTING_TYPE_COLORS' base brand shades (properties-core.js);
   report uses the darker "closed/complete" green (LISTING_TYPE_COLORS.rented)
   to read as the final step, distinct from the mid-workflow Rental Comps
   green. Cost keeps --av-danger, the app's own semantic red token — already
   the best fit rather than an arbitrary pick. */
.rs-workflow-btn--sales {
  color: #1a87ff !important;
  border-color: #1a87ff !important;
  background: transparent !important;
}

.rs-workflow-btn--cost {
  color: var(--av-danger) !important;
  border-color: var(--av-danger) !important;
  background: transparent !important;
}

.rs-workflow-btn--ltr {
  color: #2ce093 !important;
  border-color: #2ce093 !important;
  background: transparent !important;
}

.rs-workflow-btn--flip {
  color: #0891b2 !important;
  border-color: #0891b2 !important;
  background: transparent !important;
}

.rs-workflow-btn--report {
  color: #1fae75 !important;
  border-color: #1fae75 !important;
  background: transparent !important;
}

.rs-workflow-btn--report:disabled {
  color: var(--av-text-subtle) !important;
  border-color: var(--av-border) !important;
  opacity: 1;
}

.rs-workflow-btn--sales:hover,
.rs-workflow-btn--cost:hover,
.rs-workflow-btn--ltr:hover,
.rs-workflow-btn--flip:hover,
.rs-workflow-btn--report:not(:disabled):hover {
  filter: brightness(1.1);
}

.rs-notes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rs-notes > .rs-notes-layout {
  margin-top: 0.15rem;
}

.rs-notes-layout {
  display: grid;
  grid-template-columns: minmax(15rem, 0.9fr) minmax(0, 2.6fr);
  gap: 1rem;
  align-items: stretch;
  min-height: 70vh;
  margin: 0;
  padding: 0;
}

.rs-notes-sidebar,
.rs-notes-editor-col {
  min-width: 0;
}

.rs-notes-filters {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--av-border);
}

.rs-notes-search-wrap {
  position: relative;
}

.rs-notes-search-icon {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  display: inline-flex;
  color: var(--av-text-subtle);
  transform: translateY(-50%);
  pointer-events: none;
}

.rs-notes-search-icon svg {
  width: 0.95rem;
  height: 0.95rem;
}

.rs-notes-search-wrap .form-control {
  padding-left: 2.15rem !important;
}

.rs-notes-project-wrap .form-select {
  width: 100%;
}

.rs-notes-list {
  overflow-y: auto;
  max-height: 75vh;
}

.rs-note-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--av-border);
  cursor: pointer;
  transition: background var(--av-transition);
}

.rs-note-item:hover {
  background: var(--av-nav-hover);
}

.rs-note-item.is-active {
  background: color-mix(in srgb, var(--av-blue) 10%, transparent);
}

.rs-note-item-title {
  color: var(--av-text);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rs-note-item-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.rs-note-item-date {
  color: var(--av-text-subtle);
  font-size: 0.68rem;
  white-space: nowrap;
}

.rs-notes-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rs-notes-pill--general {
  background: var(--av-bg-muted);
  color: var(--av-text-muted);
}

.rs-notes-pill--project {
  background: rgba(26, 135, 255, 0.12);
  color: var(--av-blue);
}

.rs-report-group-header {
  border-bottom: none;
}

.rs-report-group:not(:last-child) {
  border-bottom: 1px solid var(--av-border);
}

.rs-report-chevron {
  display: inline-block;
  width: 0.8em;
  color: var(--av-text-subtle);
  transition: transform var(--av-transition);
}

.rs-report-chevron.is-open {
  transform: rotate(90deg);
}

.rs-report-versions {
  display: flex;
  flex-direction: column;
  padding: 0 0.9rem 0.4rem 2.1rem;
}

.rs-report-version {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  cursor: pointer;
  font-size: 0.8rem;
}

.rs-report-version:hover {
  color: var(--av-blue);
}

.rs-report-version-date {
  color: var(--av-text);
}

.rs-report-delete-btn {
  border: none;
  background: transparent;
  color: var(--av-text-subtle);
  font-size: 0.75rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  cursor: pointer;
}

.rs-report-delete-btn:hover {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.1);
}

.rs-notes-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
}

/* Notes editable fields */
.rs-notes-title-block {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

#rs-notes-title-input,
#rs-notes-body-input {
  border: 1px solid var(--av-border) !important;
  border-radius: var(--av-radius-control) !important;
  padding: 0.55rem 0.75rem !important;
  box-shadow: none !important;
  background: var(--av-bg-elevated) !important;
  color: var(--av-text) !important;
}

#rs-notes-title-input:focus,
#rs-notes-body-input:focus {
  border-color: color-mix(in srgb, var(--av-blue) 55%, var(--av-border)) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--av-blue) 18%, transparent) !important;
}

#rs-notes-body-input {
  flex: 1;
  min-height: 55vh;
  resize: none;
  font-size: 0.9rem;
  line-height: 1.6;
}

.rs-notes-icon-btn {
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0 !important;
  gap: 0;
}

/* Map overlay chrome — override light-only inline styles */
#rs-map-point-count,
#rs-clear-map-btn,
#rs-dom-legend,
#wiz-map-coords,
#rs-dom-color-btn,
#rs-map-rented-within,
#rs-map-sold-within,
#rs-map-rented-within-info-btn,
#rs-map-sold-within-info-btn,
#rs-dom-info-btn,
#rs-map-controls > div,
#rs-map-controls button,
#rs-map-controls select,
#rs-map-controls span {
  background: var(--av-bg-elevated) !important;
  color: var(--av-text) !important;
  border-color: var(--av-border-strong) !important;
}

#wiz-map-coords {
  background: color-mix(in srgb, var(--av-bg-elevated) 90%, transparent) !important;
  color: var(--av-text-muted) !important;
}

/* Sold/Rented lookback selects — accent them to match their own layer
   button's color (LISTING_TYPE_COLORS.sold / .rented in properties-core.js)
   instead of the generic theme border/text the rule above gives every
   other piece of map chrome. Same specificity as that rule (single ID
   selector) so source order alone decides the winner -- these just need to
   come after it. Background/text stay theme-driven (var(--av-text) etc.,
   from the rule above) for legibility; only the accent overrides. */
#rs-map-sold-within {
  border-color: #1a87ff !important;
  color: #1a87ff !important;
}

#rs-map-rented-within {
  border-color: #1fae75 !important;
  color: #1fae75 !important;
}

#rs-dom-legend > div:first-child {
  color: var(--av-text) !important;
}

.rs-info-hint,
[data-bs-toggle="popover"][style*="color:#6c757d"],
[data-bs-toggle="popover"][style*="color:#9ca3af"],
[data-bs-toggle="popover"][style*="color:#6b7280"] {
  color: var(--av-text-subtle) !important;
}

@media (max-width: 1100px) {
  .av-header {
    height: auto;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }

  .av-profile-meta {
    display: none;
  }
}

@media (max-width: 1199.98px) {
  .rs-home-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rs-fav-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .rs-home-stats,
  .rs-fav-stats,
  .rs-home-features {
    grid-template-columns: 1fr;
  }

  .rs-notes-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}

/* Desktop-first: keep sidebar usable on smaller screens without mobile redesign */
@media (max-width: 767.98px) {
  .av-sidebar {
    position: fixed;
    left: 0;
    transform: translateX(0);
  }

  body.sb-sidenav-toggled .av-sidebar {
    transform: translateX(0);
  }

  .av-main {
    margin-left: var(--av-sidebar-collapsed);
  }

  body:not(.sb-sidenav-toggled) .av-main {
    margin-left: var(--av-sidebar-width);
  }
}

/* Settings */
.rs-settings-stack {
  display: flex;
  flex-direction: column;
  gap: 2.75rem;
  width: 100%;
  max-width: none;
  margin-top: 0.5rem;
}

.rs-settings-stack > .av-card {
  margin: 0;
  width: 100%;
}

.rs-settings-form .form-label {
  color: var(--av-text-muted);
}

.rs-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.rs-settings-actions--end {
  justify-content: flex-end;
}

.rs-settings-plan-badge {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rs-settings-sub-table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--av-text);
  width: 100%;
  max-width: none;
}

.rs-settings-sub-table > :not(caption) > * > * {
  border: 0 !important;
  padding: 0.45rem 0.75rem 0.45rem 0;
  background: transparent !important;
  box-shadow: none !important;
}

.rs-settings-sub-table th {
  width: 7rem;
  color: var(--av-text-subtle);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}

.rs-settings-sub-table td {
  color: var(--av-text);
  font-size: 0.95rem;
  font-weight: 600;
}

.rs-settings-credit-summary {
  width: 100%;
  max-width: none;
  padding: 0.85rem 1rem;
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius-control);
  background: var(--av-bg-muted);
}

.rs-settings-device-row.is-current td {
  background: color-mix(in srgb, var(--av-nav-active-bg) 55%, transparent);
}

/* Property Report — brand type (Airovest Brand Guidelines v3.0): Bahnschrift for
   headings, Arial for body/interface. Scoped to the report modal only -- the
   rest of the app keeps its own type system; this isn't a site-wide rebrand.
   Scoped to the whole modal (#rs-property-report-modal), not just the rendered
   .rs-property-report body content -- the header/footer chrome lives outside that
   div in the static modal-property-report.html and was missing the brand font
   entirely. Airovest Blue/Green already match --av-blue/--av-green exactly,
   so no color overrides are needed here. */
#rs-property-report-modal {
  font-family: Arial, Helvetica, sans-serif;
}

#rs-property-report-modal .modal-title,
#rs-property-report-modal h4,
#rs-property-report-modal h5,
#rs-property-report-modal h6 {
  font-family: "Bahnschrift", "Arial Narrow", Arial, sans-serif;
}

/* Header carries the property address as its title (see modal-property-report.js) --
   the brand gradient here replaces the old separate address card in the body,
   which just duplicated it. */
.rs-property-report-header {
  background: var(--av-gradient-soft);
}

.rs-property-report-header .modal-title {
  font-size: 1.35rem;
  font-weight: 700;
}

/* Print/PDF-only letterhead (see renderReportHtml's own comment) -- hidden on
   screen via d-none, shown via Bootstrap's d-print-flex only when printing. */
.rs-property-report-print-header {
  border-bottom: 1px solid #d9e2ec;
  padding-bottom: 0.5rem;
}

.rs-property-report-print-footer {
  border-top: 1px solid #d9e2ec;
}

/* Matches .av-brand-wordmark's own styling (index.html's sidebar brand link). */
.rs-property-report-print-wordmark {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
  color: #1f2933;
}

/* renderPriceCharts() (js/utils.js) sets a fixed pixel `height` attribute
   sized for its native ~560px-wide usage in the live Sales/Rent Comps
   modals. The report renders that same chart into a much narrower column
   (see modal-property-report.js), and `width="100%"` alone leaves the SVG's
   viewBox letterboxed inside the unshrunk height -- height:auto here lets
   it scale down proportionally instead of leaving dead space beneath it. */
.rs-property-report svg {
  height: auto;
}

/* Print — Property Report modal only. "Download PDF" calls window.print(); this
   hides all app chrome and the modal's own header/footer so only the
   report content prints, laid out as normal flowing static content instead
   of a fixed-position modal dialog. */
@media print {
  /* html/body's own base rule (line ~80 above) is height:100% + overflow:hidden
     -- this whole app is a fixed-viewport shell where nothing scrolls except
     internal panels (.av-main/.av-scroll), by design. That's exactly the kind
     of clipping that breaks print pagination: overflow:hidden on the root
     caps the entire renderable page at one screen's height before the browser
     ever gets to paginate anything, no matter how thoroughly the modal's own
     internal containers (further below) get reset. This was the actual
     reason a second printed page never appeared -- fixing .modal/.modal-content/
     .modal-body alone couldn't matter while the root above them was still
     capped. */
  html,
  body {
    height: auto !important;
    overflow: visible !important;
  }

  /* #wrapper.av-shell (the flex row containing sidebar+main) has its own
     min-height:100vh independent of its children -- hiding .av-sidebar/
     .av-header/#page-content individually still leaves this outer flex
     container occupying a full-viewport-tall empty box that pushes the
     Property Report modal (a later sibling of #wrapper under <body>) down below
     the printable page before any of its content appears. Collapse the
     wrapper itself instead of just its children. */
  #wrapper {
    display: none !important;
    min-height: 0 !important;
    height: 0 !important;
  }

  .av-sidebar,
  .av-header,
  #page-content,
  .modal-backdrop {
    display: none !important;
  }

  /* Browsers drop background colors by default when printing (to save ink)
     -- without this, the report's dark theme card backgrounds vanish while
     their light text color stays, printing as invisible light-on-white
     text. Opt every element back in so the report prints exactly as shown. */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    background: #fff !important;
  }

  .modal.show {
    position: static !important;
    display: block !important;
    padding: 0 !important;
    /* .modal's own base rule (bootstrap.min.css) sets height:100% +
       overflow-y:auto for its normal fixed-position/viewport-pinned role --
       untouched by any of the overrides below, which only reach the dialog/
       content/body layers *inside* this element. Whatever this resolves to
       once position is static (page height, or something Chrome's print
       engine treats similarly), overflow:auto on it can still clip content
       the same way modal-content's did -- reset both here too so nothing in
       the chain from .modal down to .modal-body can cut the report short. */
    height: auto !important;
    overflow: visible !important;
  }

  .modal.show .modal-dialog {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    transform: none !important;
    /* .modal-dialog-centered's flex vertical-centering (display:flex;
       align-items:center; min-height:calc(100% - margin)) makes sense
       against a fixed-position modal sized to the viewport, but once the
       modal is forced to position:static and flows as normal content, that
       min-height calculation can produce a large blank gap before the
       actual content -- reset it back to plain block flow for print. */
    display: block !important;
    min-height: 0 !important;
    /* .modal-dialog-scrollable (bootstrap.min.css) sets height:calc(100% -
       margin*2) on the dialog itself, independent of .modal-dialog-centered's
       own min-height above -- without resetting this too, the Property Report
       modal (the only modal using -scrollable) stays viewport-height-bound
       during print, which starves its .modal-content/.modal-body of the
       room they need to report their real (often multi-page) content height
       further down this same override chain. */
    height: auto !important;
  }

  .modal.show .modal-content {
    border: none !important;
    box-shadow: none !important;
    height: auto !important;
    /* .modal-dialog-scrollable .modal-content (bootstrap.min.css) sets
       max-height:100% + overflow:hidden to make itself the scroll container
       on screen -- left in place for print, that overflow:hidden silently
       CLIPS (not just visually cuts off, but never renders) any content
       past the modal's collapsed height instead of flowing it onto
       additional printed pages. This is why "Download PDF" was producing a
       single page missing everything past Cost of Ownership: the rental
       comps sections and Market Trend were being clipped here, not just
       failing to paginate. */
    max-height: none !important;
    overflow: visible !important;
  }

  .modal.show .modal-body {
    max-height: none !important;
    overflow: visible !important;
  }

  .modal.show .modal-header,
  .modal.show .modal-footer,
  [data-print-hide] {
    display: none !important;
  }

  /* Force the app's own theme variables to their light-mode values within
     the report, regardless of the active theme -- printing the dark theme
     verbatim would waste ink, and patching individual consumers of these
     variables (cards, tables, badges) one at a time is a losing game: e.g.
     table cells get their color from a direct `color: var(--av-text)` rule
     (line ~1736 above), which is a non-inherited match that no ancestor
     `color` override can beat. Redefining the variables themselves at the
     root of the report cascades correctly to every consumer in one place.
     `!important` also beats the property header's inline
     `style="background:var(--av-gradient-soft)"`. */
  .rs-property-report {
    --av-bg: #f3f6fb !important;
    --av-bg-elevated: #ffffff !important;
    --av-bg-muted: #eef2f7 !important;
    --av-border: #d9e2ec !important;
    --av-border-strong: #c5d0dc !important;
    --av-text: #1f2933 !important;
    --av-text-muted: #62748a !important;
    --av-text-subtle: #8492a6 !important;
    --av-table-head: #f5f7fa !important;
    background: #fff !important;
    color: #1f2933 !important;
  }

  .rs-property-report .av-card {
    background: #fff !important;
    border-color: #d9e2ec !important;
  }

  .rs-print-avoid-break {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Set on every other report section by the modal's open(): page 1 holds
     the header, Analysis Result, notes and the first section; then two
     sections per page. */
  .rs-print-new-page {
    break-before: page;
    page-break-before: always;
  }

  /* A printed page is narrower than Bootstrap's lg breakpoint, so the
     report's col-lg-9 / col-lg-3 stacked and Street View dropped below the
     Analysis Result cards. Keep them side by side on paper, and let the
     photo scale to its column (its 218px screen height would distort or
     overflow there). */
  .rs-property-report .rs-report-main-col {
    flex: 0 0 66% !important;
    max-width: 66% !important;
  }
  .rs-property-report .rs-report-photo-col {
    flex: 0 0 34% !important;
    max-width: 34% !important;
  }
  /* Smaller Analysis Result cards on paper, to leave the photo room. */
  .rs-property-report .rs-report-main-col .av-card {
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
  }
  .rs-property-report .rs-report-main-col .av-card .small {
    font-size: 0.7rem !important;
  }
  .rs-property-report .rs-report-main-col .av-card .fw-bold {
    font-size: 1rem !important;
  }
  /* Comps sections: info column, (trend), chart on one line on paper -- at
     their screen widths (260px + 580px) the chart wrapped below. The chart's
     SVG is width:100% with a viewBox, so it scales into what's left. */
  .rs-property-report .rs-comp-row {
    flex-wrap: nowrap !important;
    gap: 0.75rem !important;
  }
  .rs-property-report .rs-comp-info {
    flex: 0 0 240px !important;
    width: 240px !important;
  }
  .rs-property-report .rs-comp-params {
    font-size: 0.68rem !important;
  }
  .rs-property-report .rs-comp-trend {
    flex: 0 0 7.5rem !important;
    width: 7.5rem !important;
  }
  .rs-property-report .rs-comp-chart {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
  }
  .rs-property-report .rs-report-photo-wrap {
    width: 100% !important;
  }
  .rs-property-report .rs-report-photo {
    height: auto !important;
    width: 100% !important;
  }

  table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* A multi-option toggle (e.g. the Address Lookup Provider picker) that
   reads as one physical switch shifting position, not a row of separate
   buttons independently changing color. .rs-segmented-thumb's left/width
   are set inline by JS (button widths vary with their label text, so a
   fixed 1/N split doesn't line up) -- the transition here is what makes
   that JS-driven move actually slide instead of jump. */
.rs-segmented-toggle {
  position: relative;
  isolation: isolate;
  background: var(--bs-tertiary-bg, #f1f3f5);
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 4px;
  padding: 2px;
}

.rs-segmented-thumb {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 3px;
  background: var(--bs-primary, #0d6efd);
  transition: left 0.2s ease, width 0.2s ease;
  z-index: 0;
}

.rs-segmented-toggle .rs-segmented-btn {
  position: relative;
  z-index: 1;
  background: transparent !important;
  border-color: transparent !important;
  transition: color 0.2s ease;
}

.rs-segmented-toggle .rs-segmented-btn[aria-pressed="true"] {
  color: #fff !important;
}

/* Deliberately no !important here -- modal-detail.js's show() toggles this
   element's visibility via inline style.display ('none' / ''), and Bootstrap's
   own d-flex utility (display: flex !important) would permanently win over
   that inline toggle if used instead, hiding the show/hide behavior. Only
   applies once the inline display is cleared back to '' (visible). */
.rs-detail-workflow-picker {
  display: flex;
  gap: 0.5rem;
}

.rs-segmented-toggle .rs-segmented-btn[aria-pressed="false"] {
  color: var(--bs-secondary-color, #6c757d) !important;
}

/* Replaces Leaflet's own L.control.scale -- see map.js's addDistanceIndicator
   for why (that control's preset-rounded values don't change on every zoom
   step the way this continuously-computed one does). Mirrors
   .leaflet-control-scale-line's own look (leaflet.css) for visual
   consistency with the rest of Leaflet's UI chrome. */
.rs-distance-indicator {
  border: 2px solid #777;
  border-top: none;
  line-height: 1.1;
  padding: 2px 5px 1px;
  white-space: nowrap;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.8);
  color: #333;
  text-shadow: 1px 1px #fff;
  font-size: 11px;
}

/* Price labels only show once zoomed in past a ~500ft reference scale (see
   properties-core.js's initListingMarkers) -- toggled by adding/removing
   this class on the map container rather than rebuilding every marker's
   tooltip binding on each zoom change. */
.rs-map-labels-hidden .leaflet-tooltip.rs-map-price-label {
  display: none;
}

/* ----- Logged-out auth shell ----- */

.av-auth-theme {
  display: none;
}

body.av-logged-out .av-auth-theme {
  display: inline-flex;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1040;
}

body.av-logged-out .av-sidebar,
body.av-logged-out .av-header {
  display: none;
}

body.av-logged-out .av-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 4.5rem 1.25rem 2rem;
}

.av-auth {
  width: min(26rem, 100%);
  margin: 0 auto;
}

.av-auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  color: var(--av-text);
  text-decoration: none;
}

.av-auth-card .av-auth-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.av-auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.av-auth-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  min-height: 0;
}

.av-auth-remember .form-check-input {
  float: none;
  margin: 0;
}

.av-auth-remember .form-check-label {
  font-size: 0.875rem;
  color: var(--av-text-muted);
}

.av-auth-error {
  margin: 0;
  color: var(--av-danger);
  font-size: 0.875rem;
  line-height: 1.4;
}

.av-auth-switch {
  margin: 1rem 0 0;
  color: var(--av-text-muted);
  font-size: 0.875rem;
  text-align: center;
}

.av-auth-switch a,
.av-auth-switch a:hover {
  text-decoration: none;
}

.av-auth-text-btn {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

#av-verify-resend {
  text-decoration: none;
}


/* Clients and Scout are gated per account (has_clients / has_scout from
   /api/auth/me); js/scripts.js applyProfile sets the body classes. */
.av-no-scout [data-requires-scout],
.av-no-clients [data-requires-clients] {
  display: none !important;
}

/* Clients list: the whole row opens the client; the name reads as the link. */
.rs-clients-row:hover > td {
  background: var(--av-nav-hover);
}

.rs-clients-row:hover .rs-clients-name {
  text-decoration: underline !important;
}

/* Photos sit to the right of the address so addresses stay aligned whether
   or not a row shows one. */
.av-listing-prop-row > .av-photo-thumb {
  margin-left: 0.5rem;
}
