/* ================================================================
   Green Theme — Real Estate Investment Analyzer
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  --bg:              #F7F8FA;
  --surface:         #FFFFFF;
  --surface2:        #F9FAFB;
  --surface-dim:     #ECFDF5;
  --surface-up:      #FFFFFF;

  --border:          #E5E7EB;
  --border-light:    #F0F1F3;

  --text:            #111827;
  --text-secondary:  #4B5563;
  --text-muted:      #9CA3AF;

  --green:           #10B981;
  --green-bg:        rgba(16, 185, 129, 0.08);
  --green-hover:     #0D9B6D;
  --accent:          #0D4029;
  --accent-hover:    #0A3020;
  --blue:            #3B82F6;
  --blue-bg:         rgba(59, 130, 246, 0.06);
  --red:             #EF4444;
  --red-bg:          rgba(239, 68, 68, 0.06);
  --orange:          #F59E0B;
  --orange-bg:       rgba(245, 158, 11, 0.06);

  --radius:          14px;
  --radius-sm:       10px;
  --radius-xs:       8px;
  --radius-pill:     100px;

  --shadow-sm:  0 1px 2px rgba(0,0,0,0.04);
  --shadow:     0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.06), 0 4px 6px -4px rgba(0,0,0,0.04);

  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Base ── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
}

/* ================================================================
   HEADER
   ================================================================ */
header {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
}
header h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
  color: var(--text);
}

/* ── PDF Download Button ── */
.pdf-btn {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
}
.pdf-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(13,64,41,0.25);
}
.pdf-btn svg { flex-shrink: 0; }

/* ── Top Nav ── */
.top-nav { display: flex; gap: 6px; }
.top-tab {
  padding: 7px 20px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-pill);
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.3;
}
.top-tab:hover {
  color: var(--text);
  border-color: #D1D5DB;
  background: var(--surface2);
}
.top-tab.active {
  background: #1EC677;
  color: #fff;
  border-color: #1EC677;
  font-weight: 600;
}

/* ================================================================
   LAYOUT — Two-panel split
   ================================================================ */
.uw-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0;
  height: calc(100vh - 56px);
}
.uw-split {
  display: grid;
  grid-template-columns: 2fr 3fr;
  height: 100%;
}
.uw-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.uw-panel--inputs { border-right: 1px solid var(--border); }

/* Panel headers */
.uw-panel-header {
  padding: 12px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.uw-panel-icon { font-size: 13px; opacity: 0.35; }
.uw-panel--inputs .uw-panel-header {
  background: var(--surface2);
  color: var(--text-muted);
}
.uw-panel--outputs .uw-panel-header {
  background: var(--surface-dim);
  color: var(--accent);
}

/* Scrollable panel body */
.uw-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  background: var(--bg);
}
.uw-panel-body > .card { flex-shrink: 0; }
.uw-panel-body::-webkit-scrollbar { width: 4px; }
.uw-panel-body::-webkit-scrollbar-track { background: transparent; }
.uw-panel-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 13px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h2 {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.1px;
  color: var(--text);
}
.card-badge {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: var(--radius-pill);
  padding: 2px 9px;
}

/* ================================================================
   INPUT FIELDS
   ================================================================ */
.uw-fields {
  padding: 13px 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.uw-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.uw-field label {
  font-size: 12.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
  line-height: 1.35;
}
.field-hint {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
}
.input-wrap {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  overflow: hidden;
  width: 140px;
  flex-shrink: 0;
  transition: all var(--transition);
}
.input-wrap:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-bg);
  background: var(--surface-up);
}
.input-wrap .prefix,
.input-wrap .suffix {
  padding: 7px 9px;
  font-size: 12px;
  color: var(--text-muted);
  background: #F3F4F6;
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.input-wrap input {
  flex: 1;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  width: 100%;
  outline: none;
  text-align: right;
  font-weight: 600;
  -moz-appearance: textfield;
}
.input-wrap input::-webkit-outer-spin-button,
.input-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ================================================================
   COMPUTED / SUMMARY ROWS
   ================================================================ */
.uw-computed {
  padding: 10px 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.uw-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-light);
}
.uw-row:last-child { border-bottom: none; }
.uw-row span:first-child { color: var(--text-secondary); font-weight: 500; }
.uw-row span:last-child  { font-weight: 700; color: var(--text); }
.uw-row.highlight {
  background: #ECFDF5;
  margin: 4px -20px;
  padding: 11px 20px;
  border-radius: var(--radius-xs);
  border-bottom: none;
}
.uw-row.highlight span:first-child { color: var(--text); font-weight: 500; }
.uw-row.highlight span:last-child {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #1EC677;
}

/* ================================================================
   KEY METRICS
   ================================================================ */
.uw-results-card {
  overflow: visible;
}
.uw-results-card .card-header {
  background: var(--accent);
  border-bottom: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius) var(--radius) 0 0;
}
.uw-results-card .card-header h2 { color: #fff; }
.uw-key-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border-light);
}
.uw-km-item {
  background: var(--surface);
  padding: 20px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  cursor: default;
  transition: background var(--transition);
}
.uw-km-item[data-has-tooltip]:hover { background: var(--surface2); }
.uw-km-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.uw-km-value {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.uw-km-value.positive { color: var(--green); }
.uw-km-value.negative { color: var(--red); }
.uw-km-value.neutral  { color: var(--blue); }

/* ── Tooltips ── */
.uw-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  line-height: 1.8;
  white-space: pre-line;
  color: rgba(255,255,255,0.88);
  z-index: 100;
  min-width: 220px;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}
.uw-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: var(--accent);
}
.uw-km-item[data-has-tooltip]:hover .uw-tooltip,
.uw-row[data-has-tooltip]:hover .uw-tooltip { display: block; }
.uw-row[data-has-tooltip] { position: relative; cursor: default; }
.uw-row[data-has-tooltip]:hover {
  background: var(--surface2);
  border-radius: var(--radius-xs);
  margin: 0 -4px;
  padding-left: 4px;
  padding-right: 4px;
}

/* ================================================================
   CHARTS
   ================================================================ */
.uw-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
}
.uw-chart-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.uw-chart-box h3 {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.uw-chart-note {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.55;
}
.uw-chart-box canvas {
  width: 100% !important;
  height: 190px !important;
}

/* ================================================================
   10-YEAR PROJECTION TABLE
   ================================================================ */
.uw-table-wrap { overflow-x: auto; }
.uw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-family: 'Inter', sans-serif;
}
.uw-table th {
  padding: 10px 14px;
  text-align: right;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-weight: 700;
  position: sticky;
  top: 0;
}
.uw-table th:first-child { text-align: left; min-width: 130px; }
.uw-table td {
  padding: 9px 14px;
  text-align: right;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
  font-weight: 500;
  color: var(--text);
}
.uw-table .row-label {
  text-align: left;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.uw-table .detail-label {
  font-weight: 500;
  color: var(--text-muted);
  padding-left: 28px;
  font-size: 11.5px;
}
.uw-table tr:hover td { background: var(--surface2); }
.uw-table .positive { color: var(--green); font-weight: 700; }
.uw-table .negative { color: var(--red); font-weight: 700; }
.uw-table .neutral  { color: var(--blue); font-weight: 600; }

/* Detail expand rows */
.detail-row td { background: rgba(16,185,129,0.03); }
.subitem-row td { background: rgba(16,185,129,0.015); }
.uw-table .sub-label {
  font-weight: 400;
  color: var(--text-muted);
  padding-left: 44px;
  font-size: 11px;
}
.expand-toggle {
  display: inline-block;
  width: 16px;
  font-size: 10px;
  color: var(--green);
  cursor: pointer;
  transition: transform 0.2s;
  user-select: none;
}
.expand-toggle:hover { color: var(--accent); }
.separator-row td {
  padding: 2px 0;
  border-bottom: 2px solid var(--border);
}

/* Transposed: first col sticky */
.uw-table-transposed .row-label,
.uw-table-transposed th:first-child {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 2;
}
.uw-table-transposed thead th:first-child {
  background: var(--surface2);
  z-index: 3;
}

/* ================================================================
   COLLAPSIBLE EXPENSE GROUPS
   ================================================================ */
.uw-expense-sections { padding: 0; }
.uw-expense-group { border-bottom: 1px solid var(--border-light); }
.uw-expense-group:last-child { border-bottom: none; }
.uw-expense-group summary {
  font-size: 12.5px;
  font-weight: 600;
  padding: 12px 20px;
  cursor: pointer;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background var(--transition);
  user-select: none;
}
.uw-expense-group summary::-webkit-details-marker { display: none; }
.uw-expense-group summary::before {
  content: '\25B8';
  display: inline-block;
  font-size: 10px;
  color: var(--green);
  transition: transform 0.2s;
  width: 12px;
}
.uw-expense-group[open] summary::before { transform: rotate(90deg); }
.uw-expense-group summary:hover { background: var(--surface2); }
.uw-expense-group .uw-fields { padding: 4px 20px 14px; }

/* ================================================================
   ZILLOW / LISTING IMPORT CARD
   ================================================================ */
.zillow-card {
  border: 1.5px dashed rgba(16,185,129,0.35);
  background: linear-gradient(135deg,
    rgba(16,185,129,0.04) 0%,
    rgba(16,185,129,0.01) 100%);
}
.zillow-card .card-header { border-bottom: 1px solid rgba(16,185,129,0.12); }
.zillow-badge {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: var(--radius-pill);
  padding: 2px 9px;
}
.zillow-body { padding: 12px 20px 16px; }
.zillow-input-row { display: flex; gap: 8px; align-items: center; }
.zillow-input-row input[type="url"] {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--surface2);
  outline: none;
  transition: border-color var(--transition);
  min-width: 0;
}
.zillow-input-row input[type="url"]:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-bg);
  background: var(--surface-up);
}
.zillow-input-row input[type="url"]::placeholder { color: var(--text-muted); }

/* ── Buttons ── */
#zillow-btn, #ltr-zillow-btn {
  height: 38px;
  padding: 0 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: -0.1px;
  transition: background var(--transition), opacity var(--transition);
}
#zillow-btn:hover, #ltr-zillow-btn:hover { background: var(--accent-hover); }
#zillow-btn:disabled, #ltr-zillow-btn:disabled { opacity: 0.50; cursor: not-allowed; }

/* ── Status messages ── */
#zillow-status, #ltr-zillow-status { margin-top: 10px; }
.zillow-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.zillow-spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.zillow-error {
  font-size: 12px;
  color: var(--red);
  background: var(--red-bg);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  line-height: 1.5;
}
.zillow-error code {
  background: rgba(239,68,68,0.10);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}
.zillow-success {
  background: var(--green-bg);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.zillow-address { font-size: 13px; font-weight: 600; color: var(--accent); }
.zillow-detail {
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.zillow-zestimate {
  background: var(--blue-bg);
  color: var(--blue);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
}
.zillow-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.zillow-chip {
  background: var(--green-bg);
  color: var(--accent);
  border-radius: var(--radius-pill);
  padding: 2px 9px;
  font-size: 11px;
}
.zillow-chip strong { color: var(--accent); }
.zillow-chip-info {
  background: rgba(0,0,0,0.04);
  border: 1px dashed rgba(0,0,0,0.15);
  color: var(--text-muted);
}
.zillow-chip-info strong { color: var(--text-muted); }
.zillow-warn { font-size: 12px; color: var(--orange); }
.zillow-note { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Paste section ── */
.zillow-paste-section {
  margin-top: 12px;
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}
.zillow-paste-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.zillow-paste-section textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--surface2);
  resize: vertical;
  outline: none;
  line-height: 1.5;
  transition: border-color var(--transition);
}
.zillow-paste-section textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-bg);
  background: var(--surface-up);
}
#zillow-paste-btn, #ltr-zillow-paste-btn {
  margin-top: 7px;
  height: 34px;
  padding: 0 16px;
  background: transparent;
  color: var(--accent);
  border: 1.5px solid rgba(13,64,41,0.30);
  border-radius: var(--radius-pill);
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.1px;
  transition: background var(--transition), border-color var(--transition);
}
#zillow-paste-btn:hover, #ltr-zillow-paste-btn:hover {
  background: var(--green-bg);
  border-color: var(--green);
}

/* ================================================================
   UTILITY
   ================================================================ */
.hidden { display: none !important; }

/* ================================================================
   LEAD GATE OVERLAY
   ================================================================ */
.uw-gate-overlay {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}
.uw-gate-card {
  background: #1EC677;
  border-radius: 20px;
  padding: 48px 44px 40px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(16,185,129,0.25), 0 2px 8px rgba(0,0,0,0.08);
  text-align: center;
}
.uw-gate-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-bottom: 20px;
}
.uw-gate-brandname {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}
.uw-gate-divider {
  height: 1px;
  background: rgba(255,255,255,0.30);
  margin: 20px 0 24px;
}
.uw-gate-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.4px;
  margin-bottom: 8px;
  line-height: 1.3;
}
.uw-gate-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.80);
  margin-bottom: 28px;
  line-height: 1.5;
}
.uw-gate-form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.uw-gate-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.uw-gate-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.uw-gate-field label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.uw-gate-field input {
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}
.uw-gate-field input::placeholder { color: var(--text-muted); }
.uw-gate-field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}
.uw-gate-field input.uw-gate-input-error { border-color: var(--red); }
.uw-gate-error {
  font-size: 12.5px;
  color: var(--red);
  text-align: center;
  display: none;
}
.uw-gate-btn {
  width: 100%;
  padding: 13px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-xs);
  font-size: 15px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  letter-spacing: -0.2px;
  margin-top: 4px;
}
.uw-gate-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.20);
}
.uw-gate-btn:active { transform: translateY(0); box-shadow: none; }
.uw-gate-footer {
  font-size: 11.5px;
  color: rgba(255,255,255,0.65);
  text-align: center;
  margin-top: 20px;
  line-height: 1.5;
}
@media (max-width: 480px) {
  .uw-gate-card { padding: 36px 24px 32px; }
  .uw-gate-row { grid-template-columns: 1fr; }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1100px) {
  .uw-container { height: auto; }
  .uw-split { grid-template-columns: 1fr; height: auto; }
  .uw-panel { height: auto; }
  .uw-panel--inputs { border-right: none; border-bottom: 1px solid var(--border); }
  .uw-charts-grid { grid-template-columns: 1fr; }
  .header-inner { height: auto; padding: 12px 0; flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .uw-key-metrics { grid-template-columns: 1fr; }
  .uw-charts-grid { grid-template-columns: 1fr; }
  header { padding: 0 16px; }
  .uw-panel-body { padding: 10px; }
  .pdf-btn span { display: none; }
}

/* ================================================================
   PRINT / PDF
   ================================================================ */
@media print {
  @page { margin: 1.2cm; size: A3 landscape; }

  /* Preserve brand colors */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  /* Hide interactive chrome */
  .uw-gate-overlay,
  .pdf-btn,
  .top-nav { display: none !important; }

  /* Unstick header */
  header {
    position: static !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    border-bottom: 1px solid var(--border) !important;
  }

  body { background: #fff !important; }

  /* Unlock panel heights so all content prints */
  .uw-container { height: auto !important; overflow: visible !important; }
  .uw-split     { height: auto !important; }
  .uw-panel     { height: auto !important; overflow: visible !important; }
  .uw-panel-body {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }
  .uw-panel--inputs {
    border-right: 1px solid var(--border) !important;
    border-bottom: none !important;
  }

  /* Keep the inactive tab hidden */
  .hidden { display: none !important; }

  /* Avoid awkward mid-card page breaks */
  .card,
  .uw-results-card,
  .uw-key-metric { break-inside: avoid; }
}
