@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,700;0,9..144,800;0,9..144,900;1,9..144,400&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ─── Design Tokens — Light mode (default) ─────────────────────────────────── */
:root, [data-theme="light"] {
  /* Brand */
  --equi: #E84E8A;
  --lord: #7352E3;
  --equi-dim: rgba(232, 78, 138, 0.12);
  --lord-dim: rgba(115, 82, 227, 0.12);
  --brand-gradient: linear-gradient(135deg, #E84E8A 0%, #7352E3 100%);

  /* Surfaces (warm off-white) */
  --bg: #FAF9F7;
  --surface: #FFFFFF;
  --surface2: #F4F3F0;
  --surface3: #ECEAE6;

  /* Borders */
  --border: #E2E0DA;
  --border2: #D4D2CC;

  /* Text */
  --text: #18161F;
  --muted: #625F7A;
  --text-secondary: #928FAA;

  /* Semantic (use lord as primary action) */
  --accent: #7352E3;
  --accent-hover: #6244D4;
  --focus-ring: rgba(115, 82, 227, 0.18);

  /* Status */
  --green: #059669;
  --green-dim: rgba(5, 150, 105, 0.12);
  --red: #DC2626;
  --red-dim: rgba(220, 38, 38, 0.10);
  --yellow: #D97706;
  --yellow-dim: rgba(217, 119, 6, 0.12);
  --orange: #EA580C;
  --orange-dim: rgba(234, 88, 12, 0.12);

  /* Nav */
  --nav-bg: rgba(250, 249, 247, 0.88);

  /* Toast */
  --toast-ok-bg: #ECFDF5;
  --toast-ok-border: #059669;
  --toast-ok-text: #065F46;
  --toast-err-bg: #FEF2F2;
  --toast-err-border: #DC2626;
  --toast-err-text: #991B1B;

  /* Progress bar */
  --progress-track: #E2E0DA;
}

/* ─── Dark mode tokens ──────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg: #0F172A;
  --surface: #1E293B;
  --surface2: #253344;
  --surface3: #2D3F55;
  --border: #334155;
  --border2: #475569;
  --text: #E2E8F0;
  --muted: #64748B;
  --text-secondary: #94A3B8;
  --accent: #9B7FEF;
  --accent-hover: #B09AF5;
  --focus-ring: rgba(155, 127, 239, 0.22);
  --green: #34D399;
  --green-dim: rgba(52, 211, 153, 0.15);
  --red: #F87171;
  --red-dim: rgba(248, 113, 113, 0.15);
  --yellow: #FBBF24;
  --yellow-dim: rgba(251, 191, 36, 0.15);
  --orange: #FB923C;
  --orange-dim: rgba(251, 146, 60, 0.15);
  --nav-bg: rgba(30, 41, 59, 0.88);
  --toast-ok-bg: #0D2E1E;
  --toast-ok-border: #34D399;
  --toast-ok-text: #34D399;
  --toast-err-bg: #2E0D0D;
  --toast-err-border: #F87171;
  --toast-err-text: #F87171;
  --progress-track: #334155;
}

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

/* Smooth theme transitions — only on color properties to avoid animation on layout */
body, .card, .modal, nav, .surface, input, select, textarea, button {
  transition: background-color 0.2s ease, border-color 0.15s ease, color 0.15s ease;
}

html { color-scheme: light dark; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
select, textarea { font-family: inherit; }

/* Display font — Fraunces for headings and large numbers */
h1, h2, h3, .display, .font-display { font-family: 'Fraunces', Georgia, 'Times New Roman', serif; }

/* ─── Scrollbar styling ─────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--surface2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
* { scrollbar-width: thin; scrollbar-color: var(--border2) var(--surface2); }

/* ─── Typography helpers ────────────────────────────────────────────────────── */
/* Tabular numbers for all financial display */
.tabular-nums, .financial, .stat-value, .s-value, .mock-stat-val,
.amount, .balance, .principal-display, .interest-display, td.num {
  font-variant-numeric: tabular-nums;
  font-family: 'Fraunces', Georgia, serif;
}

/* ─── Animation library ─────────────────────────────────────────────────────── */
/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block; width: 32px; height: 32px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
.spinner-sm { width: 18px; height: 18px; border-width: 2px; }
.spinner-lg { width: 48px; height: 48px; border-width: 4px; }

/* Fade in */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn 0.25s ease forwards; }

/* Slide up */
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.slide-up { animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

/* Progress bar spring fill */
@keyframes progressFill { from { width: 0; } to { width: var(--fill-width, 0%); } }
.progress-fill-animated {
  animation: progressFill 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Pulse */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* ─── Components — NAV ──────────────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-size: 20px; font-weight: 800; letter-spacing: -0.02em; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  text-decoration: none;
}
.nav-logo .equi { color: var(--equi); }
.nav-logo .lord { color: var(--lord); }
/* Brand mark — yield curve area fill icon */
.nav-logo-icon { display: block; flex-shrink: 0; }
.nav-logo-icon:hover { opacity: 0.85; transition: opacity 0.15s; }
.nav-links, .nav-right { display: flex; gap: 8px; align-items: center; }
.nav-user { font-size: 13px; color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Components — BUTTONS ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 20px; border-radius: 8px;
  font-size: 14px; font-weight: 700; font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer; transition: all 0.15s; border: none; text-decoration: none;
  white-space: nowrap; user-select: none;
}
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* Primary — full-width gradient */
.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 2px 12px rgba(115, 82, 227, 0.25);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 20px rgba(115, 82, 227, 0.35); text-decoration: none; color: #fff; }
.btn-primary:active { transform: translateY(0); }

/* Ghost */
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--lord-dim); text-decoration: none; }

/* Outline */
.btn-outline { background: transparent; border: 1.5px solid var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--lord-dim); text-decoration: none; }

/* Danger */
.btn-danger { background: transparent; border: 1px solid var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red-dim); }
.btn-danger-solid { background: var(--red); color: #fff; border: none; }
.btn-danger-solid:hover { opacity: 0.88; }

/* Sizes */
.btn-sm { padding: 5px 13px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 16px; border-radius: 10px; }
.btn-full { width: 100%; }
.btn-icon { padding: 5px 9px; background: transparent; border: 1px solid var(--border); border-radius: 7px; color: var(--muted); cursor: pointer; font-size: 13px; transition: all 0.15s; font-family: inherit; }
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon.danger:hover { border-color: var(--red); color: var(--red); }

/* Nav button */
.btn-nav { padding: 6px 14px; background: transparent; border: 1px solid var(--border); border-radius: 7px; color: var(--text); font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all 0.15s; }
.btn-nav:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Components — FORM ─────────────────────────────────────────────────────── */
label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.label-text { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
input[type="text"], input[type="email"], input[type="number"], input[type="date"],
input[type="month"], input[type="password"], select, textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  padding: 10px 14px; font-size: 14px; width: 100%;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
input:disabled, select:disabled { opacity: 0.5; cursor: not-allowed; }
input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--accent); flex-shrink: 0; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-hint.warn { color: var(--yellow); }

/* ─── Components — CARDS ────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 28px;
}
@media (max-width: 600px) { .card { padding: 18px 16px; } }
.card-title {
  font-size: 15px; font-weight: 700; margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px 32px; margin-bottom: 20px; }
@media (max-width: 600px) { .form-card { padding: 18px 16px; } }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px;
}
.stat-card .s-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .s-value {
  font-size: 20px; font-weight: 800; margin-top: 4px;
  font-family: 'Fraunces', Georgia, serif;
  font-variant-numeric: tabular-nums;
}
.s-value.green { color: var(--green); }
.s-value.accent { color: var(--accent); }
.s-value.yellow { color: var(--yellow); }

/* ─── Components — PROPERTY CARDS ──────────────────────────────────────────── */
.prop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.prop-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px; cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.prop-card:hover {
  border-color: var(--lord);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(115, 82, 227, 0.1);
}
.prop-card-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; font-family: 'Fraunces', serif; }
.prop-card-addr { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.prop-card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value {
  font-size: 16px; font-weight: 700; margin-top: 2px;
  font-family: 'Fraunces', serif; font-variant-numeric: tabular-nums;
}
.no-mortgage { font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 10px 12px; }

/* ─── Components — BADGES & CHIPS ──────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; }
.b-actual   { background: var(--green-dim);  color: var(--green); }
.b-assumed  { background: var(--yellow-dim); color: var(--yellow); }
.b-projected{ background: var(--lord-dim);   color: var(--lord); }
.b-missed   { background: var(--red-dim);    color: var(--red); }
.b-current  { background: var(--orange-dim); color: var(--orange); }
.b-no-data  { background: rgba(100,116,139,0.12); color: var(--muted); }
.b-warn     { background: var(--yellow-dim); color: var(--yellow); }
.b-info     { background: var(--lord-dim);   color: var(--lord); }

/* Filter chips */
.filter-chip {
  display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  font-family: inherit; transition: all 0.15s; user-select: none;
}
.filter-chip.on.fc-actual    { background: var(--green-dim);  border-color: var(--green);  color: var(--green); }
.filter-chip.on.fc-assumed   { background: var(--yellow-dim); border-color: var(--yellow); color: var(--yellow); }
.filter-chip.on.fc-projected { background: var(--lord-dim);   border-color: var(--lord);   color: var(--lord); }
.filter-chip.on.fc-missed    { background: var(--red-dim);    border-color: var(--red);    color: var(--red); }
.filter-chip.on.fc-current   { background: var(--orange-dim); border-color: var(--orange); color: var(--orange); }
.filter-chip.on.fc-no-data   { background: rgba(100,116,139,0.12); border-color: var(--muted); color: var(--text); }
.filter-chip.on.fc-all       { background: var(--lord-dim);   border-color: var(--lord);   color: var(--lord); }

/* Pending badge */
.pending-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px;
  background: var(--yellow-dim); color: var(--yellow);
  border: 1px solid rgba(217,119,6,0.3); border-radius: 20px; padding: 2px 9px; margin-top: 6px;
}

/* ─── Components — TABLE ────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  background: var(--surface2); padding: 10px 14px;
  text-align: left; font-size: 11px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap;
}
td { padding: 10px 14px; border-top: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
td.num { font-variant-numeric: tabular-nums; font-family: 'Fraunces', serif; }
tbody tr:nth-child(even) td { background: rgba(0,0,0,0.018); }
tbody tr:hover td { background: var(--lord-dim) !important; }
tr.row-current td:first-child { border-left: 3px solid var(--accent); }
tr.row-past { opacity: 0.75; }

/* ─── Components — TABS ─────────────────────────────────────────────────────── */
/* Underline tab bar (app) */
.tab-bar {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  margin-bottom: 28px; overflow-x: auto; scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 10px 20px; font-size: 14px; font-weight: 600; color: var(--muted);
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; font-family: inherit; transition: all 0.15s; white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Pill tab switcher (auth login/register) */
.pill-tabs {
  display: flex; gap: 4px; margin-bottom: 28px;
  background: var(--surface2); border-radius: 10px; padding: 4px;
}
.pill-tab {
  flex: 1; padding: 9px; border-radius: 7px; font-size: 14px; font-weight: 600;
  text-align: center; cursor: pointer; color: var(--muted); border: none;
  background: none; font-family: inherit; transition: all 0.2s;
}
.pill-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
[data-theme="dark"] .pill-tab.active { background: var(--surface3); }

/* ─── Components — MODAL ────────────────────────────────────────────────────── */
.modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  z-index: 200; align-items: center; justify-content: center;
  padding: 24px; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
/* Keep .overlay as alias */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }
.overlay.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px 32px; width: 100%; max-width: 500px;
  animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@media (max-width: 560px) { .modal { padding: 20px 16px; } }
.modal h2 { font-size: 18px; font-weight: 700; margin-bottom: 16px; font-family: 'Fraunces', serif; }
.modal-footer, .modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 20px; flex-wrap: wrap; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.modal-desc { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.modal-warn {
  font-size: 13.5px; color: var(--red);
  background: var(--red-dim); border: 1px solid rgba(220,38,38,0.2);
  border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; line-height: 1.5;
}

/* ─── Components — TOAST ────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 12px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 600; z-index: 9999;
  pointer-events: none; opacity: 0; transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s; max-width: 340px;
  border-left: 4px solid transparent;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok {
  background: var(--toast-ok-bg); border-color: var(--toast-ok-border);
  color: var(--toast-ok-text); border-left-color: var(--toast-ok-border);
}
.toast.err {
  background: var(--toast-err-bg); border-color: var(--toast-err-border);
  color: var(--toast-err-text); border-left-color: var(--toast-err-border);
}

/* ─── Components — PROGRESS BAR ─────────────────────────────────────────────── */
.progress-wrap { margin-bottom: 24px; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.progress-bar { height: 10px; background: var(--progress-track); border-radius: 999px; overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: 999px;
  background: var(--brand-gradient);
  transition: width 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Components — STEPPER INPUT ────────────────────────────────────────────── */
.stepper-group {
  display: flex; align-items: stretch;
}
.stepper-group input[type="number"] {
  flex: 1; border-radius: 0; text-align: center;
  border-left: none; border-right: none;
  -moz-appearance: textfield;
}
.stepper-group input[type="number"]::-webkit-inner-spin-button,
.stepper-group input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
.stepper-btn {
  min-width: 34px; padding: 0 8px;
  background: var(--surface3);
  border: 1px solid var(--border2);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 15px; font-weight: 500; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-family: inherit; user-select: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.stepper-btn:first-child { border-radius: 8px 0 0 8px; }
.stepper-btn:last-child  { border-radius: 0 8px 8px 0; }
.stepper-btn:hover  { background: var(--lord-dim); border-color: var(--lord); color: var(--lord); }
.stepper-btn:active { background: var(--lord-dim); transform: scale(0.94); }

/* ─── Components — DROP ZONE ────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border2); border-radius: 12px; padding: 40px 24px;
  text-align: center; cursor: pointer; transition: all 0.2s;
  background: var(--surface2); color: var(--muted);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent); background: var(--lord-dim); color: var(--accent);
}
.drop-zone-icon { font-size: 32px; margin-bottom: 12px; }
.drop-zone-text { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.drop-zone-hint { font-size: 12px; }

/* ─── Components — EMPTY STATES ─────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 80px 24px; color: var(--muted);
  grid-column: 1 / -1;
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h2 { font-size: 20px; color: var(--text); margin-bottom: 8px; font-family: 'Fraunces', serif; }
.empty-state p { font-size: 14px; margin-bottom: 24px; max-width: 400px; margin-left: auto; margin-right: auto; }

/* ─── Components — ALERTS ───────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; line-height: 1.6; }
.alert-info { background: var(--lord-dim); border: 1px solid rgba(115,82,227,0.25); color: var(--lord); }
[data-theme="dark"] .alert-info { color: var(--accent); border-color: rgba(155,127,239,0.3); }
.alert-warn { background: var(--yellow-dim); border: 1px solid rgba(217,119,6,0.25); color: var(--yellow); }
.alert-err { background: var(--red-dim); border: 1px solid rgba(220,38,38,0.25); color: var(--red); }
.alert-ok { background: var(--green-dim); border: 1px solid rgba(5,150,105,0.25); color: var(--green); }
.alert-proj { background: var(--orange-dim); border: 1px solid rgba(234,88,12,0.3); color: var(--orange); padding: 12px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 12px; }
.error-box { background: var(--red-dim); border: 1px solid rgba(220,38,38,0.3); border-radius: 7px; padding: 10px 14px; font-size: 13px; color: var(--red); margin-bottom: 16px; display: none; }
.success-box { background: var(--green-dim); border: 1px solid rgba(5,150,105,0.3); border-radius: 7px; padding: 10px 14px; font-size: 13px; color: var(--green); margin-bottom: 16px; display: none; }
.info-box { background: var(--lord-dim); border: 1px solid rgba(115,82,227,0.25); border-radius: 7px; padding: 14px; font-size: 13px; color: var(--lord); margin-bottom: 16px; line-height: 1.6; }
[data-theme="dark"] .info-box { color: var(--accent); }
.err-msg { font-size: 13px; color: var(--red); margin-top: 8px; min-height: 16px; }

/* ─── Components — MISC ─────────────────────────────────────────────────────── */
/* Auth state panels with icon + prose pattern */
.state-panel { text-align: center; padding: 8px 0; }
.state-panel-icon { font-size: 48px; margin-bottom: 16px; line-height: 1; }
.state-panel h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; font-family: 'Fraunces', serif; }
.state-panel p { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* Reconciliation modal */
.recon-list { max-height: 300px; overflow-y: auto; margin: 12px 0; border: 1px solid var(--border); border-radius: 10px; }
.recon-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; gap: 12px; border-bottom: 1px solid var(--border); }
.recon-row:last-child { border-bottom: none; }
.recon-row-btns { display: flex; gap: 6px; flex-shrink: 0; }
.recon-btn { padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; border: 1px solid var(--border); background: transparent; color: var(--muted); transition: all 0.15s; }
.recon-btn.sel-actual { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.recon-btn.sel-missed { background: var(--red-dim); border-color: var(--red); color: var(--red); }

/* Section header */
.section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.section-header h3 { font-size: 16px; font-weight: 700; flex: 1; font-family: 'Fraunces', serif; }

/* Bulk bar */
.bulk-bar { display: flex; gap: 10px; align-items: center; padding: 9px 14px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; font-size: 13.5px; }

/* Misc */
.ml-auto { margin-left: auto; }
.row { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.center { text-align: center; }
.badge-btn { all: unset; cursor: pointer; display: inline-block; }
.cell-record { cursor: pointer; color: var(--muted); text-decoration: underline dotted; }
.cell-record:hover { color: var(--accent); }
.cell-confirm { cursor: pointer; color: var(--yellow); text-decoration: underline dotted; }
.cell-confirm:hover { color: var(--accent); }

/* Collapsible */
.collapsible-toggle { font-size: 13px; color: var(--accent); cursor: pointer; user-select: none; margin-bottom: 12px; display: inline-flex; align-items: center; gap: 6px; }
.collapsible-content { display: none; }
.collapsible-content.open { display: block; }

/* Theme toggle */
.theme-toggle {
  width: 36px; height: 36px; border-radius: 8px; background: transparent;
  border: 1px solid var(--border); cursor: pointer; display: flex;
  align-items: center; justify-content: center; font-size: 16px;
  transition: all 0.15s; color: var(--muted);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─── Landing page specific ─────────────────────────────────────────────────── */
/* Hero */
.hero { max-width: 860px; margin: 0 auto; padding: 100px 24px 80px; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--equi-dim); border: 1px solid rgba(232,78,138,0.25);
  color: var(--equi); font-size: 12px; font-weight: 700; letter-spacing: 0.05em;
  padding: 5px 14px; border-radius: 999px; margin-bottom: 28px; text-transform: uppercase;
}
.hero-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--equi); }
h1.hero-headline {
  font-size: clamp(40px, 7vw, 68px);
  font-weight: 900; line-height: 1.06; letter-spacing: -0.03em; margin-bottom: 24px;
  font-family: 'Fraunces', Georgia, serif;
}
h1.hero-headline .highlight {
  background: var(--brand-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-sub { font-size: clamp(16px, 2.5vw, 18px); color: var(--muted); max-width: 560px; margin: 0 auto 40px; line-height: 1.7; }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-trust { margin-top: 48px; font-size: 12px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap; }
.hero-trust-item { display: flex; align-items: center; gap: 6px; }
.hero-trust-icon { color: var(--green); }

/* Feature grid */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features-grid { grid-template-columns: 1fr; } }
.feature-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 24px; transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover { border-color: var(--lord); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(115,82,227,0.1); }
.feature-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 16px;
}
.feature-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; font-family: 'Fraunces', serif; }
.feature-card p { font-size: 13.5px; color: var(--muted); line-height: 1.6; }

/* Steps */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 700px) { .steps-grid { grid-template-columns: 1fr; } }
.step { text-align: center; padding: 12px; }
.step-num {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--lord-dim); border: 1.5px solid rgba(115,82,227,0.3);
  color: var(--lord); font-size: 20px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
  font-family: 'Fraunces', serif;
}
[data-theme="dark"] .step-num { color: var(--accent); background: rgba(155,127,239,0.12); border-color: rgba(155,127,239,0.3); }
.step h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.step p { font-size: 14px; color: var(--muted); }

/* CTA section */
.cta-section {
  background: linear-gradient(135deg, var(--equi-dim), var(--lord-dim));
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 80px 24px; text-align: center;
}
.cta-section h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 900; letter-spacing: -0.02em; margin-bottom: 16px; font-family: 'Fraunces', serif; }
.cta-section p { font-size: 17px; color: var(--muted); margin-bottom: 36px; max-width: 480px; margin-left: auto; margin-right: auto; }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 32px 24px; text-align: center; font-size: 13px; color: var(--muted); }
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }
.footer-value { font-size: 12px; color: var(--text-secondary); margin-top: 8px; }

/* Section */
.section { max-width: 1100px; margin: 0 auto; padding: 0 24px 96px; }
.section-label { font-size: 12px; font-weight: 700; color: var(--equi); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; }
.section-title { font-size: clamp(26px, 4vw, 40px); font-weight: 900; letter-spacing: -0.02em; margin-bottom: 14px; font-family: 'Fraunces', serif; }
.section-sub { font-size: 17px; color: var(--muted); max-width: 540px; margin-bottom: 56px; line-height: 1.7; }

/* Mock browser */
.mock-wrap { max-width: 900px; margin: 0 auto 96px; padding: 0 24px; }
.mock-browser { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: 0 24px 80px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.04); }
[data-theme="dark"] .mock-browser { box-shadow: 0 24px 80px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04); }
.mock-bar { background: var(--surface2); border-bottom: 1px solid var(--border); padding: 10px 16px; display: flex; align-items: center; gap: 8px; }
.mock-dot { width: 10px; height: 10px; border-radius: 50%; }
.mock-url { flex: 1; background: var(--surface3); border: 1px solid var(--border); border-radius: 5px; padding: 4px 12px; font-size: 12px; color: var(--muted); margin: 0 8px; text-align: center; }
.mock-body { padding: 20px; }
.mock-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.mock-stat { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.mock-stat-label { font-size: 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.mock-stat-val { font-size: 20px; font-weight: 700; font-family: 'Fraunces', serif; font-variant-numeric: tabular-nums; }
.mock-progress-wrap { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.mock-progress-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 10px; }
.mock-bar-track { background: var(--border); border-radius: 999px; height: 8px; }
.mock-bar-fill { height: 8px; border-radius: 999px; background: var(--brand-gradient); width: 38%; }

/* ─── Auth page specific ─────────────────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.auth-logo {
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 32px;
  font-family: 'Plus Jakarta Sans', sans-serif; text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px;
}
.auth-logo .equi { color: var(--equi); }
.auth-logo .lord { color: var(--lord); }
.auth-logo-icon { display: block; flex-shrink: 0; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 36px 40px; width: 100%; max-width: 420px; box-shadow: 0 8px 32px rgba(0,0,0,0.06); }
[data-theme="dark"] .auth-card { box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
@media (max-width: 480px) { .auth-card { padding: 28px 20px; } }
.form-title { font-size: 22px; font-weight: 800; margin-bottom: 6px; font-family: 'Fraunces', serif; }
.form-sub { font-size: 13.5px; color: var(--muted); margin-bottom: 24px; line-height: 1.5; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.switch-text { text-align: center; font-size: 13px; color: var(--muted); }
.back-link { margin-top: 20px; font-size: 13px; color: var(--muted); text-align: center; }
.btn-submit {
  width: 100%; padding: 13px;
  background: var(--brand-gradient);
  color: #fff; border: none; border-radius: 8px;
  font-size: 15px; font-weight: 700; font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer; transition: all 0.15s; margin-top: 4px;
  box-shadow: 0 2px 12px rgba(115,82,227,0.25);
}
.btn-submit:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 20px rgba(115,82,227,0.35); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ─── App/Profile specific ──────────────────────────────────────────────────── */
.view { display: none; max-width: 1100px; margin: 0 auto; padding: 36px 24px 80px; }
.view.active { display: block; }
.page-header { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; }
.page-header h1 { font-size: 26px; font-weight: 900; flex: 1; font-family: 'Fraunces', serif; }
.page-back { font-size: 13px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: color 0.15s; margin-bottom: 12px; text-decoration: none; }
.page-back:hover { color: var(--accent); text-decoration: none; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; margin-bottom: 24px; }
.detail-header { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px 28px; margin-bottom: 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.detail-name { font-size: 24px; font-weight: 900; margin-bottom: 4px; font-family: 'Fraunces', serif; }
.detail-addr { font-size: 13.5px; color: var(--muted); }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pay-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filter-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.reports-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .reports-grid { grid-template-columns: 1fr; } }
.report-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
.report-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; font-family: 'Fraunces', serif; }
.report-card p { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 16px; }
.mortgage-form { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px; }
.form-section-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
@media (max-width: 580px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
#loadingView { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 60px); flex-direction: column; gap: 16px; }
#loadingView p { color: var(--muted); font-size: 14px; }

/* ─── Brand mark ────────────────────────────────────────────────────────────────
 * Mark:       Yield Curve — Area Fill
 * File:       /favicon.svg  (64×64 viewBox, scalable)
 * Usage:      nav (.nav-logo-icon, 22×22px)
 *             auth page (.auth-logo-icon, 28×28px)
 *             browser tab (<link rel="icon" href="/favicon.svg">)
 *
 * Anatomy:
 *   - Pink Y-axis + arrowhead (#E84E8A)
 *   - Pink X-axis + arrowhead (#E84E8A)
 *   - Rising bezier curve: gradient stroke, pink → violet (left → right)
 *   - Area fill: vertical gradient, violet 38% opacity → pink 2% opacity (top → baseline)
 *   - Terminal dot at curve peak: solid violet (#7352E3), r=4
 *
 * Gradients:
 *   Curve stroke — horizontal: x1=13 → x2=58 (userSpaceOnUse)
 *     #E84E8A → #7352E3
 *   Area fill — vertical: y1=8 → y2=56 (userSpaceOnUse)
 *     rgba(115,82,227,0.38) → rgba(232,78,138,0.02)
 *
 * Colours:
 *   --equi: #E84E8A  (axes, curve origin, text "equi")
 *   --lord: #7352E3  (terminal dot, area fill top, text "lord")
 * ─────────────────────────────────────────────────────────────────────────────── */
