/* MortgageDesign Equity Calculator. Styles are scoped to .mde so they won't affect the theme. */
  .mde {
    --ink:#0b1017; --text:#5b6470; --muted:#8a919b; --line:#e4ddd0; --grid:#efeae1;
    --surface:#ffffff; --page:#f2efe9; --field:#faf8f3;
    --gold:#8a6b33; --gold-line:#c6ac77; --gold-soft:#f3ecdc;
    --gold-grad:linear-gradient(90deg,#ab8b48 0%,#ebd483 50%,#ab8b48 100%);
    --card:#0b1017; --card-text:#faf8f3; --card-muted:#aab2bd;
    --s1:#0b1017; --s2:#b8862f;
    --font-display:"Playfair Display", Georgia, "Times New Roman", serif;
    --font-body:"Manrope", "Segoe UI", system-ui, sans-serif;
    --radius:10px;
    max-width:1120px; margin:0 auto; padding:32px 16px 40px; color:var(--text);
    font-family:var(--font-body); font-size:16px; line-height:1.55; box-sizing:border-box;
  }
  .mde *, .mde *::before, .mde *::after { box-sizing:border-box; }
  .mde p { margin:0; }
  .mde [hidden] { display:none !important; }

  .mde-head { display:flex; flex-direction:column; gap:10px; margin-bottom:26px; }
  .mde-eyebrow { display:flex; align-items:center; gap:12px; color:var(--gold); font-size:.78rem; font-weight:600; letter-spacing:.22em; text-transform:uppercase; }
  .mde-eyebrow::before { content:""; width:34px; height:1px; background:var(--gold-line); }
  .mde h1 { font-family:var(--font-display); font-weight:400; color:var(--ink); font-size:clamp(2.4rem,6vw,68px); line-height:1.1; margin:0; text-wrap:balance; }
  .mde h1 em, .mde h2 em { font-style:italic; color:var(--gold); }
  .mde-head p { max-width:none; }

  .mde-grid { display:grid; grid-template-columns:360px minmax(0,1fr); gap:22px; align-items:stretch; }
  .mde-grid > * { min-width:0; }
  .mde-right { display:flex; flex-direction:column; }
  .mde-right .mde-chart-card { flex:1 1 auto; display:flex; flex-direction:column; }
  @media (max-width:900px) { .mde-grid { grid-template-columns:minmax(0,1fr); } }

  .mde-panel { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:22px; }
  .mde h2 { font-family:var(--font-display); color:var(--ink); font-size:1.3rem; font-weight:400; margin:0 0 16px; display:flex; align-items:center; gap:12px; }
  .mde-step { display:inline-grid; place-items:center; width:28px; height:28px; border-radius:50%; border:1px solid var(--gold-line); color:var(--gold); font-family:var(--font-body); font-size:.8rem; font-weight:700; flex:none; }

  .mde-field { display:flex; flex-direction:column; gap:5px; margin-bottom:16px; }
  .mde-field label, .mde-flabel { font-weight:600; font-size:.9rem; color:var(--ink); display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
  .mde-field label small { font-weight:400; color:var(--muted); font-size:.8rem; }
  .mde-hint { font-size:.8rem; color:var(--muted); }
  .mde-input { display:flex; align-items:center; background:var(--field); border:1px solid var(--line); border-radius:8px; min-height:44px; transition:border-color .15s; }
  .mde-input:hover { border-color:var(--gold-line); }
  .mde-input:focus-within { outline:2px solid var(--gold); outline-offset:2px; }
  .mde-input span { padding:0 12px; color:var(--muted); white-space:nowrap; font-size:.95rem; }
  .mde-input span.pre { padding-right:0; }
  .mde-input input { flex:1; width:100%; min-width:0; border:0; outline:0; background:transparent; padding:10px 12px; font:inherit; color:var(--ink); font-variant-numeric:tabular-nums; }
  .mde-input input::-webkit-outer-spin-button, .mde-input input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
  .mde-input input[type=number] { -moz-appearance:textfield; }
  .mde input[type=range] { width:100%; margin:8px 0 0; accent-color:var(--gold); }
  .mde button:focus-visible, .mde a:focus-visible { outline:2px solid var(--gold); outline-offset:2px; }

  .mde-seg { display:flex; border:1px solid var(--line); border-radius:8px; overflow:hidden; background:var(--field); }
  .mde-seg button { flex:1; font:inherit; font-weight:600; font-size:.88rem; padding:8px 6px; min-height:44px; border:0; background:transparent; color:var(--text); cursor:pointer; }
  .mde-seg button + button { border-left:1px solid var(--line); }
  .mde-seg button[aria-pressed=true] { background:var(--gold); color:var(--card-text); }
  .mde-sep { border:0; border-top:1px solid var(--line); margin:22px 0 18px; }

  /* Property list */
  .mde-prop + .mde-prop { margin-top:16px; padding-top:16px; border-top:1px dashed var(--line); }
  .mde-prop-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
  .mde-prop-head b { color:var(--ink); font-size:.82rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; }
  .mde-remove { font:inherit; font-size:.82rem; font-weight:600; color:var(--gold); background:none; border:0; padding:6px 0; cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
  .mde-remove:hover { color:#765a28; }
  .mde-prop .mde-field:last-child { margin-bottom:0; }
  .mde-add { display:block; width:100%; margin-top:16px; font:inherit; font-weight:600; font-size:.9rem; color:var(--gold); background:var(--field); border:1px dashed var(--gold-line); border-radius:8px; min-height:44px; cursor:pointer; }
  .mde-add:hover { background:var(--gold-soft); }

  /* Per-property breakdown */
  .mde-bd { margin-top:14px; overflow-x:auto; border:1px solid var(--line); border-radius:8px; }
  .mde table { width:100%; border-collapse:collapse; font-size:.86rem; font-variant-numeric:tabular-nums; }
  .mde th { background:var(--field); color:var(--ink); text-align:right; font-weight:600; padding:9px 12px; border-bottom:1px solid var(--line); white-space:nowrap; }
  .mde td { text-align:right; padding:8px 12px; border-bottom:1px solid var(--grid); white-space:nowrap; color:var(--ink); }
  .mde th:first-child, .mde td:first-child { text-align:left; }
  .mde td small { color:var(--muted); font-size:.78rem; margin-left:4px; }
  .mde tfoot td { font-weight:700; background:var(--gold-soft); border-top:1px solid var(--gold-line); border-bottom:0; }

  .mde-result > div { flex:1 1 300px; min-width:0; }
  .mde-result .mde-cta { flex:none; }
  .mde-result { background:var(--card); border-radius:var(--radius); padding:24px 26px; color:var(--card-muted); display:flex; flex-wrap:wrap; gap:16px 24px; align-items:flex-end; justify-content:space-between; }
  .mde-label { font-size:.74rem; color:var(--gold-line); font-weight:600; letter-spacing:.18em; text-transform:uppercase; }
  .mde-big { font-family:var(--font-display); font-weight:400; color:var(--card-text); font-size:clamp(2.4rem,5.5vw,3.2rem); line-height:1.1; margin-top:6px; font-variant-numeric:lining-nums tabular-nums; }
  .mde-big-sub { font-size:.9rem; margin-top:4px; }
  .mde-big-sub b { color:var(--card-text); font-weight:600; }
  .mde-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-top:14px; }
  @media (max-width:1100px) { .mde-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } }
  .mde-stat { background:var(--surface); border:1px solid var(--gold-line); border-radius:var(--radius); padding:14px 16px; }
  .mde-stat .k { font-size:.8rem; color:var(--muted); }
  .mde-stat .v { font-family:var(--font-display); color:var(--ink); font-size:1.4rem; line-height:1.25; margin-top:2px; font-variant-numeric:lining-nums tabular-nums; }
  .mde-stat .d { font-size:.8rem; color:var(--text); margin-top:2px; }
  .mde-stat.hi { background:var(--gold-soft); }
  .mde-stat.hi .v { color:var(--gold); }
  .mde-stat.empty .v { font-family:var(--font-body); font-size:.95rem; font-weight:600; color:var(--ink); }
  .mde-cta { display:inline-block; text-align:center; font-weight:700; font-size:.82rem; letter-spacing:.09em; text-transform:uppercase; text-decoration:none; background:var(--gold-grad); color:#1a1305; border:1px solid #6b4f16; padding:13px 18px; border-radius:10px; }
  .mde-cta:hover { filter:brightness(1.06); }

  .mde-chart-card { margin-top:18px; }
  .mde-chart-head { display:flex; flex-wrap:wrap; gap:12px; justify-content:space-between; align-items:center; margin-bottom:12px; }
  .mde-chart-head h2 { margin:0; display:block; }
  .mde-tabs { display:inline-flex; flex-wrap:wrap; border:1px solid var(--line); border-radius:8px; overflow:hidden; background:var(--field); }
  .mde-tabs button { font:inherit; font-size:.84rem; font-weight:600; padding:8px 14px; border:0; background:transparent; color:var(--text); cursor:pointer; }
  .mde-tabs button + button { border-left:1px solid var(--line); }
  .mde-tabs button[aria-pressed=true] { background:var(--gold); color:var(--card-text); }
  @media (max-width:560px) {
    .mde-tabs { display:grid; grid-auto-flow:column; grid-auto-columns:1fr; width:100%; }
    .mde-tabs button { padding:8px 6px; font-size:.8rem; }
  }
  .mde-chart-sub { font-size:.88rem; margin-bottom:10px !important; }
  .mde-legend { display:flex; gap:18px; flex-wrap:wrap; font-size:.85rem; color:var(--text); margin-bottom:6px; }
  .mde-legend i { display:inline-block; width:12px; height:12px; border-radius:3px; margin-right:6px; vertical-align:-1px; }
  .mde-legend i.line { width:16px; height:3px; border-radius:2px; vertical-align:3px; }
  .mde-legend i.dash { width:16px; height:0; border-top:2px dashed #5b6470; border-radius:0; vertical-align:3px; background:none !important; }
  .mde-legend i.band { background:var(--gold-soft) !important; border:1px solid var(--gold-line); }
  .mde-chart { position:relative; width:100%; }
  .mde-chart svg { display:block; width:100%; overflow:visible; }
  .mde-chart text { font-family:var(--font-body); font-size:11px; fill:var(--muted); font-variant-numeric:tabular-nums; }
  .mde-chart text.ann { fill:var(--ink); font-weight:600; font-size:11.5px; }
  .mde-chart text.big { fill:var(--ink); font-family:var(--font-display); font-size:17px; }
  .mde-tip { position:absolute; pointer-events:none; background:#fff; border:1px solid var(--line); box-shadow:0 8px 22px rgba(11,16,23,.12); border-radius:10px; padding:10px 12px; font-size:.82rem; min-width:210px; opacity:0; z-index:2; }
  .mde-tip b { display:block; margin-bottom:4px; color:var(--ink); }
  .mde-tip div { display:flex; justify-content:space-between; gap:14px; }
  .mde-tip div span:last-child { color:var(--ink); font-weight:600; font-variant-numeric:tabular-nums; }
  .mde-tip i { display:inline-block; width:9px; height:9px; border-radius:2px; margin-right:6px; }
  .mde-note { margin-top:14px !important; font-size:.84rem; background:var(--field); border:1px solid var(--line); border-radius:8px; padding:11px 13px; }
  .mde-note b { color:var(--ink); }
  .mde-actions { margin-top:auto; padding-top:16px; border-top:1px solid var(--line); display:flex; flex-wrap:wrap; gap:12px 20px; align-items:center; justify-content:space-between; }
  .mde-chart-card .mde-actions { margin-top:18px; }
  .mde-actions p { font-size:.88rem; flex:1 1 240px; }
  .mde-btn { display:inline-flex; align-items:center; gap:8px; font:inherit; font-weight:700; font-size:.82rem; letter-spacing:.09em; text-transform:uppercase; text-decoration:none; background:var(--gold); color:var(--card-text); border:1px solid var(--gold); padding:13px 18px; border-radius:10px; cursor:pointer; }
  .mde-btn:hover { background:#765a28; }
  .mde-fine { margin-top:20px !important; font-size:.76rem; color:var(--muted); }
