:root{
  --bg:#0b1220;
  --card:#111a2e;
  --muted:#93a4c7;
  --text:#e9eefb;
  --accent:#6aa6ff;
  --accent2:#33d6a6;
  --danger:#ff6a6a;
  --border:rgba(255,255,255,0.10);
  --shadow:0 10px 30px rgba(0,0,0,0.35);
  --radius:16px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(106,166,255,0.25), transparent 60%),
    radial-gradient(1000px 500px at 80% 20%, rgba(51,214,166,0.18), transparent 55%),
    var(--bg);
  color:var(--text);
  line-height:1.5;
}

a{ color:var(--accent); text-decoration:none; }
a:hover{ text-decoration:underline; }

.container{ max-width:1100px; margin:0 auto; padding:28px 18px 60px; }

header{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:18px;
}

.brand{ display:flex; flex-direction:column; gap:2px; }
.brand h1{ margin:0; font-size:22px; letter-spacing:0.2px; }
.brand p{ margin:0; color:var(--muted); font-size:13px; }

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--border);
  background:rgba(255,255,255,0.03);
  padding:8px 10px;
  border-radius:999px;
  font-size:12px;
  color:var(--muted);
}

.grid{ display:grid; grid-template-columns:1fr; gap:16px; }
@media (min-width:980px){
  .grid{ grid-template-columns:420px 1fr; align-items:start; }
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border:1px solid var(--border);
  box-shadow:var(--shadow);
  border-radius:var(--radius);
  padding:16px;
}

.card h2{ margin:0 0 12px; font-size:16px; }
.subtle{ color:var(--muted); font-size:13px; margin-top:6px; }

.hr{ border:none; border-top:1px solid var(--border); margin:16px 0; }

.field{ margin-bottom:14px; }
.field label{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  font-size:13px;
  color:var(--muted);
  margin-bottom:6px;
}
.field label span.value{ color:var(--text); font-weight:600; }

input[type="number"], input[type="text"], input[type="month"], input[type="range"], select{
  width:100%;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,0.04);
  color:var(--text);
  padding:10px 12px;
  outline:none;
}
input[type="range"]{ padding:0; height:34px; }
input:focus, select:focus{
  border-color: rgba(106,166,255,0.7);
  box-shadow: 0 0 0 3px rgba(106,166,255,0.15);
}

.row2{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
@media (max-width:420px){ .row2{ grid-template-columns:1fr; } }

.actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:8px; }

button{
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(106,166,255,0.15);
  color:var(--text);
  padding:10px 12px;
  cursor:pointer;
  transition: transform 0.04s ease, background 0.2s ease, border-color 0.2s ease;
}
button:hover{ background:rgba(106,166,255,0.22); border-color:rgba(106,166,255,0.45); }
button:active{ transform:translateY(1px); }
button.secondary{ background:rgba(255,255,255,0.06); }
button.secondary:hover{ background:rgba(255,255,255,0.10); }

.results{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:12px;
  margin-top:10px;
}
@media (min-width:720px){ .results{ grid-template-columns:repeat(4,1fr); } }

.metric{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background:rgba(255,255,255,0.03);
}
.metric .k{ color:var(--muted); font-size:12px; margin-bottom:6px; }
.metric .v{ font-size:18px; font-weight:700; letter-spacing:0.2px; }
.metric .mini{ color:var(--muted); font-size:12px; margin-top:4px; }

.tableWrap{ overflow:auto; margin-top:10px; }
table{
  width:100%;
  border-collapse:collapse;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,0.02);
  overflow:hidden;
}
th,td{
  padding:10px 10px;
  border-bottom:1px solid var(--border);
  text-align:right;
  font-size:12px;
  white-space:nowrap;
}
th{
  color:var(--muted);
  font-weight:600;
  background:rgba(255,255,255,0.03);
}
td:first-child, th:first-child{ text-align:left; }
tr:last-child td{ border-bottom:none; }

details{ margin-top:14px; }
details summary{ cursor:pointer; color:var(--accent); font-weight:600; }

.error{
  display:none;
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,106,106,0.35);
  background:rgba(255,106,106,0.10);
  color:#ffd1d1;
  font-size:13px;
}

.breadcrumb{
  list-style:none;
  display:flex;
  gap:6px;
  padding:0;
  margin:0 0 10px 0;
  font-size:13px;
  color:var(--muted);
}
.breadcrumb li::after{ content:"›"; margin-left:6px; color:#6b7bbf; }
.breadcrumb li:last-child::after{ content:""; }
.breadcrumb a{ color:var(--accent); }

footer.siteFooter{
  margin-top:18px;
  color:var(--muted);
  font-size:12px;
}
footer.siteFooter a{ color:var(--accent); }


/* MoneyAIQ Mobile Tweaks */

/* Make cards/sections breathe on small screens */
@media (max-width: 520px){
  .container{ padding:18px 14px 46px; }
  header{ margin-bottom:12px; }
  .card{ padding:14px; }
  .results{ grid-template-columns:1fr; }
  .row2{ grid-template-columns:1fr; }
  table th, table td{ font-size:12px; padding:10px 8px; }
}

/* Consistent back link */
.backLink{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin:6px 0 10px;
  padding:8px 10px;
  border:1px solid var(--border);
  background:rgba(255,255,255,0.03);
  border-radius:12px;
  color:var(--text);
  text-decoration:none;
  font-size:13px;
}
.backLink:hover{ text-decoration:none; border-color:rgba(106,166,255,0.45); }
