/* SkAI Shared Design System */
:root {
  --ink: #0a0f1a;
  --cream: #f7f5f0;
  --gold: #c9a84c;
  --gold-dim: #a88a3a;
  --slate: #3d4663;
  --mist: #e8e4dc;
  --glass: rgba(255,255,255,0.06);
  --red: #e54d4d;
  --orange: #e5924d;
  --green: #4dca6a;
  --blue: #6495ed;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--ink);
  color: var(--cream);
  overflow-x: hidden;
  min-height: 100vh;
}

.grain {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* NAV */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 1.25rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(10,15,26,0.85);
  border-bottom: 1px solid rgba(201,168,76,0.08);
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--gold);
  text-decoration: none;
}

.logo span {
  color: var(--cream);
  opacity: 0.4;
  font-weight: 400;
  font-size: 0.85rem;
  margin-left: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  color: rgba(247,245,240,0.5);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--gold);
}

.nav-links .btn-nav {
  background: var(--gold);
  color: var(--ink);
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  transition: background 0.2s;
}

.nav-links .btn-nav:hover {
  background: var(--gold-dim);
  color: var(--ink);
}

/* MAIN CONTENT */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 7rem 2rem 4rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.page-header p {
  font-size: 1rem;
  color: rgba(247,245,240,0.5);
  max-width: 700px;
}

/* UPLOAD MODE TOGGLE */
.upload-mode-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  padding: 4px;
  border: 1px solid rgba(201,168,76,0.1);
  width: fit-content;
}

.mode-btn {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  color: rgba(247,245,240,0.4);
  letter-spacing: 0.02em;
}

.mode-btn.active {
  background: var(--gold);
  color: var(--ink);
}

.mode-btn:hover:not(.active) {
  color: var(--cream);
}

/* UPLOAD ZONE */
.upload-zone,
.multi-upload-zone {
  border: 2px dashed rgba(201,168,76,0.2);
  border-radius: 8px;
  padding: 4rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: rgba(255,255,255,0.01);
  position: relative;
}

.upload-zone:hover,
.upload-zone.dragover,
.multi-upload-zone:hover,
.multi-upload-zone.dragover {
  border-color: var(--gold);
  background: rgba(201,168,76,0.03);
}

.upload-zone.uploading,
.multi-upload-zone.uploading {
  pointer-events: none;
  opacity: 0.7;
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.upload-zone h3,
.multi-upload-zone h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.upload-zone p,
.multi-upload-zone p {
  font-size: 0.9rem;
  color: rgba(247,245,240,0.4);
}

.upload-zone .file-types,
.multi-upload-zone .file-types {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: rgba(247,245,240,0.25);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.upload-zone input[type="file"],
.multi-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* MULTI-FILE LIST */
.multi-file-list {
  position: relative;
  z-index: 2;
  margin-top: 1.5rem;
}

.multi-file-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.multi-file-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.1);
  border-radius: 4px;
  font-size: 0.85rem;
}

.mf-icon {
  font-size: 1.1rem;
  opacity: 0.5;
}

.mf-name {
  flex: 1;
  color: var(--cream);
  font-weight: 500;
}

.mf-size {
  font-size: 0.75rem;
  color: rgba(247,245,240,0.35);
}

.mf-remove {
  background: none;
  border: none;
  color: var(--red);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.25rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.mf-remove:hover {
  opacity: 1;
}

.multi-analyze-btn {
  width: 100%;
  justify-content: center;
  font-size: 0.95rem !important;
  padding: 0.75rem 2rem !important;
}

/* PROGRESS */
.progress-container {
  margin-top: 2rem;
  display: none;
}

.progress-container.visible {
  display: block;
}

.progress-bar-bg {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s;
}

.progress-text {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: rgba(247,245,240,0.5);
  text-align: center;
}

/* ANALYSIS STATUS */
.analysis-status {
  margin-top: 2rem;
  padding: 2rem;
  background: var(--glass);
  border: 1px solid rgba(201,168,76,0.1);
  border-radius: 6px;
  text-align: center;
  display: none;
}

.analysis-status.visible {
  display: block;
}

.analysis-status .spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(201,168,76,0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.analysis-status h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.analysis-status p {
  font-size: 0.85rem;
  color: rgba(247,245,240,0.4);
}

/* RESULTS */
.results-container {
  display: none;
}

.results-container.visible {
  display: block;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.result-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.deal-type-badge {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(201,168,76,0.25);
  padding: 0.35rem 0.85rem;
  border-radius: 3px;
}

.best-match-badge {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  border: 1px solid rgba(77,202,106,0.25);
  background: rgba(77,202,106,0.08);
  padding: 0.35rem 0.85rem;
  border-radius: 3px;
}

.result-meta {
  display: flex;
  gap: 2rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.meta-item {
  font-size: 0.8rem;
  color: rgba(247,245,240,0.4);
}

.meta-item strong {
  color: rgba(247,245,240,0.7);
}

/* ===========================
   3-SCORE INVESTMENT RATING
   =========================== */
.scores-section {
  background: linear-gradient(135deg, rgba(201,168,76,0.04), rgba(100,149,237,0.04));
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.scores-header {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(201,168,76,0.1);
}

.scores-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.score-card {
  text-align: center;
  padding: 1rem;
}

.score-gauge {
  position: relative;
  width: 128px;
  height: 128px;
  margin: 0 auto 1rem;
}

.score-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
}

.score-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 0.5rem;
}

.score-reasoning {
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(247,245,240,0.5);
  margin-bottom: 0.75rem;
}

.score-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.score-metric {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.sm-label {
  color: rgba(247,245,240,0.35);
  text-transform: capitalize;
}

.sm-value {
  color: rgba(247,245,240,0.7);
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}

/* ===========================
   CAPITAL IMPROVEMENT ROI
   =========================== */
.capex-section h3 {
  margin-bottom: 1rem !important;
}

.capex-summary {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(201,168,76,0.06);
  border-radius: 6px;
}

.capex-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(247,245,240,0.4);
  margin-bottom: 0.2rem;
}

.capex-stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
}

.capex-table-wrapper {
  overflow-x: auto;
  margin-bottom: 1rem;
  border-radius: 6px;
}

.capex-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.capex-table th {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247,245,240,0.4);
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(201,168,76,0.15);
  white-space: nowrap;
}

.capex-table td {
  padding: 0.75rem;
  font-size: 0.85rem;
  color: rgba(247,245,240,0.7);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: top;
}

.capex-table tr.best-roi {
  background: rgba(77,202,106,0.05);
}

.capex-table tr.best-roi td:first-child {
  border-left: 3px solid var(--green);
}

.capex-item-name {
  font-weight: 600;
  color: var(--cream);
  font-size: 0.85rem;
}

.capex-item-desc {
  font-size: 0.75rem;
  color: rgba(247,245,240,0.4);
  margin-top: 0.15rem;
}

.capex-num {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  white-space: nowrap;
}

.roi-high {
  color: var(--green) !important;
  font-weight: 700 !important;
}

.roi-medium {
  color: var(--gold) !important;
  font-weight: 600 !important;
}

.roi-low {
  color: rgba(247,245,240,0.5) !important;
}

.capex-priority {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  white-space: nowrap;
}

.capex-priority.high {
  background: rgba(77,202,106,0.12);
  color: var(--green);
}

.capex-priority.medium {
  background: rgba(201,168,76,0.12);
  color: var(--gold);
}

.capex-priority.low {
  background: rgba(247,245,240,0.06);
  color: rgba(247,245,240,0.4);
}

.capex-best-banner {
  padding: 0.75rem 1rem;
  background: rgba(77,202,106,0.08);
  border: 1px solid rgba(77,202,106,0.15);
  border-radius: 4px;
  font-size: 0.85rem;
  color: rgba(247,245,240,0.7);
  margin-bottom: 1rem;
}

.capex-best-banner strong {
  color: var(--green);
}

.capex-value-summary {
  padding: 1rem;
  background: rgba(255,255,255,0.02);
  border-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(247,245,240,0.6);
  margin-bottom: 1rem;
}

.capex-risks {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(229,77,77,0.1);
}

.capex-risks-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.75rem;
}

.capex-risk-item {
  padding: 0.5rem 0.75rem;
  background: rgba(229,77,77,0.04);
  border-left: 2px solid rgba(229,77,77,0.3);
  border-radius: 0 3px 3px 0;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: rgba(247,245,240,0.6);
  line-height: 1.5;
}

/* ===========================
   CROSS-DOCUMENT ANALYSIS
   =========================== */
.cross-doc-section {
  border-color: rgba(100,149,237,0.15) !important;
}

.cross-doc-subtitle {
  font-size: 0.85rem;
  color: rgba(247,245,240,0.4);
  margin-bottom: 1.25rem;
}

.cross-doc-flag {
  padding: 1rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.cross-doc-flag.high {
  border-left: 3px solid var(--red);
  background: rgba(229,77,77,0.03);
}

.cross-doc-flag.medium {
  border-left: 3px solid var(--orange);
  background: rgba(229,146,77,0.03);
}

.cross-doc-flag.low {
  border-left: 3px solid var(--blue);
  background: rgba(100,149,237,0.03);
}

.cdf-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.cdf-type-badge {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  background: rgba(100,149,237,0.12);
  color: var(--blue);
}

.cdf-type-badge.contradiction {
  background: rgba(229,77,77,0.12);
  color: var(--red);
}

.cdf-type-badge.timeline-conflict {
  background: rgba(229,146,77,0.12);
  color: var(--orange);
}

.cdf-type-badge.financial-mismatch {
  background: rgba(229,77,77,0.12);
  color: var(--red);
}

.cdf-severity {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
}

.cdf-severity.high {
  background: rgba(229,77,77,0.12);
  color: var(--red);
}

.cdf-severity.medium {
  background: rgba(229,146,77,0.12);
  color: var(--orange);
}

.cdf-severity.low {
  background: rgba(100,149,237,0.12);
  color: var(--blue);
}

.cdf-docs {
  font-size: 0.75rem;
  color: rgba(247,245,240,0.35);
  margin-bottom: 0.4rem;
  font-style: italic;
}

.cdf-description {
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(247,245,240,0.7);
}

.cdf-recommendation {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: rgba(247,245,240,0.5);
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.02);
  border-radius: 3px;
}

/* SUMMARY CARD */
.summary-card {
  background: linear-gradient(135deg, rgba(201,168,76,0.06), rgba(201,168,76,0.02));
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 6px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.summary-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.summary-card p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(247,245,240,0.8);
}

/* SECTION CARDS */
.section-card {
  background: var(--glass);
  border: 1px solid rgba(201,168,76,0.08);
  border-radius: 6px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.section-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(201,168,76,0.1);
}

/* TERMS GRID */
.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.term-item {
  padding: 0.75rem;
  background: rgba(255,255,255,0.02);
  border-radius: 4px;
  border-left: 2px solid rgba(201,168,76,0.2);
}

.term-label {
  font-size: 0.68rem;
  color: rgba(247,245,240,0.35);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.term-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cream);
}

/* PROMOTE STRUCTURE */
.promote-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(247,245,240,0.7);
  margin-bottom: 1rem;
}

.tier-table {
  width: 100%;
  border-collapse: collapse;
}

.tier-table th {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247,245,240,0.35);
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(201,168,76,0.1);
}

.tier-table td {
  padding: 0.65rem 0.75rem;
  font-size: 0.9rem;
  color: rgba(247,245,240,0.7);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

/* FEES TABLE */
.fee-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.fee-row:last-child {
  border-bottom: none;
}

.fee-type {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(247,245,240,0.5);
  min-width: 140px;
}

.fee-amount {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: var(--cream);
  font-size: 0.95rem;
}

.fee-desc {
  font-size: 0.85rem;
  color: rgba(247,245,240,0.4);
  flex: 1;
  margin: 0 1rem;
}

/* RISKS */
.risk-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  align-items: flex-start;
}

.risk-item:last-child {
  border-bottom: none;
}

.risk-severity {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.risk-severity.high {
  background: rgba(229,77,77,0.15);
  color: var(--red);
  border: 1px solid rgba(229,77,77,0.2);
}

.risk-severity.medium {
  background: rgba(229,146,77,0.15);
  color: var(--orange);
  border: 1px solid rgba(229,146,77,0.2);
}

.risk-severity.low {
  background: rgba(77,202,106,0.15);
  color: var(--green);
  border: 1px solid rgba(77,202,106,0.2);
}

.risk-category {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(247,245,240,0.35);
  min-width: 80px;
  flex-shrink: 0;
}

.risk-desc {
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(247,245,240,0.65);
}

/* RED FLAGS */
.red-flag {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(229,77,77,0.05);
  border-left: 3px solid var(--red);
  border-radius: 0 4px 4px 0;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(247,245,240,0.7);
}

.red-flag::before {
  content: "!";
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--red);
  flex-shrink: 0;
}

/* KEY PARTIES */
.party-row {
  display: flex;
  gap: 1.5rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.party-row:last-child {
  border-bottom: none;
}

.party-role {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(247,245,240,0.35);
  min-width: 120px;
  flex-shrink: 0;
}

.party-name {
  font-size: 0.9rem;
  color: rgba(247,245,240,0.7);
}

/* INVESTOR NOTES */
.investor-notes {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(247,245,240,0.7);
}

/* MINI SCORES (deal list) */
.deal-mini-scores {
  display: flex;
  gap: 0.3rem;
}

.mini-score {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.35rem;
  border-radius: 2px;
  background: rgba(201,168,76,0.1);
  color: var(--gold);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  padding: 0.65rem 1.5rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: var(--ink);
}

.btn-primary:hover {
  background: var(--gold-dim);
}

.btn-secondary {
  background: transparent;
  color: var(--cream);
  border: 1px solid rgba(201,168,76,0.2);
}

.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

/* DEALS LIST */
.deals-list {
  margin-top: 3rem;
}

.deals-list h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: rgba(247,245,240,0.6);
}

.deal-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--glass);
  border: 1px solid rgba(201,168,76,0.06);
  border-radius: 5px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
}

.deal-list-item:hover {
  border-color: rgba(201,168,76,0.2);
  background: rgba(255,255,255,0.04);
}

.deal-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.deal-info .icon {
  font-size: 1.5rem;
  opacity: 0.5;
}

.deal-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.deal-meta {
  font-size: 0.78rem;
  color: rgba(247,245,240,0.35);
  margin-top: 0.2rem;
}

.deal-status {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 3px;
}

.deal-status.analyzed {
  background: rgba(77,202,106,0.12);
  color: var(--green);
}

.deal-status.uploaded {
  background: rgba(201,168,76,0.12);
  color: var(--gold);
}

.deal-status.analyzing {
  background: rgba(100,149,237,0.12);
  color: #6495ed;
}

.deal-status.error {
  background: rgba(229,77,77,0.12);
  color: var(--red);
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: rgba(247,245,240,0.3);
}

.empty-state .icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

/* ERROR */
.error-message {
  background: rgba(229,77,77,0.1);
  border: 1px solid rgba(229,77,77,0.2);
  border-radius: 6px;
  padding: 1rem 1.5rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--red);
  display: none;
}

.error-message.visible {
  display: block;
}

/* FOOTER */
footer {
  position: relative;
  z-index: 1;
  padding: 2rem 3rem;
  border-top: 1px solid rgba(201,168,76,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: rgba(247,245,240,0.25);
  max-width: 1100px;
  margin: 4rem auto 0;
}

footer .logo-small {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--gold);
  opacity: 0.5;
}

/* ===========================
   MARKET BENCHMARKS
   =========================== */
.market-benchmarks-section {
  border-color: rgba(100,149,237,0.2) !important;
  background: linear-gradient(135deg, rgba(100,149,237,0.03), rgba(201,168,76,0.03)) !important;
}

.benchmarks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.benchmark-card {
  padding: 1.25rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(100,149,237,0.1);
  border-radius: 6px;
}

.benchmark-card-wide {
  grid-column: 1 / -1;
}

.benchmark-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247,245,240,0.4);
  margin-bottom: 0.75rem;
}

.benchmark-comparison {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.benchmark-rent-grid {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.benchmark-val {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.benchmark-val-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(247,245,240,0.3);
}

.benchmark-val-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cream);
}

.benchmark-val-number.deal-val {
  color: var(--gold);
}

.benchmark-val-number.market-val {
  color: var(--blue);
}

.benchmark-vs {
  font-size: 0.7rem;
  color: rgba(247,245,240,0.25);
  font-style: italic;
  padding: 0 0.25rem;
}

.benchmark-delta {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  background: rgba(201,168,76,0.12);
  color: var(--gold);
}

.benchmark-assessment {
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(247,245,240,0.55);
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.03);
}

.benchmark-flags {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(100,149,237,0.1);
}

.benchmark-flags-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 0.75rem;
}

.benchmark-flag-item {
  padding: 0.5rem 0.75rem;
  background: rgba(229,146,77,0.04);
  border-left: 2px solid rgba(229,146,77,0.3);
  border-radius: 0 3px 3px 0;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: rgba(247,245,240,0.6);
  line-height: 1.5;
}

/* ===========================
   REGIONAL COMPARABLES
   =========================== */
.market-comps-section {
  border-color: rgba(77,202,106,0.15) !important;
}

.market-comps-header {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.market-msa-badge {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.7rem;
  border-radius: 3px;
  background: rgba(100,149,237,0.1);
  border: 1px solid rgba(100,149,237,0.2);
  color: var(--blue);
}

.market-submarket-badge {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.7rem;
  border-radius: 3px;
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.2);
  color: var(--gold);
}

.market-confidence-badge {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}

.confidence-high {
  background: rgba(77,202,106,0.12);
  color: var(--green);
}

.confidence-medium {
  background: rgba(201,168,76,0.12);
  color: var(--gold);
}

.confidence-low {
  background: rgba(229,146,77,0.12);
  color: var(--orange);
}

.comps-subsection {
  margin-bottom: 1.5rem;
}

.comps-subtitle {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247,245,240,0.4);
  margin-bottom: 0.75rem;
}

.comps-table-wrapper {
  overflow-x: auto;
  border-radius: 6px;
}

.comps-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.comps-table th {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247,245,240,0.35);
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid rgba(77,202,106,0.12);
  white-space: nowrap;
}

.comps-table td {
  padding: 0.6rem;
  font-size: 0.82rem;
  color: rgba(247,245,240,0.65);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.comp-name {
  font-weight: 600;
  color: var(--cream) !important;
}

.comp-num {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  white-space: nowrap;
}

.comp-highlight {
  color: var(--gold) !important;
  font-weight: 700 !important;
}

.comp-notes-row td {
  padding: 0.25rem 0.6rem 0.6rem !important;
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}

.comp-notes {
  font-size: 0.72rem !important;
  font-style: italic;
  color: rgba(247,245,240,0.35) !important;
}

.rent-summary-grid {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.rent-summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem;
  background: rgba(77,202,106,0.04);
  border-radius: 4px;
  border-left: 2px solid rgba(77,202,106,0.2);
  min-width: 100px;
}

.rs-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(247,245,240,0.35);
}

.rs-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--cream);
}

/* ===========================
   MARKET FUNDAMENTALS
   =========================== */
.market-data-section {
  border-color: rgba(100,149,237,0.12) !important;
}

.market-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.market-stat {
  padding: 0.75rem;
  background: rgba(255,255,255,0.02);
  border-radius: 4px;
  border-left: 2px solid rgba(100,149,237,0.2);
}

.market-stat-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(247,245,240,0.35);
  margin-bottom: 0.2rem;
}

.market-stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--cream);
}

.market-stat-sub {
  font-size: 0.68rem;
  color: rgba(247,245,240,0.35);
  margin-top: 0.15rem;
}

.market-employers {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
}

.market-employers-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247,245,240,0.35);
  margin-bottom: 0.75rem;
}

.market-employers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.employer-tag {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  background: rgba(100,149,237,0.08);
  border: 1px solid rgba(100,149,237,0.15);
  border-radius: 3px;
  color: rgba(247,245,240,0.65);
}

.market-trends-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.market-trend-item {
  padding: 1rem;
  background: rgba(255,255,255,0.02);
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.03);
}

.mt-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247,245,240,0.35);
  margin-bottom: 0.5rem;
}

.mt-value {
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(247,245,240,0.6);
}

/* ═══════════════════════════════════════════
   DEAL COMPARISON PAGE
   ═══════════════════════════════════════════ */

/* Nav active link */
.nav-active {
  color: var(--gold) !important;
}

/* Compare back link */
.compare-back {
  display: inline-block;
  color: rgba(247,245,240,0.4);
  font-size: 0.85rem;
  text-decoration: none;
  margin-bottom: 0.75rem;
  transition: color 0.2s;
}
.compare-back:hover { color: var(--cream); }

.compare-header {
  margin-bottom: 2rem;
}
.compare-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 0.25rem;
}
.compare-header p {
  color: rgba(247,245,240,0.4);
  font-size: 0.95rem;
}

.compare-section-subtitle {
  color: rgba(247,245,240,0.45);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  margin-top: -0.25rem;
}

.winner-badge-inline {
  color: var(--gold);
  font-weight: 600;
}

/* ─── SELECTION UI ─── */
.selection-instructions {
  color: rgba(247,245,240,0.5);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  border-left: 3px solid var(--gold);
}

.selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.selection-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--glass);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}
.selection-card:hover {
  border-color: rgba(201,168,76,0.3);
  background: rgba(255,255,255,0.07);
}
.selection-card.selected {
  border-color: var(--gold);
  background: rgba(201,168,76,0.08);
}

.selection-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.selection-check-icon {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: transparent;
  transition: all 0.2s;
}
.selection-card.selected .selection-check-icon {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
  font-weight: 700;
}

.selection-card-body {
  flex: 1;
  min-width: 0;
}

.selection-deal-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.3rem;
}

.selection-deal-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: rgba(247,245,240,0.4);
  margin-bottom: 0.5rem;
}

.sel-badge {
  background: rgba(100,149,237,0.15);
  color: var(--blue);
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.selection-scores {
  display: flex;
  gap: 0.5rem;
}

.sel-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  min-width: 44px;
  font-size: 0.9rem;
  font-weight: 700;
}
.sel-score span {
  font-size: 0.55rem;
  font-weight: 500;
  opacity: 0.5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.sel-score.cf { color: var(--green); }
.sel-score.cr { color: var(--gold); }
.sel-score.tv { color: var(--blue); }

.selection-footer {
  position: sticky;
  bottom: 0;
  background: rgba(10,15,26,0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.5rem;
}

.selection-count-badge {
  font-size: 0.85rem;
  color: rgba(247,245,240,0.5);
  font-weight: 500;
}

/* ─── BEST OVERALL CARD ─── */
.best-overall-card {
  background: linear-gradient(135deg, rgba(201,168,76,0.12) 0%, rgba(10,15,26,0) 60%);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 16px;
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}
.best-overall-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.best-overall-crown {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.best-overall-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 0.2rem;
}

.best-overall-location {
  color: rgba(247,245,240,0.4);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.best-overall-scores {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.bo-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  min-width: 72px;
  font-size: 1.4rem;
  font-weight: 700;
}
.bo-score span {
  font-size: 0.6rem;
  font-weight: 500;
  opacity: 0.55;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.bo-score.cf { color: var(--green); }
.bo-score.cr { color: var(--gold); }
.bo-score.tv { color: var(--blue); }
.bo-score.avg { color: var(--cream); border: 1px solid rgba(255,255,255,0.12); }

.best-overall-reason {
  font-size: 0.9rem;
  color: rgba(247,245,240,0.65);
  line-height: 1.5;
}
.best-overall-reason strong {
  color: var(--gold);
}

/* ─── SCORE COMPARISON GRID ─── */
.compare-scores-section h3 {
  margin-bottom: 0.4rem;
}

.compare-scores-grid {
  display: grid;
  grid-template-columns: 140px repeat(var(--num-cols, 3), 1fr);
  gap: 0;
}

.compare-prop-header {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 1rem 0.75rem;
  text-align: center;
}
.compare-prop-header--empty {
  background: transparent;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.cph-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cph-location {
  font-size: 0.7rem;
  color: rgba(247,245,240,0.4);
  margin-top: 0.15rem;
}

.csr-label {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(247,245,240,0.5);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 1rem 0.5rem 1rem 0;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.csr-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.04);
  gap: 0.4rem;
  transition: background 0.2s;
}
.csr-cell.winner {
  background: rgba(201,168,76,0.06);
  border-top-color: rgba(201,168,76,0.15);
  border-bottom: 1px solid rgba(201,168,76,0.15);
  box-shadow: inset 0 0 0 1px rgba(201,168,76,0.18);
  border-radius: 8px;
}

.csr-gauge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.csr-gauge svg {
  display: block;
}
.csr-score {
  position: absolute;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.csr-winner-tag {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(201,168,76,0.15);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}

/* ─── PROPERTY SUMMARY TABLE ─── */
.cpt-wrapper {
  overflow-x: auto;
  margin: 0 -1px;
}

.cpt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 500px;
}

.cpt-label-col {
  width: 200px;
  min-width: 160px;
  text-align: left;
  background: rgba(10,15,26,0.8);
  position: sticky;
  left: 0;
  z-index: 2;
}

.cpt-val-col {
  text-align: center;
  min-width: 140px;
}

.cpt-head-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cream);
  padding: 0 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.cpt-head-loc {
  font-size: 0.65rem;
  color: rgba(247,245,240,0.35);
  margin-top: 0.15rem;
}

.cpt-table th {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.cpt-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}

.cpt-section-row td {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(247,245,240,0.3);
  background: rgba(255,255,255,0.02);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.cpt-label {
  color: rgba(247,245,240,0.6);
  font-size: 0.8rem;
  white-space: nowrap;
  background: rgba(10,15,26,0.8);
  position: sticky;
  left: 0;
  z-index: 1;
}

.cpt-val {
  text-align: center;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}

.cpt-winner {
  color: var(--gold);
  font-weight: 600;
  background: rgba(201,168,76,0.07);
  border-left: 2px solid rgba(201,168,76,0.3);
  border-right: 2px solid rgba(201,168,76,0.3);
}

/* ─── MARKET CONTEXT ─── */
.market-compare-grid {
  display: grid;
  grid-template-columns: repeat(var(--num-cols, 3), 1fr);
  gap: 1.25rem;
}

.mkt-col {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 1.25rem;
}

.mkt-col-header {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mkt-location-line {
  font-size: 0.75rem;
  color: rgba(247,245,240,0.4);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.mkt-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.mkt-stat {
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
}
.mkt-stat-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(247,245,240,0.35);
  margin-bottom: 0.2rem;
}
.mkt-stat-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cream);
}
.mkt-stat-sub {
  font-size: 0.65rem;
  color: rgba(247,245,240,0.35);
  margin-top: 0.1rem;
}

.mkt-label-sm {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247,245,240,0.3);
  margin-bottom: 0.5rem;
}

.mkt-employers {
  margin-bottom: 0.75rem;
}
.mkt-employers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.mkt-flags {
  margin-top: 0.75rem;
}
.mkt-flag-item {
  font-size: 0.75rem;
  color: rgba(229,146,77,0.85);
  line-height: 1.45;
  margin-bottom: 0.35rem;
}

.mkt-empty {
  font-size: 0.8rem;
  color: rgba(247,245,240,0.3);
  padding: 1rem 0;
}

/* PROPERTY SUMMARY TEMPLATE */
.property-summary-section {}

.ps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.ps-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(201,168,76,0.07);
  border-radius: 6px;
  padding: 1rem 1.25rem;
}

.ps-section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(201,168,76,0.1);
}

.ps-table {
  width: 100%;
  border-collapse: collapse;
}

.ps-table tr + tr td {
  border-top: 1px solid rgba(255,255,255,0.04);
}

.ps-label {
  font-size: 0.7rem;
  color: rgba(247,245,240,0.45);
  padding: 0.3rem 0.5rem 0.3rem 0;
  vertical-align: top;
  width: 58%;
  line-height: 1.4;
}

.ps-value {
  font-size: 0.75rem;
  color: var(--cream);
  font-weight: 500;
  padding: 0.3rem 0;
  text-align: right;
  vertical-align: top;
  line-height: 1.4;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  nav { padding: 1rem 1.5rem; }
  .app-container { padding: 6rem 1rem 3rem; }
  .upload-zone,
  .multi-upload-zone { padding: 3rem 1.5rem; }
  .terms-grid { grid-template-columns: 1fr; }
  .result-header { flex-direction: column; }
  .risk-item { flex-direction: column; gap: 0.5rem; }
  .fee-row { flex-direction: column; gap: 0.25rem; }
  .actions { flex-direction: column; }
  footer { padding: 1.5rem; flex-direction: column; gap: 0.5rem; }
  .scores-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .capex-table-wrapper { margin-left: -1rem; margin-right: -1rem; }
  .upload-mode-toggle { width: 100%; }
  .mode-btn { flex: 1; text-align: center; }
  .benchmarks-grid { grid-template-columns: 1fr; }
  .benchmark-card-wide { grid-column: auto; }
  .benchmark-comparison { flex-direction: column; align-items: flex-start; }
  .benchmark-rent-grid { flex-direction: column; }
  .comps-table-wrapper { margin-left: -1rem; margin-right: -1rem; }
  .market-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .market-trends-grid { grid-template-columns: 1fr; }
  .rent-summary-grid { flex-direction: column; }

  /* Comparison responsive */
  .selection-grid { grid-template-columns: 1fr; }
  .compare-scores-grid { grid-template-columns: 90px repeat(var(--num-cols, 3), 1fr); }
  .cph-name { font-size: 0.7rem; }
  .best-overall-card { padding: 1.25rem; }
  .best-overall-name { font-size: 1.2rem; }
  .bo-score { min-width: 56px; font-size: 1.1rem; padding: 0.4rem 0.65rem; }
  .market-compare-grid { grid-template-columns: 1fr; }
  .cpt-label-col { min-width: 120px; width: 130px; }
  .cpt-val-col { min-width: 110px; }
  .selection-footer { padding: 0.75rem 0; }
  .ps-grid { grid-template-columns: 1fr; }
}
