/* ===========================
   KW REALTY SF — CMA TOOL
   =========================== */

:root {
  --kw-red: #C8102E;
  --kw-dark: #222222;
  --kw-gray: #555555;
  --kw-light: #F4F4F4;
  --kw-white: #FFFFFF;
  --kw-border: #DDDDDD;
  --kw-accent: #8B0000;
  --radius: 4px;
  --shadow: 0 2px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Lato', sans-serif;
  background: #EFEFEF;
  color: var(--kw-dark);
  font-size: 14px;
  line-height: 1.5;
}

/* ===========================
   SCREENS
   =========================== */
.screen { display: none; }
.screen.active { display: block; }

/* ===========================
   LOGIN
   =========================== */
#loginScreen {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  position: relative;
}
#loginScreen.active {
  display: flex;
}

.login-bg {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d0a0f 50%, #1a1a1a 100%);
  z-index: 0;
}
.login-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, transparent, transparent 40px, rgba(200,16,46,0.03) 40px, rgba(200,16,46,0.03) 80px);
}

.login-box {
  position: relative; z-index: 1;
  background: #fff;
  border-radius: 8px;
  padding: 48px 44px;
  width: 440px;
  box-shadow: var(--shadow-lg);
  border-top: 5px solid var(--kw-red);
}

.login-logo {
  width: 200px;
  display: block;
  margin: 0 auto 24px;
  /* logo has black bg — use mix-blend-mode to handle on white */
  border-radius: 4px;
}

.login-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 36px;
  font-weight: 800;
  text-transform: uppercase;
  text-align: center;
  color: var(--kw-dark);
  letter-spacing: 3px;
  margin-bottom: 4px;
}
.login-title span { color: var(--kw-red); }

.login-sub {
  text-align: center;
  color: var(--kw-gray);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 32px;
}

/* ===========================
   FORM ELEMENTS
   =========================== */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--kw-gray); }
.form-group input,
.form-group select,
.form-group textarea {
  border: 1.5px solid var(--kw-border);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  color: var(--kw-dark);
  background: #fff;
  transition: border-color 0.15s;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--kw-red);
  box-shadow: 0 0 0 3px rgba(200,16,46,0.08);
}
textarea { resize: vertical; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.form-grid .span2 { grid-column: span 2; }
.form-grid .span4 { grid-column: span 4; }

/* ===========================
   BUTTONS
   =========================== */
.btn-primary {
  background: var(--kw-red);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--kw-accent); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--kw-gray);
  border: 1.5px solid var(--kw-border);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--kw-red); color: var(--kw-red); }

.btn-secondary {
  background: var(--kw-light);
  color: var(--kw-dark);
  border: 1.5px solid var(--kw-border);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-secondary:hover { background: #e5e5e5; }

/* ===========================
   APP HEADER
   =========================== */
.app-header {
  background: var(--kw-dark);
  color: #fff;
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.header-logo { height: 34px; object-fit: contain; }
.header-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #fff;
}
.header-right { display: flex; align-items: center; gap: 10px; }
.agent-badge {
  font-size: 13px;
  color: #ccc;
  font-weight: 600;
  margin-right: 6px;
}

/* ── Header action buttons (Save / Load) ── */
.btn-hdr-action {
  padding: 7px 13px !important;
  font-size: 12px !important;
  color: #ccc !important;
  border-color: #444 !important;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-hdr-action:hover { border-color: var(--kw-red) !important; color: #fff !important; }
.btn-load-cma { cursor: pointer; }

/* ── Auto-save status indicator ── */
.autosave-status {
  font-size: 11px;
  color: #4caf50;
  font-weight: 700;
  letter-spacing: 0.3px;
  opacity: 0;
  transition: opacity 0.4s;
  white-space: nowrap;
}
.autosave-status.show { opacity: 1; }

/* ── Resume auto-save prompt ── */
.resume-prompt {
  background: #fff8e1;
  border-bottom: 2px solid #ffc107;
  padding: 10px 32px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.resume-prompt.hidden { display: none; }
.resume-icon {
  font-size: 20px;
  color: #e65100;
  flex-shrink: 0;
}
.resume-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.resume-text strong { font-size: 13px; color: #333; }
.resume-text span   { font-size: 12px; color: #777; }
.resume-actions     { display: flex; gap: 8px; flex-shrink: 0; }
.btn-sm {
  padding: 6px 14px !important;
  font-size: 12px !important;
}

/* ===========================
   STEP NAV
   =========================== */
.step-nav {
  display: flex;
  background: #fff;
  border-bottom: 2px solid var(--kw-border);
  position: sticky;
  top: 60px;
  z-index: 90;
}

.step-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 16px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  gap: 2px;
}
.step-tab:hover { background: var(--kw-light); }
.step-tab.active {
  border-bottom-color: var(--kw-red);
  background: #fff8f9;
}
.step-tab.done .step-num { color: #28a745; }

.step-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--kw-border);
  line-height: 1;
  transition: color 0.15s;
}
.step-tab.active .step-num { color: var(--kw-red); }

.step-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--kw-gray);
}
.step-tab.active .step-label { color: var(--kw-dark); }

/* ===========================
   STEP CONTENT
   =========================== */
.step-content {
  display: none;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}
.step-content.active { display: block; }

.step-header { margin-bottom: 28px; }
.step-header h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 30px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--kw-dark);
  margin-bottom: 4px;
}
.step-header p { color: var(--kw-gray); font-size: 14px; }

.step-actions {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding-top: 24px;
  border-top: 2px solid var(--kw-border);
}

/* ===========================
   CARDS
   =========================== */
.card {
  background: #fff;
  border-radius: 6px;
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.card-section-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--kw-red);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0e0e3;
}

/* ===========================
   MLS SEARCH
   =========================== */
.mls-search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.mls-search-bar input {
  flex: 1;
  border: 2px solid var(--kw-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 15px;
  font-family: 'Lato', sans-serif;
}
.mls-search-bar input:focus {
  outline: none;
  border-color: var(--kw-red);
}

.mls-results {
  background: #fff;
  border: 1.5px solid var(--kw-border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.mls-result-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--kw-border);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.12s;
}
.mls-result-item:last-child { border-bottom: none; }
.mls-result-item:hover { background: #fff8f9; }
.mls-result-addr { font-weight: 700; }
.mls-result-detail { font-size: 12px; color: var(--kw-gray); margin-top: 2px; }
.mls-result-price { font-weight: 700; color: var(--kw-red); font-size: 16px; }

.divider {
  text-align: center;
  color: #bbb;
  font-size: 12px;
  margin: 20px 0;
  position: relative;
}
.divider::before, .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--kw-border);
}
.divider::before { left: 0; }
.divider::after { right: 0; }

/* ===========================
   CHECKBOX GRID
   =========================== */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  padding: 8px 12px;
  border: 1.5px solid var(--kw-border);
  border-radius: var(--radius);
  transition: all 0.12s;
}
.checkbox-item:hover { border-color: var(--kw-red); background: #fff8f9; }
.checkbox-item input[type=checkbox] { accent-color: var(--kw-red); width: 16px; height: 16px; }

/* ===========================
   COMP RESULTS
   =========================== */
.comp-results-area { margin-top: 24px; }
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--kw-border);
}
.results-count {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--kw-dark);
}
.results-hint { font-size: 12px; color: var(--kw-gray); }

.comp-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.comp-card {
  background: #fff;
  border: 1.5px solid var(--kw-border);
  border-radius: 6px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.comp-card:hover { border-color: var(--kw-red); box-shadow: var(--shadow); }
.comp-card.selected {
  border-color: var(--kw-red);
  background: #fff8f9;
}
.comp-card.selected::after {
  content: '✓ Selected';
  position: absolute;
  top: 10px; right: 10px;
  background: var(--kw-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.comp-card-address { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.comp-card-price { font-size: 20px; font-weight: 800; color: var(--kw-red); font-family: 'Barlow Condensed', sans-serif; }
.comp-card-details { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.comp-detail-pill {
  background: var(--kw-light);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--kw-gray);
}
.comp-status-sold { color: #c0392b; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.comp-status-active { color: #27ae60; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.comp-dom { font-size: 11px; color: #999; }

/* ===========================
   SELECTED COMPS
   =========================== */
.selected-comps-area {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 2px solid var(--kw-border);
}
.section-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--kw-dark);
  margin-bottom: 14px;
}
.selected-list { display: flex; flex-direction: column; gap: 10px; }
.empty-state { color: #aaa; font-style: italic; padding: 20px; text-align: center; border: 2px dashed var(--kw-border); border-radius: 6px; }
.selected-comp-row {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid var(--kw-border);
  border-radius: 6px;
  padding: 12px 16px;
  gap: 16px;
}
.selected-comp-row .comp-num {
  width: 28px; height: 28px;
  background: var(--kw-red);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  flex-shrink: 0;
}
.selected-comp-row .comp-info { flex: 1; }
.selected-comp-row .comp-info strong { font-size: 14px; display: block; }
.selected-comp-row .comp-info span { font-size: 12px; color: var(--kw-gray); }
.selected-comp-row .comp-price { font-size: 18px; font-weight: 800; color: var(--kw-red); font-family: 'Barlow Condensed', sans-serif; }
.btn-remove {
  background: none; border: none; color: #bbb; cursor: pointer;
  font-size: 18px; line-height: 1;
  transition: color 0.12s;
}
.btn-remove:hover { color: var(--kw-red); }

/* ===========================
   ADJUSTMENT TABLE
   =========================== */
.adjustment-table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: 6px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.adj-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.adj-table th {
  background: var(--kw-dark);
  color: #fff;
  padding: 12px 14px;
  text-align: left;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}
.adj-table th.subject-col { background: var(--kw-red); }
.adj-table th.comp-col { background: #3a3a3a; }
.adj-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--kw-border);
  vertical-align: middle;
}
.adj-table tr:last-child td { border-bottom: none; }
.adj-table tr:nth-child(even) td { background: #f9f9f9; }
.adj-table .row-label {
  font-weight: 700;
  color: var(--kw-gray);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--kw-light) !important;
}
.adj-pos { color: #27ae60; font-weight: 700; }
.adj-neg { color: #c0392b; font-weight: 700; }
.adj-zero { color: #aaa; }

.adj-row-calc td { background: #f0f4f0 !important; }
.adj-row-manual td { background: #fdf8f0 !important; }
.adj-row-manual .row-label { background: #fdf0e0 !important; }

.adj-manual-input {
  width: 100%;
  min-width: 90px;
  padding: 4px 8px;
  border: 1px solid #d0b080;
  border-radius: 4px;
  font-size: 13px;
  background: #fff;
  text-align: right;
}

.custom-adj-header {
  background: #e8e0f8 !important;
  font-weight: 700;
  font-size: 12px;
  color: #5540a0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 10px !important;
  border-top: 2px solid #b8a8e8 !important;
}

.adj-custom-label {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #c0b0e0;
  border-radius: 4px;
  font-size: 13px;
  background: #fff;
  box-sizing: border-box;
}

.adj-custom-label::placeholder { color: #aaa; font-style: italic; }

.adj-total-row td {
  background: #f8f0f1 !important;
  font-weight: 800;
  border-top: 2px solid var(--kw-red) !important;
}
.adj-sale-price { font-weight: 800; font-family: 'Barlow Condensed', sans-serif; font-size: 16px; }
.adj-adjusted { font-weight: 800; color: var(--kw-red); font-family: 'Barlow Condensed', sans-serif; font-size: 16px; }
.adj-diff { font-size: 11px; }

/* ===========================
   VALUE ANALYSIS
   =========================== */
.analysis-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-box {
  text-align: center;
  padding: 20px 12px;
  border: 2px solid var(--kw-border);
  border-radius: 6px;
}
.stat-box.highlight { border-color: var(--kw-red); background: #fff8f9; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--kw-gray); font-weight: 700; margin-bottom: 6px; }
.stat-value { font-family: 'Barlow Condensed', sans-serif; font-size: 28px; font-weight: 800; color: var(--kw-dark); }
.stat-box.highlight .stat-value { color: var(--kw-red); }

.price-range-inputs {
  display: flex;
  align-items: center;
  gap: 12px;
}
.price-range-inputs input {
  flex: 1;
  border: 1.5px solid var(--kw-border);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-family: 'Lato', sans-serif;
  font-size: 14px;
}
.price-range-inputs span { color: #aaa; font-size: 18px; }

/* ===========================
   REPORT ACTIONS
   =========================== */
.report-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  align-items: center;
}

/* ===========================
   CMA REPORT (PRINT VIEW)
   =========================== */

/* Online: pages shown as discrete cards with gray gap between */
.cma-report {
  background: #d0d0d0;
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.report-page {
  background: #fff;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  min-height: 1080px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  page-break-after: always;
  break-after: page;
}

/* Three-column header: agent left | title center | logo right */
.report-page-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 28px;
  border-bottom: none;
  margin-bottom: 0;
  gap: 12px;
}

.rph-left { display: flex; flex-direction: column; }
.rph-agent-name { font-size: 14px; font-weight: 700; color: #1a1a1a; }
.rph-agent-brokerage { font-size: 10px; color: #999; text-transform: uppercase; letter-spacing: 0.8px; }

.rph-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  color: #1a1a1a;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.report-logo { height: 34px; object-fit: contain; justify-self: end; mix-blend-mode: multiply; }

/* Red bar below header */
.rph-redbar { height: 5px; background: var(--kw-red); flex-shrink: 0; }

/* Inner page content wrapper */
.page-content { padding: 32px 36px; flex: 1; }

/* ── COVER PAGE ── */
.cover-page {
  background: linear-gradient(150deg, #111 0%, #2b070d 55%, #111 100%);
  color: #fff;
  min-height: 1080px;
}
.cover-header { padding: 40px 48px 28px; border-bottom: 4px solid var(--kw-red); }
.cover-logo { height: 52px; object-fit: contain; }
.cover-body { padding: 80px 64px 60px; flex: 1; }
.cover-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 400;
  text-transform: uppercase; letter-spacing: 9px;
  color: rgba(255,255,255,0.35); margin-bottom: 20px;
}
.cover-address {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 58px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1px;
  line-height: 1.05; color: #fff;
}
.cover-city {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px; font-weight: 400;
  color: rgba(255,255,255,0.45); margin-top: 10px; letter-spacing: 3px;
}
.cover-divider { width: 72px; height: 4px; background: var(--kw-red); margin: 32px 0; }
.cover-for { font-size: 15px; color: rgba(255,255,255,0.6); }
.cover-footer {
  padding: 28px 48px; border-top: 4px solid var(--kw-red);
  display: flex; justify-content: space-between; align-items: flex-end;
}
.cover-date { color: rgba(255,255,255,0.4); font-size: 12px; text-align: right; }

/* ── AGENT CARD (cover & footer) ── */
.agent-card { display: flex; align-items: center; gap: 14px; }
.agent-initials {
  border-radius: 50%; background: var(--kw-red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 800; flex-shrink: 0;
}
.agent-info-name { font-weight: 800; font-size: 15px; color: #fff; }
.agent-info-title { font-size: 10px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1px; }
.agent-info-contact { font-size: 12px; color: rgba(255,255,255,0.65); margin-top: 3px; }

/* ── SUBJECT PROPERTY ── */
.subject-headline {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 34px; font-weight: 800;
  text-transform: uppercase; color: var(--kw-dark); margin-bottom: 4px;
}
.subject-subline { font-size: 13px; color: var(--kw-gray); margin-bottom: 24px; }

.prop-specs-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-bottom: 20px;
}
.prop-spec-box {
  border: 1.5px solid var(--kw-border); border-radius: 6px;
  padding: 14px 10px; text-align: center;
}
.prop-spec-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 24px; font-weight: 800; color: var(--kw-dark);
}
.prop-spec-label {
  font-size: 9px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--kw-gray); font-weight: 700; margin-top: 3px;
}

/* Detail rows (label + value with divider, like MoxiWorks) */
.detail-rows { border-top: 1px solid #e0e0e0; }
.detail-row {
  display: flex; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid #e8e8e8; font-size: 13.5px;
}
.detail-label { font-weight: 700; color: #1a1a1a; }
.detail-value { color: #444; }

/* Feature tags */
.prop-features { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.prop-feature-tag {
  background: var(--kw-light); border: 1px solid var(--kw-border);
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; color: var(--kw-gray);
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* ── SIDE-BY-SIDE COMPARISONS ── */
.comp-header-row { margin-bottom: 0; }
.comp-header-cell {
  padding: 14px 14px 12px; color: #fff; vertical-align: top;
}
.comp-header-cell.subject-cell { background: #f0f0f0; }
.comp-header-cell.comp-cell { background: var(--kw-red); border-left: 1px solid rgba(255,255,255,0.15); }
.comp-header-spacer { background: #e0e0e0; }

.comp-header-label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 1.5px;
  color: rgba(255,255,255,0.55); margin-bottom: 5px;
}
.comp-header-address { font-weight: 700; font-size: 12px; line-height: 1.3; }
.comp-header-price {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px; font-weight: 800; margin-top: 4px;
}
.comp-header-badge {
  display: inline-block; font-size: 9px; font-weight: 700;
  padding: 1px 7px; border-radius: 10px; text-transform: uppercase;
  letter-spacing: 0.5px; margin-top: 4px;
}
.badge-sold    { background: rgba(255,255,255,0.18); color: rgba(255,255,255,0.85); }
.badge-active  { background: rgba(39,174,96,0.3); color: #b0f0c8; border: 1px solid rgba(39,174,96,0.4); }
.badge-pending { background: rgba(230,126,34,0.3); color: #ffd4a0; border: 1px solid rgba(230,126,34,0.4); }

.sbs-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sbs-table .sbs-label {
  font-weight: 700; font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.5px; color: #555; padding: 8px 14px;
  background: #f4f4f4; border-right: 2px solid #ddd;
  border-bottom: 1px solid #e8e8e8; white-space: nowrap;
}
.sbs-table td { padding: 8px 14px; border-bottom: 1px solid #e8e8e8; color: #222; }
.sbs-table tr:nth-child(even) td { background: #fafafa; }
.sbs-table tr:nth-child(even) .sbs-label { background: #efefef; }
.sbs-table .sbs-subject { background: #fff5f6 !important; font-weight: 600; border-right: 2px solid var(--kw-red); }

/* (conclusion styles now in REPORT — CONCLUSION section below) */

/* ── FOOTER (last page) ── */
.report-page-footer {
  background: #fff; padding: 20px 36px; margin-top: auto;
  display: flex; justify-content: space-between; align-items: center; gap: 32px;
  border-top: 3px solid var(--kw-red);
}
.footer-disclaimer { font-size: 9px; color: #888; max-width: 440px; line-height: 1.6; }

/* ===========================
   LOADING / SPINNER
   =========================== */
.loading-spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* ===========================
   NOTIFICATIONS
   =========================== */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--kw-dark);
  color: #fff;
  padding: 14px 20px;
  border-radius: 6px;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  border-left: 4px solid var(--kw-red);
  animation: slideIn 0.2s ease;
}
.toast.success { border-left-color: #27ae60; }
.toast.error { border-left-color: #e74c3c; }
@keyframes slideIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===========================
   ROSTER LOOKUP
   =========================== */
.login-box { gap: 14px; display: flex; flex-direction: column; }

.roster-search-wrap { display: flex; flex-direction: column; gap: 6px; }
.roster-search-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--kw-gray); }
.roster-search-row { display: flex; align-items: center; gap: 8px; position: relative; }
.roster-search-row input {
  flex: 1;
  border: 2px solid var(--kw-red);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  color: var(--kw-dark);
}
.roster-search-row input:focus { outline: none; box-shadow: 0 0 0 3px rgba(200,16,46,0.12); }

.roster-load-status {
  font-size: 11px;
  color: #aaa;
  white-space: nowrap;
  min-width: 60px;
  text-align: right;
}
.roster-load-status.loading { color: var(--kw-red); }
.roster-load-status.ready { color: #27ae60; }
.roster-load-status.error { color: #e74c3c; }

.roster-dropdown {
  background: #fff;
  border: 1.5px solid var(--kw-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
  z-index: 200;
  width: 100%;
}
.roster-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--kw-border);
  transition: background 0.1s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.roster-item:last-child { border-bottom: none; }
.roster-item:hover { background: #fff8f9; }
.roster-item-name { font-weight: 700; font-size: 14px; }
.roster-item-detail { font-size: 12px; color: var(--kw-gray); }
.roster-item-selected {
  background: #fff0f2;
  border: 2px solid var(--kw-red);
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.roster-item-selected .check { color: var(--kw-red); font-size: 18px; }
.roster-item-selected .info strong { display: block; font-size: 14px; }
.roster-item-selected .info span { font-size: 12px; color: var(--kw-gray); }
.roster-change { font-size: 11px; color: var(--kw-red); cursor: pointer; text-decoration: underline; margin-left: auto; }

.roster-divider {
  text-align: center;
  color: #bbb;
  font-size: 11px;
  margin: 4px 0 2px;
  position: relative;
}
.roster-divider::before, .roster-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: var(--kw-border);
}
.roster-divider::before { left: 0; }
.roster-divider::after { right: 0; }

#agentFields { display: flex; flex-direction: column; gap: 12px; }

/* ===========================
   1-PAGE CMA SUMMARY
   =========================== */
.cma-summary-page { display: none; }

.sa-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px; font-weight: 800; text-align: center;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--kw-dark); padding: 10px 0 8px;
  border: 2.5px solid var(--kw-red); border-bottom: none;
}
.sa-table {
  width: 100%; border-collapse: collapse;
  border: 2.5px solid var(--kw-red); font-size: 7.5px;
  table-layout: fixed;
}
.sa-table thead th, .sa-table thead td {
  border: 1px solid #bbb; padding: 3px 4px; vertical-align: middle; text-align: center;
}
.sa-sub-col { background: #fffbf0 !important; font-size: 8px !important; }
.sa-comp-hdr { background: var(--kw-dark) !important; color: #fff !important; font-size: 9px !important; font-weight: 700; }
.sa-comp-hdr.sa-comp-shade { background: #3a3a3a !important; }
.sa-comp-addr { font-size: 8px !important; font-weight: 600 !important; }
.sa-comp-addr.sa-comp-shade { background: #e2e2e2 !important; }
.sa-subhdr-row td { background: #d4d4d4 !important; font-weight: 700; font-size: 7px; text-align: center; padding: 2px 3px; border: 1px solid #bbb; color: #333; }
.sa-subhdr-row td.sa-comp-shade { background: #b8b8b8 !important; }
.sa-lbl { font-size: 7.5px; padding: 2px 5px; color: #333; border-right: 1px solid #ddd; white-space: nowrap; border-bottom: 1px solid #e0e0e0; }
.sa-lbl-col { width: 110px; }
.sa-sub { font-size: 7.5px; padding: 2px 5px; text-align: center; background: #fffdf5 !important; border-right: 1px solid #ddd; border-bottom: 1px solid #e0e0e0; }
.sa-desc { font-size: 7.5px; padding: 2px 4px; text-align: center; border-right: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0; }
.sa-adj  { font-size: 7.5px; padding: 2px 4px; text-align: right; border-right: 1px solid #ccc; min-width: 42px; border-bottom: 1px solid #e0e0e0; }
/* Row alternation — yellow on odd rows */
.sa-table tbody tr:nth-child(odd) td  { background-color: #FFFBE6; }
.sa-table tbody tr:nth-child(even) td { background-color: #ffffff; }
/* Subject col stays tinted */
.sa-table tbody .sa-sub { background: #fffdf5 !important; }
/* Column shading — every other comp pair */
.sa-table tbody td.sa-comp-shade                    { background-color: #EAECF0 !important; }
.sa-table tbody tr:nth-child(odd) td.sa-comp-shade  { background-color: #E2E6EF !important; }
.sa-adj.sa-pos { color: #166534; font-weight: 700; }
.sa-adj.sa-neg { color: #991b1b; font-weight: 700; }
.sa-adj.sa-zero { color: #888; }
.sa-spacer td { height: 4px; background: #e8e8e8 !important; border-top: 1px solid #ccc; }
.sa-total td { background: #dde2ea !important; font-weight: 700; border-top: 1.5px solid #999; font-size: 7.5px; }
.sa-total td.sa-comp-shade { background: #c4ccd8 !important; }
.sa-adjprice td { background: var(--kw-dark) !important; color: #fff !important; font-weight: 700; }
.sa-adjval { text-align: center !important; font-size: 9px !important; letter-spacing: 0.5px; }
.sa-adjval.sa-adjval-shade { background: #3a3a3a !important; }

.sa-footer {
  display: flex; justify-content: space-between; align-items: flex-end;
  border: 2.5px solid var(--kw-red); border-top: none;
  padding: 8px 12px; background: #fff;
}
.sa-footer-left { display: flex; align-items: center; gap: 10px; }
.sa-logo { height: 36px; object-fit: contain; background: white; padding: 2px; }
.sa-footer-info { font-size: 8px; color: #333; line-height: 1.5; }
.sa-footer-agent { font-weight: 700; font-size: 9px; }
.sa-footer-brok { color: var(--kw-red); font-weight: 600; }
.sa-footer-right { text-align: right; }
.sa-opinion-label { font-size: 8px; color: #555; line-height: 1.4; max-width: 200px; }
.sa-opinion-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px; font-weight: 800; color: var(--kw-dark); letter-spacing: 0.5px;
}

/* ===========================
   PRINT STYLES
   =========================== */
@media print {
  body { background: #fff; margin: 0; }
  /* Summary-only print mode */
  body.printing-summary * { display: none !important; }
  body.printing-summary .cma-summary-page,
  body.printing-summary .cma-summary-page * { display: revert !important; }
  body.printing-summary .cma-summary-page { display: block !important; }
  body.printing-summary .sa-table { display: table !important; }
  body.printing-summary .sa-table thead { display: table-header-group !important; }
  body.printing-summary .sa-table tbody { display: table-row-group !important; }
  body.printing-summary .sa-table tr { display: table-row !important; }
  body.printing-summary .sa-table th,
  body.printing-summary .sa-table td { display: table-cell !important; }
  body.printing-summary .sa-logo { background: white !important; mix-blend-mode: normal !important; }
  body.printing-summary .sa-footer { display: flex !important; }
  body.printing-summary .sa-footer-left { display: flex !important; }
  body.printing-summary .sa-footer-info,
  body.printing-summary .sa-footer-right { display: block !important; }
  body.printing-summary .cma-summary-page { page-break-after: avoid; }
  body.printing-summary * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.printing-summary .sa-comp-hdr { background: #fff !important; color: var(--kw-dark) !important; border-bottom: 2px solid var(--kw-red) !important; }
  body.printing-summary .sa-comp-hdr.sa-comp-shade { background: #f0f0f0 !important; color: var(--kw-dark) !important; }
  body.printing-summary .sa-adjprice td { background: #fff !important; color: var(--kw-dark) !important; border-top: 2px solid var(--kw-red) !important; border-bottom: 2px solid var(--kw-red) !important; }
  body.printing-summary .sa-adjval.sa-adjval-shade { background: #f0f0f0 !important; }
  .app-header, .step-nav, .step-content:not(#step4),
  .report-actions, .step-header { display: none !important; }
  #step4 { display: block !important; padding: 0 !important; max-width: 100%; }
  .cma-report { background: #fff; padding: 0; gap: 0; }
  .report-page {
    box-shadow: none; page-break-after: always; break-after: page;
    min-height: 100vh; max-width: 100%;
    /* overflow:hidden clips table content in print — must override */
    overflow: visible;
    position: relative;
  }
  .cover-page { min-height: 100vh; }

  /* Ensure the SBS table and adj table render fully without clipping */
  #compsGrid, #reportAdjTable { overflow: visible; width: 100%; }
  .sbs-table, .adj-table { font-size: 8.5pt; }
  .sbs-table .sbs-label { width: 110px; }
  .sbs-table td, .sbs-table .sbs-label { padding: 5px 10px; }

  /* Keep subject property heading on same page as its content (combined view) */
  .report-page-header { break-after: avoid; page-break-after: avoid; }
  .rph-redbar { break-after: avoid; page-break-after: avoid; }

  /* Remove ID bar (page header strip) from CMA-only printout; keep in combined presentation */
  body:not(.showing-combined) .report-page-header,
  body:not(.showing-combined) .rph-redbar { display: none !important; }

  /* Prevent agent footer from covering net-to-seller on the combined net page */
  .combined-net-page { padding-bottom: 140px; }

  /* Preserve background colors (headers, hero, cover) */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .adj-manual-input { border: none; background: transparent; text-align: right; }
  .adj-custom-label { border: none; background: transparent; }

  /* Hide manual-adjustment rows where all values are zero */
  tr.adj-row-zero { display: none !important; }

  /* ── WHITE BACKGROUND PRINT OVERRIDES ── */
  /* Cover page: white bg with dark text */
  .cover-page {
    background: #fff !important; color: var(--kw-dark) !important;
  }
  .cover-label { color: var(--kw-red) !important; }
  .cover-address { color: var(--kw-dark) !important; }
  .cover-city { color: #666 !important; }
  .cover-for { color: #555 !important; }
  .cover-date { color: #888 !important; }
  .cover-footer { border-top-color: var(--kw-red) !important; }

  /* Agent card: dark text when on white bg */
  .agent-info-name { color: var(--kw-dark) !important; }
  .agent-info-title { color: #888 !important; }
  .agent-info-contact { color: #555 !important; }

  /* Adj table header: dark on white */
  .adj-table th { background: #fff !important; color: var(--kw-dark) !important; border-bottom: 2px solid var(--kw-red) !important; }
  .comp-header-cell { color: var(--kw-dark) !important; }
  .comp-header-cell.comp-cell { background: #fff0f0 !important; color: var(--kw-dark) !important; }
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .checkbox-grid { grid-template-columns: repeat(2, 1fr); }
  .comp-list { grid-template-columns: 1fr; }
  .analysis-stats { grid-template-columns: repeat(2, 1fr); }
  .prop-specs-grid { grid-template-columns: repeat(2, 1fr); }
  .step-tab .step-label { display: none; }
  .login-box { width: 95%; padding: 32px 24px; }
}

/* ═══════════════════════════════════════
   COMING SOON BAR
═══════════════════════════════════════ */
.coming-soon-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: #fffbf0; border: 1.5px solid #f0d080;
  border-radius: 6px; padding: 14px 18px; margin-bottom: 20px; gap: 12px;
}
.coming-soon-left { display: flex; align-items: center; gap: 12px; }
.coming-soon-icon { font-size: 22px; }
.coming-soon-left strong { display: block; font-size: 14px; color: var(--kw-dark); }
.coming-soon-sub { font-size: 12px; color: #888; }
.coming-soon-badge {
  background: #f0d080; color: #7a6000;
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px;
  padding: 4px 10px; border-radius: 20px; white-space: nowrap; flex-shrink: 0;
}

/* ═══════════════════════════════════════
   CSV IMPORT
═══════════════════════════════════════ */
.csv-import-card { margin-bottom: 16px; }
.import-desc { font-size: 13px; color: var(--kw-gray); margin-bottom: 16px; line-height: 1.6; }

.csv-drop-zone {
  border: 2.5px dashed var(--kw-border);
  border-radius: 8px; padding: 36px 24px;
  text-align: center; cursor: pointer;
  transition: all 0.15s; background: #fafafa;
}
.csv-drop-zone:hover, .csv-drop-zone.drag-over {
  border-color: var(--kw-red); background: #fff8f9;
}
.csv-drop-icon { color: #ccc; margin-bottom: 10px; }
.csv-drop-zone:hover .csv-drop-icon, .csv-drop-zone.drag-over .csv-drop-icon { color: var(--kw-red); }
.csv-drop-text { font-size: 15px; font-weight: 700; color: var(--kw-dark); margin-bottom: 4px; }
.csv-drop-sub  { font-size: 12px; color: #aaa; margin-bottom: 12px; }
.csv-browse-btn { cursor: pointer; display: inline-block; }

.csv-import-status {
  margin-top: 14px; padding: 12px 16px;
  border-radius: 6px; font-size: 13px;
  display: flex; align-items: center; gap: 10px;
}
.csv-import-status.success { background: #f0fff4; border: 1.5px solid #27ae60; color: #1a7a40; }
.csv-import-status.error   { background: #fff0f0; border: 1.5px solid #e74c3c; color: #c0392b; }
.csv-import-status strong  { font-weight: 800; }
.skip-note { font-size: 11px; color: #888; margin-left: 6px; }

/* ═══════════════════════════════════════
   HOW-TO CARD
═══════════════════════════════════════ */
.how-to-card {
  background: var(--kw-light); border-radius: 6px;
  padding: 16px 20px; margin-bottom: 24px;
}
.how-to-title { font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--kw-gray); margin-bottom: 12px; }
.how-to-steps { display: flex; gap: 16px; flex-wrap: wrap; }
.how-to-step { display: flex; align-items: flex-start; gap: 8px; font-size: 12px;
  color: var(--kw-dark); flex: 1; min-width: 160px; }
.how-num { background: var(--kw-red); color: #fff; width: 20px; height: 20px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; flex-shrink: 0; margin-top: 1px; }

/* ═══════════════════════════════════════
   COMP ENTRY CARDS
═══════════════════════════════════════ */
.comp-cards-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 2px; color: var(--kw-dark);
  margin-bottom: 14px; display: flex; align-items: center; gap: 12px;
}
.comp-cards-hint { font-family: 'Lato', sans-serif; font-size: 12px;
  font-weight: 400; color: #aaa; text-transform: none; letter-spacing: 0; }
.comp-cards-wrap { display: flex; flex-direction: column; gap: 16px; }

.comp-entry-card {
  background: #fff; border: 1.5px solid var(--kw-border);
  border-radius: 8px; padding: 20px 24px;
  box-shadow: var(--shadow);
}
.comp-entry-card.has-data { border-color: var(--kw-red); }

.comp-entry-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--kw-light);
}
.comp-entry-num {
  font-family: 'Barlow Condensed', sans-serif; font-size: 18px;
  font-weight: 800; text-transform: uppercase; letter-spacing: 2px; color: var(--kw-red);
}
.btn-clear-comp {
  background: none; border: 1.5px solid #e0b0b0; color: #c0392b;
  padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700;
  cursor: pointer; transition: all 0.12s;
}
.btn-clear-comp:hover { background: #ffeaea; }

.comp-form-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.comp-form-grid .span2 { grid-column: span 2; }

.comp-entry-summary {
  margin-top: 16px; padding-top: 14px; border-top: 2px solid var(--kw-light);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.comp-summary-price {
  font-family: 'Barlow Condensed', sans-serif; font-size: 26px;
  font-weight: 800; color: var(--kw-red);
}
.comp-summary-detail { font-size: 13px; color: var(--kw-gray); }
.comp-summary-ppsf {
  margin-left: auto; background: var(--kw-light); padding: 4px 12px;
  border-radius: 20px; font-size: 12px; font-weight: 700; color: var(--kw-gray);
}

/* ═══════════════════════════════════════
   ANALYSIS STATS
═══════════════════════════════════════ */
.analysis-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 4px;
}
.stat-box {
  border: 2px solid var(--kw-border); border-radius: 6px;
  padding: 18px 12px; text-align: center;
}
.stat-box.highlight { border-color: var(--kw-red); background: #fff8f9; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--kw-gray); font-weight: 700; margin-bottom: 6px; }
.stat-value { font-family: 'Barlow Condensed', sans-serif; font-size: 26px; font-weight: 800; color: var(--kw-dark); }
.stat-box.highlight .stat-value { color: var(--kw-red); }

/* ═══════════════════════════════════════
   REPORT — COMPS GRID TABLE
═══════════════════════════════════════ */
.comps-grid-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.comps-grid-table th {
  background: var(--kw-dark); color: #fff; padding: 9px 10px;
  text-align: left; font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
}
.comps-grid-table td { padding: 9px 10px; border-bottom: 1px solid var(--kw-border); }
.comps-grid-table tr:nth-child(even) td { background: #f9f9f9; }
.comps-grid-table tr.subject-row td {
  background: #fff0f2 !important; font-weight: 700;
  border-top: 2px solid var(--kw-red); border-bottom: 2px solid var(--kw-red);
}

/* ═══════════════════════════════════════
   REPORT — CONCLUSION
═══════════════════════════════════════ */

/* Hero band — breaks out of .page-content padding */
.conc-hero {
  background: #fff;
  border-top: 4px solid var(--kw-red);
  border-bottom: 3px solid var(--kw-red);
  margin: -32px -36px 0;
  padding: 56px 48px 52px;
  text-align: center;
  position: relative;
}
.conc-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 5px;
  background: var(--kw-red);
}
.conc-hero-eyebrow {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 3.5px;
  color: var(--kw-red);
  font-weight: 700;
  margin-bottom: 18px;
}
.conc-hero-price {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 86px;
  font-weight: 800;
  color: var(--kw-dark);
  line-height: 1;
  letter-spacing: -1px;
  margin-bottom: 16px;
}
.conc-hero-tagline {
  font-size: 11px;
  color: #888;
  letter-spacing: 0.4px;
}

/* Two supporting range boxes */
.conc-support-row {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  border-bottom: 2px solid #ececec;
  margin: 0 -36px 32px;
}
.conc-support-box {
  padding: 30px 48px;
  text-align: center;
}
.conc-support-sep {
  background: #e0e0e0;
  margin: 24px 0;
}
.conc-support-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--kw-gray);
  font-weight: 700;
  margin-bottom: 10px;
}
.conc-support-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--kw-dark);
  line-height: 1;
}
.conc-support-sub {
  font-size: 11px;
  color: #bbb;
  margin-top: 7px;
}

/* Analysis notes */
.conc-notes {
  margin: 0 0 28px;
  padding: 18px 22px;
  background: #f8f8f8;
  border-left: 4px solid var(--kw-red);
  border-radius: 0 4px 4px 0;
}
.conc-notes-label {
  font-weight: 800;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--kw-red);
  margin-bottom: 8px;
}
.conc-notes-body {
  font-size: 13px;
  line-height: 1.75;
  color: #333;
}

/* ═══════════════════════════════════════
   REPORT PAGE FOOTER
═══════════════════════════════════════ */
.last-page { padding-bottom: 140px; }
.report-page-footer {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: #fff;
  padding: 22px 48px;
  display: flex; justify-content: space-between; align-items: center; gap: 32px;
  border-top: 3px solid var(--kw-red);
  border-top-color: var(--kw-red);
}
.footer-disclaimer {
  font-size: 9px; color: #888; max-width: 420px; line-height: 1.65;
  font-style: italic;
}

/* ═══════════════════════════════════════
   PRICE RANGE INPUTS
═══════════════════════════════════════ */
.price-range-inputs { display: flex; align-items: center; gap: 10px; }
.price-range-inputs input { flex:1; border:1.5px solid var(--kw-border); border-radius:var(--radius); padding:9px 12px; font-family:'Lato',sans-serif; font-size:14px; }
.price-range-inputs span { color:#aaa; font-size:18px; }

/* ═══════════════════════════════════════
   MISC REPORT
═══════════════════════════════════════ */
.prop-notes { margin-top: 16px; padding: 14px 16px; background: #f9f9f9;
  border-radius: 4px; border-left: 4px solid var(--kw-red); font-size: 13px; }
.report-actions { display: flex; gap: 12px; margin-bottom: 24px; align-items: center; }


/* ===========================
   PRICE TIER SELECTOR
   =========================== */
.price-tier-card { border-left: 4px solid var(--kw-red); }
.tier-btn-group { display: flex; gap: 12px; }
.tier-btn {
  flex: 1;
  padding: 12px 20px;
  border: 2px solid var(--kw-border);
  border-radius: var(--radius);
  background: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  color: var(--kw-gray);
  transition: all 0.2s;
}
.tier-btn:hover { border-color: var(--kw-red); color: var(--kw-red); }
.tier-btn.active {
  background: var(--kw-red);
  border-color: var(--kw-red);
  color: #fff;
}


/* ═══════════════════════════════════════
   TOOL PICKER SCREEN
═══════════════════════════════════════ */
#toolPickerScreen { min-height: 100vh; align-items: center; justify-content: center; }
#toolPickerScreen.active { display: flex; }

.tool-picker-bg {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d0a0f 50%, #1a1a1a 100%);
  z-index: 0;
}
.tool-picker-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, transparent, transparent 40px, rgba(200,16,46,0.03) 40px, rgba(200,16,46,0.03) 80px);
}
.tool-picker-wrap {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 48px 32px; width: 100%; max-width: 980px;
}
.tool-picker-logo { height: 52px; object-fit: contain; margin-bottom: 28px; }
.tool-picker-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 32px; font-weight: 700; color: #fff;
  margin-bottom: 6px; text-align: center;
}
.tool-picker-title span { color: var(--kw-red); }
.tool-picker-sub { font-size: 13px; color: rgba(255,255,255,0.4); margin-bottom: 36px; }
.tool-picker-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; width: 100%; margin-bottom: 28px; }
.tool-card {
  background: rgba(255,255,255,0.04); border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 32px 24px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  cursor: pointer; text-align: left; color: #fff; transition: all 0.2s;
}
.tool-card:hover { background: rgba(200,16,46,0.12); border-color: var(--kw-red); transform: translateY(-2px); }
.tool-card-combo { border-color: rgba(200,16,46,0.35); background: rgba(200,16,46,0.07); }
.tool-card-combo:hover { background: rgba(200,16,46,0.18); }
.tool-card-combo-badge {
  display: inline-block;
  background: var(--kw-red); color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  padding: 2px 8px; border-radius: 3px;
}
.tool-card-icon { color: var(--kw-red); margin-bottom: 4px; }
.tool-card-title { font-family: 'Barlow Condensed', sans-serif; font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.tool-card-desc { font-size: 12px; color: rgba(255,255,255,0.5); line-height: 1.6; flex: 1; }
.tool-card-arrow { font-size: 20px; color: var(--kw-red); margin-top: 8px; align-self: flex-end; }
.tool-picker-logout { color: rgba(255,255,255,0.4); border-color: rgba(255,255,255,0.15); }
.tool-picker-logout:hover { color: #fff; border-color: rgba(255,255,255,0.4); }

/* ═══════════════════════════════════════
   COMBO TAB BAR
═══════════════════════════════════════ */
.combo-tab-bar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: var(--kw-dark);
  border-bottom: 3px solid var(--kw-red);
  box-shadow: 0 2px 16px rgba(0,0,0,0.35);
}
.combo-tab-bar.active { display: block; }
.combo-tab-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1400px; margin: 0 auto; padding: 0 20px; height: 46px;
}
.combo-tab-brand {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.7);
  letter-spacing: 0.3px; white-space: nowrap;
}
.combo-tab-btns { display: flex; align-items: center; gap: 4px; }
.combo-tab-btn {
  display: flex; align-items: center; gap: 6px;
  background: transparent; border: none;
  color: rgba(255,255,255,0.45); cursor: pointer;
  font-family: 'Lato', sans-serif; font-size: 13px; font-weight: 600;
  padding: 6px 18px; border-radius: 4px; transition: all 0.18s;
  letter-spacing: 0.2px;
}
.combo-tab-btn:hover { color: #fff; background: rgba(255,255,255,0.07); }
.combo-tab-btn.active { color: #fff; background: var(--kw-red); }
.combo-tab-btn.active:hover { background: #a50d25; }
.combo-tab-exit {
  background: transparent; border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.45); cursor: pointer;
  font-family: 'Lato', sans-serif; font-size: 12px;
  padding: 5px 14px; border-radius: 4px; transition: all 0.18s;
  white-space: nowrap;
}
.combo-tab-exit:hover { color: #fff; border-color: rgba(255,255,255,0.5); }
body.combo-mode #appScreen,
body.combo-mode #sellerNetScreen { padding-top: 46px; }

/* ═══════════════════════════════════════
   SELLER NET SHEET — LAYOUT
═══════════════════════════════════════ */
/* ═══════════════════════════════════════
   COMBINED CLIENT PRESENTATION
═══════════════════════════════════════ */
#combinedScreen.active { display: block; }

.combined-action-bar {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--kw-dark);
  border-bottom: 3px solid var(--kw-red);
  padding: 0 24px; height: 54px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.combined-action-back {
  display: flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.6); cursor: pointer;
  font-family: 'Lato', sans-serif; font-size: 13px;
  padding: 6px 14px; border-radius: 4px; transition: all 0.18s;
}
.combined-action-back:hover { color: #fff; border-color: rgba(255,255,255,0.5); }
.combined-action-center { text-align: center; }
.combined-action-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px; font-weight: 700; color: #fff; letter-spacing: 0.3px;
}
.combined-action-sub { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 1px; }
.combined-action-print {
  display: flex; align-items: center; gap: 7px;
  background: var(--kw-red); border: none; color: #fff; cursor: pointer;
  font-family: 'Lato', sans-serif; font-size: 13px; font-weight: 700;
  padding: 8px 18px; border-radius: 4px; transition: background 0.18s;
  letter-spacing: 0.2px;
}
.combined-action-print:hover { background: #a50d25; }

.combined-preview-wrap {
  background: #d0d0d0;
  padding: 40px 0; min-height: calc(100vh - 54px);
  display: flex; flex-direction: column; align-items: center; gap: 0;
}
/* CMA pages inside combined preview inherit all .report-page styles */
.combined-preview-wrap .cma-report {
  background: transparent; padding: 0; gap: 0;
  display: flex; flex-direction: column; align-items: center; width: 100%;
}
.combined-preview-wrap .report-page {
  width: 900px; max-width: 96vw;
  margin-bottom: 20px;
  box-shadow: 0 4px 28px rgba(0,0,0,0.22);
}
.combined-net-page { width: 900px; max-width: 96vw; margin-bottom: 20px; }
body.cma-only-present .combined-net-page { display: none !important; }

/* Net page body layout */
.combined-net-body { padding: 28px 36px 20px; }
.combined-net-prop-header { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1.5px solid var(--kw-border); }
.combined-net-prop-address {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px; font-weight: 700; color: var(--kw-dark);
}
.combined-net-prop-meta { font-size: 12px; color: var(--kw-gray); margin-top: 4px; }

.combined-net-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.combined-net-col {}
.combined-net-section { margin-bottom: 22px; }
.combined-net-section-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--kw-red); padding-bottom: 6px;
  border-bottom: 1.5px solid var(--kw-red); margin-bottom: 8px;
}
.combined-net-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; font-size: 12.5px; border-bottom: 1px solid #f0f0f0;
  color: var(--kw-dark);
}
.combined-net-row span:last-child { font-weight: 600; }
.combined-net-subtotal {
  background: #f7f7f7; padding: 6px 4px;
  font-weight: 700 !important; font-size: 13px !important;
  border-top: 1.5px solid var(--kw-border) !important;
  border-bottom: 1.5px solid var(--kw-border) !important;
}
.combined-net-deduct span:last-child { color: #c0392b; }

.combined-net-hero {
  margin: 20px 0 0;
  background: #fff;
  border: 2px solid var(--kw-red);
  border-radius: 8px;
  padding: 28px 36px;
  display: flex; flex-direction: column; align-items: center;
  position: relative; overflow: hidden;
}
.combined-net-hero::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 4px; background: var(--kw-red);
}
.combined-net-hero-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
  color: var(--kw-red); margin-bottom: 4px;
}
.combined-net-hero-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 72px; font-weight: 800; color: var(--kw-dark); line-height: 1;
  margin-bottom: 8px;
}
.combined-net-hero-val.net-positive { color: #4ade80; }
.combined-net-hero-val.net-negative { color: #f87171; }
/* Pending state: no sale price entered — render gracefully instead of giant bar */
.combined-net-hero-val.pending {
  font-size: 28px; opacity: 0.35; letter-spacing: 6px;
}
.combined-net-hero-note { font-size: 11px; color: #999; text-align: center; }

/* Combo tab right section */
.combo-tab-right { display: flex; align-items: center; gap: 10px; }
.combo-present-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--kw-red); border: none; color: #fff; cursor: pointer;
  font-family: 'Lato', sans-serif; font-size: 12px; font-weight: 700;
  padding: 6px 14px; border-radius: 4px; transition: background 0.18s;
  letter-spacing: 0.2px; white-space: nowrap;
}
.combo-present-btn:hover { background: #a50d25; }

/* ── PRINT: Combined Presentation ── */
@media print {
  body.showing-combined .combo-tab-bar,
  body.showing-combined .combined-action-bar { display: none !important; }

  body.showing-combined .combined-preview-wrap {
    background: #fff; padding: 0;
    display: block;
  }
  body.showing-combined .combined-preview-wrap .report-page,
  body.showing-combined .combined-net-page {
    width: 100%; max-width: 100%;
    box-shadow: none; margin: 0;
    page-break-after: always; break-after: page;
    min-height: 100vh; overflow: visible;
  }
  body.showing-combined .combined-net-hero {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  body.showing-combined * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* When showing combined, hide the regular CMA print output */
  body.showing-combined #appScreen,
  body.showing-combined #sellerNetScreen { display: none !important; }
}

#sellerNetScreen.active { display: block; }

.sn-layout {
  display: grid;
  grid-template-columns: 480px 1fr;
  min-height: calc(100vh - 60px);
  align-items: start;
}

/* ── Inputs column ── */
.sn-inputs {
  padding: 24px 24px 40px;
  background: #efefef;
  overflow-y: auto;
  min-height: calc(100vh - 60px);
}
.sn-card {
  background: #fff; border-radius: 6px; padding: 20px 20px 16px;
  margin-bottom: 14px; box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.sn-card-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--kw-red); margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 2px solid var(--kw-light);
}
.sn-info-note {
  background: #fff8e1; border: 1px solid #ffc107; border-left: 3px solid #ff9800;
  border-radius: 4px; padding: 10px 12px; font-size: 12px; color: #7a5000;
  margin-top: 10px;
}
.sn-info-note.hidden { display: none; }
.sn-actions { display: flex; gap: 10px; flex-wrap: wrap; padding: 8px 0; }

/* ── Result column ── */
.sn-result {
  background: #fff; position: sticky; top: 60px;
  min-height: calc(100vh - 60px); max-height: calc(100vh - 60px);
  overflow-y: auto; display: flex; flex-direction: column;
  border-left: 3px solid var(--kw-red);
}
.sn-result-header {
  background: #fff; padding: 20px 28px;
  border-bottom: 4px solid var(--kw-red);
}
.sn-result-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px; font-weight: 800; color: var(--kw-dark); letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 4px;
}
.sn-result-sub { font-size: 13px; color: #666; margin-bottom: 6px; }
.sn-result-meta { font-size: 11px; color: #999; }
.sn-result-meta strong { color: #555; }

.sn-section { padding: 14px 24px 0; }
.sn-section-title {
  font-size: 9px; text-transform: uppercase; letter-spacing: 2px;
  color: var(--kw-red); font-weight: 800; margin-bottom: 8px;
  padding-bottom: 4px; border-bottom: 1px solid #eee;
}
.sn-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 4px 0; font-size: 13px; color: #444; border-bottom: 1px solid #f5f5f5;
}
.sn-row span:last-child { font-weight: 600; color: #222; text-align: right; }
.sn-row.sn-subtotal {
  font-weight: 700; color: #222; background: #f9f9f9;
  margin: 4px -24px 10px; padding: 7px 24px;
  border-top: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0;
}
.sn-row.sn-expense span:last-child { color: var(--kw-red); }
/* Reference/basis row — not an expense, just a note for calculation context */
.sn-row.sn-basis {
  font-size: 12px; color: #999; font-style: italic;
  border-bottom: none; padding-bottom: 0;
}
.sn-row.sn-basis span:first-child::before { content: "↳ "; font-style: normal; opacity: 0.5; }
.sn-row.sn-basis span:last-child { color: #bbb; font-weight: 400; }
.sn-row-note {
  font-size: 11px; color: #999; padding: 2px 0 6px; font-style: italic;
  text-align: right;
}
.out-callquote { color: #e65100 !important; font-style: italic; }

/* Net to seller */
.sn-net-section {
  margin: 16px 0 0; padding: 22px 24px 20px;
  background: #fff; text-align: center;
  border-top: 4px solid var(--kw-red);
  border: 2px solid var(--kw-red);
  margin: 16px 12px 0;
  border-radius: 4px;
}
.sn-net-label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 3px;
  color: var(--kw-red); font-weight: 700; margin-bottom: 8px;
}
.net-value {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 52px; font-weight: 800; line-height: 1;
}
.net-value.net-positive { color: #4caf50; }
.net-value.net-negative { color: #ef5350; }
/* Pending state (no calculation yet) — show dash at readable size, not a huge bar */
.net-value:not(.net-positive):not(.net-negative) {
  font-size: 28px; opacity: 0.4; letter-spacing: 6px;
}

.sn-disclaimer {
  font-size: 10px; color: #aaa; padding: 14px 24px 10px;
  line-height: 1.65; border-top: 1px solid #eee; margin-top: auto;
}
.sn-footer-agent {
  padding: 12px 24px 16px; border-top: 1px solid #eee;
}
.sn-footer-name { font-weight: 800; font-size: 14px; color: var(--kw-dark); }
.sn-footer-brokerage { font-size: 11px; color: var(--kw-gray); }

/* ═══════════════════════════════════════
   BUYER NET — LOAN TYPE TABS
═══════════════════════════════════════ */
.bn-tabs {
  display: flex; gap: 4px; margin-top: 14px; border-bottom: 2px solid #eee; padding-bottom: 0;
}
.bn-tab {
  padding: 7px 16px; border: none; background: none; border-radius: 6px 6px 0 0;
  font-size: 13px; font-weight: 600; color: #888; cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all .15s;
}
.bn-tab:hover { color: var(--kw-dark); background: #f5f5f5; }
.bn-tab.active { color: var(--kw-red); border-bottom-color: var(--kw-red); background: #fff; }

/* Credit rows (green tint) */
.sn-row.sn-credit span:last-child { color: #4caf50; }

/* ═══════════════════════════════════════
   SELLER NET — PRINT
═══════════════════════════════════════ */
@media print {
  /* Tighter page margins so content fits without browser scaling */
  @page { margin: 12mm; }

  /* Only print the active screen */
  .screen:not(.active) { display: none !important; }

  #sellerNetScreen .sn-inputs,
  #buyerNetScreen .sn-inputs,
  #sellerNetScreen .sn-actions,
  .combo-tab-bar,
  .app-header { display: none !important; }

  #sellerNetScreen.active { display: block !important; }
  #buyerNetScreen.active  { display: block !important; }

  /* ── Combo mode: print CMA + Seller Net together ── */
  body.combo-mode #appScreen        { display: block !important; padding-top: 0 !important; }
  body.combo-mode #sellerNetScreen  { display: block !important; padding-top: 0 !important; }
  /* Last CMA report page already has break-after:page, so seller net starts on a fresh page */

  .sn-layout { display: block; }
  .sn-result {
    position: static; max-height: none; min-height: 0 !important;
    border: none; overflow: visible;
  }
  .net-value { color: var(--kw-dark) !important; }
  /* Restore pending placeholder to normal size when printing (shows real value) */
  .net-value:not(.net-positive):not(.net-negative) { font-size: 28px !important; }

  /* ── Seller Net: compact layout to fit on one page ── */
  #sellerNetScreen .sn-result-header { padding: 12px 20px; }
  #sellerNetScreen .sn-result-title  { font-size: 16px; }
  #sellerNetScreen .sn-section       { padding: 6px 20px 0; }
  #sellerNetScreen .sn-section-title { font-size: 8px; margin-bottom: 4px; padding-bottom: 2px; }
  #sellerNetScreen .sn-row           { padding: 2px 0; font-size: 12px; }
  #sellerNetScreen .sn-row-note      { font-size: 9px; padding: 1px 0 2px; }
  #sellerNetScreen .sn-row.sn-subtotal { padding: 5px 20px; margin: 2px -20px 6px; }
  #sellerNetScreen .sn-net-section   { padding: 12px 20px 10px; margin-top: 8px; page-break-inside: avoid; }
  #sellerNetScreen .net-value        { font-size: 38px !important; }
  #sellerNetScreen .sn-net-label     { margin-bottom: 4px; }
  #sellerNetScreen .sn-disclaimer    { padding: 8px 20px 6px; font-size: 9px; }
  #sellerNetScreen .sn-footer-agent  { padding: 6px 20px 8px; }
  #sellerNetScreen .sn-footer-name   { font-size: 12px; }
  #sellerNetScreen .sn-footer-brokerage { font-size: 10px; }

  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
