:root {
  --bg: #f7f6f1;
  --surface: #fffefa;
  --navy: #091c2a;
  --ink: #11222e;
  --muted: #63727a;
  --line: #dce6e1;
  --brand: #0b7657;
  --brand-dark: #075840;
  --brand-tint: #eaf4ee;
  --ivory-soft: #f1efe8;
  --radius: 14px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
}
a { color: var(--brand-dark); text-decoration: none; }

/* Calculator shell */
.calculator-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 16px;
}
.calculator-form-panel,
.calculator-result-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.calculator-form-panel { padding: 20px; background: var(--surface); }
.calculator-result-panel { padding: 20px; background: var(--navy); color: #fff; }

.calculator-heading {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.calculator-heading .tick {
  display: grid; width: 26px; height: 26px; flex: none;
  place-items: center; border-radius: 8px;
  background: var(--brand-tint); color: var(--brand-dark);
}
.calculator-heading .tick svg { width: 15px; height: 15px; }
.calculator-eyebrow {
  margin: 0; color: var(--navy); font-size: 0.75rem;
  font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
}
.calculator-helper { margin: 2px 0 0; color: var(--muted); font-size: 0.78rem; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.field label {
  display: block; font-size: 0.68rem; font-weight: 700; color: var(--muted);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em;
}
.field input, .field select {
  width: 100%; padding: 10px 11px; font-size: 0.95rem; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--ivory-soft); appearance: none; font-family: var(--sans);
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a6b7a' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 34px;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 118, 87, 0.14);
}
.field input:disabled { opacity: 0.4; cursor: not-allowed; }

/* Result panel */
.result-panel-heading {
  display: flex; align-items: start; justify-content: space-between; gap: 12px;
  padding-bottom: 16px; border-bottom: 1px solid rgba(220,230,225,.2);
}
.result-eyebrow {
  margin: 0; color: var(--brand-tint); font-size: 0.68rem;
  font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
}
.result-year { margin: 4px 0 0; color: #a9c3ba; font-size: 0.75rem; }
.result-private {
  padding: 5px 8px; border: 1px solid rgba(234,244,238,.22);
  border-radius: 999px; color: #d6e2de; font-size: 0.65rem; font-weight: 700;
}
.result { padding-top: 12px; }
.row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid rgba(220,230,225,.16);
  font-size: 0.92rem; font-variant-numeric: tabular-nums;
}
.row .val { font-weight: 600; white-space: nowrap; color: #f1f5f2; }
.row.sub .val { color: #f2b2a9; }
.row.muted { border-bottom: none; color: #a9c3ba; font-size: 0.82rem; }
.row.muted .val { color: #a9c3ba; }
.row.total {
  border-bottom: none; margin-top: 12px;
  background: var(--brand-tint); border: 1px solid #4a9b7f;
  border-radius: 10px; padding: 12px 14px;
  color: var(--navy); font-weight: 700;
}
.row.total .val { color: var(--brand-dark); font-size: 1.15rem; }
.result-note { margin: 12px 0 0; color: #a9c3ba; font-size: 0.75rem; line-height: 1.5; }
.result-note[role='alert'] {
  padding: 10px 12px; border-radius: 9px;
  background: rgba(242,178,169,.12); color: #ffd0c8;
}
.result-privacy { margin: 16px 0 0; color: #a9c3ba; font-size: 0.7rem; }

/* Share link */
.share-link {
  margin-top: 10px; padding: 8px 14px;
  border: 1px solid rgba(234,244,238,.4); border-radius: 8px;
  background: transparent; color: #d6e2de;
  cursor: pointer; font-size: 0.8rem; font-weight: 700;
}
.share-link:hover { background: var(--brand); color: #fff; }

/* Brand link at bottom */
.embed-brand {
  display: block; text-align: center; margin: 12px 0 16px;
  color: var(--muted); font-size: 0.75rem; font-weight: 700;
  text-decoration: none;
}
.embed-brand:hover { color: var(--brand-dark); }

/* Desktop: side-by-side */
@media (min-width: 700px) {
  .calculator-shell { grid-template-columns: 1.5fr 1fr; }
}
