/* =============================================================================
   WellPay Elite-Invest — bank-grade light theme (mobile-first)
   Brand: deep teal #0a2e3d · gold accent #d4af37
   ============================================================================= */

:root {
  --emg-teal: #0a2e3d;
  --emg-teal-mid: #0b3b4f;
  --emg-teal-soft: #2c5a6e;
  --emg-gold: #d4af37;
  --emg-gold-soft: rgba(212, 175, 55, 0.14);
  --emg-ink: #1a2a3f;
  --emg-muted: #64748b;
  --emg-border: #e2e8f0;
  --emg-border-strong: #cbd5e1;
  --emg-surface: #ffffff;
  --emg-surface-alt: #f8fafc;
  --emg-page: #eef2f7;
  --emg-success: #15803d;
  --emg-success-bg: #ecfdf5;
  --emg-danger: #b91c1c;
  --emg-danger-bg: #fef2f2;
  --emg-warning-bg: #fffbeb;
  --emg-warning-border: #e67e22;
  --emg-radius-lg: 1rem;
  --emg-radius-xl: 1.25rem;
  --emg-shadow-sm: 0 1px 3px rgba(10, 46, 61, 0.06);
  --emg-shadow-md: 0 4px 18px rgba(10, 46, 61, 0.08);
  --emg-max: 1200px;
  --emg-touch: 44px;
  --emg-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--emg-font);
  background: var(--emg-page);
  color: var(--emg-ink);
  line-height: 1.55;
  font-size: 15px;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

/* --- Hide LFE portal hub forever --- */
.lfe-hub,
#lfeHubMount {
  display: none !important;
}

/* --- Layout shell (client width: 1200px) --- */
.container {
  max-width: var(--emg-max);
  margin: 0 auto;
  padding: 1rem;
  width: 100%;
}

/* --- Sticky navigation — same content width as client --- */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid var(--emg-border);
  padding: 0.6rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 auto 1rem;
  max-width: var(--emg-max);
  width: 100%;
  box-sizing: border-box;
}

.logo {
  font-weight: 800;
  color: var(--emg-teal);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

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

.nav-link {
  background: var(--emg-surface-alt);
  border: 1px solid var(--emg-border);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--emg-teal-soft);
  padding: 0.55rem 1rem;
  min-height: var(--emg-touch);
  border-radius: 999px;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.nav-link:hover {
  border-color: var(--emg-gold);
  color: var(--emg-teal);
}

.nav-link.active {
  background: var(--emg-teal);
  border-color: var(--emg-teal);
  color: #fff;
  box-shadow: var(--emg-shadow-sm);
}

.lfe-welcome-user {
  font-size: 0.8125rem;
  color: var(--emg-teal-soft);
  margin: 0;
  font-weight: 500;
  width: 100%;
  flex-basis: 100%;
  order: 10;
}

/* --- Live status bar --- */
.emg-status-bar,
#emgLfeStatus.emg-status-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  margin: 1rem 0 0.75rem;
  padding: 0.65rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--emg-teal);
  background: linear-gradient(90deg, var(--emg-gold-soft), #fff);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-left: 4px solid var(--emg-gold);
  border-radius: var(--emg-radius-lg);
  box-shadow: var(--emg-shadow-sm);
}

.emg-status-bar:empty {
  display: none;
}

.emg-status-bar::before {
  content: '';
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emg-gold);
  animation: emg-pulse 2s ease-in-out infinite;
}

@keyframes emg-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.85);
  }
}

/* --- LFE shell overlays (light bank theme) --- */
.lfe-auth-bar {
  max-width: var(--emg-max);
  margin: 0.75rem auto 0;
  padding: 0 1.25rem;
  border-radius: var(--emg-radius-lg);
  border: 1px solid var(--emg-border);
  background: var(--emg-surface);
  box-shadow: var(--emg-shadow-sm);
}

.lfe-advisory-banner {
  max-width: var(--emg-max);
  margin: 0.75rem auto;
  padding: 0.65rem 1rem;
  font-size: 0.8125rem;
  color: var(--emg-muted);
  background: var(--emg-surface-alt);
  border: 1px solid var(--emg-border);
  border-left: 4px solid var(--emg-teal-soft);
  border-radius: var(--emg-radius-lg);
}

.lfe-modal-auth .panel {
  border-radius: var(--emg-radius-xl);
  border: 1px solid var(--emg-border);
  box-shadow: var(--emg-shadow-md);
}

.lfe-modal-auth label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--emg-teal-soft);
}

.lfe-modal-auth input {
  min-height: var(--emg-touch);
  border-radius: 0.625rem;
  border: 1px solid var(--emg-border-strong);
  font-family: inherit;
}

.lfe-modal-auth .lfe-btn-primary {
  background: var(--emg-teal);
  border-color: var(--emg-teal);
  min-height: var(--emg-touch);
}

.lfe-modal-auth .lfe-btn-primary:hover {
  background: var(--emg-teal-mid);
}

/* Auth role pills (Institution | Partner | Admin) */
.auth-role-pills {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1rem;
  flex-wrap: wrap;
}

.auth-role-pills button {
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--emg-touch);
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--emg-border-strong);
  background: var(--emg-surface-alt);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--emg-muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.auth-role-pills button:hover {
  border-color: var(--emg-gold);
  color: var(--emg-teal);
}

.auth-role-pills button.active {
  background: var(--emg-teal);
  border-color: var(--emg-teal);
  color: #fff;
}

/* Role visibility helpers — only on section markers, NEVER on body */
body[data-emg-role],
html[data-emg-role] {
  display: revert !important;
}

[data-emg-role]:not(body):not(html) {
  display: none;
}

body[data-emg-active-role='institution'] [data-emg-role~='institution'],
body[data-emg-active-role='partner'] [data-emg-role~='partner'],
body[data-emg-active-role='admin'] [data-emg-role~='admin'],
body[data-emg-active-role='customer'] [data-emg-role~='customer'],
body[data-emg-active-role='guest'] [data-emg-role~='guest'] {
  display: revert;
}

[data-emg-role].emg-block,
body[data-emg-active-role='institution'] [data-emg-role~='institution'].emg-block,
body[data-emg-active-role='partner'] [data-emg-role~='partner'].emg-block,
body[data-emg-active-role='admin'] [data-emg-role~='admin'].emg-block,
body[data-emg-active-role='customer'] [data-emg-role~='customer'].emg-block {
  display: block;
}

[data-emg-role].emg-flex,
body[data-emg-active-role='institution'] [data-emg-role~='institution'].emg-flex,
body[data-emg-active-role='partner'] [data-emg-role~='partner'].emg-flex,
body[data-emg-active-role='admin'] [data-emg-role~='admin'].emg-flex,
body[data-emg-active-role='customer'] [data-emg-role~='customer'].emg-flex {
  display: flex;
}

/* --- Panels --- */
.info-panel {
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin-bottom: 0;
  display: none;
  border: none;
}

.info-panel.active {
  display: block;
}

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, var(--emg-teal) 0%, var(--emg-teal-mid) 100%);
  border-radius: var(--emg-radius-xl);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
  color: #fff;
  box-shadow: var(--emg-shadow-md);
}

.hero h1 {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.65rem;
}

.hero p {
  font-size: 0.9375rem;
  line-height: 1.6;
  opacity: 0.95;
  max-width: 72ch;
}

.hero-badge {
  background: var(--emg-gold-soft);
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #fef9e7;
}

.capital-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.stack-item {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* --- Alerts & notices --- */
.disclaimer {
  background: var(--emg-surface);
  border-left: 4px solid var(--emg-muted);
  padding: 0.85rem 1rem;
  border-radius: var(--emg-radius-lg);
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  color: #334155;
  border: 1px solid var(--emg-border);
  border-left-width: 4px;
  border-left-color: var(--emg-muted);
}

.warning-box {
  background: var(--emg-warning-bg);
  border-left: 4px solid var(--emg-warning-border);
  padding: 0.85rem 1rem;
  border-radius: var(--emg-radius-lg);
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  border: 1px solid #fde68a;
  border-left-width: 4px;
  border-left-color: var(--emg-warning-border);
}

.note-text {
  background: #fefce8;
  padding: 0.65rem 0.85rem;
  border-radius: var(--emg-radius-lg);
  font-size: 0.75rem;
  margin-top: 0.65rem;
  border: 1px solid #fef08a;
  color: #713f12;
  line-height: 1.5;
}

/* --- Section headings --- */
.section-title {
  font-size: clamp(1.05rem, 3vw, 1.25rem);
  font-weight: 700;
  margin: 1.25rem 0 0.85rem;
  border-left: 4px solid var(--emg-gold);
  padding-left: 0.75rem;
  color: var(--emg-teal);
  letter-spacing: -0.01em;
}

/* --- Scenario pills --- */
.scenario-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  align-items: stretch;
}

.scenario-btn {
  background: var(--emg-surface);
  border: 1px solid var(--emg-border-strong);
  padding: 0.65rem 1.15rem;
  min-height: var(--emg-touch);
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--emg-teal-soft);
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  flex: 1 1 auto;
  min-width: min(100%, 140px);
}

.scenario-btn:hover {
  border-color: var(--emg-gold);
  color: var(--emg-teal);
}

.scenario-btn.active {
  background: var(--emg-teal);
  border-color: var(--emg-teal);
  color: #fff;
  box-shadow: var(--emg-shadow-sm);
}

/* --- Cards / panels --- */
.card {
  background: var(--emg-surface);
  border-radius: var(--emg-radius-xl);
  border: 1px solid var(--emg-border);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--emg-shadow-sm);
}

#simulatorCard {
  overflow: hidden;
}

/* --- Proportion summary pills --- */
.proportion-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 0.65rem;
  background: var(--emg-surface-alt);
  border-radius: var(--emg-radius-lg);
  padding: 0.75rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--emg-border);
}

.proportion-item {
  background: var(--emg-surface);
  padding: 0.65rem 0.85rem;
  border-radius: var(--emg-radius-lg);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: left;
  line-height: 1.45;
  border: 1px solid var(--emg-border);
  color: var(--emg-teal-soft);
}

.proportion-item span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--emg-teal);
}

/* --- Form controls & sliders --- */
.input-group-sm {
  margin-bottom: 1rem;
}

.input-group-sm > label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--emg-teal-soft);
  display: block;
  margin-bottom: 0.45rem;
  line-height: 1.35;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
}

.input-row input[type='range'] {
  width: 100%;
  min-width: 0;
  height: 6px;
  accent-color: var(--emg-teal);
  cursor: pointer;
}

.input-row .num-input,
.expense-detail input[type='number'],
.input-group-sm > input[type='number'] {
  width: 100%;
  max-width: 120px;
  min-height: var(--emg-touch);
  padding: 0.5rem 0.65rem;
  border-radius: 0.625rem;
  border: 1px solid var(--emg-border-strong);
  font-size: 0.875rem;
  font-family: inherit;
  text-align: right;
  background: var(--emg-surface);
  color: var(--emg-ink);
}

.input-row .num-input:focus,
.expense-detail input:focus,
.eligibility-inputs input:focus,
.eligibility-inputs select:focus,
.emg-chat-input-row input:focus {
  outline: 2px solid rgba(212, 175, 55, 0.45);
  outline-offset: 1px;
  border-color: var(--emg-gold);
}

.expense-detail {
  font-size: 0.8125rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.45rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--emg-border);
}

.expense-detail:last-of-type {
  border-bottom: none;
  margin-bottom: 0.5rem;
}

.expense-detail span {
  color: var(--emg-muted);
  font-weight: 500;
}

.expense-detail input[type='number'] {
  max-width: 110px;
}

hr {
  margin: 1.25rem 0;
  border: none;
  border-top: 1px solid var(--emg-border);
}

/* --- Live stats grid --- */
#liveStats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.stat-value {
  background: var(--emg-surface-alt);
  border-radius: var(--emg-radius-lg);
  padding: 0.75rem 0.85rem;
  margin: 0;
  text-align: left;
  border: 1px solid var(--emg-border);
}

.stat-value > div:first-child {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--emg-muted);
  margin-bottom: 0.25rem;
}

.stat-value .big {
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 800;
  color: var(--emg-teal);
  line-height: 1.2;
}

.stat-value .note-text {
  margin-top: 0.45rem;
  font-size: 0.6875rem;
}

/* --- 10-year table --- */
.ten-year-table {
  background: var(--emg-surface-alt);
  border-radius: var(--emg-radius-lg);
  padding: 1rem;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  border: 1px solid var(--emg-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ten-year-table > strong {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--emg-teal);
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.row-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
  padding: 0.35rem 0;
  flex-wrap: wrap;
}

.row-flex span:first-child {
  color: var(--emg-muted);
  flex: 1 1 55%;
  min-width: 0;
}

.row-flex strong,
.row-flex span:last-child:not(:only-child) {
  font-weight: 600;
  color: var(--emg-teal);
  text-align: right;
  flex-shrink: 0;
}

.total-return {
  font-weight: 800;
  color: var(--emg-success) !important;
}

/* --- Primary actions --- */
.update-btn {
  background: var(--emg-teal);
  color: #fff;
  border: none;
  width: 100%;
  min-height: var(--emg-touch);
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.15s, transform 0.1s;
}

.update-btn:hover:not(:disabled) {
  background: var(--emg-teal-mid);
}

.update-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.update-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.lfe-submit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.lfe-submit-row .update-btn {
  flex: 1 1 min(100%, 220px);
  margin-top: 0;
}

#checkEligibilityBtn {
  background: var(--emg-teal-soft);
}

#submitLfeBtn {
  background: #0f6b4c;
}

/* --- Eligibility panel --- */
.eligibility-card {
  background: linear-gradient(180deg, var(--emg-surface) 0%, var(--emg-surface-alt) 100%);
  border-radius: var(--emg-radius-xl);
  padding: 1.25rem 1.35rem;
  margin-top: 0.5rem;
  border: 1px solid var(--emg-border-strong);
  box-shadow: var(--emg-shadow-sm);
}

.eligibility-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 1rem;
  color: var(--emg-teal);
  letter-spacing: -0.01em;
}

.eligibility-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.eligibility-inputs label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--emg-teal-soft);
  display: block;
  margin-bottom: 0.35rem;
}

.eligibility-inputs input,
.eligibility-inputs select {
  width: 100%;
  min-height: var(--emg-touch);
  padding: 0.55rem 0.75rem;
  border-radius: 0.625rem;
  border: 1px solid var(--emg-border-strong);
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--emg-surface);
}

.eligibility-result {
  background: var(--emg-surface);
  border-radius: var(--emg-radius-lg);
  padding: 0.85rem 1rem;
  margin-top: 0.85rem;
  text-align: left;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.55;
  border: 1px solid var(--emg-border);
}

.approved {
  background: var(--emg-success-bg);
  color: var(--emg-success);
  border-left: 4px solid #22c55e;
  border-color: #a7f3d0;
  border-left-color: #22c55e;
}

.rejected {
  background: var(--emg-danger-bg);
  color: var(--emg-danger);
  border-left: 4px solid #ef4444;
  border-color: #fecaca;
  border-left-color: #ef4444;
}

.lfe-sync-banner {
  margin-top: 0.85rem !important;
  padding: 0.85rem 1rem !important;
  border-radius: var(--emg-radius-lg) !important;
  background: var(--emg-success-bg) !important;
  border: 1px solid #a7f3d0 !important;
  font-size: 0.8125rem !important;
  color: #14532d !important;
}

.lfe-sync-banner code {
  font-size: 0.8125rem;
  background: rgba(255, 255, 255, 0.65);
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
}

/* --- Bank messages chat panel --- */
.emg-chat-panel {
  margin-top: 1.25rem;
}

.emg-chat-panel[hidden] {
  display: none !important;
}

.emg-chat-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--emg-border);
}

.emg-chat-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--emg-teal);
  letter-spacing: -0.01em;
}

.emg-chat-status {
  font-size: 0.75rem;
  color: var(--emg-muted);
  font-weight: 500;
}

.emg-chat-messages {
  min-height: 160px;
  max-height: min(50vh, 320px);
  overflow-y: auto;
  padding: 0.75rem;
  background: var(--emg-surface-alt);
  border: 1px solid var(--emg-border);
  border-radius: var(--emg-radius-lg);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  -webkit-overflow-scrolling: touch;
}

.emg-chat-messages:empty::after {
  content: 'No messages yet. Your bank officer will reply here after you submit an application.';
  font-size: 0.8125rem;
  color: var(--emg-muted);
  text-align: center;
  padding: 2rem 1rem;
  line-height: 1.5;
}

.emg-chat-bubble {
  max-width: min(100%, 520px);
  padding: 0.65rem 0.85rem;
  border-radius: var(--emg-radius-lg);
  font-size: 0.8125rem;
  line-height: 1.5;
  word-break: break-word;
}

.emg-chat-bubble--bank {
  align-self: flex-start;
  background: var(--emg-surface);
  border: 1px solid var(--emg-border);
  border-left: 3px solid var(--emg-teal);
}

.emg-chat-bubble--user {
  align-self: flex-end;
  background: var(--emg-teal);
  color: #fff;
  border: 1px solid var(--emg-teal-mid);
}

.emg-chat-bubble-meta {
  display: block;
  font-size: 0.6875rem;
  opacity: 0.75;
  margin-bottom: 0.2rem;
  font-weight: 600;
}

.emg-chat-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
  align-items: stretch;
}

.emg-chat-input-row input {
  flex: 1 1 180px;
  min-height: var(--emg-touch);
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--emg-border-strong);
  font-family: inherit;
  font-size: 0.875rem;
  background: var(--emg-surface);
}

.emg-chat-send {
  width: auto;
  flex: 0 0 auto;
  min-width: 100px;
  margin-top: 0;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  background: var(--emg-gold);
  color: var(--emg-teal);
}

.emg-chat-send:hover:not(:disabled) {
  background: #c9a030;
  color: var(--emg-teal);
}

/* --- Document upload (clickable bank portal links) --- */
.emg-doc-upload {
  margin: 1rem 0 0.25rem;
  padding: 1rem 1.1rem;
  border-radius: var(--emg-radius-lg, 12px);
  border: 1px solid var(--emg-border);
  background: #f8fafc;
}

.emg-doc-upload-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--emg-teal);
  margin-bottom: 0.35rem;
}

.emg-doc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.emg-doc-slot {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  min-width: 0;
}

.emg-doc-slot input[type='file'] {
  width: 100%;
  max-width: 100%;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
}

/* --- Opportunity panel --- */
#opportunityPanel {
  background: var(--emg-surface);
  border: 1px solid var(--emg-border);
  border-radius: var(--emg-radius-xl);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--emg-shadow-sm);
}

.opportunity-heading {
  font-size: clamp(1.15rem, 3vw, 1.35rem);
  font-weight: 700;
  color: var(--emg-teal);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.opportunity-lead {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--emg-ink);
  margin-bottom: 1rem;
}

.opportunity-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.65rem;
}

.opportunity-list li {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #334155;
  padding-left: 0.25rem;
}

.opportunity-list li::marker {
  color: var(--emg-gold);
}

/* --- Footer --- */
footer,
.panel-footer-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--emg-muted);
  border-top: 1px solid var(--emg-border);
  padding-top: 1rem;
  margin-top: 1.5rem;
  line-height: 1.5;
}

/* --- Responsive: tablet --- */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .nav-bar {
    padding: 0.6rem 1rem;
    margin-left: auto;
    margin-right: auto;
  }

  .nav-links {
    width: 100%;
    justify-content: stretch;
  }

  .nav-link {
    flex: 1 1 calc(50% - 0.25rem);
    text-align: center;
    justify-content: center;
  }

  .hero {
    padding: 1.15rem 1.15rem;
    border-radius: var(--emg-radius-lg);
  }

  .card,
  .eligibility-card,
  #opportunityPanel {
    padding: 1rem 1.05rem;
    border-radius: var(--emg-radius-lg);
  }

  .scenario-buttons {
    flex-direction: column;
  }

  .scenario-btn {
    width: 100%;
    min-width: 0;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .input-row .num-input {
    max-width: none;
    width: 100%;
  }

  .expense-detail {
    grid-template-columns: 1fr;
  }

  .expense-detail input[type='number'] {
    max-width: none;
    width: 100%;
  }

  .lfe-submit-row {
    flex-direction: column;
  }

  .lfe-submit-row .update-btn {
    flex-basis: 100%;
    width: 100%;
  }

  .emg-chat-input-row {
    flex-direction: column;
  }

  .emg-chat-send {
    width: 100%;
  }

  .emg-doc-grid {
    grid-template-columns: 1fr;
  }

  .lfe-auth-bar {
    padding: 0 1rem;
  }
}

/* --- Responsive: small phones --- */
@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .logo {
    font-size: 0.95rem;
    flex: 1 1 100%;
  }

  .nav-link {
    flex: 1 1 100%;
  }

  .hero-badge {
    font-size: 0.625rem;
    line-height: 1.4;
  }

  .capital-stack {
    flex-direction: column;
  }

  .stack-item {
    width: 100%;
    text-align: center;
  }

  .proportion-row {
    grid-template-columns: 1fr;
  }

  #liveStats {
    grid-template-columns: 1fr;
  }

  .eligibility-inputs {
    grid-template-columns: 1fr;
  }

  .row-flex {
    flex-direction: column;
    align-items: stretch;
  }

  .row-flex strong,
  .row-flex span:last-child:not(:only-child) {
    text-align: left;
  }

  .emg-status-bar {
    font-size: 0.75rem;
    padding: 0.55rem 0.75rem;
  }
}

/* --- Prevent horizontal overflow (do NOT override .container client max-width) --- */
.card,
.hero,
.eligibility-card,
.ten-year-table,
.proportion-row,
#simulatorCard,
#opportunityPanel {
  max-width: 100%;
}

input[type='range'] {
  max-width: 100%;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .emg-status-bar::before {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}
