:root{
  /* Light theme defaults */
  --bg:#ffffff;
  --txt:#222222;
  --muted:#555555;
  --outline:#505050;
  --panel:#f7f7f7;
  --card:#ffffff;
  --cta:#CC3300; /* Inferno Red for CTA */
  --cta-txt:#ffffff;

  /* Chart colors (light) */
  --chart-label:#222222;
  --chart-before:#ff6a00;
  --chart-after:#22c55e;
  --donut-base:#e3e3e3;
}

/* Dark theme */
body.theme-dark{
  --bg:#0a1d4c;
  --txt:#f5f6f8;
  --muted:#c8d3ea;
  --outline:rgba(255,255,255,.18);
  --panel: linear-gradient(180deg, rgba(14,31,79,.6), rgba(12,26,63,.6));
  --card: rgba(10,19,64,.45);
  --cta:#CC3300; /* keep red in dark too */
  --cta-txt:#ffffff;

  --chart-label:rgba(255,255,255,0.9);
  --chart-before:rgba(255,106,0,0.9);
  --chart-after:rgba(34,197,94,0.9);
  --donut-base:rgba(255,255,255,0.15);
}

*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--txt);
  font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;}
/* Header */
.site-header{position:sticky;top:0;backdrop-filter:blur(8px);
  background-color:#fff;border-bottom:1px solid rgba(0,0,0,.1);z-index:30}
.hdr-wrap{max-width:1120px;margin:0 auto;padding:0 14px;}
.hdr{display:flex;align-items:center;justify-content:space-between}
.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:#000}
.logo{height:60px;width:auto}
.brand-text{font-weight:600;color:#000}
.nav{display:flex;align-items:center;gap:16px}
.nav-link{color:#000;text-decoration:none;font-weight:500}

/* Containers */
.wrap{max-width:1120px;margin:0 auto;padding:14px}

/* Buttons */
.btn{display:inline-flex;align-items:center;gap:8px;padding:10px 16px;border-radius:999px;text-decoration:none;font-weight:700;border:1px solid var(--outline); color:var(--txt)}
.btn.solid,.btn.cta{background:var(--cta); border:1px solid var(--cta); color:var(--cta-txt)}
.btn.ghost{background:transparent; border:1px solid var(--outline); color:var(--txt)}
.btn.ghost:hover{background:rgba(0,0,0,.04)}

/* Panels & layout */
.column{display:flex;flex-direction:column;gap:14px}
.panel{background:var(--panel); border:1px solid var(--outline); border-radius:14px; padding:12px}
.panel .card{background:var(--card); border:1px solid var(--outline); border-radius:12px; padding:10px}
.stack{display:flex;flex-direction:column;gap:10px}
.row{display:flex;gap:10px;flex-wrap:wrap}
label{display:flex;flex-direction:column;gap:6px;min-width:220px;flex:1}
input[type=text],input[type=number]{background:transparent; color:var(--txt); border:1px solid var(--outline); border-radius:8px; padding:6px 12px; grid-template-columns:1fr 160px; gap:12px; align-items:center}
.pill{display:inline-flex; gap:6px; align-items:center; border:1px solid var(--outline); border-radius:999px; padding:4px 10px; color:var(--muted); background:transparent}

/* Table & viz */
.tbl{width:100%; border-collapse:separate; border-spacing:0 6px; font-size:.95rem}
.tbl th,.tbl td{padding:6px 8px; background:#fafafa; border:1px solid var(--outline); color:var(--txt)}
body.theme-dark .tbl th, body.theme-dark .tbl td{background:rgba(10,19,64,.85)}
.tbl th{background:transparent; border:0; color:var(--muted); font-weight:600}
.tbl td:first-child{border-top-left-radius:10px; border-bottom-left-radius:10px}
.tbl td:last-child{border-top-right-radius:10px; border-bottom-right-radius:10px}
.num{text-align:right}

/* Chips & grid */
.chips{display:flex; gap:8px; flex-wrap:wrap}
.chip{padding:6px 10px; border-radius:999px; border:1px solid var(--outline); color:var(--muted); background:transparent}
.grid.two{display:grid; gap:14px; grid-template-columns:1fr}
@media(min-width:900px){.grid.two{grid-template-columns:1fr 1fr}}
.grid.three{display:grid; gap:14px; grid-template-columns:1fr}
@media(min-width:1000px){.grid.three{grid-template-columns:1fr 1fr 1fr}}
.center{display:flex; align-items:center; justify-content:center}

/* Donut */
.donut-wrap{position:relative; width:100%; display:flex; justify-content:center; align-items:center; padding:12px}
.donut-wrap.small canvas{width:260px; height:260px}
.donut-center{position:absolute; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; inset:0}
.donut-center .roi{font-size:1.6rem; font-weight:800; color:var(--txt)}
.donut-center .meta{font-size:.9rem; color:var(--muted)}

/* Advanced grid responsive */
.adv-grid{display:grid; gap:14px; grid-template-columns:1fr;}
@media(min-width:900px){.adv-grid{grid-template-columns:1fr 1fr;}}
@media(min-width:1200px){.adv-grid{grid-template-columns:1fr 1fr 1fr 1fr;}}

.site-footer{border-top:1px solid var(--outline); margin-top:16px}
.micro{font-size:.85rem}
.muted{color:var(--muted)}
canvas{max-width:100%}

/* Tooltip */
.info-tip{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;
  border:1px solid var(--outline);color:var(--muted);font-size:12px;line-height:1;margin-left:6px;cursor:help;position:relative; background:transparent}
.info-tip:hover{background:rgba(0,0,0,0.04)}
.info-tip .tip{position:absolute;left:50%;transform:translateX(-50%);bottom:130%;min-width:220px;max-width:300px;background:#111;
  color:#fff;border:1px solid var(--outline);border-radius:10px;padding:10px 12px;font-size:.85rem;line-height:1.3;opacity:0;pointer-events:none;transition:opacity .15s ease}
.info-tip:hover .tip{opacity:1}
.info-tip .arrow{position:absolute;left:50%;transform:translateX(-50%);bottom:120%;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #111}


/* Smooth <details> animation */
.smooth-details > summary{cursor:pointer; list-style:none}
.smooth-details > summary::-webkit-details-marker{display:none}
.smooth-details .details-content{overflow:hidden; height:0}
.smooth-details[open] .details-content{ /* height set via JS on open for animation */ }







/* Plus/minus icon animation */
.smooth-details > summary::before{
  content:'+';
  display:inline-block;
  color:var(--txt);
  font-size:28px;
  line-height:1;
  width:20px;
  text-align:center;
  transition:transform .3s ease, opacity .3s ease;
  transform:scale(1);
  opacity:0.85;
}
.smooth-details[open] > summary::before{
  content:'−';
  transform:scale(1.2);
  opacity:1;
}
/* Tighten h2 vertical margins */
h2{margin:0.5em 0 0.5em;}

h3{margin:0.5em 0 0.5em;}

/* Ensure ZIP code input visually matches numeric fields */
#zip{background:transparent;color:var(--txt);border:1px solid var(--outline);border-radius:8px;padding:6px 12px;height:auto;width:100%;font-family:inherit;font-size:inherit;box-sizing:border-box;}


/* Unify font family and size for 'Your home' inputs */
#inputs input[type=text],
#inputs input[type=number] {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.4;
}


/* v8.5.8: Unify font family/size for all page inputs */
.panel input[type=text],
.panel input[type=number],
.panel input[type=range]{
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  border-radius:8px;
  padding:6px 12px;
}


/* v8.5.10: Apply consistent 8px radius to Adjust assumptions cards */
#advanced .card {
  border-radius: 8px;
}
