/* Pennies To Pots — free calculator site, 2026/27
   Brand: navy #143259, cream #FEF5E4, gold #C38B28, sage #919B75, inputs #F0E2B8 */

:root {
  --navy: #143259;
  --navy-mid: #28456d;
  --navy-dark: #18345b;
  --cream: #fef5e4;
  --cream-deep: #f6e7c9;
  --gold: #c38b28;
  --gold-rule: #c19a50;
  --gold-soft: #dca34d;
  --sage: #919b75;
  --sage-deep: #6f7856;
  --input: #f0e2b8;
  --ink: #143259;
  --muted: #4a5a73;
  --line: rgba(20, 50, 89, 0.14);
  --white: #fffdf8;
  --danger: #8b3a2a;
  --radius: 10px;
  --max: 1120px;
  --header-h: 4.5rem;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--navy);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--gold); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

h1, h2, h3, h4, .serif {
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", "Book Antiqua", Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: var(--navy);
  margin: 0 0 0.6rem;
}

h1 { font-size: clamp(1.7rem, 3vw, 2.35rem); }
h2 { font-size: clamp(1.25rem, 2vw, 1.55rem); }
h3 { font-size: 1.1rem; }

p { margin: 0 0 0.9rem; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }
.tiny { font-size: 0.82rem; color: var(--muted); }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy);
  color: var(--cream);
  padding: 0.5rem 0.8rem;
  z-index: 100;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- Header ---------- */
.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header::after {
  content: "";
  display: block;
  height: 3px;
  background: var(--gold-rule);
}

.header-inner, .wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding: 0.55rem 0;
}

.logo-link {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  text-decoration: none;
}
.logo-link img {
  height: 48px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
  object-position: left center;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem 0.2rem;
}
.nav a {
  text-decoration: none;
  color: var(--navy);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
}
.nav a:hover, .nav a[aria-current="page"] {
  background: var(--navy);
  color: var(--cream);
}

/* ---------- Page intro ---------- */
.page {
  padding: 1.6rem 0 3rem;
}

.kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.lede {
  font-size: 1.05rem;
  max-width: 46rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  margin: 0.8rem 0 1.4rem;
}
.pill {
  display: inline-block;
  background: var(--navy);
  color: var(--cream);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
}
.pill.gold {
  background: var(--gold);
  color: var(--navy-dark);
}
.pill.sage {
  background: var(--sage);
  color: var(--navy-dark);
}
.pill.plain {
  background: var(--cream-deep);
  color: var(--navy);
  border: 1px solid var(--line);
}

.notice {
  background: var(--white);
  border-left: 4px solid var(--gold);
  padding: 0.85rem 1rem;
  margin: 0 0 1.4rem;
  max-width: 46rem;
}
.notice p:last-child { margin-bottom: 0; }

.example-banner {
  background: var(--navy);
  color: var(--cream);
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  border-top: 3px solid var(--gold);
  margin: 0 0 1.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.example-banner[hidden] { display: none; }
.example-banner p { margin: 0; color: var(--cream); }
.example-banner strong { color: var(--gold-soft); }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1.5rem;
  align-items: start;
}
.panel, .results {
  min-width: 0;
}
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.3rem;
}
.results { display: flex; flex-direction: column; gap: 1rem; }

@media (max-width: 840px) {
  .layout { grid-template-columns: 1fr; }
}

/* ---------- Forms ---------- */
fieldset {
  border: 0;
  margin: 0 0 1.1rem;
  padding: 0;
}
legend, .group-title {
  font-family: Palatino, "Palatino Linotype", Georgia, serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--navy);
  padding: 0;
  margin: 0 0 0.7rem;
  width: 100%;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--gold-rule);
}

.field {
  margin: 0 0 0.85rem;
}
.field label, .check label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.28rem;
}
.hint {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 0.2rem;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  max-width: 100%;
  font: inherit;
  font-size: 16px; /* stop iOS zoom */
  color: var(--navy);
  background: var(--input);
  border: 1px solid #c9b57a;
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%),
    linear-gradient(135deg, var(--navy) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 1.8rem;
}
input:disabled, select:disabled {
  opacity: 0.55;
}

.pound {
  position: relative;
}
.pound input {
  padding-left: 1.45rem;
}
.pound::before {
  content: "£";
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--navy);
  font-weight: 600;
  pointer-events: none;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.6rem 0;
}
.check input[type="checkbox"],
.check input[type="radio"] {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.15rem 0 0;
  accent-color: var(--navy);
  flex: 0 0 auto;
}
.check label { margin: 0; font-weight: 500; }

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.2rem 0 0.4rem;
}
.toggle-row label {
  flex: 1 1 auto;
  min-width: 9rem;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.toggle-row input { accent-color: var(--navy); }
.toggle-row label:has(input:checked) {
  background: var(--navy);
  color: var(--cream);
  border-color: var(--navy);
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}
@media (max-width: 560px) {
  .row-2 { grid-template-columns: 1fr; }
}

/* ---------- Result cards (navy, gold rule) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.7rem;
}

.card {
  background: var(--navy);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 0.9rem 1rem 1rem;
  box-shadow: 0 1px 0 rgba(20, 50, 89, 0.08);
  position: relative;
  min-width: 0;
}
.card::before {
  content: "";
  display: block;
  height: 3px;
  background: var(--gold);
  border-radius: 3px 3px 0 0;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
}
.card .label {
  color: #f0e2b8;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0 0 0.25rem;
  line-height: 1.3;
}
.card .value {
  font-family: Palatino, "Palatino Linotype", Georgia, serif;
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  font-weight: 600;
  color: var(--cream);
  margin: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.15;
}
.card .sub {
  color: #d9c9a0;
  font-size: 0.82rem;
  margin: 0.35rem 0 0;
  line-height: 1.5;
}
.card.sage { background: #3f4a32; }
.card.sage::before { background: var(--sage); }

.headline-card .value { font-size: clamp(1.5rem, 3vw, 2rem); }

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}
@media (max-width: 560px) {
  .pair, .cards { grid-template-columns: 1fr; }
}

/* cream result block */
.block {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.15rem;
  min-width: 0;
}
.block h2, .block h3 { margin-top: 0; }

/* Threshold list */
.thresholds { list-style: none; margin: 0; padding: 0; }
.thresholds li {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 0.75rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.thresholds li:first-child { border-top: 0; padding-top: 0.15rem; }
.marker {
  width: 8px;
  border-radius: 8px;
  background: var(--sage);
  margin: 0.2rem 0;
}
.marker.over { background: var(--gold); }
.marker.trap { background: #b5533c; }
.marker.ok { background: var(--sage); }
.marker.near { background: var(--gold-soft); }
.th-title {
  font-weight: 700;
  margin: 0 0 0.15rem;
  font-size: 0.98rem;
}
.th-meta {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}
.status-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  margin-left: 0.35rem;
  vertical-align: middle;
  background: var(--cream-deep);
  color: var(--navy);
}
.status-tag.over { background: var(--gold); color: var(--navy-dark); }
.status-tag.trap { background: #b5533c; color: var(--cream); }

/* Compare table */
.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.compare th, .compare td {
  text-align: left;
  padding: 0.45rem 0.5rem 0.45rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.compare th { font-weight: 600; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.compare td.num, .compare th.num { text-align: right; font-variant-numeric: tabular-nums; }
.compare .total td { font-weight: 700; border-bottom: 0; padding-top: 0.65rem; }

/* Wide tables scroll inside their own box instead of widening the page (Safari/WebKit on phones) */
.table-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.table-scroll .year-table { min-width: 620px; }

/* CTA */
.cta {
  display: inline-block;
  background: var(--gold);
  color: var(--navy-dark);
  font-weight: 700;
  text-decoration: none;
  padding: 0.75rem 1.15rem;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
}
.cta:hover { background: var(--gold-soft); color: var(--navy-dark); }
.cta-wrap { margin: 0.4rem 0 0; }
.cta-note { margin: 0.55rem 0 0; }

button.linkish, .text-btn {
  background: none;
  border: 0;
  color: var(--navy);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  padding: 0;
}

/* Home */
.hero {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.4rem 1.8rem;
  align-items: center;
  margin: 0 0 1.8rem;
}
.hero-logo { width: 160px; }
.tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.tool-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.2rem 1.3rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-top: 4px solid var(--gold);
}
.tool-card:hover { border-color: var(--navy); border-top-color: var(--gold); color: inherit; }
.tool-card h2 { margin-bottom: 0.4rem; }
.tool-card p { flex: 1; }
.tool-card .cta { margin-top: 0.6rem; align-self: flex-start; }

.cards-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 860px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.7rem 0 0.55rem;
  }
  .nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.2rem 0.3rem;
    justify-content: stretch;
  }
  .logo-link img { height: 42px; max-width: 220px; }
  .nav a {
    padding: 0.4rem 0.45rem;
    font-size: 0.82rem;
    text-align: center;
    white-space: normal;
    line-height: 1.25;
  }
}

@media (max-width: 700px) {
  .hero { grid-template-columns: 1fr; justify-items: start; }
  .hero-logo { width: 120px; }
  .tools { grid-template-columns: 1fr; }
  .cards-3 { grid-template-columns: 1fr; }
}

/* Find out more + legal */
.more, .legal {
  margin-top: 2.4rem;
  padding-top: 1.4rem;
  border-top: 3px solid var(--gold-rule);
}
.more h2, .legal h2 { margin-bottom: 0.7rem; }
.more ul {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 1.5rem;
}
.more li {
  break-inside: avoid;
  padding: 0.28rem 0 0.28rem 0.9rem;
  position: relative;
}
.more li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7rem;
  width: 0.45rem;
  height: 0.45rem;
  background: var(--gold);
  border-radius: 50%;
}
@media (max-width: 640px) {
  .more ul { columns: 1; }
}

.legal-block { margin: 0 0 1.1rem; max-width: 50rem; }
.legal-block h3 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--line);
}
.legal-block p:last-child { margin-bottom: 0; }

.site-footer {
  background: var(--navy);
  color: var(--cream);
  padding: 1.3rem 0 1.6rem;
  border-top: 3px solid var(--gold);
}
.site-footer p { margin: 0 0 0.4rem; color: #efe4c8; font-size: 0.88rem; }
.site-footer a { color: var(--gold-soft); }
.site-footer a:hover { color: var(--cream); }

.empty {
  background: var(--white);
  border: 1px dashed #c9b57a;
  border-radius: var(--radius);
  padding: 1.2rem;
  color: var(--muted);
}

#childcare-fields[hidden], #paye-tax-field[hidden] { display: none !important; }

@media print {
  .site-header { position: static; }
  .cta, .nav { display: none; }
  .card { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

.load-example-row {
  margin: 0 0 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}
.load-example-row .cta { border: 0; font: inherit; cursor: pointer; }

/* ---------- Five calculators in the nav (mobile: 2 columns, odd last item full width) ---------- */
@media (max-width: 860px) {
  .nav a:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 861px) and (max-width: 1180px) {
  .nav a { padding: 0.4rem 0.55rem; font-size: 0.86rem; }
}
/* Eight links (Home plus seven calculators): keep them on one row from 1280px up. */
@media (min-width: 1181px) {
  .logo-link img { height: 42px; max-width: 200px; }
  .nav { gap: 0.1rem 0; }
  .nav a { padding: 0.35rem 0.32rem; font-size: 0.8rem; }
}
@media (min-width: 1480px) {
  .logo-link img { height: 48px; max-width: 260px; }
  .nav { gap: 0.15rem 0.05rem; }
  .nav a { padding: 0.4rem 0.42rem; font-size: 0.86rem; }
}

/* Absurdly large results (for example a 1000% growth rate over 60 years) wrap inside the text instead of widening the page */
main p, main li { overflow-wrap: anywhere; }
