/* ============================================================
   AirVest — Real Estate Investment Analyzer UI
   style.css
============================================================ */

/* ---- CSS Variables / Design Tokens ---- */
:root {
  /* Brand — AirVest navy + orange */
  --primary:        #f07020;
  --primary-hover:  #d96010;
  --primary-light:  #fff4ed;
  --primary-dark:   #c05008;

  /* Semantic */
  --success:        #10b981;
  --success-light:  #ecfdf5;
  --warning:        #f59e0b;
  --warning-light:  #fffbeb;
  --danger:         #ef4444;
  --danger-light:   #fef2f2;

  /* Neutrals */
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Sidebar */
  --sidebar-bg:    #0d1f3c;
  --sidebar-hover: #1b3a6b;
  --sidebar-active:#1b3a6b;
  --sidebar-text:  #cbd5e1;
  --sidebar-muted: #64748b;
  --sidebar-width: 272px;

  /* Header */
  --header-bg:     #ffffff;
  --header-height: 60px;

  /* Layout */
  --content-bg:    #f1f5f9;
  --card-bg:       #ffffff;
  --border:        #e2e8f0;
  --border-focus:  #f07020;

  /* Typography */
  --text:          #1e293b;
  --text-secondary:#64748b;
  --text-muted:    #94a3b8;

  /* Spacing */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  /* Shadow */
  --shadow-sm: 0 1px 3px 0 rgba(0,0,0,.08), 0 1px 2px -1px rgba(0,0,0,.05);
  --shadow:    0 4px 12px 0 rgba(0,0,0,.08), 0 2px 6px -1px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,.12), 0 4px 10px -5px rgba(0,0,0,.08);
}

/* ---- Base Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--content-bg);
  line-height: 1.5;
  overflow-x: hidden;
}

/* ============================================================
   APP SHELL LAYOUT
============================================================ */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ---- Header ---- */
#app-header {
  height: var(--header-height);
  background: var(--header-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  flex-shrink: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
  border-bottom: 1px solid #e2e8f0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.brand-logo svg,
.brand-logo-img {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  object-fit: contain;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand-name {
  font-size: 1.5rem;
  font-weight: 400;
  font-family: 'Blogger Sans', 'Inter', sans-serif;
  color: #1b3a6b;
  letter-spacing: .3px;
  line-height: 1;
}
.brand-v {
  color: #f07020;
  font-size: 1.35em;
  vertical-align: baseline;
}
.brand-tagline {
  font-size: .7rem;
  color: #94a3b8;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: .625rem;
}

/* ---- Main Layout ---- */
#main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ============================================================
   SIDEBAR
============================================================ */
#sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,.04);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem 1rem .75rem;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--sidebar-muted);
  flex-shrink: 0;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
  border-radius: var(--radius-sm);
  color: var(--sidebar-muted);
  display: flex;
  align-items: center;
  transition: background .15s, color .15s;
}
.btn-icon:hover { background: rgba(255,255,255,.07); color: #fff; }
.btn-icon svg { width: 18px; height: 18px; }

#scenario-list {
  flex: 1;
  overflow-y: auto;
  padding: .25rem .5rem .75rem;
}
#scenario-list::-webkit-scrollbar { width: 4px; }
#scenario-list::-webkit-scrollbar-track { background: transparent; }
#scenario-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

.sidebar-loading {
  color: var(--sidebar-muted);
  font-size: .8rem;
  padding: 1rem;
  text-align: center;
}

/* Scenario list item */
.scenario-item {
  border-radius: var(--radius);
  padding: .625rem .75rem;
  cursor: pointer;
  transition: background .15s;
  margin-bottom: 2px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.scenario-item:hover { background: var(--sidebar-hover); }
.scenario-item.active { background: var(--sidebar-active); }

.scenario-item-name {
  font-size: .875rem;
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scenario-item-meta {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.scenario-item-cf {
  font-size: .7rem;
  color: var(--sidebar-muted);
  margin-left: auto;
  white-space: nowrap;
}
.scenario-item-cf.positive { color: #34d399; }
.scenario-item-cf.negative { color: #f87171; }

.scenario-item-actions {
  display: none;
  position: absolute;
  right: .5rem;
  top: 50%;
  transform: translateY(-50%);
  gap: .2rem;
  background: var(--sidebar-active);
  border-radius: var(--radius-sm);
  padding: .1rem .2rem;
}
.scenario-item:hover .scenario-item-actions { display: flex; }
.scenario-item.active .scenario-item-actions { display: flex; }

.scenario-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: .2rem .3rem;
  border-radius: 4px;
  color: var(--sidebar-muted);
  transition: background .12s, color .12s;
  display: flex;
  align-items: center;
}
.scenario-action-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.scenario-action-btn svg { width: 13px; height: 13px; }
.scenario-action-btn.delete:hover { background: rgba(239,68,68,.2); color: #f87171; }

/* ============================================================
   BADGE
============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: .65rem;
  font-weight: 600;
  padding: .15rem .45rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}
.badge-ltr  { background: #eff6ff; color: #3b82f6; }
.badge-str  { background: #fdf4ff; color: #a855f7; }
.badge-cash { background: #ecfdf5; color: #059669; }
.badge-mortgage { background: #fff7ed; color: #ea580c; }

/* ============================================================
   CONTENT AREA
============================================================ */
#content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
#content::-webkit-scrollbar { width: 6px; }
#content::-webkit-scrollbar-track { background: transparent; }
#content::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }

/* ---- Empty state ---- */
#empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
  padding: 3rem 2rem;
}
#empty-state .empty-icon svg {
  width: 80px; height: 80px;
}
#empty-state h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
}
#empty-state p {
  color: var(--text-secondary);
  font-size: .9375rem;
  line-height: 1.6;
}

/* ============================================================
   SCENARIO VIEW
============================================================ */
#scenario-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Scenario header */
#scenario-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem .75rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.scenario-header-left { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.scenario-header-left h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}
#scenario-badges { display: flex; gap: .4rem; }
.scenario-header-right { display: flex; gap: .5rem; align-items: center; }

/* ============================================================
   TAB BAR
============================================================ */
#tab-bar {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  gap: .125rem;
  flex-shrink: 0;
  overflow-x: auto;
}
#tab-bar::-webkit-scrollbar { height: 0; }

.tab {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .75rem 1rem;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.tab svg { width: 15px; height: 15px; }
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ============================================================
   TAB PANELS
============================================================ */
#tab-panels {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}
#tab-panels::-webkit-scrollbar { width: 6px; }
#tab-panels::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }
.hidden { display: none !important; }

/* ============================================================
   FORMS
============================================================ */
.form-top-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

/* Scenario name bar */
.scenario-name-bar {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.scenario-name-bar input[type="text"] {
  font-size: 1rem;
  font-weight: 600;
}

/* Rental strategy checkbox row */
.sn-type-row {
  display: flex;
  gap: .75rem;
}
.sn-type-option {
  display: flex;
  align-items: center;
  cursor: pointer;
}
.sn-type-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.sn-type-box {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .75rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--gray-600);
  background: var(--gray-50);
  transition: border-color .15s, background .15s, color .15s;
  user-select: none;
}
.sn-type-option:hover .sn-type-box {
  border-color: var(--primary);
  background: #eff6ff;
  color: var(--primary);
}
.sn-type-check {
  width: 15px; height: 15px;
  border: 1.5px solid var(--gray-400);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, background .15s;
}
.sn-type-check::after {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: transparent;
  transition: background .15s;
}
.sn-type-option input[type="radio"]:checked + .sn-type-box {
  border-color: var(--primary);
  background: #eff6ff;
  color: var(--primary);
  font-weight: 600;
}
.sn-type-option input[type="radio"]:checked + .sn-type-box .sn-type-check {
  border-color: var(--primary);
  background: var(--primary);
}
.sn-type-option input[type="radio"]:checked + .sn-type-box .sn-type-check::after {
  background: #fff;
}

/* Form section sub-label */
.form-section-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-500);
  margin-bottom: .5rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--border);
}

/* URL fetch row */
.url-fetch-row {
  display: flex;
  gap: .625rem;
  align-items: center;
  margin-bottom: .75rem;
}
.url-fetch-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .45rem .75rem;
  background: var(--surface);
  transition: border-color .15s;
}
.url-fetch-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}
.url-fetch-icon {
  width: 16px; height: 16px;
  color: var(--gray-400);
  flex-shrink: 0;
}
.url-fetch-input-wrap input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-size: .85rem;
  color: var(--gray-800);
  min-width: 0;
  padding: 0;
}
.url-fetch-status {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  padding: .4rem .75rem;
  border-radius: 6px;
  margin-bottom: .5rem;
}
.url-fetch-loading { background: #eff6ff; color: #2563eb; }
.url-fetch-success { background: #f0fdf4; color: #15803d; }
.url-fetch-error   { background: #fef2f2; color: #dc2626; }

/* PDF upload row */
.pdf-upload-row {
  display: flex;
  align-items: center;
  gap: .625rem;
  margin-bottom: .75rem;
}
.pdf-or-divider {
  font-size: .78rem;
  color: var(--gray-400);
  white-space: nowrap;
}
.pdf-hint {
  font-size: .75rem;
  color: var(--gray-400);
}

/* ================================================================
   PROPERTY PHOTO GALLERY
   ================================================================ */

/* ── Section wrapper ─────────────────────────────────────────── */
.photo-gallery-section {
  margin: 8px 0 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--gray-50);
  transition: border-color .2s, box-shadow .2s;
}
.photo-gallery-section.drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

/* ── Header ──────────────────────────────────────────────────── */
.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--border);
}
.gallery-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.gallery-count {
  font-size: .68rem;
  font-weight: 500;
  color: var(--gray-400);
  letter-spacing: 0;
  text-transform: none;
}
.gallery-header-actions { display: flex; gap: 4px; }

/* ── Empty / drag-drop zone ──────────────────────────────────── */
.gallery-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 28px 16px;
  cursor: pointer;
  color: var(--gray-400);
  font-size: .8rem;
  transition: background .15s, color .15s;
  user-select: none;
}
.gallery-empty:hover,
.photo-gallery-section.drag-over .gallery-empty {
  background: rgba(59,130,246,.04);
  color: var(--primary);
}
.gallery-empty-icon {
  width: 36px; height: 36px;
  opacity: .45;
  transition: opacity .15s;
}
.gallery-empty:hover .gallery-empty-icon,
.photo-gallery-section.drag-over .gallery-empty-icon { opacity: .75; }
.gallery-empty-sub {
  font-size: .68rem;
  color: var(--gray-400);
  margin-top: 2px;
}

/* ── CSS Grid ────────────────────────────────────────────────── */
/*
  Layout (≥ 480 px):
    Col 1 (hero) : 2fr — spans 2 rows
    Cols 2–3     : 1fr each — 4 thumb slots
  < 480 px: flat 2-column equal grid, no hero span
*/
.photo-gallery-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3px;
  padding: 3px;
  background: var(--gray-200);
}

/* ── Thumbnail cell ──────────────────────────────────────────── */
.gallery-thumb {
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  background: var(--gray-200);
  aspect-ratio: 4 / 3;   /* uniform thumb height without fixed px */
  cursor: zoom-in;
  outline: none;
  transition: transform .15s, box-shadow .15s;
}
.gallery-thumb:hover  { transform: scale(1.02); z-index: 1; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.gallery-thumb:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Fill cell with image, crop overflow — preserves aspect ratio of cell */
.gallery-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
  user-select: none;
}

/* ── Hero: first image — spans 2 rows ───────────────────────── */
.gallery-hero {
  grid-column: 1;
  grid-row: 1 / span 2;
  aspect-ratio: auto;    /* height determined by 2-row span */
}

/* ── Hero badge ─────────────────────────────────────────────── */
.gallery-hero-badge {
  position: absolute;
  bottom: 6px; left: 6px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  user-select: none;
}

/* ── Per-photo remove button ─────────────────────────────────── */
.gallery-remove-btn {
  position: absolute;
  top: 4px; right: 4px;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px; height: 20px;
  font-size: 11px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background .15s;
  z-index: 2;
}
.gallery-remove-btn:hover { background: rgba(220,38,38,.85); }
.gallery-thumb:hover .gallery-remove-btn { display: flex; }

/* ── "Add more" slot ─────────────────────────────────────────── */
.gallery-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  border: 1.5px dashed var(--gray-300);
  background: transparent;
  color: var(--gray-400);
  border-radius: 5px;
  aspect-ratio: 4 / 3;
  font-size: .65rem;
  transition: background .15s, border-color .15s, color .15s;
}
.gallery-add:hover {
  background: rgba(59,130,246,.06);
  border-color: var(--primary);
  color: var(--primary);
}
.gallery-add svg { width: 18px; height: 18px; }

/* ── Responsive: collapse to 2-col flat grid on small screens ── */
@media (max-width: 480px) {
  .photo-gallery-grid {
    grid-template-columns: 1fr 1fr;
  }
  .gallery-hero {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 4 / 3;
  }
}

/* ================================================================
   LIGHTBOX
   ================================================================ */
.gl-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gl-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.88);
  backdrop-filter: blur(6px);
}

/* ── Stage: contains the image, respects natural aspect ratio ── */
.gl-stage {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(90vw, 1200px);
  max-height: 82vh;
  padding: 0 56px;   /* room for nav arrows */
}
.gl-stage img {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;   /* never stretch — natural aspect ratio */
  border-radius: 6px;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  user-select: none;
  draggable: false;
}

/* ── Close button ────────────────────────────────────────────── */
.gl-close {
  position: fixed;
  top: 16px; right: 20px;
  z-index: 2;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  border-radius: 50%;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s;
}
.gl-close:hover { background: rgba(255,255,255,.22); }
.gl-close svg { width: 18px; height: 18px; }

/* ── Prev / Next arrows ──────────────────────────────────────── */
.gl-nav {
  position: fixed;
  top: 50%; transform: translateY(-50%);
  z-index: 2;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s;
}
.gl-nav:hover { background: rgba(255,255,255,.25); }
.gl-nav svg { width: 20px; height: 20px; }
.gl-prev { left: 16px; }
.gl-next { right: 16px; }
.gl-nav[disabled] { opacity: .25; pointer-events: none; }

/* ── Footer: counter + delete ────────────────────────────────── */
.gl-footer {
  position: fixed;
  bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 20px;
}
.gl-counter {
  color: rgba(255,255,255,.75);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .04em;
}
.gl-delete {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(220,38,38,.75);
  backdrop-filter: blur(4px);
  border: none;
  color: #fff;
  font-size: .75rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .15s;
}
.gl-delete:hover { background: rgba(220,38,38,.95); }
.gl-delete svg { width: 14px; height: 14px; }

/* ── Keyboard hint (shown briefly on open) ───────────────────── */
.gl-hint {
  position: fixed;
  bottom: 60px; left: 50%; transform: translateX(-50%);
  z-index: 2;
  color: rgba(255,255,255,.4);
  font-size: .68rem;
  letter-spacing: .06em;
  pointer-events: none;
  animation: gl-hint-fade 3s ease forwards;
}
@keyframes gl-hint-fade {
  0%   { opacity: 1; }
  60%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Mobile adjustments ──────────────────────────────────────── */
@media (max-width: 600px) {
  .gl-stage { padding: 0 44px; max-height: 75vh; }
  .gl-stage img { max-height: 75vh; }
  .gl-nav { width: 36px; height: 36px; }
  .gl-prev { left: 6px; }
  .gl-next { right: 6px; }
}

/* ── Featured Photos — 3-tile layout ────────────────────────── */

/* CSS custom properties make all derived heights consistent */
.pp-feat-grid {
  --fh:  165pt;   /* total grid height */
  --gap:   4pt;   /* gap between tiles  */
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--gap);
  height: var(--fh);
  margin-bottom: 10pt;
  page-break-inside: avoid;
}

/* Large tile — background-image set inline per-image */
.pp-feat-main {
  overflow: hidden;
  border-radius: 4pt;
  height: var(--fh);
  background: #f1f5f9;
  /* background-image / size / position set inline */
}

/* Right column — explicit height, flex for equal-height small tiles */
.pp-feat-stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  height: var(--fh);
}

/* Each small tile — explicit height derived from grid vars */
.pp-feat-tile {
  overflow: hidden;
  border-radius: 4pt;
  height: calc((var(--fh) - var(--gap)) / 2);
  background: #f1f5f9;
  /* background-image / size / position set inline per-image */
}

/* Placeholder when fewer than 3 photos */
.pp-feat-placeholder {
  border-radius: 4pt;
  height: calc((var(--fh) - var(--gap)) / 2);
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
}

/* Single-photo fallback */
.pp-feat-single {
  height: 150pt;
  overflow: hidden;
  border-radius: 4pt;
  margin-bottom: 10pt;
  page-break-inside: avoid;
  background: #f1f5f9;
  /* background-image set inline */
}

/* Divider with text */
.form-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: .75rem 0;
  color: var(--gray-400);
  font-size: .75rem;
}
.form-divider::before, .form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.form-group label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: .35rem;
}
.form-group.col-span-2 { grid-column: span 2; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem 1.25rem;
}
.form-grid-full { grid-template-columns: 1fr; margin-bottom: .5rem; }
.form-group-full { grid-column: 1 / -1; }
.form-grid-addr { grid-template-columns: 3fr 1fr; margin-bottom: .5rem; gap: 1rem 1.25rem; }
@media (max-width: 480px) { .form-grid-addr { grid-template-columns: 1fr; } }

.form-grid-inline {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .875rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
  height: 38px;
  padding: 0 .75rem;
  font-size: .875rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
  outline: none;
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { opacity: 0; }
input:focus, select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
input.error { border-color: var(--danger); }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  background-size: 16px;
  padding-right: 2rem;
}

/* Input group with $ prefix or % suffix */
.input-group {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.input-group:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.input-group input {
  border: none !important;
  box-shadow: none !important;
  flex: 1;
  border-radius: 0;
  min-width: 0;
}
.input-addon, .input-addon-right {
  display: flex;
  align-items: center;
  padding: 0 .625rem;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--gray-500);
  background: var(--gray-50);
  border: none;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Radio cards — compact */
.radio-group {
  display: flex;
  gap: .5rem;
}
.radio-card {
  flex: 1;
  cursor: pointer;
}
.radio-card input[type="radio"] { display: none; }
.radio-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  padding: .625rem .5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color .15s, background .15s;
  text-align: center;
}
.radio-card-inner svg {
  width: 20px; height: 20px;
  color: var(--gray-400);
  transition: color .15s;
}
.radio-card-inner span {
  font-size: .75rem;
  font-weight: 600;
  color: var(--gray-600);
  transition: color .15s;
}
.radio-card input:checked + .radio-card-inner {
  border-color: var(--primary);
  background: var(--primary-light);
}
.radio-card input:checked + .radio-card-inner svg { color: var(--primary); }
.radio-card input:checked + .radio-card-inner span { color: var(--primary-dark); }

/* Radio cards — small variant */
.radio-group-sm { gap: .375rem; }
.radio-card-sm .radio-card-inner {
  flex-direction: row;
  padding: .45rem .65rem;
  gap: .35rem;
}
.radio-card-sm .radio-card-inner svg { width: 15px; height: 15px; }
.radio-card-sm .radio-card-inner span { font-size: .7rem; }

/* Radio inline */
.radio-group-inline { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.radio-inline {
  display: flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  font-size: .8375rem;
  color: var(--gray-700);
}
.radio-inline input[type="radio"] { accent-color: var(--primary); }

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  font-size: .8375rem;
  color: var(--gray-700);
}
.checkbox-label input[type="checkbox"] { accent-color: var(--primary); width: 15px; height: 15px; }

/* Info box (mortgage payment preview) */
.info-box {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .75rem 1rem;
  background: var(--primary-light);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  margin-top: 1rem;
}
.info-label {
  font-size: .8125rem;
  font-weight: 500;
  color: var(--primary-dark);
}
.info-value {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--primary);
}

/* Tooltip */
.tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--gray-300);
  color: var(--gray-600);
  font-size: .65rem;
  font-weight: 700;
  cursor: help;
  position: relative;
  flex-shrink: 0;
  font-style: normal;
}
.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-800);
  color: #fff;
  font-size: .7rem;
  font-weight: 400;
  line-height: 1.4;
  padding: .4rem .625rem;
  border-radius: var(--radius-sm);
  white-space: normal;
  min-width: 180px;
  max-width: 250px;
  text-align: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  box-shadow: var(--shadow);
}
.tooltip:hover::after { opacity: 1; }

/* Help text */
.help-text {
  font-size: .75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================================
   ACCORDION
============================================================ */
.accordion {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: .875rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.125rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
}
.accordion-trigger:hover { background: var(--gray-50); }

.acc-icon { color: var(--primary); flex-shrink: 0; }
.acc-icon svg { width: 18px; height: 18px; display: block; }
.acc-title {
  flex: 1;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--text);
}
.acc-chevron {
  color: var(--gray-400);
  transition: transform .25s ease;
  flex-shrink: 0;
}
.acc-chevron svg { width: 18px; height: 18px; display: block; }
.accordion.open .acc-chevron { transform: rotate(180deg); }

.accordion-body {
  padding: 0 1.125rem 1.125rem;
  display: none;
}
.accordion.open .accordion-body { display: block; }

/* ============================================================
   EXPENSE TABLE
============================================================ */
.expense-inflation-row { margin-bottom: 1rem; }
.expense-table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: .75rem; }

.expense-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8125rem;
}
.expense-table thead th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-weight: 600;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: .625rem .75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.expense-table .th-percent { text-align: center; width: 160px; }
.expense-table .th-per-unit,
.expense-table .th-piti { text-align: center; width: 75px; }
.expense-table input[type="checkbox"]:disabled { opacity: .35; cursor: not-allowed; }
.expense-table select:disabled { opacity: .5; cursor: not-allowed; }

/* Inline % checkbox + basis select */
.exp-pct-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}
.exp-pct-basis {
  font-size: .7rem;
  padding: 1px 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--gray-700);
  cursor: pointer;
  max-width: 90px;
}
.td-pct-col { text-align: center; }
.expense-table tbody tr:last-child td { border-bottom: none; }
.expense-table tbody tr:hover td { background: var(--gray-50); }
.expense-table td {
  padding: .45rem .75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.expense-table td input[type="text"],
.expense-table td input[type="number"],
.expense-table td select {
  height: 32px;
  font-size: .8125rem;
}
.expense-table td.td-center { text-align: center; }
.expense-table td.td-delete { text-align: center; width: 40px; }

.btn-delete-row {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: .2rem;
  border-radius: var(--radius-sm);
  transition: color .12s, background .12s;
  display: flex;
  align-items: center;
}
.btn-delete-row:hover { color: var(--danger); background: var(--danger-light); }
.btn-delete-row svg { width: 15px; height: 15px; }

/* ============================================================
   UNITS TABLE
============================================================ */
.units-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .625rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.units-toolbar-left {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.units-label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--gray-700);
  background: var(--gray-100);
  padding: .2rem .6rem;
  border-radius: 99px;
  border: 1px solid var(--border);
}
.units-total-preview {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--success);
}
.units-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: .625rem;
}
.units-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8125rem;
  min-width: 560px;
}
.units-table thead th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-weight: 600;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: .6rem .75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.units-table tbody tr { border-bottom: 1px solid var(--border); }
.units-table tbody tr:last-child { border-bottom: none; }
.units-table tbody tr:hover td { background: var(--gray-50); }
.units-table td {
  padding: .4rem .75rem;
  vertical-align: middle;
}
.units-table td input[type="text"],
.units-table td input[type="number"] {
  height: 32px;
  font-size: .8125rem;
}
.units-table .td-unit-actions {
  text-align: right;
  white-space: nowrap;
  width: 72px;
}
.btn-unit-action {
  background: none;
  border: none;
  cursor: pointer;
  padding: .2rem .3rem;
  border-radius: var(--radius-sm);
  color: var(--gray-400);
  transition: color .12s, background .12s;
  display: inline-flex;
  align-items: center;
}
.btn-unit-action:hover          { color: var(--primary); background: var(--primary-light); }
.btn-unit-action.delete:hover   { color: var(--danger);  background: var(--danger-light); }
.btn-unit-action svg { width: 14px; height: 14px; }

.global-income-settings {
  margin-top: .875rem;
  padding-top: .875rem;
  border-top: 1px dashed var(--border);
}
.global-income-settings .form-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* Seasonal grid */
.seasonal-section { margin-top: 1rem; }
.seasonal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}
.seasonal-months {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .5rem;
}
.seasonal-month {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.seasonal-month label {
  font-size: .7rem;
  font-weight: 600;
  color: var(--gray-500);
  text-align: center;
  text-transform: uppercase;
}
.seasonal-month input {
  height: 34px;
  text-align: center;
  font-size: .8125rem;
}

/* ============================================================
   FORM ACTIONS
============================================================ */
.form-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem 0 .25rem;
}

.save-status {
  font-size: .8rem;
  color: var(--success);
  font-weight: 500;
  transition: opacity .3s;
}

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1rem;
  font-size: .8375rem;
  font-family: inherit;
  font-weight: 600;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
  outline: none;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-primary:active { transform: scale(.98); }

.btn-secondary {
  background: #fff;
  color: var(--gray-700);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-300); }

.btn-ghost {
  background: none;
  color: var(--gray-600);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--gray-100); border-color: var(--border); }

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover { background: #dc2626; }

.btn-danger-ghost {
  background: none;
  color: var(--danger);
  border-color: transparent;
}
.btn-danger-ghost:hover { background: var(--danger-light); border-color: var(--danger); }

.btn-lg {
  padding: .625rem 1.5rem;
  font-size: .9375rem;
  border-radius: var(--radius);
}
.btn-sm {
  padding: .35rem .75rem;
  font-size: .75rem;
}

/* ============================================================
   PANEL TOOLBAR
============================================================ */
.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.panel-toolbar h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
}

/* ============================================================
   CHARTS
============================================================ */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.chart-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.125rem;
  box-shadow: var(--shadow-sm);
}
.chart-title {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: .875rem;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.chart-wrap {
  position: relative;
  height: 220px;
}

/* ============================================================
   DATA TABLES
============================================================ */
.table-scroll-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--card-bg);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
  white-space: nowrap;
}
.data-table thead th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-weight: 600;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: .75rem .875rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.data-table thead th:first-child,
.data-table thead th:nth-child(2) { text-align: center; }

.data-table tbody tr { border-bottom: 1px solid var(--gray-100); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover td { background: #fafbfc; }
.data-table tbody tr.year-row td { background: var(--gray-50); font-weight: 600; }
.data-table tbody tr.year-separator td { border-top: 2px solid var(--border); }

.data-table td {
  padding: .6rem .875rem;
  text-align: right;
  color: var(--text);
}
.data-table td:first-child,
.data-table td:nth-child(2) { text-align: center; color: var(--gray-500); font-size: .75rem; font-weight: 600; }

.cell-positive { color: var(--success) !important; font-weight: 600; }
.cell-negative { color: var(--danger) !important; font-weight: 600; }
.cell-neutral  { color: var(--gray-500); }
.cell-revenue  { color: #16a34a !important; font-weight: 600; }
.at-revenue-row .at-label-cell { color: #15803d; font-weight: 600; }
.cell-zero     { color: var(--gray-300); font-weight: 400; letter-spacing: .05em; }

/* Override generic 2nd-column centering for annual table year columns */
.annual-table td:nth-child(2),
.annual-table th:nth-child(2) {
  text-align: right !important;
  color: var(--text) !important;
  font-size: inherit !important;
  font-weight: inherit !important;
}

/* ---- Annual table: transposed (categories = rows, years = columns) ---- */

/* Override generic first-child alignment for annual table */
.annual-table td:first-child,
.annual-table th:first-child {
  text-align: left !important;
}

/* Column sizing */
.annual-table th.at-col-category { min-width: 210px; }
.annual-table th.at-col-year     { min-width: 110px; text-align: right; }
.annual-table th.at-col-y0       { background: #f0f4ff; color: var(--primary); border-bottom: 2px solid var(--primary); }
.annual-table td.at-col-y0       { background: #f8faff; }
.annual-table th.at-col-total    { min-width: 110px; text-align: right; background: var(--gray-50); }
.annual-table td.at-col-total    { background: var(--gray-50); font-weight: 700; }

/* Section header rows */
.annual-table tr.at-section-header td {
  background: var(--gray-800) !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-size: .7rem !important;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: .35rem 1rem !important;
  border-bottom: none !important;
  pointer-events: none;
}

/* Label cell (left column) */
.annual-table td.at-label-cell {
  text-align: left !important;
  color: var(--gray-700) !important;
  font-size: .825rem !important;
  font-weight: 500 !important;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: .4rem;
}

/* Expandable summary rows */
.annual-table tr.at-expandable {
  cursor: pointer;
  user-select: none;
}
.annual-table tr.at-expandable:hover td { background: #eff6ff !important; }
.annual-table tr.at-expandable td.at-label-cell { font-weight: 600 !important; }

/* Sub-rows (indent = breakdown items) */
.annual-table tr.at-sub-row td {
  background: #fafcff !important;
  font-size: .775rem !important;
  border-bottom: 1px solid var(--gray-100) !important;
}
.annual-table tr.at-sub-row td.at-label-cell {
  color: var(--gray-500) !important;
  font-weight: 400 !important;
}

/* Indent arrow in sub-rows */
.at-indent-arrow {
  color: var(--gray-400);
  font-size: .7rem;
  margin-right: .15rem;
  flex-shrink: 0;
}

/* Summary / subtotal rows */
.annual-table tr.at-total-row td {
  border-top: 1.5px solid var(--border) !important;
  font-weight: 700 !important;
  background: var(--gray-50) !important;
}

/* Cash Flow highlight row */
.annual-table tr.at-cf-row td {
  background: #f0fdf4 !important;
  font-weight: 700 !important;
  font-size: .875rem !important;
  border-top: 2px solid var(--success) !important;
  border-bottom: 2px solid var(--success) !important;
}
.annual-table tr.at-cf-row td:first-child { color: var(--success) !important; }

/* Expand chevron (shared with other uses) */
.expand-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--gray-100);
  color: var(--gray-500);
  flex-shrink: 0;
  transition: transform .2s ease, background .15s, color .15s;
}
.expand-chevron svg { width: 12px; height: 12px; display: block; }
.expand-chevron.open {
  transform: rotate(90deg);
  background: var(--primary-light);
  color: var(--primary);
}
.annual-table tr.at-expandable:hover .expand-chevron {
  background: var(--primary-light);
  color: var(--primary);
}

/* Row slide-in animation */
@keyframes rowSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.annual-table tr.at-sub-row:not(.hidden) { animation: rowSlideIn .15s ease; }

/* Panel toolbar multi-button group */
.panel-toolbar-actions {
  display: flex;
  align-items: center;
  gap: .375rem;
  flex-wrap: wrap;
}

/* Compare table */
.compare-table thead th { text-align: center; }
.compare-table tbody td { text-align: center; }
.compare-table tbody tr.metric-label td:first-child { text-align: left; font-weight: 600; color: var(--gray-700); }
.compare-table thead th.col-metric { text-align: left; }

/* ============================================================
   5-YEAR SUMMARY CARDS
============================================================ */
.metric-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: .875rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.125rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: .35rem;
  transition: box-shadow .15s;
}
.metric-card:hover { box-shadow: var(--shadow); }

.metric-card-label {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--gray-500);
}
.metric-card-value {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
}
.metric-card-value.positive { color: var(--success); }
.metric-card-value.negative { color: var(--danger); }
.metric-card-value.primary  { color: var(--primary); }
.metric-card-sub {
  font-size: .75rem;
  color: var(--gray-400);
}

/* Summary sections row */
/* Investment Return Summary */
.inv-summary-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.inv-summary-col {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.125rem;
  box-shadow: var(--shadow-sm);
}
.inv-summary-col-title {
  font-size: .8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--gray-600);
  margin-bottom: .875rem;
  padding-bottom: .625rem;
  border-bottom: 1px solid var(--border);
}
.inv-summary-col .kv-table td:first-child {
  font-weight: 500;
  color: var(--gray-700);
}
.inv-summary-col .kv-table tr.kv-total td {
  font-weight: 700;
  border-top: 1px solid var(--border);
  padding-top: .6rem;
  font-size: .95rem;
}
.inv-summary-col-title {
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ROI breakdown toggle button */
.roi-bd-toggle {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-left: auto;
  padding: .2rem .55rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light, #eff6ff);
  border: 1px solid var(--primary-border, #bfdbfe);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.roi-bd-toggle:hover  { background: var(--primary); color: #fff; }
.roi-bd-toggle.active { background: var(--primary); color: #fff; }

/* ROI breakdown panel */
.roi-breakdown-panel {
  display: none;
  flex-direction: column;
  gap: .75rem;
  margin-top: .875rem;
  padding-top: .875rem;
  border-top: 1px dashed var(--border);
}
.roi-breakdown-panel.open { display: flex; }

.roi-bd-item {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem .875rem;
}
.roi-bd-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .3rem;
}
.roi-bd-label  { font-size: .8rem; font-weight: 700; color: var(--gray-800); }
.roi-bd-result { font-size: .875rem; font-weight: 700; color: var(--primary); }
.roi-bd-formula {
  font-size: .73rem;
  color: var(--gray-500);
  font-style: italic;
  margin-bottom: .35rem;
}
.roi-bd-desc {
  font-size: .72rem;
  color: var(--gray-600);
  margin-bottom: .5rem;
  line-height: 1.4;
}
.roi-bd-lines  { display: flex; flex-direction: column; gap: .2rem; }
.roi-bd-row {
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
  color: var(--gray-600);
}
.roi-bd-row-lbl { flex: 1; }
.roi-bd-row-val { font-weight: 600; color: var(--gray-700); text-align: right; }
.roi-bd-row-total {
  margin-top: .3rem;
  padding-top: .3rem;
  border-top: 1px solid var(--border);
  font-weight: 700;
  color: var(--gray-900);
}
.roi-bd-row-total .roi-bd-row-val { color: var(--primary); }

.summary-sections-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.summary-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.125rem;
  box-shadow: var(--shadow-sm);
}
.summary-section h4,
.summary-returns-section h4 {
  font-size: .8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--gray-600);
  margin-bottom: .875rem;
  padding-bottom: .625rem;
  border-bottom: 1px solid var(--border);
}
.summary-returns-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.125rem;
  box-shadow: var(--shadow-sm);
}

/* Summary key-value lists */
.kv-table { width: 100%; border-collapse: collapse; font-size: .8375rem; }
.kv-table tr { border-bottom: 1px solid var(--gray-100); }
.kv-table tr:last-child { border-bottom: none; }
.kv-table td { padding: .5rem .25rem; }
.kv-table td:first-child { color: var(--gray-600); font-weight: 500; }
.kv-table td:last-child { text-align: right; font-weight: 600; color: var(--text); }
.kv-table td.value-positive { color: var(--success); }
.kv-table td.value-negative { color: var(--danger); }
.kv-table td.value-highlight { color: var(--primary); font-size: .9375rem; font-weight: 700; }

/* ============================================================
   MODAL
============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(3px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  margin: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  animation: modalIn .2s ease;
}
.modal-dialog-sm { max-width: 420px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(-8px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
}
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
  border-radius: var(--radius-sm);
  color: var(--gray-400);
  transition: color .12s, background .12s;
}
.modal-close:hover { color: var(--text); background: var(--gray-100); }
.modal-close svg { width: 18px; height: 18px; display: block; }

.modal-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .625rem;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* PDF export section checkboxes */
.pdf-section-checks {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.pdf-check-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .625rem .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.pdf-check-row:hover {
  background: var(--gray-50);
  border-color: var(--primary);
}
.pdf-check-row input[type="checkbox"] {
  margin-top: .2rem;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}
.pdf-check-info {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.pdf-check-label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--gray-800);
}
.pdf-check-sub {
  font-size: .75rem;
  color: var(--gray-500);
}
.pdf-check-sub-row {
  margin-left: 1.5rem;
  background: var(--gray-50);
  border-color: var(--gray-200);
}
.pdf-options-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: .75rem 0;
}

/* Option card grid (in modal) */
.option-card-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.option-card {
  cursor: pointer;
}
.option-card input[type="radio"] { display: none; }
.option-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: 1.125rem .75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  text-align: center;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.option-card-inner svg {
  width: 28px; height: 28px;
  color: var(--gray-400);
  transition: color .15s;
  stroke-width: 1.5;
}
.option-card-inner strong {
  font-size: .8375rem;
  font-weight: 700;
  color: var(--text);
}
.option-card-inner small {
  font-size: .75rem;
  color: var(--gray-400);
}
.option-card input:checked + .option-card-inner {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}
.option-card input:checked + .option-card-inner svg { color: var(--primary); }

/* ============================================================
   EMPTY STATE INLINE
============================================================ */
.empty-state-inline {
  text-align: center;
  padding: 2rem;
  color: var(--gray-500);
  font-size: .875rem;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--gray-300);
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1024px) {
  .form-top-row { grid-template-columns: 1fr 1fr; }
  .charts-row { grid-template-columns: 1fr; }
  .summary-sections-row { grid-template-columns: 1fr; }
  .inv-summary-section  { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 240px; }
  .form-top-row { grid-template-columns: 1fr; }
  .metric-cards { grid-template-columns: repeat(2, 1fr); }
  .seasonal-months { grid-template-columns: repeat(4, 1fr); }
  #tab-bar { padding: 0 .75rem; }
  .tab { padding: .625rem .625rem; font-size: .75rem; }
  #tab-panels { padding: 1rem; }
}

@media (max-width: 600px) {
  #main-layout { flex-direction: column; }
  #sidebar { width: 100%; height: auto; max-height: 200px; }
  .metric-cards { grid-template-columns: 1fr 1fr; }
  .option-card-group { grid-template-columns: 1fr; }
}

/* ============================================================
   PRINT STYLES
============================================================ */
@media print {
  #sidebar, #app-header, #tab-bar, .form-actions, .panel-toolbar .btn { display: none !important; }
  #content { overflow: visible; }
  #tab-panels { overflow: visible; padding: 0; }
  .tab-panel { display: block !important; page-break-inside: avoid; }
  body { background: #fff; font-size: 12px; }
}

/* ============================================================
   UTILITIES
============================================================ */
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-primary { color: var(--primary); }
.text-muted   { color: var(--text-muted); }
.font-bold    { font-weight: 700; }
.font-mono    { font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace; }

/* Loading animation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.loading-dot::after {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: spin 1s linear infinite;
}

/* ============================================================
   ANNUAL TABLE HOVER TOOLTIP
============================================================ */
.annual-tooltip {
  position: absolute;
  z-index: 9999;
  background: var(--gray-900);
  color: #fff;
  border-radius: 7px;
  padding: .6rem .8rem;
  font-size: .775rem;
  min-width: 190px;
  max-width: 280px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  pointer-events: none;
  line-height: 1.4;
}
.at-tip-row {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .15rem 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.at-tip-row:last-child { border-bottom: none; }
.at-tip-total {
  border-top: 1px solid rgba(255,255,255,.2) !important;
  margin-top: .1rem;
  padding-top: .25rem;
  font-weight: 700;
}
.at-tip-lbl { color: rgba(255,255,255,.7); }
.at-tip-val { color: #fff; font-weight: 600; white-space: nowrap; }

/* Cells that have a tooltip hint cursor */
.annual-table td[data-tip-key] { cursor: help; }
.annual-table td[data-tip-key]:hover { background: #eef6ff !important; }

/* ============================================================
   PRINT DOC — screen: hidden; print: visible
============================================================ */
#print-doc { display: none; }

/* ============================================================
   PRINT PAGE COMPONENT STYLES (used both screen-preview & print)
============================================================ */

/* Page container */
.print-page {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 8.5pt;
  color: #1e293b;
  line-height: 1.35;
  background: #fff;
}

/* Page header bar */
.pp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid #1e3a5f;
  padding-bottom: 5pt;
  margin-bottom: 10pt;
}
.pp-brand {
  font-weight: 700;
  font-size: 10pt;
  color: #1e3a5f;
  margin-right: 6pt;
}
.pp-scenario { font-size: 8.5pt; color: #475569; }
.pp-address   { font-size: 8pt;   color: #475569; margin-left: 6pt; font-style: italic; }
.pp-header-right { font-size: 7.5pt; color: #64748b; text-align: right; }
.pp-header-right span { display: block; }
.pp-date { color: #94a3b8; }

/* ── Executive Summary page ── */
.pp-exec-banner {
  background: #1e3a5f;
  color: #fff;
  border-radius: 5pt;
  padding: 10pt 14pt;
  margin-bottom: 10pt;
  text-align: center;
}
.pp-exec-banner-title {
  font-size: 14pt;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.pp-exec-banner-sub {
  font-size: 8pt;
  color: #94a3b8;
  margin-top: 2pt;
}
/* Exec cards use the same pp-card / pp-grid-2 classes as the rest of the report */
.pp-exec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8pt;
}

/* ── How Calculated page ── */
.pp-calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10pt 14pt;
}
.pp-calc-block {
  border: 1px solid #e2e8f0;
  border-radius: 5pt;
  padding: 7pt 9pt;
  break-inside: avoid;
}
.pp-calc-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3pt;
  gap: 6pt;
}
.pp-calc-label  { font-weight: 700; font-size: 8pt; color: #1e3a5f; }
.pp-calc-formula {
  font-size: 7pt; color: #64748b;
  font-style: italic;
  text-align: right;
  flex-shrink: 0;
}
.pp-calc-desc   { font-size: 7pt; color: #64748b; margin: 0 0 4pt; }
.pp-calc-table  { width: 100%; border-collapse: collapse; font-size: 7.5pt; }
.pp-calc-table td { padding: 1.5pt 3pt; }
.pp-calc-lbl    { color: #475569; width: 70%; }
.pp-calc-val    { text-align: right; font-weight: 500; color: #1e293b; }
.pp-calc-total td { border-top: 1px solid #cbd5e1; font-weight: 700; color: #1e3a5f; padding-top: 3pt; }

/* Section titles */
.pp-section-title {
  font-size: 11pt;
  font-weight: 700;
  color: #1e3a5f;
  margin: 0 0 8pt;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4pt;
}
.pp-sub-title {
  font-size: 8pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #64748b;
  margin: 8pt 0 4pt;
}

/* Two-column card grid (page 1) */
.pp-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8pt;
  margin-bottom: 10pt;
}
.pp-card {
  border: 1px solid #e2e8f0;
  border-radius: 4pt;
  padding: 6pt 8pt;
}
.pp-card-title {
  font-size: 7.5pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #3b82f6;
  margin-bottom: 5pt;
  border-bottom: 1px solid #eff6ff;
  padding-bottom: 3pt;
}

/* Key-value table */
.pp-kv { border-collapse: collapse; width: 100%; }
.pp-kv tr { border-bottom: 1px solid #f1f5f9; }
.pp-kv tr:last-child { border-bottom: none; }
.pp-kv-k {
  color: #64748b;
  font-size: 7.5pt;
  padding: 2.5pt 4pt 2.5pt 0;
  width: 55%;
  vertical-align: top;
}
.pp-kv-v {
  font-weight: 600;
  font-size: 7.5pt;
  text-align: right;
  padding: 2.5pt 0;
  color: #1e293b;
}
.pp-kv-v.pos { color: #10b981; }
.pp-kv-v.neg { color: #ef4444; }
.pp-kv-v.highlight { color: #1e3a5f; font-weight: 700; }
.pp-kv-v.pp-kv-link { font-weight: 400; word-break: break-all; }
.pp-kv-total td { font-weight: 700; border-top: 1pt solid #cbd5e1; padding-top: 4pt; }
.pp-link { color: #2563eb; text-decoration: none; font-size: 6.5pt; }

/* Generic data table (units, expenses) */
.pp-table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 8pt;
}
.pp-table th {
  background: #f8fafc;
  font-size: 7pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: #64748b;
  padding: 3pt 5pt;
  text-align: left;
  border-bottom: 1.5px solid #e2e8f0;
}
.pp-table td {
  font-size: 7.5pt;
  padding: 2.5pt 5pt;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}
.pp-table tr:last-child td { border-bottom: none; }

/* ─ Annual analysis table (page 2) ─ */
.pp-annual {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}
.pp-annual th {
  background: #1e3a5f;
  color: #fff;
  font-size: 7pt;
  font-weight: 700;
  padding: 3.5pt 4pt;
  text-align: right;
  border-right: 1px solid #2d4f7c;
}
.pp-annual-label { text-align: left !important; width: 30%; }
.pp-annual-total { background: #0f2744 !important; }

.pp-annual td {
  font-size: 7.5pt;
  padding: 2.5pt 4pt;
  text-align: right;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
}
.pp-row-label { text-align: left !important; color: #334155; font-weight: 500; }
.pp-total { font-weight: 700; background: #f8fafc; }
.pp-annual tr.pp-indent td { background: #fafcff; font-size: 7pt; }
.pp-annual tr.pp-indent .pp-row-label { color: #64748b; padding-left: 10pt; }
.pp-annual tr.pp-section-row td {
  background: #334155;
  color: #fff;
  font-size: 6.5pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 2.5pt 5pt;
  text-align: left;
}
.pp-annual td.neg { color: #ef4444; font-weight: 600; }
.pp-annual td.subtotal { font-weight: 700; background: #f0f9ff; color: #1e3a5f; border-top: 1.5px solid #bfdbfe; }
.pp-annual td.cf { color: #10b981; font-weight: 700; background: #f0fdf4; border-top: 1.5px solid #86efac; }
.pp-annual td.muted { color: #64748b; }
.pp-annual td.revenue { color: #16a34a; font-weight: 600; }
.pp-annual .pp-row-revenue { color: #15803d; font-weight: 600; }
.pp-annual td.pp-total.revenue { color: #16a34a; font-weight: 700; }
.pp-zero { color: #94a3b8; }
.pp-annual-y0 { background: #1e3a5f; }

/* Summary two-column layout (page 3) */
.pp-summary-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16pt;
  margin-top: 6pt;
}
.pp-summary-col {
  border: 1px solid #e2e8f0;
  border-radius: 4pt;
  padding: 8pt 10pt;
}

/* ============================================================
   @MEDIA PRINT — Letter, 3 pages
============================================================ */
@media print {
  @page {
    size: letter portrait;
    margin: 0.55in 0.5in;
  }

  /* Hide everything except the print document */
  body > *:not(#print-doc) { display: none !important; }
  #print-doc { display: block !important; }

  /* Inputs & Summary pages: keep together on one page each */
  .print-page-fixed {
    page-break-after: always;
    page-break-inside: avoid;
    width: 100%;
  }
  .print-page-fixed:last-child { page-break-after: auto; }

  /* Annual cash-flow page: allow the table to flow across pages */
  .print-page-flow {
    page-break-after: always;
    page-break-inside: auto;
    width: 100%;
  }
  .print-page-flow:last-child { page-break-after: auto; }

  /* Keep individual rows together; allow breaks between rows */
  .pp-annual { page-break-inside: auto; }
  .pp-annual tr { page-break-inside: avoid; break-inside: avoid; }
  /* Keep section header glued to the next data row */
  .pp-annual tr.pp-section-row { page-break-after: avoid; break-after: avoid; }

  /* Ensure backgrounds print */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* ============================================================
   SHARE CARD — WhatsApp Investment Card Export
============================================================ */

/* ── Header toolbar button ───────────────────────────────── */
.btn-share-card {
  background: #25d366;
  color: #fff;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.btn-share-card:hover  { background: #1da851; color: #fff; }
.btn-share-card:active { background: #128c3e; color: #fff; }

.btn-push-wp {
  background: #0F2A44;
  color: #fff;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.btn-push-wp:hover  { background: #FF7A1A; color: #fff; }
.btn-push-wp:active { background: #e86a0e; color: #fff; }

/* ── Modal overrides ─────────────────────────────────────── */
.modal-dialog-share { max-width: 460px; }

.sc-modal-preview-area {
  background: #0f172a;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  max-height: 65vh;
  overflow-y: auto;
  padding: 20px 20px 12px;
}

.sc-preview-scroll { width: 100%; display: flex; justify-content: center; }
.sc-preview-wrap   { display: flex; justify-content: center; }

.sc-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between !important;
  flex-wrap: wrap;
  gap: 8px;
}

.sc-modal-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .75rem;
  color: var(--gray-400);
}

.sc-modal-actions { display: flex; gap: 8px; }

.btn-share-export {
  background: #25d366;
  color: #fff;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  padding: .5rem 1.1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .875rem;
  transition: background .15s;
}
.btn-share-export:hover    { background: #1da851; }
.btn-share-export:disabled { background: #94a3b8; cursor: not-allowed; }

/* ── The card itself ─────────────────────────────────────── */
/* NOTE: No CSS variables — all explicit hex so html2canvas renders correctly */
.sc-card {
  width: 390px;
  background: #f8fafc;
  border-radius: 20px;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  flex-shrink: 0;
}

/* Banner / property image */
.sc-banner {
  position: relative;
  height: 210px;
  background: #1e3a5f;
  overflow: hidden;
}
.sc-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sc-banner-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 60%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sc-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(15,23,42,0.05) 0%,
    rgba(15,23,42,0.45) 60%,
    rgba(15,23,42,0.82) 100%);
}
.sc-banner-badges {
  position: absolute;
  bottom: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.sc-badge {
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.28);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
}

/* Title block */
.sc-title-block {
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f1f5f9;
}
.sc-brand-line {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #3b82f6;
  margin-bottom: 5px;
}
.sc-headline {
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-location {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #64748b;
}
.sc-location svg { flex-shrink: 0; }

/* Property specs strip */
.sc-specs-strip {
  display: flex;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.sc-spec-cell {
  flex: 1;
  text-align: center;
  padding: 10px 6px;
  border-right: 1px solid #e2e8f0;
}
.sc-spec-cell:last-child { border-right: none; }
.sc-spec-num {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}
.sc-spec-tag {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #94a3b8;
  margin-top: 3px;
}

/* Hero metric — Net Profit */
/* Total Investment row */
.sc-total-investment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 18px 4px;
  padding: 10px 16px;
  background: #f1f5f9;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}
.sc-ti-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.sc-ti-value {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.sc-hero {
  margin: 16px 18px 14px;
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  border-radius: 16px;
  padding: 22px 20px 18px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.sc-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 140px; height: 140px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
}
.sc-hero::after {
  content: '';
  position: absolute;
  bottom: -30px; left: -20px;
  width: 100px; height: 100px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
}
.sc-hero-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}
.sc-hero-amount {
  font-size: 44px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  letter-spacing: -.03em;
  position: relative;
  z-index: 1;
}
.sc-hero-sub {
  font-size: 11px;
  color: rgba(255,255,255,.45);
  margin-top: 7px;
  position: relative;
  z-index: 1;
}

/* Metrics 2-column grid */
.sc-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 18px 14px;
}
.sc-metric-tile {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 13px 14px;
}
.sc-metric-tile.sc-tile-accent {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.sc-metric-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 5px;
}
.sc-metric-tile.sc-tile-accent .sc-metric-label { color: #3b82f6; }
.sc-metric-value {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  letter-spacing: -.01em;
}
.sc-metric-value.pos { color: #16a34a; }
.sc-metric-value.neg { color: #dc2626; }

/* 2-tile layout: larger values since there's more space */
.sc-metrics-2up .sc-metric-value { font-size: 30px; }
.sc-metrics-2up .sc-metric-label { font-size: 10px; }

/* Secondary metrics row */
.sc-secondary-row {
  display: flex;
  gap: 10px;
  padding: 0 18px 14px;
}
.sc-secondary-tile {
  flex: 1;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* Equity Multiple tile — centred, slightly more prominent */
.sc-equity-tile {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  justify-content: center;
  gap: 10px;
}
.sc-secondary-label {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
}
.sc-equity-tile .sc-secondary-label { color: #16a34a; }
.sc-secondary-value {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}
.sc-equity-tile .sc-secondary-value { font-size: 18px; color: #15803d; }
.sc-secondary-value.pos { color: #16a34a; }

/* Strategy flow pills */
.sc-strategy-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.sc-strategy-pill {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sc-pill-buy  { background: #1e3a5f; color: #fff; }
.sc-pill-rent { background: #166534; color: #fff; }
.sc-pill-sell { background: #92400e; color: #fff; }
.sc-strategy-arrow {
  font-size: 14px;
  font-weight: 700;
  color: #94a3b8;
  line-height: 1;
}

/* Card subtitle line */
.sc-subtitle {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  margin-top: 2px;
}

/* Compact title block modifier */
.sc-title-block--compact {
  padding: 10px 18px 8px;
}

/* ── Sectioned card layout ───────────────────────────────────── */
.sc-sections {
  margin: 0;
}
.sc-section {
  padding: 10px 18px;
  border-bottom: 1px solid #f1f5f9;
}
.sc-section:last-child {
  border-bottom: none;
}
.sc-sec-title {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 6px;
}
.sc-kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
}
.sc-kv-row--profit {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
}
.sc-kv-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}
.sc-kv-value {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}
.sc-kv-value.pos { color: #16a34a; }
.sc-kv-value.neg { color: #dc2626; }
.sc-kv-strong {
  font-size: 14px;
  font-weight: 800;
}

/* Options pills */
.sc-options-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sc-opt-pill {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}
.sc-opt-pill.active {
  background: #1e3a5f;
  color: #fff;
  border-color: #1e3a5f;
}

/* Divider with label */
.sc-section-label {
  padding: 0 18px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #94a3b8;
}

/* Exit summary table */
.sc-exit-table {
  margin: 0 18px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}
.sc-exit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  font-size: 12.5px;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}
.sc-exit-row:last-child {
  border-bottom: none;
  background: #eff6ff;
  font-weight: 700;
  color: #1e3a5f;
}
.sc-exit-label { font-weight: 500; }
.sc-exit-val   { font-weight: 700; color: #0f172a; }
.sc-exit-val.neg { color: #dc2626; }
.sc-exit-val.hi  { color: #2563eb; font-size: 14px; }

/* Card footer */
.sc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #0f172a;
}
.sc-footer-brand {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: .03em;
}
.sc-footer-brand em {
  font-style: normal;
  color: #3b82f6;
}
.sc-footer-tag {
  font-size: 10px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ── V2 Card Design — Pixel-Accurate Layout ─────────────────────
   Spacing tokens (all hardcoded — no CSS vars for html2canvas):
   Grid outer pad : 12px  │  Grid gap      : 8px
   Card pad H     : 10px  │  Card pad V    : 12px
   Card width     : 179px │  Content width : 159px
   Icon (strategy): 44px  │  Icon (option) : 32px
   Icon (header)  : 12px  │  Icon (pill)   : 11px
   Font (value)   : 12px  │  Font (bigval) : 23px
   Font (label)   : 6.5px │  Font (hdr)    : 8px
──────────────────────────────────────────────────────────────── */

/* ── Banner strategy pills ───────────────────────────────────── */
.sc-banner { position: relative; }
.sc-banner-strategy {
  position: absolute;
  bottom: 16px;
  left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  z-index: 2;
}
.sc-bsp-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 14px;
  border-radius: 16px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  color: #fff;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.18);
}
.sc-bsp-buy  { background: linear-gradient(135deg, #1e3a5f, #0f2847); }
.sc-bsp-rent { background: linear-gradient(135deg, #166534, #14532d); }
.sc-bsp-sell { background: linear-gradient(135deg, #92400e, #78350f); }
.sc-bsp-arrow {
  color: rgba(255,255,255,0.45);
  font-size: 12px;
  font-weight: 300;
  line-height: 32px;
  flex-shrink: 0;
}

/* ── V2 Header ───────────────────────────────────────────────── */
.sc-v2-header {
  padding: 13px 16px 11px;
  background: #fff;
  border-bottom: 1px solid #eef1f6;
}
.sc-v2-brand {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .05em;
  color: #1e40af;
  margin-bottom: 5px;
  white-space: nowrap;
}
.sc-v2-subtitle {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  font-size: 10.5px;
  color: #374151;
  font-weight: 500;
  overflow: hidden;
}
.sc-v2-si {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.sc-v2-dot {
  display: inline-block;
  color: #d1d5db;
  font-weight: 300;
  padding: 0 4px;
}

/* ── 2-column card grid ──────────────────────────────────────── */
.sc-v2-grid {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px 0;
}
.sc-v2-grid + .sc-v2-grid { padding-top: 8px; }
.sc-v2-grid:last-of-type  { padding-bottom: 10px; }
.sc-v2-grid--stretch { align-items: stretch; }

/* Base card — 179px wide, 10px H padding → 159px content */
.sc-v2-card {
  flex: 1;
  border-radius: 16px;
  padding: 12px 10px;
  min-width: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 3px 10px rgba(0,0,0,0.06);
  box-sizing: border-box;
}

/* Card color variants */
.sc-vc-invest  { background: linear-gradient(150deg, #f0f7ff 0%, #dbeafe 100%); }
.sc-vc-capital {
  background: linear-gradient(150deg, #f5f3ff 0%, #ede9fe 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.sc-vc-returns { background: linear-gradient(150deg, #f0fdf4 0%, #dcfce7 100%); display: flex; flex-direction: column; }
.sc-vc-options { background: linear-gradient(150deg, #fffbeb 0%, #fef3c7 100%); }

/* ── Card section headers (8px, same height across all cards) ─ */
.sc-vc-hdr {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 20px;              /* fixed height → same baseline all cards */
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
}
.sc-vc-invest  .sc-vc-hdr { color: #1e40af; }
.sc-vc-capital .sc-vc-hdr { color: #6d28d9; }
.sc-vc-returns .sc-vc-hdr { color: #166534; }
.sc-vc-options .sc-vc-hdr { color: #92400e; }
.sc-vc-hdr-orange           { color: #c2410c; }

/* ── Investment Strategy — icons row ────────────────────────── */
.sc-si-row {
  display: flex;
  align-items: center;
  justify-content: space-evenly;  /* even distribution across 159px */
  padding: 2px 0 6px;
}
.sc-si-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
/* All circles identical: 44px */
.sc-si-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.sc-si-buy  { background: linear-gradient(145deg, #3b82f6, #1d4ed8); box-shadow: 0 3px 10px rgba(29,78,216,0.32); }
.sc-si-rent { background: linear-gradient(145deg, #22c55e, #15803d); box-shadow: 0 3px 10px rgba(21,128,61,0.32); }
.sc-si-sell { background: linear-gradient(145deg, #f59e0b, #b45309); box-shadow: 0 3px 10px rgba(180,83,9,0.28); }

/* Label — fixed height so BUY/SELL align with RENT(AIRBNB) */
.sc-si-label {
  height: 26px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  font-size: 8px;
  font-weight: 700;
  text-align: center;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.4;
}
.sc-si-arrow {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 300;
  opacity: .65;
  flex-shrink: 0;
  align-self: center;
  margin-bottom: 20px; /* visually align arrow with circle center, not label */
}

/* ── Total Investment — centered big value ───────────────────── */
.sc-vc-bigval {
  font-size: 23px;
  font-weight: 900;
  color: #0f172a;
  text-align: center;
  white-space: nowrap;
  letter-spacing: -.03em;
  margin: 4px 0 2px;
}

/* ── Returns — 3 equal metric columns ───────────────────────── */
.sc-ret-metrics {
  display: flex;
  gap: 0;
  margin-bottom: 10px;
  flex: 1;
  align-items: flex-start;
}
/* Each column = exactly 1/3 of content width (53px) */
.sc-ret-col {
  flex: 0 0 33.333%;
  width: 33.333%;
  text-align: center;
  padding: 0 1px;
  box-sizing: border-box;
  overflow: visible;
}
.sc-ret-col + .sc-ret-col {
  border-left: 1px solid rgba(0,0,0,0.07);
}
.sc-ret-lbl {
  height: 20px;              /* fixed height → value baselines align */
  display: flex; align-items: flex-end; justify-content: center;
  font-size: 6.5px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 3px;
  line-height: 1.3;
  word-break: break-word;
  text-align: center;
}
.sc-ret-val {
  font-size: 12px;
  font-weight: 900;
  color: #166534;
  white-space: nowrap;
  letter-spacing: -.02em;
  line-height: 1.25;
  display: block;
  text-align: center;
}
.sc-ret-val.pos { color: #166534; }
.sc-ret-val.neg { color: #b91c1c; }
.sc-ret-sub {
  display: block;
  font-size: 6px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  margin-top: 2px;
  letter-spacing: 0;
  white-space: nowrap;
  text-align: center;
}

/* ── Net Profit bar ──────────────────────────────────────────── */
.sc-npb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #16a34a 0%, #166534 100%);
  border-radius: 10px;
  padding: 0 12px;
  height: 38px;              /* fixed height for consistent look */
  margin-top: auto;
  gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 4px 12px rgba(22,101,52,0.26);
  flex-shrink: 0;
}
.sc-npb-lbl {
  font-size: 7.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
  flex-shrink: 0;
}
.sc-npb-val {
  font-size: 17px;
  font-weight: 900;
  color: #fff;
  white-space: nowrap;
  letter-spacing: -.02em;
  flex-shrink: 0;
}

/* ── Investment Options — icon rows ─────────────────────────── */
.sc-opt2-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;              /* fixed row height → perfectly even */
}
.sc-opt2-row + .sc-opt2-row {
  border-top: 1px solid rgba(0,0,0,0.05);
}
/* All circles identical: 32px */
.sc-oi2 {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.sc-oi2-cash    { background: linear-gradient(145deg, #22c55e, #15803d); box-shadow: 0 2px 7px rgba(21,128,61,0.26); }
.sc-oi2-loan    { background: linear-gradient(145deg, #3b82f6, #1e40af); box-shadow: 0 2px 7px rgba(30,64,175,0.26); }
.sc-oi2-partial { background: linear-gradient(145deg, #f59e0b, #b45309); box-shadow: 0 2px 7px rgba(180,83,9,0.23); }
.sc-opt2-lbl {
  font-size: 9.5px;
  font-weight: 700;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Partial Investment Details ──────────────────────────────── */
.sc-v2-partial {
  margin: 0 12px 10px;
  background: linear-gradient(150deg, #fff7ed 0%, #ffedd5 100%);
  border-radius: 16px;
  padding: 12px 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 3px 10px rgba(0,0,0,0.05);
}
.sc-pd-grid {
  display: flex;
  gap: 7px;
}
/* All 3 boxes identical via flex: 1 */
.sc-pd-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  min-height: 58px;
}
.sc-pd-lbl {
  font-size: 7px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 5px;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
}
.sc-pd-val {
  font-size: 16px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -.02em;
  white-space: nowrap;
  text-align: center;
}
.sc-pd-green { color: #166534; }

/* ════════════════════════════════════════════════════════════════════════
   SC3 Investment Card — Strict Grid System
   Width: 390px │ Outer pad: 16px │ Gap: 8px │ Col: 175px │ Inner: 151px
════════════════════════════════════════════════════════════════════════ */

/* ── Base card — crystal glass ───────────────────────────────────── */
.sc3-card {
  width: 400px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: 20px;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-shadow:
    0 8px 32px rgba(31,38,135,0.18),
    0 0 0 1px rgba(255,255,255,0.6),
    inset 0 1px 0 rgba(255,255,255,0.9);
  position: relative;
}

/* ── Banner ─────────────────────────────────────────────────────────── */
.sc3-banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  min-height: 56px;
}
.sc3-banner .sc-banner-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}
.sc3-banner .sc-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15,23,42,.55) 0%, rgba(15,23,42,.1) 55%, transparent 100%);
}

/* ── Header ─────────────────────────────────────────────────────────── */
.sc3-header {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(255,255,255,0.4);
}
.sc3-brand {
  font-size: 11px;
  font-weight: 800;
  color: #1b3a6b;
  letter-spacing: .18em;
}
.sc3-brand em { font-style: normal; font-weight: 300; }
.sc3-brand-v { color: #f07020; font-style: normal; }
.sc3-subtitle {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.sc3-sub-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 500;
  color: #64748b;
}
.sc3-sub-dot { color: #cbd5e1; font-size: 10px; }
.sc3-str-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #ea580c;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ── Hero metric strip ──────────────────────────────────────────────── */
.sc3-hero {
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.3);
}
.sc3-hero-divider {
  width: 1px;
  background: rgba(255,255,255,0.6);
  margin: 4px 0;
}
.sc3-hero-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.sc3-hero-lbl {
  font-size: 9px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.sc3-hero-val-lg {
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.5px;
  color: #0f172a;
}
.sc3-hero-val-md {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  color: #0f172a;
}
.sc3-hero-sub {
  font-size: 8px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.sc3-hero-cell.emerald .sc3-hero-val-lg,
.sc3-hero-cell.emerald .sc3-hero-val-md { color: #059669; }
.sc3-hero-cell.neg     .sc3-hero-val-lg,
.sc3-hero-cell.neg     .sc3-hero-val-md { color: #dc2626; }
.sc3-hero-cell.gold    .sc3-hero-val-lg,
.sc3-hero-cell.gold    .sc3-hero-val-md { color: #d97706; }

/* ── Two-column layout ──────────────────────────────────────────────── */
.sc3-two-col {
  display: flex;
  gap: 10px;
  padding: 14px 14px 0;
}
.sc3-left-col, .sc3-right-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Section glass cards ─────────────────────────────────────────────── */
.sc3-sec {
  border-radius: 14px;
  padding: 14px 14px;
  box-sizing: border-box;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.sc3-sec::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: 14px 14px 0 0;
}
.sc3-invest  { background: rgba(219,234,254,0.45); border-color: rgba(147,197,253,0.6); }
.sc3-invest::before  { background: linear-gradient(90deg, #3b82f6, transparent); }
.sc3-capital { background: rgba(254,243,199,0.45); border-color: rgba(253,230,138,0.6); }
.sc3-capital::before { background: linear-gradient(90deg, #f59e0b, transparent); }
.sc3-returns { background: rgba(220,252,231,0.45); border-color: rgba(187,247,208,0.6); }
.sc3-returns::before { background: linear-gradient(90deg, #10b981, transparent); }
.sc3-options { background: rgba(255,247,237,0.45); border-color: rgba(254,215,170,0.6); }
.sc3-options::before { background: linear-gradient(90deg, #f97316, transparent); }

/* ── Section header ──────────────────────────────────────────────────── */
.sc3-sec-hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 12px;
  white-space: nowrap;
}
.sc3-invest  .sc3-sec-hdr { color: #1d4ed8; }
.sc3-capital .sc3-sec-hdr { color: #b45309; }
.sc3-returns .sc3-sec-hdr { color: #047857; }
.sc3-options .sc3-sec-hdr { color: #c2410c; }

/* ── Investment Strategy ─────────────────────────────────────────────── */
.sc3-strat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  flex: 1;
}
.sc3-strat-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.sc3-strat-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sc3-strat-buy  { background: #2563eb; color: #fff; }
.sc3-strat-rent { background: #16a34a; color: #fff; }
.sc3-strat-sell { background: #d97706; color: #fff; }
.sc3-strat-lbl {
  font-size: 8px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.sc3-strat-arrow {
  font-size: 16px;
  color: #cbd5e1;
  font-weight: 300;
  margin-bottom: 18px;
}

/* ── Total Investment ────────────────────────────────────────────────── */
.sc3-big-val {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  letter-spacing: -.03em;
  margin-top: 4px;
}
.sc3-big-lbl {
  font-size: 9px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-top: 4px;
}
.sc3-cf-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,.07);
}
.sc3-cf-pct  { font-size: 11px; font-weight: 700; }
.sc3-cf-text { font-size: 9px; color: #94a3b8; }

/* ── Returns ─────────────────────────────────────────────────────────── */
.sc3-ret-metrics {
  display: flex;
  gap: 0;
  margin-bottom: 8px;
}
.sc3-ret-col {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 0 4px;
  box-sizing: border-box;
}
.sc3-ret-col + .sc3-ret-col { border-left: 1px solid rgba(0,0,0,.07); }
.sc3-ret-lbl {
  font-size: 7px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 3px;
  min-height: 16px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
}
.sc3-ret-val {
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  letter-spacing: -.02em;
  line-height: 1.2;
  text-align: center;
  display: block;
  padding-bottom: 6px;
}
.sc3-ret-val.pos { color: #059669; }
.sc3-ret-val.neg { color: #dc2626; }
.sc3-ret-sub {
  display: block;
  font-size: 6.5px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  margin-top: 2px;
  white-space: nowrap;
  text-align: center;
}
.sc3-em-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  background: rgba(255,255,255,0.35);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 8px;
  margin-bottom: 8px;
}
.sc3-em-lbl {
  font-size: 7.5px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.sc3-em-val {
  font-size: 13px;
  font-weight: 800;
  color: #d97706;
  letter-spacing: -.02em;
}
.sc3-npb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.35);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 8px;
  padding: 6px 10px;
  margin-top: auto;
  gap: 6px;
  flex-shrink: 0;
}
.sc3-npb-lbl {
  font-size: 7.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
}
.sc3-npb-val { font-size: 14px; font-weight: 800; white-space: nowrap; letter-spacing: -.02em; }
.sc3-npb-val.pos { color: #059669; }
.sc3-npb-val.neg { color: #dc2626; }

/* ── Investment Options ──────────────────────────────────────────────── */
.sc3-opt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.sc3-opt-row:last-child { border-bottom: none; }
.sc3-opt-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.sc3-opt-cash    { background: #16a34a; }
.sc3-opt-loan    { background: #2563eb; }
.sc3-opt-partial { background: #7c3aed; }
.sc3-opt-lbl     { font-size: 10px; font-weight: 600; color: #1e293b; }
.sc3-opt-detail  { font-size: 9px; color: #94a3b8; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc3-opt-units   { font-size: 9px; font-weight: 700; color: #7c3aed; margin-top: 2px; }
.sc3-opt-arrow   { margin-left: auto; color: #cbd5e1; }

/* ── Partial Investment (right-column card) ──────────────────────────── */
.sc3-partial {
  background: rgba(245,243,255,0.45);
  border: 1px solid rgba(221,214,254,0.6);
  border-radius: 14px;
  padding: 14px 14px;
  position: relative;
  overflow: hidden;
}
.sc3-partial::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #7c3aed, transparent);
  border-radius: 14px 14px 0 0;
}
.sc3-partial .sc3-sec-hdr { color: #6d28d9; }
.sc3-pd-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.sc3-pd-col  { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sc3-pd-lbl  {
  font-size: 8px; font-weight: 600; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: 3px; white-space: nowrap;
}
.sc3-pd-val  { font-size: 17px; font-weight: 800; color: #0f172a; letter-spacing: -.02em; white-space: nowrap; }
.sc3-pd-green { color: #7c3aed; }

/* ── Footer ─────────────────────────────────────────────────────────── */
.sc3-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 18px;
  margin-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.35);
}
.sc3-footer-brand { font-size: 11px; font-weight: 800; color: #1b3a6b; letter-spacing: .16em; }
.sc3-footer-brand em { font-style: normal; font-weight: 300; }
.sc3-footer-tag { font-size: 8px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .14em; }
