/* Investment growth calculator. Mobile first.
   Everything under .pw-calc is self-contained so the section can be embedded on any page.
   The "Page shell" block at the bottom is only for calculator.html. */

.pw-calc {
  --pwc-ink: #141414;
  --pwc-gold: #c9a250;
  --pwc-gold-text: #a9843c;  /* large text on white only */
  --pwc-tint: #f5f4f0;
  --pwc-line: #dcdad4;
  --pwc-muted: #4a4a4a;
  --pwc-error: #b3261e;
  --pwc-head: "Montserrat", system-ui, sans-serif;
  --pwc-body: "Inter", system-ui, sans-serif;
  --pwc-gutter: clamp(16px, 4vw, 48px);

  background: #fff;
  color: var(--pwc-ink);
  font-family: var(--pwc-body);
  font-size: 16px;
  line-height: 1.6;
  padding: 32px 0 56px;
}
.pw-calc *, .pw-calc *::before, .pw-calc *::after { box-sizing: border-box; }
.pw-calc p { margin: 0 0 1em; }
.pw-calc h3 { font-family: var(--pwc-head); font-weight: 700; line-height: 1.25; margin: 0 0 8px; }
.pwc-wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--pwc-gutter); }
.pwc-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.pwc-grid { display: grid; gap: 32px; }

/* ---------- Inputs ---------- */
.pwc-inputs {
  position: relative;
  background: var(--pwc-tint);
  border-top: 3px solid var(--pwc-gold);
  padding: 18px 16px 16px;
}
.pwc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pwc-field { margin-bottom: 14px; min-width: 0; }
.pwc-field label { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 600; line-height: 1.4; }
.pwc-optional { font-weight: 400; color: var(--pwc-muted); }

.pwc-input { position: relative; }
.pwc-input::before, .pwc-input::after {
  position: absolute; top: 0; bottom: 0; display: flex; align-items: center;
  font-size: 15px; color: var(--pwc-muted); pointer-events: none;
}
.pwc-prefix::before { content: attr(data-unit); left: 12px; }
.pwc-suffix::after { content: attr(data-unit); right: 12px; font-size: 13px; }

.pw-calc input[type="text"], .pw-calc select {
  display: block; width: 100%; height: 48px; margin: 0;
  font-family: var(--pwc-body); font-size: 17px; color: var(--pwc-ink);
  background: #fff; border: 1.5px solid #6b6b6b; border-radius: 0;
  -webkit-appearance: none; appearance: none;
}
.pw-calc input[type="text"] { padding: 0 12px; font-variant-numeric: tabular-nums; }
.pwc-prefix input[type="text"] { padding-left: 28px; }
.pwc-suffix input[type="text"] { padding-right: 64px; }
.pw-calc select {
  padding: 0 40px 0 12px; font-size: 16px;
  background-image: linear-gradient(45deg, transparent 50%, var(--pwc-ink) 50%), linear-gradient(135deg, var(--pwc-ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px;
  background-size: 6px 6px; background-repeat: no-repeat;
}
.pw-calc input:focus-visible, .pw-calc select:focus-visible {
  outline: 3px solid var(--pwc-ink); outline-offset: 1px;
}
.pw-calc input[aria-invalid="true"] { border-color: var(--pwc-error); border-width: 2px; }
.pwc-error { margin: 4px 0 0 !important; font-size: 13px; line-height: 1.4; color: var(--pwc-error); font-weight: 600; }

.pwc-toggle {
  display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center;
  font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 4px;
}
.pwc-toggle input {
  -webkit-appearance: none; appearance: none; margin: 0; cursor: pointer;
  position: relative; width: 44px; height: 26px; border-radius: 13px;
  background: #8a8a8a; transition: background .15s;
}
.pwc-toggle input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: transform .15s;
}
.pwc-toggle input:checked { background: var(--pwc-ink); }
.pwc-toggle input:checked::after { transform: translateX(18px); background: var(--pwc-gold); }
.pwc-toggle input:focus-visible { outline: 3px solid var(--pwc-ink); outline-offset: 2px; }

/* ---------- Results ---------- */
.pwc-results { min-width: 0; transition: opacity .15s; }
.pwc-stale .pwc-results { opacity: .45; }

.pwc-headline {
  font-family: var(--pwc-head); font-weight: 700;
  font-size: 24px; line-height: 1.25; letter-spacing: -.01em;
  margin: 0 0 6px !important;
}
.pwc-growth-line { font-size: 16px; color: var(--pwc-muted); margin-bottom: 18px !important; }
.pwc-empty .pwc-stats, .pwc-empty .pwc-chart, .pwc-empty .pwc-table { display: none; }

.pwc-stats { margin: 0 0 20px; display: grid; border-top: 1px solid var(--pwc-line); }
.pwc-stat {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--pwc-line);
}
.pwc-stat dt { font-size: 14px; color: var(--pwc-muted); display: flex; align-items: center; gap: 8px; }
.pwc-stat dd { margin: 0; font-family: var(--pwc-head); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.pwc-stat-total dd { font-size: 20px; }
.pwc-key { display: inline-block; width: 14px; height: 10px; flex: none; clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
.pwc-stat-contrib .pwc-key { background: var(--pwc-ink); }
.pwc-stat-growth .pwc-key { background: var(--pwc-gold); }

.pwc-chart { margin: 0 0 8px; }
.pwc-canvas { position: relative; height: 260px; }
.pwc-no-chart .pwc-chart { display: none; }
.pwc-no-chart .pwc-table { display: block; }

.pwc-table { margin: 0 0 28px; font-size: 14px; }
.pwc-table summary {
  cursor: pointer; font-weight: 600; padding: 8px 0; color: var(--pwc-ink);
  text-decoration: underline; text-underline-offset: 3px;
}
.pwc-table summary:focus-visible { outline: 2px solid var(--pwc-ink); outline-offset: 3px; }
.pwc-table-scroll { max-height: 360px; overflow: auto; border: 1px solid var(--pwc-line); }
.pwc-table table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pwc-table th, .pwc-table td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--pwc-line); white-space: nowrap; }
.pwc-table th[scope="row"], .pwc-table thead th:first-child { text-align: left; font-weight: 600; }
.pwc-table thead th { position: sticky; top: 0; background: var(--pwc-tint); font-weight: 600; }

.pwc-note { padding-top: 18px; margin-bottom: 8px; border-top: 1px solid var(--pwc-line); }
.pwc-note h3 { position: relative; padding-left: 26px; font-size: 18px; }
/* 45-degree slash before each heading, as on the rest of the site */
.pwc-note h3::before {
  content: ""; position: absolute; left: 0; top: .32em; width: 16px; height: 12px;
  background: var(--pwc-gold); clip-path: polygon(10px 0, 100% 0, 6px 100%, 0 100%);
}
.pwc-note p:last-child { margin-bottom: 0; }
.pwc-note [data-pwc="basis"] { font-size: 14px; color: var(--pwc-muted); }

/* CTA panel: black, with a 45-degree cut corner and gold slash */
.pwc-cta {
  position: relative; margin: 28px 0 24px; padding: 24px 20px 22px;
  background: var(--pwc-ink); color: #e8e6e1;
  clip-path: polygon(0 0, calc(100% - 32px) 0, 100% 32px, 100% 100%, 0 100%);
}
.pwc-cta::before {
  content: ""; position: absolute; top: 0; right: 0; width: 46px; height: 46px;
  background: var(--pwc-gold); clip-path: polygon(14px 0, 32px 0, 100% 32px, 100% 46px);
}
.pwc-cta p { font-family: var(--pwc-head); font-weight: 600; font-size: 17px; line-height: 1.45; color: #fff; padding-right: 20px; }
.pwc-btn {
  display: block; width: 100%; padding: 15px 20px; border: 0; cursor: pointer;
  background: var(--pwc-gold); color: var(--pwc-ink);
  font-family: var(--pwc-head); font-weight: 700; font-size: 15px; letter-spacing: .02em;
  text-align: center; text-decoration: none; transition: background .15s;
}
.pwc-btn:hover { background: #d8b263; }
.pwc-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.pwc-disclaimer { font-size: 12.5px; line-height: 1.55; color: var(--pwc-muted); margin: 0 !important; }

@media (min-width: 560px) {
  .pwc-stats { grid-template-columns: repeat(3, 1fr); gap: 12px; border-top: 0; }
  .pwc-stat { flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 0 0; border-bottom: 0; border-top: 3px solid var(--pwc-line); }
  .pwc-stat-total { border-top-color: var(--pwc-gold); }
  .pwc-stat dd, .pwc-stat-total dd { font-size: 22px; }
  .pwc-canvas { height: 320px; }
  .pwc-cta { padding: 28px 28px 26px; }
  .pwc-btn { display: inline-block; width: auto; padding: 15px 28px; }
}
@media (min-width: 900px) {
  .pw-calc { padding: 56px 0 80px; }
  .pwc-grid { grid-template-columns: 340px 1fr; gap: 48px; align-items: start; }
  .pwc-inputs { position: sticky; top: 24px; padding: 22px 22px 20px; }
  .pwc-headline { font-size: 32px; }
  .pwc-canvas { height: 340px; }
}
@media (min-width: 1100px) {
  .pwc-grid { grid-template-columns: 360px 1fr; gap: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .pw-calc * { transition: none !important; }
}

/* ---------- Page shell (calculator.html only) ---------- */
.calc-hero { padding-top: 8px; padding-bottom: 28px; }
.calc-hero h1 { color: #fff; font-size: 26px; letter-spacing: -.01em; margin-bottom: 10px; max-width: 780px; }
.calc-hero .subhead { max-width: 640px; }
@media (min-width: 768px) {
  .calc-hero { padding-top: 24px; padding-bottom: 48px; }
  .calc-hero h1 { font-size: 36px; margin-bottom: 14px; }
}
@media (min-width: 1100px) {
  .calc-hero h1 { font-size: 42px; }
}
