/* AstraVeris Datacenter Underwriting — page styles
   Layered on top of /style.css. Memo / investor-deck aesthetic:
   dense data rows, clear hierarchy, dark theme, gold accents. */

.uw-page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px 32px 96px;
  color: var(--text-primary, #C9CDD6);
}

.uw-state {
  min-height: 60vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
}
/* display:flex above would otherwise override the hidden attribute's UA
   display:none — JS toggles these states via el.hidden, so hidden must win. */
.uw-state[hidden] { display: none !important; }
.uw-state-inner { max-width: 560px; }
.uw-state h2 { font-family: 'Space Grotesk', sans-serif; font-weight: 600; }

.uw-muted { color: var(--text-muted, #7A7E89); }
.uw-small { font-size: 13px; }
.uw-link { color: var(--gold, #D4A843); text-decoration: none; }
.uw-link:hover { text-decoration: underline; }

/* HERO ───────────────────────────────────────────────────────────── */
.uw-hero {
  padding: 24px 0 32px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 32px;
}
.uw-crumb { font-size: 13px; color: var(--text-muted, #7A7E89); margin-bottom: 12px; text-transform: capitalize; }
.uw-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 36px; font-weight: 600;
  margin: 0 0 8px; line-height: 1.15;
  color: #D6CDAE;
}
.uw-subtitle {
  font-size: 14px;
  color: var(--text-secondary, #A8AAB4);
  margin-bottom: 28px;
}
.uw-stage-badge, .uw-buildtype-badge {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid rgba(212,168,67,0.35);
  border-radius: 12px;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-left: 4px;
  color: var(--gold, #D4A843);
}

/* KEY STATS row (hero) */
.uw-keystats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.uw-stat {
  padding: 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
}
.uw-stat-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #7A7E89);
  margin-bottom: 6px;
}
.uw-stat-value {
  font-family: 'DM Mono', monospace;
  font-size: 24px;
  font-weight: 500;
  color: #D6CDAE;
  margin-bottom: 4px;
}
.uw-stat-sub { font-size: 12px; color: var(--text-muted, #7A7E89); }

/* Action buttons */
.uw-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.uw-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px;
  background: var(--gold, #D4A843); color: #0E0E14;
  border: 1px solid var(--gold, #D4A843);
  border-radius: 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
}
.uw-btn:hover { background: #E0B658; border-color: #E0B658; }
.uw-btn-secondary {
  background: transparent; color: var(--gold, #D4A843);
}
.uw-btn-secondary:hover {
  background: rgba(212,168,67,0.08);
}

/* SECTIONS ─────────────────────────────────────────────────────── */
.uw-section { margin-bottom: 40px; }
.uw-section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px; font-weight: 500;
  color: #D6CDAE;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.uw-section-sub {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary, #A8AAB4);
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.uw-thesis { font-size: 15px; line-height: 1.6; color: var(--text-primary, #C9CDD6); }

/* DATA RELIABILITY strip (hero) — per-memo trust scorecard */
.uw-reliability {
  margin: 0 0 28px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
}
.uw-rel-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.uw-rel-title {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted, #7A7E89);
}
.uw-grade-badge {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  cursor: help;
}
.uw-grade-a { background: rgba(110,201,150,0.16); color: #6EC996; }
.uw-grade-b { background: rgba(212,168,67,0.16);  color: var(--gold, #D4A843); }
.uw-grade-c { background: rgba(224,145,60,0.14);  color: #E0913C; }
.uw-grade-d { background: rgba(196,104,104,0.16); color: #C46868; }
.uw-rel-mix {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-secondary, #A8AAB4);
}
.uw-rel-bar {
  display: flex; height: 6px;
  border-radius: 3px; overflow: hidden;
  background: rgba(255,255,255,0.05);
  margin-bottom: 12px;
}
.uw-rel-seg { display: block; height: 100%; }
.uw-rel-seg-reported  { background: #6FBE6F; }
.uw-rel-seg-derived   { background: var(--gold, #D4A843); }
.uw-rel-seg-estimated { background: #5A5E69; }
.uw-rel-upgrades-title {
  font-size: 11px;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted, #7A7E89);
  margin: 0 0 4px;
}
.uw-rel-upgrades {
  list-style: none; margin: 0 0 10px; padding: 0;
  font-size: 12.5px;
}
.uw-rel-upgrades li { padding: 3px 0; color: var(--text-secondary, #A8AAB4); }
.uw-rel-field { color: #D6CDAE; font-family: 'DM Mono', monospace; }
.uw-rel-formula { font-family: 'DM Mono', monospace; font-size: 11.5px; margin: 0; }
/* Index-table badge cell */
.uw-rel-cell { text-align: center; white-space: nowrap; }

/* CHECKLIST */
.uw-checklist {
  list-style: none; padding: 0; margin: 16px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 4px 24px;
}
.uw-checklist li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
  font-size: 13px;
}
.uw-check-key { color: var(--text-secondary, #A8AAB4); flex-shrink: 0; }
.uw-check-val { color: var(--text-muted, #7A7E89); text-align: right; }

/* Evidence-backed checklist (underwriting.js rewrites the UL when
   dc_checklist_evidence.json is available; the rules above stay as the
   static-stub fallback). */
.uw-checklist-ev { gap: 10px 24px; }
.uw-checklist-ev li {
  display: block;
  padding: 10px 12px;
  background: rgba(255,255,255,0.015);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 6px;
}
.uw-check-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.uw-check-status {
  font-family: 'DM Mono', monospace;
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.06em;
  padding: 1px 7px;
  border-radius: 3px;
  white-space: nowrap;
}
.uw-ev-verified { background: rgba(110,201,150,0.16); color: #6EC996; }
.uw-ev-evidence { background: rgba(212,168,67,0.16);  color: var(--gold, #D4A843); }
.uw-ev-implied  { background: rgba(91,168,217,0.14);  color: #5BA8D9; }
.uw-ev-unknown  { background: rgba(255,255,255,0.06); color: var(--text-muted, #7A7E89); }
.uw-check-detail {
  color: var(--text-secondary, #A8AAB4);
  line-height: 1.45;
  margin-bottom: 6px;
}
.uw-check-source {
  font-size: 11.5px;
  color: var(--text-muted, #7A7E89);
  font-style: italic;
  word-break: break-word;
}

/* SOURCES & USES */
.uw-su-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
@media (max-width: 720px) { .uw-su-grid { grid-template-columns: 1fr; } }

/* TABLES */
.uw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.uw-table th, .uw-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.uw-table th {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, #7A7E89);
  cursor: pointer;
}
.uw-num {
  font-family: 'DM Mono', monospace;
  text-align: right;
  white-space: nowrap;
}
.uw-row-total td {
  font-weight: 600;
  color: #D6CDAE;
  border-top: 2px solid rgba(212,168,67,0.20);
  border-bottom: none;
}

.uw-table-wide td { padding: 10px 12px; }
.uw-input-label { width: 30%; color: var(--text-secondary, #A8AAB4); }
.uw-input-value { width: 22%; color: #D6CDAE; }
.uw-input-source {
  width: 48%; font-size: 12px;
  color: var(--text-muted, #7A7E89);
  font-style: italic;
}

/* PRO FORMA TABLE */
.uw-pf-scroll, .uw-sens-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.uw-pf-table th, .uw-pf-table td { white-space: nowrap; padding: 6px 12px; }
.uw-pf-table td:first-child { color: var(--text-secondary, #A8AAB4); }
.uw-row-rev td { color: #D6CDAE; font-weight: 500; }
.uw-row-opex td { color: var(--text-muted, #7A7E89); border-top: 1px dashed rgba(255,255,255,0.08); }
.uw-row-noi td { font-weight: 600; color: var(--gold, #D4A843); background: rgba(212,168,67,0.04); }
.uw-row-fcf td { font-weight: 500; color: #D6CDAE; border-top: 1px solid rgba(255,255,255,0.06); }
.uw-row-cum td { font-style: italic; color: var(--text-muted, #7A7E89); }

/* SENSITIVITY */
.uw-sens-table th, .uw-sens-table td { padding: 6px 12px; text-align: center; }
.uw-sens-table td:first-child, .uw-sens-table th:first-child {
  text-align: left;
  color: var(--text-secondary, #A8AAB4);
}
.uw-sens-base { box-shadow: inset 0 0 0 2px var(--gold, #D4A843); font-weight: 700; }
.uw-sens-good { color: #6FBE6F; }
.uw-sens-ok { color: #D6CDAE; }
.uw-sens-bad { color: #C46868; }

/* CONFIDENCE DOTS */
.uw-conf-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.uw-conf-reported { background: #6FBE6F; }       /* green */
.uw-conf-derived { background: var(--gold, #D4A843); }   /* gold */
.uw-conf-estimated { background: var(--text-muted, #7A7E89); } /* grey */
.uw-conf-cell {
  display: inline-flex; align-items: center;
  cursor: help;
}
.uw-conf { width: 30px; text-align: center; }

/* METHODOLOGY */
.uw-method-list { padding-left: 18px; font-size: 13px; line-height: 1.7; color: var(--text-secondary, #A8AAB4); }
.uw-method-list li { margin-bottom: 6px; }
.uw-disclaimer {
  margin-top: 16px;
  padding: 12px 16px;
  border-left: 2px solid var(--gold, #D4A843);
  background: rgba(212,168,67,0.04);
}

/* LANDING PAGE (index) */
.uw-index-header {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: baseline;
  margin-bottom: 24px;
}
.uw-index-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px; font-weight: 600;
  margin: 0;
  color: #D6CDAE;
}
.uw-index-sub { color: var(--text-muted, #7A7E89); font-size: 13px; }
.uw-index-filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 720px) { .uw-index-filters { grid-template-columns: 1fr 1fr; } }
.uw-index-filters input, .uw-index-filters select {
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--text-primary, #C9CDD6);
  border-radius: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
}
.uw-margin-great { color: #6FBE6F; font-weight: 600; }
.uw-margin-good { color: #D6CDAE; }
.uw-margin-ok { color: var(--text-secondary, #A8AAB4); }
.uw-margin-bad { color: #C46868; }

/* STAGE PILLS — slug → labeled, colored pill (mirrors .status-pill palette:
   green = live/operating, gold = announced, amber = in-flux, grey = unknown) */
.uw-stage-pill {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted, #7A7E89);
}
.uw-stage-operating    { background: rgba(110,201,150,0.14); color: #6EC996; }
.uw-stage-construction { background: rgba(91,168,217,0.14);  color: #5BA8D9; }
.uw-stage-permitted    { background: rgba(102,187,170,0.14); color: #66BBAA; }
.uw-stage-announced    { background: rgba(212,168,67,0.16);  color: var(--gold, #D4A843); }
.uw-stage-prefiled     { background: rgba(171,130,212,0.14); color: #AB82D4; }
.uw-stage-rezoning     { background: rgba(224,145,60,0.14);  color: #E0913C; }
.uw-stage-tracking     { background: rgba(255,255,255,0.05); color: var(--text-secondary, #A8AAB4); }
.uw-stage-optioned     { background: rgba(140,160,200,0.14); color: #8CA0C8; }
.uw-stage-withdrawn    { background: rgba(196,104,104,0.14); color: #C46868; }
.uw-stage-unknown      { background: rgba(255,255,255,0.05); color: var(--text-muted, #7A7E89); }

/* ── LIFECYCLE STAGES (v5) — tabs, panels, surveillance, insurance ──
   Hidden-attribute guard (the uw-state lesson): display:flex/grid rules
   below would override the UA's [hidden] display:none. JS toggles the
   tab bar, stage panels, band section, banners and reliability strips
   via el.hidden — hidden must always win anywhere inside the memo page. */
.uw-page [hidden] { display: none !important; }

/* Stage tab bar */
.uw-stage-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 28px;
  padding: 6px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
}
.uw-stage-tab {
  flex: 0 1 auto;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-secondary, #A8AAB4);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
}
.uw-stage-tab:hover { color: #D6CDAE; background: rgba(255,255,255,0.04); }
.uw-stage-tab.active {
  background: rgba(212,168,67,0.12);
  border-color: rgba(212,168,67,0.35);
  color: var(--gold, #D4A843);
}
@media (max-width: 720px) {
  .uw-stage-tabs { gap: 6px; }
  .uw-stage-tab { flex: 1 1 calc(50% - 6px); padding: 7px 10px; font-size: 12px; }
}

/* Per-stage reliability strip — reuses .uw-reliability; tighter in panels */
.uw-stage-rel { margin: 0 0 20px; }

.uw-stage-uncomputable { margin: 0 0 16px; }

/* Insurance pending-diligence caveats */
.uw-stage-caveats { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.uw-stage-caveats li {
  padding: 8px 12px; margin-bottom: 6px;
  background: rgba(224,145,60,0.05);
  border-left: 2px solid #E0913C;
  border-radius: 0 4px 4px 0;
  color: var(--text-secondary, #A8AAB4);
  line-height: 1.5;
}

/* Surveillance covenant table — DSCR coloring */
.uw-dscr-ok { color: #6FBE6F; }
.uw-dscr-breach { color: #C46868; font-weight: 600; background: rgba(196,104,104,0.06); }

/* Lease rollover placeholder (requires rent roll via the memo engine) */
.uw-rollover-pending {
  padding: 12px 14px;
  background: rgba(255,255,255,0.015);
  border: 1px dashed rgba(255,255,255,0.10);
  border-radius: 6px;
  font-size: 13px;
}
.uw-rollover-pending .uw-check-detail { margin: 8px 0; }

/* Document-upgrade CTA cards (profile upgradable_by map) */
.uw-cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.uw-cta-card {
  padding: 12px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  display: flex; flex-direction: column; gap: 8px;
}
.uw-cta-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.uw-cta-doc {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px; font-weight: 600;
  color: #D6CDAE;
}
.uw-cta-count {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--gold, #D4A843);
  background: rgba(212,168,67,0.10);
  padding: 1px 7px; border-radius: 3px;
  white-space: nowrap;
}
.uw-cta-fields { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.uw-cta-fields li { padding: 3px 0; color: var(--text-secondary, #A8AAB4); overflow-wrap: anywhere; }
.uw-cta-cli {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-muted, #7A7E89);
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 4px;
  padding: 6px 8px;
  overflow-x: auto;
  white-space: pre;
}
/* "Not yet tracked" CTA field marker — hollow dot vs the solid conf dots */
.uw-conf-untracked { background: transparent; border: 1px dashed var(--text-muted, #7A7E89); }

/* ACTUALS APPLIED banner (engine memo — dc_memo_actuals/{slug}.json) */
.uw-actuals-banner {
  margin: 0 0 28px;
  padding: 14px 16px;
  background: rgba(110,201,150,0.05);
  border: 1px solid rgba(110,201,150,0.25);
  border-radius: 8px;
}
.uw-actuals-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.uw-actuals-title {
  font-family: 'DM Mono', monospace;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em;
  color: #6EC996;
}
.uw-actuals-receipts { list-style: none; margin: 10px 0 0; padding: 0; font-size: 12.5px; }
.uw-actuals-receipts li { padding: 4px 0; color: var(--text-secondary, #A8AAB4); overflow-wrap: anywhere; }
.uw-actuals-alert { color: #E0913C; }
