/* Deal Analysis modal — cream/sage redesign */

:root {
  --cream-bg: #F8F9FA;
  --cream-surface: #FFFFFF;
  --cream-border: #E2E8F0;
  --cream-muted: #E2E8F0;
  --cream-text-primary: #1a1a1a;
  --cream-text-secondary: #333333;
  --cream-text-hint: #444444;
  --sage: #5A7A5C;
  --sage-light: #E8F2E8;
  --sage-mid: #C8DFC8;
  --sage-dark: #3D5C3E;
  --amber-cta: #D4AA1E;
  --amber-cta-text: #2C1800;
  --distress-red: #C84A2A;
  --distress-red-light: #FAE8E3;
  --dark-header: #0F1923;
  --modal-score-green: #8FB88F;
}

#property-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: rgba(61, 46, 26, 0.55);
  backdrop-filter: blur(4px);
}

#property-modal.flex {
  display: flex;
}

.property-modal-dialog,
.property-modal-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1080px;
  max-height: min(90vh, 900px);
  background: var(--cream-bg);
  border: 1px solid var(--cream-border);
  border-radius: 10px;
  box-shadow: 0 24px 48px rgba(61, 46, 26, 0.25);
  overflow: hidden;
}

/* ── Dark header ── */
.modal-dark-header {
  display: flex;
  align-items: stretch;
  gap: 16px;
  padding: 16px 20px;
  padding-right: 52px;
  background: var(--dark-header);
  flex-shrink: 0;
  position: relative;
  overflow: visible;
}

.modal-header-separator {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(143, 184, 143, 0.35), transparent);
  flex-shrink: 0;
}

.modal-header-photo-wrap {
  width: 130px;
  min-width: 130px;
  height: 110px;
  min-height: 110px;
  max-height: none;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--cream-surface);
  position: relative;
  cursor: pointer;
}

.modal-header-photo-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  width: 130px;
  min-width: 130px;
  overflow: visible;
}

.modal-header-photo-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  overflow: visible;
  padding: 0 2px 4px;
}

.modal-header-photo-meta.hidden {
  display: none;
}

.modal-header-photo-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 60px;
  overflow: visible;
  padding: 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.modal-header-photo-meta-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #999999;
  line-height: 1.25;
  white-space: normal;
  overflow: visible;
}

.modal-header-photo-meta-value {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
}

.modal-listing-actions-bar,
.modal-action-row {
  padding: 12px 16px;
  background: var(--cream-surface);
  border-bottom: 1px solid var(--cream-border);
  flex-shrink: 0;
}

.modal-listing-actions-bar:empty,
.modal-action-row:empty {
  display: none;
}

.modal-action-row-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.modal-action-row-buttons > .modal-action-btn,
.modal-action-row-buttons > .modal-action-item,
.modal-action-row-buttons > .modal-action-slot > .modal-action-btn {
  flex: 1;
  min-width: 0;
}

.modal-action-row-buttons > .modal-action-slot {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 8px;
}

.modal-action-links-slot {
  display: flex;
  flex: 2;
  min-width: 0;
  gap: 8px;
}

.modal-action-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1;
  min-width: 0;
}

.modal-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  border-radius: 8px;
  border: 1px solid var(--cream-border);
  background: var(--cream-surface);
  color: var(--cream-text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.modal-action-btn:hover:not(:disabled) {
  background: var(--cream-bg);
  border-color: var(--sage-mid);
}

.modal-action-btn--primary {
  background: var(--amber-cta);
  color: var(--amber-cta-text);
  border-color: var(--amber-cta);
}

.modal-action-btn--primary:hover:not(:disabled) {
  filter: brightness(1.05);
}

.modal-action-btn--primary.is-success {
  background: var(--sage);
  color: var(--sage-light);
  border-color: var(--sage-dark);
}

.modal-action-btn--zillow {
  background: rgba(0, 106, 255, 0.08);
  color: #0056cc;
  border-color: rgba(0, 106, 255, 0.35);
}

.modal-action-btn--zillow:hover {
  background: rgba(0, 106, 255, 0.14);
  color: #004bb5;
}

.modal-action-btn--redfin {
  background: rgba(200, 74, 42, 0.08);
  color: var(--distress-red);
  border-color: rgba(200, 74, 42, 0.35);
}

.modal-action-btn--redfin:hover {
  background: rgba(200, 74, 42, 0.14);
}

.modal-action-btn--contact {
  background: var(--sage-light);
  color: var(--sage-dark);
  border-color: var(--sage-mid);
}

.modal-action-btn--contact:hover:not(:disabled) {
  background: var(--sage-mid);
}

.modal-action-credits {
  font-size: 10px;
  color: var(--cream-text-hint);
  text-align: center;
  margin-top: 4px;
  line-height: 1.2;
}

.modal-action-skip-results {
  margin-top: 8px;
}

.modal-listing-actions-bar .modal-listing-links-row {
  margin-top: 0;
}

.modal-header-photo-wrap .modal-streetview-img,
.modal-header-photo-wrap .modal-streetview-iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 0;
}

.modal-streetview-iframe {
  position: absolute;
  inset: 0;
}

.modal-streetview-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--cream-surface) 25%, var(--cream-border) 50%, var(--cream-surface) 75%);
  background-size: 200% 100%;
  animation: modal-streetview-shimmer 1.2s ease-in-out infinite;
}

@keyframes modal-streetview-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.modal-streetview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream-surface, #EDE4D6);
  border: 0.5px solid var(--cream-border, #D4C4A8);
  border-radius: 6px;
  width: 100%;
  height: 100%;
  max-height: 120px;
  color: var(--cream-muted, #C8B89A);
  font-size: 28px;
}

.modal-header-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 4px 0;
}

.modal-header-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--cream-text-hint);
  text-transform: uppercase;
}

#modal-address {
  font-size: 17px;
  font-weight: 600;
  color: var(--cream-bg);
  margin: 0;
  line-height: 1.35;
}

#modal-owner {
  font-size: 13px;
  color: var(--cream-text-hint);
  margin: 0;
}

.modal-header-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.modal-header-link {
  font-size: 11px;
  color: var(--modal-score-green, #8FB88F);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a.modal-header-link.modal-header-link--zillow {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  color: var(--cream-bg, #F8F9FA);
  background: rgba(143, 184, 143, 0.2);
  border: 1px solid rgba(143, 184, 143, 0.55);
  border-radius: 6px;
  padding: 6px 12px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

a.modal-header-link.modal-header-link--zillow:hover {
  background: rgba(143, 184, 143, 0.35);
  border-color: var(--modal-score-green, #8FB88F);
  color: #fff;
}

.modal-header-link:hover {
  color: var(--cream-bg, #F8F9FA);
}

.modal-header-link-sep {
  font-size: 10px;
  color: var(--cream-text-hint);
  opacity: 0.6;
}

.modal-header-link-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.modal-copy-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.modal-ghost-btn {
  font-size: 10px;
  padding: 3px 8px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--cream-text-hint);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.modal-ghost-btn:hover {
  color: var(--cream-bg);
  background: rgba(255, 255, 255, 0.08);
}

.modal-header-score-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 88px;
  padding: 4px 8px;
}

.modal-header-score-num,
.modal-left-score-num {
  font-size: 88px;
  font-weight: 600;
  color: var(--modal-score-green);
  line-height: 1;
}

.modal-left-score-num {
  font-size: 56px;
}

.modal-header-score-label,
.modal-left-score-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--cream-text-hint);
  text-transform: uppercase;
  margin-top: 4px;
}

.modal-deal-quality-badge {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.modal-deal-quality-badge.quality-elite { background: var(--sage); color: var(--sage-light); }
.modal-deal-quality-badge.quality-strong { background: var(--sage-mid); color: var(--sage-dark); }
.modal-deal-quality-badge.quality-review { background: var(--amber-cta); color: var(--amber-cta-text); }
.modal-deal-quality-badge.quality-speculative { background: var(--cream-muted); color: var(--cream-text-primary); }
.modal-deal-quality-badge.quality-low { background: #888; color: #eee; }

.modal-header-actions {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: flex;
  gap: 6px;
  align-items: center;
  z-index: 3;
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 25, 35, 0.85);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

/* ── Tag strip ── */
.modal-tag-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 12px;
  background: var(--cream-surface, #EDE4D6);
  border-bottom: 0.5px solid var(--cream-border, #D4C4A8);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.modal-tag-pills-left {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.modal-tag-pills-left .tag-pill,
.modal-tag-strip .tag-pill {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 500;
}

.modal-header-tags .tag-pill.tag-short-sale,
.tag-pill.tag-short-sale {
  background: var(--distress-red, #C84A2A);
  color: #fff;
  font-weight: 600;
}

.modal-motivation-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.modal-motivation-pill.lead-hot { background: #8B3A20; color: #FAE8E3; }
.modal-motivation-pill.lead-warm { background: var(--amber-cta, #D4AA1E); color: var(--amber-cta-text, #2C1800); }
.modal-motivation-pill.lead-cold { background: var(--cream-muted, #C8B89A); color: var(--cream-text-primary, #3D2E1A); }

/* ── Body split ── */
.modal-main-scroll.property-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

.modal-body-split {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: visible;
}

.modal-left-panel {
  width: 168px;
  flex-shrink: 0;
  background: var(--cream-surface);
  border-right: 1px solid var(--cream-border);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  overflow: visible;
  position: sticky;
  top: 0;
  align-self: flex-start;
  max-height: none;
}

.modal-left-top-row {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  padding-top: 0;
}

.modal-left-divider {
  width: 100%;
  height: 1px;
  background: var(--cream-border);
}

.modal-why-score-link {
  font-size: 10px;
  color: var(--cream-text-hint);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.modal-score-breakdown {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  font-size: 13px;
  color: var(--cream-text-hint);
}

.modal-score-breakdown li {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 2px 0;
}

.modal-score-breakdown.hidden {
  display: none;
}

.modal-score-breakdown .factor-icon.positive { color: var(--sage); }
.modal-score-breakdown .factor-icon.distress { color: var(--amber-cta); }

.modal-left-motivation.motivation-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.modal-motivation-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--amber-cta, #D4AA1E);
  line-height: 1;
  text-align: center;
}

.modal-motivation-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--cream-text-primary, #3D2E1A);
  text-transform: uppercase;
  text-align: center;
  line-height: 1.2;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.modal-investment-grade {
  font-size: 10px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--sage-light);
  color: var(--sage-dark);
  border: 1px solid var(--sage-mid);
  text-align: center;
  width: 100%;
}

.modal-left-alert {
  width: 100%;
  font-size: 9px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--distress-red-light);
  border: 1px solid rgba(200, 74, 42, 0.35);
  color: var(--distress-red);
  text-align: center;
}

.modal-left-stats {
  width: 100%;
  margin: 0;
  padding: 0;
}

.modal-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
  font-size: 9px;
  padding: 2px 0;
}

.modal-stat-row dt {
  color: var(--cream-text-hint);
  font-weight: 400;
}

.modal-stat-row dd {
  margin: 0;
  color: var(--cream-text-secondary, #333333);
  font-weight: 500;
  text-align: right;
}

.modal-stat-row dd.stat-highlight { color: var(--sage); }

.modal-skip-trace-wrap {
  display: none;
}

.modal-skip-trace-btn {
  width: auto;
  white-space: nowrap;
  background: var(--amber-cta);
  color: var(--amber-cta-text);
  font-size: 9px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  padding: 5px 7px;
  cursor: pointer;
}

.modal-skip-trace-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.modal-skip-credits {
  font-size: 8px;
  color: var(--cream-text-hint);
  text-align: right;
  margin: 2px 0 0;
}

.modal-skip-results {
  width: 100%;
  margin-top: 4px;
  word-break: break-word;
}

.modal-skip-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
}

.modal-skip-phone {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
}

.modal-skip-email {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  line-height: 1.3;
}

.modal-skip-copy-btn {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #333;
  cursor: pointer;
}

.modal-skip-empty {
  font-size: 11px;
  color: #888;
  margin: 0;
}

.modal-skip-cached-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #eee;
  color: #666;
}

.modal-owner-info-stats {
  background: var(--cream-surface, #FFFFFF);
  border: 1px solid var(--cream-border, #E2E8F0);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 20px;
}

.modal-owner-info-dl {
  margin: 0;
}

.modal-owner-info-hint {
  font-size: 12px;
  color: var(--cream-text-secondary, #64748B);
  margin: 0 0 14px;
  line-height: 1.45;
}

.modal-owner-skip-heading {
  margin-top: 4px;
}

.modal-owner-skip-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.modal-owner-skip-results {
  margin-top: 8px;
}

.modal-owner-skip-upgrade {
  background: var(--cream-surface, #FFFFFF);
  border: 1px solid var(--cream-border, #E2E8F0);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  text-align: center;
}

.modal-owner-upgrade-text {
  font-size: 12px;
  color: var(--cream-text-secondary, #64748B);
  margin: 0 0 10px;
  line-height: 1.45;
}

/* ── Right panel tabs ── */
.modal-right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.modal-tab-bar {
  display: flex;
  background: var(--cream-surface);
  border-bottom: 1px solid var(--cream-border);
  flex-shrink: 0;
  padding: 0 16px;
  gap: 0;
  align-items: stretch;
  width: 100%;
}

#property-modal .modal-tab-btn {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent !important;
  color: var(--cream-text-hint) !important;
  cursor: pointer;
  margin: 0;
  transition: color 0.15s ease, border-color 0.15s ease;
}

#property-modal .modal-tab-btn:hover:not(.active) {
  color: var(--cream-text-primary) !important;
  background: transparent !important;
}

#property-modal .modal-tab-btn.active {
  color: var(--sage-dark) !important;
  font-weight: 700;
  background: transparent !important;
  border-bottom-color: var(--sage);
  box-shadow: none;
  z-index: 1;
  position: relative;
}

.modal-tab-panels {
  flex: 1;
  overflow-y: visible;
  min-height: 0;
  max-height: none;
}

.modal-tab-pane {
  display: none;
  background: var(--cream-bg);
  padding: 16px 24px;
  min-height: 0;
  transition: opacity 0.15s ease;
}

.modal-tab-pane.active {
  display: block;
  animation: modal-tab-fade-in 0.15s ease;
}

@keyframes modal-tab-fade-in {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* ── Action footer ── */
.modal-action-footer {
  display: flex;
  gap: 8px;
  align-items: stretch;
  padding: 10px 14px;
  background: var(--cream-surface);
  border-top: 1px solid var(--cream-border);
  flex-shrink: 0;
}

.modal-footer-pipeline { flex: 1; min-width: 0; display: flex; align-items: stretch; }

.modal-footer-pipeline .modal-pipeline-btn,
.modal-footer-pipeline a.modal-pipeline-btn,
.modal-footer-pipeline button.modal-pipeline-btn {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-footer-pipeline-btn,
#pipeline-upgrade-btn {
  width: 100%;
  background: var(--amber-cta) !important;
  color: var(--amber-cta-text) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 8px 12px !important;
  cursor: pointer;
}

.modal-pipeline-btn {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.3;
}

.modal-pipeline-btn--in {
  background: #16a34a !important;
  color: #fff !important;
  border: 1px solid #15803d !important;
}

.modal-pipeline-btn--in:hover {
  background: #15803d !important;
  color: #fff !important;
}

.modal-pipeline-btn--add {
  background: #fff !important;
  color: #1a1a1a !important;
  border: 2px solid #16a34a !important;
}

.modal-pipeline-btn--add:hover {
  background: rgba(22, 163, 74, 0.08) !important;
  color: #14532d !important;
}

.modal-footer-brief-btn,
#generate-brief-btn {
  flex: 1;
  min-height: 44px;
  background: var(--sage);
  color: var(--sage-light);
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-footer-copy-btn,
#modal-copy-zillow-btn {
  flex: 0 0 130px;
  width: 130px;
  min-height: 44px;
  background: #ffffff;
  border: 1px solid #cccccc;
  color: #333333;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.modal-footer-copy-btn:hover,
#modal-copy-zillow-btn:hover {
  background: #f5f5f5;
  border-color: #999999;
}

.property-modal-footer-note {
  font-size: 9px;
  color: var(--cream-text-hint);
  text-align: center;
  padding: 6px 14px;
  margin: 0;
  background: var(--cream-surface);
}

/* ── Details tab content ── */
.modal-section-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #444;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.modal-section-heading {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #444;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.modal-why-score-card {
  background: var(--cream-surface);
  border: 1px solid var(--cream-border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.modal-why-score-card .modal-section-label {
  margin-bottom: 4px;
}

.modal-score-panel-hint {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--cream-text-hint, #8B7A5E);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.modal-score-adjust-note {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 6px 10px;
}

.modal-breakdown-total {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--cream-border);
  font-size: 12px;
  font-weight: 700;
  color: var(--cream-text-primary, #3D2E1A);
  text-align: right;
}

.modal-breakdown-row--omitted .breakdown-pts {
  font-style: italic;
  font-weight: 500;
}

.modal-why-score-card .modal-breakdown-row {
  padding: 6px 0;
  border-bottom: 1px solid var(--cream-border);
}

.modal-why-score-card .modal-breakdown-row:last-child {
  border-bottom: none;
}

.modal-why-score-card .modal-breakdown-row span:last-child {
  color: var(--cream-text-hint);
  font-weight: 600;
  font-size: 12px;
  text-align: right;
  min-width: 52px;
}

.property-modal-offers-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.property-modal-offer {
  background: var(--cream-surface);
  color: var(--cream-text-primary);
  border-radius: 6px;
  padding: 7px 8px;
  text-align: center;
}

.property-modal-offer.offer-balanced {
  background: var(--sage);
  color: var(--sage-light);
}

.property-modal-offer-value {
  font-size: 13px;
  font-weight: 600;
}

.property-modal-offer-meta {
  font-size: 9px;
  opacity: 0.85;
  margin-top: 2px;
}

.modal-offer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--cream-text-secondary);
  margin-bottom: 12px;
}

.modal-section-divider {
  height: 1px;
  background: var(--cream-border);
  margin: 8px 0;
}

/* Details tab — readable label/value contrast */
#modal-tab-details .modal-section-label,
#modal-tab-details .modal-section-heading,
#modal-tab-owner .modal-section-label,
#modal-tab-owner .modal-section-heading {
  color: #444;
}

#modal-tab-details .modal-stat-card-label,
#modal-tab-details .modal-stat-row dt,
#modal-tab-owner .modal-stat-row dt,
#modal-tab-details .modal-mortgage-card-label,
#modal-tab-details .modal-breakdown-row .label-muted {
  color: #444;
  font-size: 11px;
}

#modal-tab-details .modal-stat-card-value,
#modal-tab-details .modal-stat-row dd,
#modal-tab-owner .modal-stat-row dd,
#modal-tab-details .modal-deal-signals-list li,
#modal-tab-details .modal-breakdown-row,
#modal-tab-details .modal-mortgage-card-value,
#modal-tab-details .property-modal-offer-value {
  color: #1a1a1a;
  font-weight: 700;
}

#modal-tab-details .modal-intel-chip {
  color: #333;
  font-weight: 500;
}

#modal-tab-details .modal-section-divider {
  background: var(--cream-border);
  border-color: var(--cream-border);
}

.modal-deal-signals-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.modal-deal-signals-list li {
  display: flex;
  gap: 7px;
  font-size: 10px;
  color: var(--cream-text-primary);
  padding: 3px 0;
  align-items: flex-start;
}

.modal-deal-signals-list .sig-positive { color: var(--sage); flex-shrink: 0; font-weight: 700; }
.modal-deal-signals-list .sig-risk { color: var(--distress-red); flex-shrink: 0; }

.modal-deal-signals-list .sig-pts {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  color: var(--cream-text-hint);
  flex-shrink: 0;
}

.modal-intel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.modal-intel-chip {
  font-size: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--cream-surface);
  border: 1px solid var(--cream-border);
  color: var(--cream-text-secondary);
  font-weight: 500;
}

.modal-listing-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.modal-listing-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.modal-listing-link-btn--zillow {
  background: #006aff;
  color: #fff;
  border-color: #0056cc;
}

.modal-listing-link-btn--zillow:hover {
  background: #0056cc;
  color: #fff;
}

.modal-listing-link-btn--google {
  background: #4285F4;
  color: #fff;
  border-color: #3367d6;
}

.modal-listing-link-btn--google:hover {
  background: #3367d6;
  color: #fff;
}

.modal-listing-link-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1;
  min-width: 0;
}

.modal-listing-link-hint {
  font-size: 11px;
  color: #D4AA1E;
  margin: 4px 0 0;
  text-align: center;
  line-height: 1.3;
}

.modal-listing-url-panel {
  margin-top: 10px;
  border: 1px solid var(--cream-border, #E2E8F0);
  border-radius: 6px;
  background: var(--cream-surface, #FFFFFF);
}

.modal-listing-url-summary {
  font-size: 11px;
  font-weight: 600;
  color: var(--cream-text-secondary, #64748B);
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.modal-listing-url-summary::-webkit-details-marker {
  display: none;
}

.modal-listing-url-summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.15s ease;
}

.modal-listing-url-panel[open] .modal-listing-url-summary::before {
  transform: rotate(90deg);
}

.modal-listing-url-body {
  padding: 0 10px 10px;
  border-top: 1px solid var(--cream-border, #E2E8F0);
}

.modal-listing-url-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
  margin-top: 8px;
}

.modal-listing-url-input {
  flex: 1;
  min-width: 180px;
  font-size: 11px;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--cream-border, #E2E8F0);
  background: var(--cream-surface, #FFFFFF);
  color: var(--cream-text-primary, #0F172A);
}

.modal-listing-url-input::placeholder {
  color: var(--cream-text-hint, #94A3B8);
}

.modal-listing-url-input:focus {
  outline: none;
  border-color: var(--sage, #5A7A5C);
  box-shadow: 0 0 0 2px rgba(90, 122, 92, 0.15);
}

.modal-listing-url-fetch-btn {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid var(--sage-dark, #3D5C3E);
  background: var(--sage, #5A7A5C);
  color: var(--sage-light, #E8F2E8);
  cursor: pointer;
  white-space: nowrap;
}

.modal-listing-url-fetch-btn:hover:not(:disabled) {
  background: var(--sage-dark, #3D5C3E);
}

.modal-listing-url-fetch-btn:disabled,
.modal-listing-url-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.modal-listing-url-error {
  font-size: 10px;
  color: var(--distress-red, #C84A2A);
  margin: 6px 0 0;
}

.modal-listing-url-error.hidden {
  display: none;
}

.modal-section-heading {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #444;
  text-transform: uppercase;
  margin: 0 0 8px;
}

/* ── AI Brief tab ── */
.ai-brief-generate-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 24px 16px;
  gap: 8px;
  width: 100%;
}

.ai-brief-generate-subtitle {
  font-size: 11px;
  font-weight: 400;
  color: #888;
  text-align: center;
  margin: 0;
  line-height: 1.4;
}

.ai-brief-skeleton-label {
  font-size: 11px;
  color: var(--cream-text-hint);
}

.ai-brief-skeleton {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-brief-skeleton-line {
  height: 12px;
  border-radius: 4px;
  animation: ai-brief-pulse 1.2s ease-in-out infinite;
}

.ai-brief-skeleton-line:nth-child(1) { width: 100%; }
.ai-brief-skeleton-line:nth-child(2) { width: 80%; }
.ai-brief-skeleton-line:nth-child(3) { width: 60%; }

@keyframes ai-brief-pulse {
  0%, 100% { background: var(--cream-surface); }
  50% { background: var(--cream-border); }
}

.ai-brief-summary {
  border-left: 3px solid var(--sage);
  padding-left: 10px;
  font-size: 11px;
  color: var(--cream-text-primary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.ai-brief-starter {
  background: var(--cream-surface);
  border-left: 3px solid var(--amber-cta);
  padding: 8px 12px;
  font-style: italic;
  font-size: 11px;
  color: var(--cream-text-primary);
  margin-bottom: 12px;
  border-radius: 0 6px 6px 0;
}

.ai-brief-section { margin-bottom: 12px; }
.ai-brief-section-label {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--cream-text-hint);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.ai-brief-section p {
  font-size: 11px;
  color: var(--cream-text-primary);
  line-height: 1.55;
  margin: 0;
}

.ai-brief-risks-box {
  background: #FFF0EE;
  border: 0.5px solid #E8B0A0;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 12px;
}
.ai-brief-risks-box .ai-brief-section-label { color: #7A2A18; font-weight: 500; }

.ai-brief-exit-box {
  background: #F0F7F0;
  border: 0.5px solid #A8CCA8;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 12px;
}
.ai-brief-exit-box .ai-brief-section-label { color: var(--sage-dark); font-weight: 500; }

.ai-brief-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}

.ai-brief-kw {
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 500;
}

.ai-brief-kw.kw-sage { background: var(--sage-light); color: var(--sage-dark); }
.ai-brief-kw.kw-amber { background: #F5E6B8; color: var(--amber-cta-text); }
.ai-brief-kw.kw-cream { background: var(--cream-muted); color: var(--cream-text-primary); }

/* ── Mortgage tab cards ── */
.modal-mortgage-card {
  background: var(--cream-surface);
  border: 1px solid var(--cream-border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
}

.modal-mortgage-card-label {
  font-size: 11px;
  color: #444;
  text-transform: uppercase;
}

.modal-mortgage-card-value {
  font-size: 12px;
  color: #1a1a1a;
  font-weight: 500;
  margin-top: 2px;
}

/* ── Legacy layout (pipeline.html fallback) ── */
.property-modal-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #313244;
  background: #1e1e2e;
}

.property-modal-body:not(.modal-body-split) {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 1rem 1rem;
}

.modal-streetview-wrap:not(.modal-header-photo-wrap) {
  position: relative;
  width: calc(100% + 2rem);
  height: 140px;
  margin: -0.75rem -1rem 0.75rem;
  background: #11111b;
  overflow: hidden;
}

.property-modal-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 900px) {
  .property-modal-columns {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

.property-modal-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}

.property-modal-stat {
  background: var(--cream-surface, #11111b);
  border-radius: 0.375rem;
  padding: 0.4rem 0.5rem;
  overflow: hidden;
}

.property-modal-stat-label {
  font-size: 0.6rem;
  color: var(--cream-text-hint, #64748B) !important;
  text-transform: uppercase;
}

.property-modal-stat-value {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--cream-text-primary, #1a1a1a) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.dark .property-modal-stat-value,
[data-theme="dark"] .property-modal-stat-value {
  color: var(--text, #E6EDF3) !important;
}

.modal-listing-banner.active {
  background: rgba(90, 122, 92, 0.15);
  color: var(--sage-dark);
  border-bottom: 1px solid var(--sage-mid);
  padding: 6px 16px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.modal-listing-banner.pending {
  background: rgba(212, 170, 30, 0.15);
  color: var(--amber-cta-text);
}

.modal-listing-banner.sold {
  background: rgba(90, 122, 92, 0.1);
  color: var(--sage);
}

.modal-listing-banner.loading {
  background: var(--cream-surface);
  color: var(--cream-text-hint);
}

.modal-info-tip { position: relative; display: inline-flex; }
.modal-info-tip-text {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  width: max-content;
  max-width: 240px;
  padding: 6px 8px;
  font-size: 11px;
  background: var(--cream-surface);
  border: 1px solid var(--cream-border);
  border-radius: 6px;
  opacity: 0;
  visibility: hidden;
  z-index: 50;
}
.modal-info-tip:hover .modal-info-tip-text { opacity: 1; visibility: visible; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

#property-modal.modal-overlay-new {
  align-items: center;
}

.modal-container-new {
  display: flex;
  flex-direction: column;
  max-width: 1080px;
  width: min(1080px, calc(100vw - 2rem));
  margin: 0 auto;
}

.modal-header-new {
  padding: 10px 16px;
  align-items: flex-start;
  gap: 12px;
  max-height: none;
  overflow: visible;
}

.modal-header-score-num {
  font-size: 48px;
  font-weight: 600;
}

.modal-address-row,
.modal-owner-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.modal-inline-copy {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--cream-text-hint);
  padding: 0 2px;
  line-height: 1;
}

.modal-inline-copy:hover { color: var(--cream-bg); }

.modal-header-tags {
  margin-top: 6px;
}

.modal-top-percent-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
  margin-top: 4px;
  white-space: nowrap;
}

.modal-top-percent-badge-sm { font-size: 9px; margin-top: 6px; }

.modal-top-percent-badge.top-2 { background: #2D5A2E; color: #A8D5A8; }
.modal-top-percent-badge.top-5 { background: #3D5C3E; color: #C8DFC8; }
.modal-top-percent-badge.top-10 { background: #3D5C3E; color: #C8DFC8; }
.modal-top-percent-badge.top-20 { background: #5C4A00; color: #E8D080; }

.modal-confidence-line {
  font-size: 9px;
  color: var(--cream-text-hint);
  text-align: center;
  line-height: 1.3;
}

.modal-motivation-tier {
  font-size: 9px;
  text-align: center;
  margin-top: 2px;
}

.modal-motivation-tier.tier-high { color: #E8A090; }
.modal-motivation-tier.tier-moderate { color: var(--amber-cta); }
.modal-motivation-tier.tier-low { color: var(--cream-text-hint); }

.modal-key-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
  justify-content: center;
}

.modal-signal-pill {
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 4px;
  margin: 2px;
}

.modal-signal-pill.sig-distress { background: rgba(200, 74, 42, 0.25); color: #F5C0B0; }
.modal-signal-pill.sig-sage { background: rgba(90, 122, 92, 0.25); color: #C8DFC8; }
.modal-signal-pill.sig-muted {
  background: rgba(200, 184, 154, 0.2);
  color: var(--cream-text-secondary, #6B5A3E);
}

/* Opportunity bar */
.modal-opportunity-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--cream-surface, #FFFFFF);
  border-bottom: 1px solid var(--cream-border, #E2E8F0);
  padding: 16px 24px;
}

.modal-opp-card {
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-right: 1px solid var(--cream-border, #D4C4A8);
  overflow: visible;
  min-width: 0;
}

.modal-opp-card:last-child { border-right: none; }

.modal-opp-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--cream-text-primary, #3D2E1A);
}

.modal-opp-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #444;
  text-transform: uppercase;
}

.modal-opp-sub {
  font-size: 9px;
  color: var(--cream-text-secondary, #6B5A3E);
  white-space: nowrap;
  overflow: visible;
}

.modal-opp-sub.sub-sage { color: var(--sage, #5A7A5C); }
.modal-opp-sub.sub-amber { color: var(--amber-cta, #D4AA1E); }

.modal-opp-card--unavailable {
  padding: 8px 10px;
  min-height: 0;
}

.modal-opp-unavailable {
  font-size: 11px;
  font-style: italic;
  color: var(--cream-text-hint, #9B8B74);
  line-height: 1.3;
}

/* Offer range hero */
.modal-offer-range {
  background: var(--cream-bg, #F8F9FA);
  border-bottom: 1px solid var(--cream-border, #E2E8F0);
  padding: 16px 24px;
}

.modal-offer-range-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.modal-offer-updated-ago {
  font-size: 10px;
  font-weight: 600;
  color: var(--sage, #5A7A5C);
}

.modal-live-price-success {
  font-size: 12px;
  font-weight: 600;
  color: #1a7a3c;
  margin: 0 0 8px;
}

.modal-offer-cards.is-updated {
  animation: offer-cards-flash 0.85s ease;
}

@keyframes offer-cards-flash {
  0%, 100% { box-shadow: none; }
  40% { box-shadow: 0 0 0 2px rgba(90, 122, 92, 0.5); }
}

.ai-brief-empty-msg {
  font-size: 13px;
  color: var(--cream-text-secondary, #64748B);
  margin: 0;
  line-height: 1.5;
}

.ai-brief-error {
  background: #FAE8E3;
  border: 1px solid #E8B4A8;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 0;
}

.ai-brief-error p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #7A2A18;
  line-height: 1.45;
}

#modal-tab-ai .ai-brief-error {
  background: rgba(122, 42, 24, 0.15);
  border-color: rgba(232, 180, 168, 0.35);
}

#modal-tab-ai .ai-brief-error p {
  color: #F5C4B8;
}

#property-modal .modal-offer-range,
#property-modal .modal-subto-analysis,
#property-modal .modal-opportunity-bar,
#property-modal .modal-tab-pane:not(#modal-tab-ai) {
  color: #1a1a1a;
}

.modal-offer-range-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #444;
  text-transform: uppercase;
}

.market-data-badge {
  font-size: 10px;
  font-weight: 500;
  color: var(--sage, #5A7A5C);
  background: rgba(90, 122, 92, 0.12);
  border-radius: 4px;
  padding: 2px 8px;
}

.market-status-pill {
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  padding: 3px 9px;
  margin-left: 4px;
}

.market-status-for-sale {
  background: #1a7a3c;
  color: #e8f5e9;
}

.market-status-pending {
  background: #b8860b;
  color: #fff8e1;
}

.market-status-sold {
  background: #6b7280;
  color: #f3f4f6;
}

.modal-market-dom {
  font-size: 10px;
  color: var(--cream-text-secondary, #6B5E4E);
}

.modal-offer-market-disclaimer {
  font-size: 10px;
  color: var(--cream-text-hint, #9B8B74);
  margin: 0 0 8px;
  line-height: 1.4;
}

.modal-data-note {
  font-size: 9px;
  color: var(--cream-text-hint, #9B8B74);
  text-align: center;
  padding: 4px 14px 0;
  margin: 0;
}

.modal-valuation-status-banner {
  font-size: 11px;
  text-align: center;
  padding: 6px 14px;
  margin: 4px 14px 0;
  border-radius: 6px;
  line-height: 1.35;
}
.modal-valuation-status-banner--pending {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.45);
  color: #ca8a04;
}
.modal-valuation-status-banner--updated {
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(22, 163, 74, 0.45);
  color: #16a34a;
}
.modal-valuation-status-banner--review {
  background: rgba(107, 114, 128, 0.12);
  border: 1px solid rgba(107, 114, 128, 0.35);
  color: #6b7280;
}
.modal-valuation-status-banner.hidden {
  display: none;
}

.modal-offer-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.modal-offer-card {
  background: var(--cream-surface, #FFFFFF);
  border: 1px solid var(--cream-border, #E2E8F0);
  border-radius: 8px;
  padding: 12px 10px;
  text-align: center;
  min-width: 0;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.modal-offer-card.hero {
  background: var(--cream-surface, #FFFFFF);
  border: 2px solid var(--sage, #5A7A5C);
  padding: 12px 10px;
  box-shadow: 0 4px 14px rgba(90, 122, 92, 0.18);
  transform: translateY(-1px);
}

.modal-offer-recommended {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: var(--sage);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.modal-offer-risk-spectrum {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 0 4px;
}

.modal-offer-risk-label {
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream-text-hint);
  flex-shrink: 0;
}

.modal-offer-risk-track {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sage-light), var(--amber-cta), var(--distress-red-light));
  position: relative;
}

.modal-offer-risk-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sage);
  border: 2px solid var(--cream-surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.modal-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: stretch;
  padding: 12px;
  background: var(--cream-surface);
  border: 1px solid var(--cream-border);
  border-radius: 8px;
  margin-bottom: 8px;
}

.modal-stats-bar-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 6px;
  min-width: 0;
}

.modal-stats-bar-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.modal-stats-bar-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.modal-stats-bar-label {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-text-hint);
  line-height: 1.2;
}

.modal-stats-bar-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--cream-text-primary);
  line-height: 1.25;
}

.modal-stats-bar-value--positive {
  color: var(--sage-dark);
}

.modal-stats-bar-value--negative {
  color: var(--distress-red);
}

.modal-stats-bar-value--neutral {
  color: var(--text-muted, #6b7280);
}

.modal-cashflow-note {
  font-size: 11px;
  color: var(--text-muted, #6b7280);
  margin: 4px 0 0;
}

.modal-stats-bar-label,
.modal-stats-bar-value {
  font-size: 20px;
  font-weight: 700;
}

.modal-score-theme-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-top: 6px;
  letter-spacing: 0.04em;
}

.modal-mortgage-empty {
  padding: 1rem;
  background: var(--sage-light, #E8F2E8);
  border-radius: 8px;
  font-size: 0.875rem;
}

.modal-mortgage-equity {
  font-weight: 700;
  margin-top: 0.5rem;
  color: var(--sage-dark, #3D5C3E);
}

.modal-stats-bar-grade {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  font-size: 10px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--sage-light);
  color: var(--sage-dark);
  white-space: nowrap;
}

.modal-offer-card-label {
  font-size: 10px;
  color: #444;
  line-height: 1.2;
}

.modal-offer-card.hero .modal-offer-card-label { color: #1a1a1a; }

.modal-offer-card-price {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 2px 0;
}

.modal-offer-card.hero .modal-offer-card-price {
  font-size: 13px;
  color: #1a1a1a;
}

.modal-offer-card-pct,
.modal-offer-card-sub {
  font-size: 9px;
  color: #333;
  line-height: 1.2;
}

.modal-offer-card.hero .modal-offer-card-pct,
.modal-offer-card.hero .modal-offer-card-sub {
  color: #333;
}

.modal-offer-value-source {
  font-size: 10px;
  font-weight: 500;
  color: var(--sage, #5A7A5C);
  margin: 0 0 6px;
}

.modal-offer-value-source--zillow {
  color: #166534;
  background: rgba(22, 101, 52, 0.1);
  border-radius: 4px;
  padding: 4px 8px;
  font-weight: 600;
}

.modal-offer-value-source--county {
  color: #92400e;
  background: rgba(217, 119, 6, 0.15);
  border: 0.5px solid rgba(217, 119, 6, 0.35);
  border-radius: 4px;
  padding: 4px 8px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 8px;
}

.modal-county-pricing-fallback {
  margin: 0 0 6px;
}

.modal-zillow-url-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
  margin-top: 6px;
}

.modal-zillow-url-input {
  flex: 1;
  min-width: 180px;
  font-size: 11px;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--cream-border, #E2E8F0);
  background: var(--cream-surface, #FFFFFF);
  color: var(--cream-text-primary, #0F172A);
}

.modal-zillow-url-input::placeholder {
  color: var(--cream-text-hint, #94A3B8);
}

.modal-zillow-url-input:focus {
  outline: none;
  border-color: var(--sage, #5A7A5C);
  box-shadow: 0 0 0 2px rgba(90, 122, 92, 0.15);
}

.modal-zillow-url-fetch-btn {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid var(--sage-dark, #3D5C3E);
  background: var(--sage, #5A7A5C);
  color: var(--sage-light, #E8F2E8);
  cursor: pointer;
  white-space: nowrap;
}

.modal-zillow-url-fetch-btn:hover:not(:disabled) {
  background: var(--sage-dark, #3D5C3E);
}

.modal-zillow-url-fetch-btn:disabled,
.modal-zillow-url-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.modal-zillow-url-error {
  font-size: 10px;
  color: var(--distress-red, #C84A2A);
  margin: 6px 0 0;
}

.modal-zillow-url-error.hidden {
  display: none;
}

.modal-offer-refreshed {
  font-size: 10px;
  color: var(--cream-text-hint, #94A3B8);
  margin: 0 0 6px;
}

.ai-brief-conversation-top {
  margin-bottom: 10px;
}

.ai-brief-starter-quote {
  margin: 4px 0 0;
  padding: 8px 10px 8px 12px;
  border-left: 3px solid var(--sage, #5A7A5C);
  background: rgba(90, 122, 92, 0.1);
  border-radius: 0 6px 6px 0;
  font-size: 11px;
  font-style: italic;
  color: var(--cream-text-primary, #3D2E1A);
  line-height: 1.45;
}

.modal-offer-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  color: #444;
}

.modal-offer-metrics .metric-val { color: #1a1a1a; font-weight: 600; }
.modal-offer-metrics .metric-val.sage { color: var(--sage, #5A7A5C); }
.modal-offer-metrics .metric-grade {
  margin-left: auto;
  background: var(--sage, #5A7A5C);
  color: var(--sage-light, #E8F2E8);
  font-size: 10px;
  font-weight: 500;
  border-radius: 4px;
  padding: 3px 8px;
}

.modal-offer-piti-breakdown {
  font-size: 11px;
  color: #666;
  margin: 6px 0 0;
  line-height: 1.4;
}

/* Property stats grid */
.modal-property-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.modal-stat-card {
  background: var(--cream-surface, #FFFFFF);
  border: 1px solid var(--cream-border, #E2E8F0);
  border-radius: 8px;
  padding: 10px 12px;
}

.modal-stat-card-label {
  font-size: 9px;
  color: var(--cream-text-hint, #9B8B74);
  text-transform: uppercase;
}

.modal-stat-card-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--cream-text-primary, #0F172A);
  margin-top: 2px;
}

.modal-stat-card-value.value-sage { color: var(--sage, #5A7A5C); }

.modal-score-breakdown-details { margin-bottom: 14px; }

.modal-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--cream-text-primary, #3D2E1A);
  padding: 3px 0;
}

.modal-breakdown-label {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}

.breakdown-pts {
  color: var(--cream-text-hint);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  text-align: right;
}

.modal-breakdown-row .pts-sage { color: var(--sage, #5A7A5C); }
.modal-breakdown-row .pts-amber { color: var(--amber-cta, #D4AA1E); }

/* Seller timeline — hidden in compact modal to fit 1080p viewport */
.property-modal-inner .modal-seller-timeline { display: none; }

.modal-timeline-track {
  position: relative;
  height: 2px;
  background: var(--cream-border, #D4C4A8);
  margin: 28px 8px 8px;
}

.modal-timeline-dot-wrap {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  min-width: 48px;
}

.modal-timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 0 auto 4px;
  background: var(--sage, #5A7A5C);
}

.modal-timeline-dot.dot-red { background: var(--distress-red, #C84A2A); }
.modal-timeline-dot.dot-amber { background: var(--amber-cta, #D4AA1E); }

.modal-timeline-year {
  font-size: 9px;
  color: var(--cream-text-hint, #9B8B74);
  white-space: nowrap;
}

.modal-timeline-label {
  font-size: 9px;
  color: var(--cream-text-secondary, #6B5A3E);
  white-space: nowrap;
}

/* AI Brief v3 */
.ai-brief-generate-btn {
  background: var(--sage, #5A7A5C);
  color: var(--sage-light, #E8F2E8);
  font-size: 16px;
  font-weight: 600;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
}

.ai-brief-skeleton-line:nth-child(4) { width: 70%; }

.ai-brief-why-box {
  background: var(--cream-surface, #EDE4D6);
  border: 0.5px solid var(--cream-border, #D4C4A8);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.ai-brief-why-box p {
  font-size: 10px;
  color: var(--cream-text-secondary, #6B5A3E);
  font-style: italic;
  margin: 4px 0 0;
  line-height: 1.5;
}

.ai-brief-action-box {
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

.ai-brief-action-box.action-call {
  background: #1A3D1A;
  border: 1px solid #2D5A2E;
  color: #A8D5A8;
}

.ai-brief-action-box.action-research {
  background: #3D2D00;
  border: 1px solid #5C4500;
  color: #E8C060;
}

.ai-brief-action-box.action-skip {
  background: var(--cream-muted, #C8B89A);
  border: 1px solid var(--cream-border, #D4C4A8);
  color: var(--cream-text-primary, #3D2E1A);
}

.ai-brief-action-steps {
  list-style: disc;
  margin: 0 0 8px 18px;
  padding: 0;
  font-size: 11px;
  color: var(--cream-text-primary, #3D2E1A);
  line-height: 1.45;
}

.ai-brief-action-steps li { margin-bottom: 4px; }

.ai-brief-short-sale-flag {
  font-size: 11px;
  font-weight: 600;
  color: var(--distress-red, #C84A2A);
  background: var(--distress-red-light, #FAE8E3);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 10px;
}

.ai-brief-structure { margin: 0 0 6px; }

.ai-brief-reasons {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  font-size: 10px;
  color: var(--cream-text-secondary, #6B5A3E);
}

.ai-brief-kw.kw-risk { background: #FAE8E3; color: #7A2A18; }

.ai-brief-meta-line {
  font-size: 10px;
  color: var(--cream-text-hint, #9B8B74);
  margin-bottom: 6px;
}

/* AI Brief tab — dark panel at bottom of modal scroll */
.modal-tab-ai-bottom {
  border-top: 0.5px solid var(--cream-border, #D4C4A8);
}

#modal-tab-ai.modal-tab-pane {
  background: #1a1a2e !important;
  overflow: visible;
  max-height: none;
}

#modal-tab-ai,
#modal-tab-ai #ai-brief-container {
  color: #f0f0f0;
  overflow: visible;
  max-height: none;
}

#modal-tab-ai .ai-brief-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#modal-tab-ai .ai-brief-card {
  background: #2a2a3e;
  border-radius: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: visible;
  max-height: none;
}

#modal-tab-ai .ai-brief-card--risks {
  background: #3e2a2a;
  border-color: rgba(252, 165, 165, 0.25);
}

#modal-tab-ai .ai-brief-card--exit {
  background: #2a3e2a;
  border-color: rgba(168, 204, 168, 0.35);
}

#modal-tab-ai .ai-brief-section-label {
  color: #bbbbbb;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

#modal-tab-ai .ai-brief-card-body,
#modal-tab-ai .ai-brief-card-body p,
#modal-tab-ai .ai-brief-card-body li,
#modal-tab-ai .ai-brief-starter-quote,
#modal-tab-ai .ai-brief-meta-line,
#modal-tab-ai .ai-brief-action-steps,
#modal-tab-ai .ai-brief-action-steps li,
#modal-tab-ai .ai-brief-reasons,
#modal-tab-ai .ai-brief-reasons li,
#modal-tab-ai .ai-brief-card-body strong,
#modal-tab-ai blockquote {
  color: #f0f0f0;
  font-size: 13px;
  line-height: 1.55;
}

#modal-tab-ai .ai-brief-card-body p,
#modal-tab-ai .ai-brief-meta-line {
  margin: 0 0 8px;
}

#modal-tab-ai .ai-brief-card-body p:last-child,
#modal-tab-ai .ai-brief-meta-line:last-child {
  margin-bottom: 0;
}

#modal-tab-ai .ai-brief-starter-quote {
  background: rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--sage, #5A7A5C);
  margin: 0;
  padding: 8px 10px 8px 12px;
  border-radius: 0 6px 6px 0;
  font-style: italic;
}

#modal-tab-ai .ai-brief-keywords {
  margin-top: 8px;
}

#modal-tab-ai .ai-brief-action-box.action-skip {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f0f0f0;
  font-size: 13px;
}

#modal-tab-ai .ai-brief-short-sale-flag {
  color: #fca5a5;
  margin: 8px 0 0;
  font-size: 13px;
}

#modal-tab-ai .ai-brief-skeleton-label {
  color: #bbbbbb;
}

#modal-tab-ai .ai-brief-skeleton-line {
  animation-name: ai-brief-pulse-dark;
}

@keyframes ai-brief-pulse-dark {
  0%, 100% { background: rgba(255, 255, 255, 0.12); }
  50% { background: rgba(255, 255, 255, 0.22); }
}

#modal-tab-ai .ai-brief-upgrade-msg {
  color: #d8b4fe;
  text-align: center;
  padding: 16px 12px;
  font-size: 13px;
}

#modal-tab-ai .ai-brief-upgrade-link {
  color: #c4b5fd;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

#modal-tab-ai .ai-brief-upgrade-link:hover {
  color: #e9d5ff;
}

/* Mobile — stack header columns */
@media (max-width: 600px) {
  .modal-dark-header.modal-header-new {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    padding-right: 44px;
  }

  .modal-header-photo-col {
    width: 100%;
    min-width: 0;
    flex-direction: row;
    align-items: flex-start;
  }

  .modal-header-photo-wrap {
    width: 120px;
    min-width: 120px;
  }

  .modal-header-photo-meta {
    flex: 1;
    min-width: 0;
  }

  .modal-header-score-col {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-width: 0;
    padding: 12px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 4px;
  }

  .modal-header-score-num {
    font-size: 64px;
  }

  .modal-action-row-buttons {
    flex-direction: column;
  }

  .modal-action-btn,
  .modal-action-item {
    width: 100%;
  }

  .modal-stats-bar {
    grid-template-columns: 1fr;
  }

  .modal-stats-bar-grade {
    justify-self: stretch;
    text-align: center;
  }

  .modal-offer-cards {
    grid-template-columns: 1fr;
  }

  .modal-property-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.modal-left-panel {
  width: 168px;
  padding: 16px 12px;
  gap: 12px;
}

.modal-left-score-num {
  font-size: 56px;
  font-weight: 600;
  line-height: 1;
}

.modal-signal-pill.sig-distress { background: var(--distress-red-light); color: var(--distress-red); }
.modal-signal-pill.sig-sage { background: var(--sage-light); color: var(--sage-dark); }
.modal-signal-pill.sig-muted { background: var(--cream-bg); color: var(--cream-text-secondary); border: 1px solid var(--cream-border); }

.modal-confidence-line {
  font-size: 9px;
  color: var(--cream-text-hint);
  text-align: center;
  line-height: 1.3;
}

.modal-motivation-tier.tier-high { color: var(--distress-red); }
.modal-motivation-tier.tier-moderate { color: var(--amber-cta); }
.modal-motivation-tier.tier-low { color: var(--cream-text-hint); }

.modal-why-score-link {
  font-size: 10px;
  color: var(--sage);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.modal-score-breakdown {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  font-size: 12px;
  color: var(--cream-text-secondary);
}

.modal-left-score-label {
  font-size: 11px;
}

.modal-action-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  padding: 10px 16px;
}

.modal-distress-box {
  background: #FFF0EE;
  border: 0.5px solid #E8B0A0;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 8px;
}

.modal-distress-box p {
  font-size: 10px;
  color: var(--cream-text-primary, #3D2E1A);
  margin: 0 0 4px;
  line-height: 1.5;
}

.modal-distress-box .modal-distress-note {
  font-size: 9px;
  color: #7A2A18;
  margin-top: 6px;
}

.results-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1.5rem;
}

.results-empty-state .empty-icon { font-size: 32px; margin-bottom: 12px; }
.results-empty-state h4 { font-size: 14px; font-weight: 500; color: var(--cream-text-primary, var(--text)); margin: 0 0 8px; }
.results-empty-state p { font-size: 12px; color: var(--cream-text-hint, var(--text2)); margin: 0 0 16px; line-height: 1.5; }

.results-empty-clear-btn {
  background: var(--sage, var(--acc));
  color: var(--sage-light, #fff);
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 12px;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .modal-body-split {
    flex-direction: column;
  }

  .modal-left-panel {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    height: auto;
    padding: 10px 12px;
    gap: 10px;
    justify-content: space-between;
  }

  .modal-left-panel .score-block { flex: 0 0 auto; }

  .modal-left-panel .key-signals,
  .modal-left-panel .modal-key-signals { display: none; }

  .modal-left-panel .why-score-disclosure { display: none; }

  .modal-left-panel .motivation-block { flex: 0 0 auto; }

  .modal-left-panel .grade-badge,
  .modal-left-panel .modal-investment-grade { flex: 0 0 auto; }

  .modal-right-panel { width: 100%; }
}

/* ── Mobile ── */
@media (max-width: 768px) {
  #property-modal.modal-overlay-new { align-items: flex-end; }

  .modal-container-new {
    width: 100vw;
    max-height: min(90vh, 900px);
    border-radius: 16px 16px 0 0;
  }

  .property-modal-inner,
  .property-modal-dialog {
    width: 100vw;
    max-height: min(90vh, 900px);
    border-radius: 16px 16px 0 0;
  }

  .modal-header-new { flex-wrap: wrap; }
  .modal-main-scroll.property-modal-body { flex: 1; min-height: 0; }
  .modal-opportunity-bar { grid-template-columns: repeat(2, 1fr); }
  .modal-body-split { flex-direction: column; }

  .modal-offer-cards { grid-template-columns: 1fr; }

  .modal-timeline-track {
    height: auto;
    background: none;
    margin: 0;
    padding-left: 12px;
    border-left: 2px solid var(--cream-border, #D4C4A8);
  }

  .modal-timeline-dot-wrap {
    position: relative;
    transform: none;
    left: auto !important;
    text-align: left;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
  }

  .modal-timeline-dot { margin: 0; flex-shrink: 0; }

  .modal-body-split {
    flex-direction: column;
  }

  .modal-left-panel {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    height: auto;
    padding: 10px 12px;
    gap: 10px;
    justify-content: space-between;
  }

  .modal-left-panel .score-block { flex: 0 0 auto; }

  .modal-left-panel .key-signals,
  .modal-left-panel .modal-key-signals { display: none; }

  .modal-left-panel .why-score-disclosure { display: none; }

  .modal-left-panel .motivation-block { flex: 0 0 auto; }

  .modal-left-panel .grade-badge,
  .modal-left-panel .modal-investment-grade { flex: 0 0 auto; }

  .modal-right-panel { width: 100%; }

  .modal-tab-bar {
    overflow-x: auto;
    white-space: nowrap;
  }

  .modal-dark-header {
    flex-wrap: wrap;
  }

  .modal-header-photo-wrap {
    width: 130px;
    min-width: 130px;
    height: 110px;
    min-height: 110px;
  }

  .modal-header-photo-col {
    width: 130px;
    min-width: 130px;
  }

  #property-modal .modal-tab-btn {
    min-width: 0;
    flex: 1;
    font-size: 14px;
    padding: 10px 12px;
  }

  .modal-header-score-col {
    margin-right: 40px;
    max-width: calc(100% - 48px);
  }

  .modal-deal-quality-badge {
    white-space: normal;
    text-align: center;
    max-width: 120px;
    line-height: 1.25;
  }
}

@media (max-width: 900px) {
  .modal-header-score-col {
    flex-wrap: wrap;
    align-items: flex-end;
    margin-right: 44px;
  }

  .modal-deal-quality-badge {
    order: 3;
    flex-basis: 100%;
    max-width: none;
    margin-top: 4px;
  }
}

/* Live price + SubTo analysis */
.modal-offer-live-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.modal-live-price-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  border: none;
  background: var(--amber-cta, #D4AA1E);
  color: var(--amber-cta-text, #2C1800);
  cursor: pointer;
}

.modal-live-price-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.modal-live-price-btn.is-success {
  background: var(--sage, #5A7A5C);
  color: var(--sage-light, #E8F2E8);
}

.modal-market-freshness {
  font-size: 10px;
  color: var(--cream-text-hint, #9B8B74);
}

.modal-valuation-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  font-size: 11px;
}

.modal-valuation-primary {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal-valuation-amount {
  font-size: 18px;
  font-weight: 700;
  color: var(--cream-text-primary, #1a1a1a);
}

.modal-valuation-source {
  font-size: 11px;
  font-weight: 600;
}

.modal-valuation-source--live {
  color: var(--sage-dark, #3d6b40);
}

.modal-valuation-source--arcgis {
  color: #2563eb;
}

.modal-valuation-source--county {
  color: var(--amber-cta, #D4AA1E);
}

.modal-market-gap-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.modal-live-price-hero {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f0f7f0 0%, #e8f2e8 100%);
  border: 1px solid var(--sage-light, #c8dcc8);
}

.modal-zillow-cross-ref-note {
  margin: 0 0 6px;
  font-size: 10px;
  color: var(--text-muted, #6b7280);
  line-height: 1.35;
}

.modal-offer-value-source--pending {
  color: var(--amber-cta, #D4AA1E);
  font-weight: 600;
}

.modal-offer-value-source--zestimate {
  color: var(--text-muted, #6b7280);
  font-weight: 600;
}

.market-data-badge--estimate {
  opacity: 0.85;
}

.modal-live-price-btn--prominent {
  width: 100%;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 14px;
}

.modal-offer-value-source--live {
  color: var(--sage-dark, #3d6b40);
  font-weight: 600;
}

.modal-offer-value-source--arcgis {
  color: #2563eb;
  font-weight: 600;
}

.modal-valuation-listed {
  color: var(--amber-cta, #D4AA1E);
  font-weight: 600;
}

.modal-valuation-zestimate {
  color: var(--sage, #5A7A5C);
  font-weight: 600;
}

.modal-valuation-jv {
  color: var(--cream-text-hint, #9B8B74);
}

.modal-subto-analysis {
  background: var(--cream-surface, #FFFFFF);
  border-bottom: 0.5px solid var(--cream-border, #E2E8F0);
  padding: 12px;
}

.modal-subto-analysis.hidden { display: none; }

.modal-subto-analysis h4 {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #444;
  margin: 0 0 8px;
}

.modal-subto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.modal-subto-block {
  margin-bottom: 0;
}

.modal-subto-block--full {
  margin-bottom: 0;
}

.modal-subto-block-title {
  font-size: 11px;
  font-weight: 600;
  color: #444;
  margin-bottom: 4px;
}

.modal-subto-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: #1a1a1a;
  padding: 2px 0;
}

.modal-subto-row span:first-child {
  color: #444;
}

.modal-subto-row span:last-child {
  color: #1a1a1a;
  font-weight: 600;
}

.modal-subto-row .dscr-warn { color: var(--amber-cta, #D4AA1E); font-weight: 600; }
.modal-subto-row .dscr-good { color: var(--sage, #5A7A5C); font-weight: 600; }
.modal-subto-improve { font-size: 10px; color: var(--sage, #5A7A5C); margin-top: 4px; }
.modal-subto-warn { color: var(--amber-cta, #D4AA1E) !important; }
.modal-subto-recent-sale {
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  margin: 0 0 10px;
  border: 1px solid var(--amber-cta, #D4AA1E);
  border-radius: 6px;
  background: rgba(212, 170, 30, 0.08);
}
.modal-subto-basis-note,
.modal-mortgage-disclaimer {
  font-size: 10px;
  color: #555;
  margin: 6px 0 0;
  line-height: 1.35;
}
.modal-subto-row--muted { opacity: 0.85; font-size: 11px; }
.modal-score-computed-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  margin-top: 4px;
  letter-spacing: 0.02em;
}
.modal-subto-fmr-text { font-size: 11px; margin: 0; color: #1a1a1a; }
.modal-subto-fmr-source { font-size: 10px; color: #444; margin: 4px 0 0; }

/* SubTo score tooltips (cards + modal) */
.score-tooltip-wrap {
  position: relative;
}

.score-tooltip-bubble {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  max-width: 220px;
  padding: 6px 8px;
  border-radius: 4px;
  background: #1a1a1a;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.score-tooltip-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1a1a1a;
}

.score-tooltip-wrap:hover .score-tooltip-bubble,
.score-tooltip-wrap:focus-within .score-tooltip-bubble {
  opacity: 1;
  visibility: visible;
}

.score-tooltip-bubble--left {
  left: 0;
  transform: none;
}

.score-tooltip-bubble--left::after {
  left: 24px;
  transform: none;
}

.card-score-badge.score-tooltip-wrap .score-tooltip-bubble {
  min-width: 180px;
}

.modal-header-score-col.score-tooltip-wrap {
  cursor: help;
}

.modal-header-score-col .score-tooltip-bubble {
  min-width: 200px;
}

.score-block.score-tooltip-wrap {
  cursor: help;
  width: 100%;
}

.modal-section8-link-wrap { margin: 0 0 12px; }
.modal-section8-link { font-size: 13px; font-weight: 600; color: var(--sage, #5A7A5C); text-decoration: none; }
.modal-section8-link:hover { text-decoration: underline; }
.modal-section8-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-section8-header h4 { margin: 0; font-size: 16px; }
.modal-section8-score { font-size: 12px; font-weight: 700; color: #5A7A5C; background: rgba(90, 122, 92, 0.12); padding: 4px 8px; border-radius: 999px; }
.modal-section8-block { border: 1px solid var(--border, #ddd); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.modal-section8-block-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted, #888); margin-bottom: 8px; }
.modal-section8-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 4px 0; }
.modal-section8-row--total { font-weight: 700; border-top: 1px solid var(--border, #ddd); margin-top: 6px; padding-top: 8px; }
.modal-section8-badge { margin-top: 10px; padding: 10px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.modal-section8-badge--good { background: rgba(90, 122, 92, 0.15); color: #2d6a35; border: 1px solid rgba(90, 122, 92, 0.35); }
.modal-section8-badge--warn { background: rgba(200, 74, 42, 0.12); color: #C84A2A; border: 1px solid rgba(200, 74, 42, 0.35); }
.modal-section8-badge--neutral { background: rgba(120, 120, 120, 0.12); color: #666; }
.modal-section8-warn { font-size: 12px; color: #D4AA1E; margin: 0 0 12px; }
.modal-section8-hha { margin: 0; font-size: 13px; }
.modal-section8-disclaimer { font-size: 11px; color: var(--text-muted, #888); margin: 8px 0 0; }
.modal-section8-empty { font-size: 13px; color: var(--text-muted, #888); }

.modal-insurance-line {
  font-size: 13px;
  color: var(--text-primary, #1f2937);
  margin: 8px 0 0;
  line-height: 1.45;
  word-break: break-word;
}
.modal-insurance-line--tooltip {
  border-bottom: 1px dotted var(--text-muted, #6b7280);
  cursor: help;
}
.modal-insurance-risk-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(200, 74, 42, 0.15);
  color: #C84A2A;
  border: 1px solid rgba(200, 74, 42, 0.35);
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
}
.modal-roof-insight {
  font-size: 13px;
  color: #B8860B;
  margin: 6px 0 0;
  line-height: 1.45;
  word-break: break-word;
}
@media (prefers-color-scheme: dark) {
  .modal-insurance-line { color: var(--text-primary, #e5e7eb); }
  .modal-roof-insight { color: #D4AA1E; }
}
body.dark .modal-insurance-line,
.property-modal.dark .modal-insurance-line,
[data-theme="dark"] .modal-insurance-line {
  color: #e5e7eb;
}
body.dark .modal-roof-insight,
.property-modal.dark .modal-roof-insight,
[data-theme="dark"] .modal-roof-insight {
  color: #D4AA1E;
}

.modal-deal-intelligence {
  margin-top: 16px;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
  background: rgba(0,0,0,0.15);
  overflow: hidden;
}

.modal-deal-intel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
  background: rgba(90, 122, 92, 0.08);
}

.modal-deal-intel-title {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}

.modal-deal-intel-balance {
  font-size: 11px;
  color: var(--amber-cta, #D4AA1E);
  font-weight: 600;
}

.modal-deal-intel-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
  font-size: 12px;
}

.modal-deal-intel-row:last-of-type { border-bottom: none; }

.modal-deal-intel-label {
  font-weight: 600;
  white-space: nowrap;
}

.modal-deal-intel-teaser {
  color: var(--text-secondary, #9ca3af);
  line-height: 1.35;
}

.modal-deal-intel-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.modal-deal-intel-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--sage, #5A7A5C);
  background: transparent;
  color: var(--sage, #5A7A5C);
  cursor: pointer;
  white-space: nowrap;
}

.modal-deal-intel-btn--primary {
  background: var(--sage, #5A7A5C);
  color: #fff;
  border-color: var(--sage, #5A7A5C);
}

.modal-deal-intel-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.modal-deal-intel-unlocked {
  color: var(--sage, #5A7A5C);
  font-size: 11px;
  font-weight: 600;
}

.modal-deal-intel-package {
  padding: 10px 12px;
  background: rgba(90, 122, 92, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.modal-deal-intel-detail {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.45;
}

.modal-deal-intel-detail a { color: var(--sage, #5A7A5C); }

.modal-deal-intel-error {
  font-size: 11px;
  color: #ef4444;
  padding: 0 12px 10px;
}
