/* HonestSums Savings Tracker: app styles (brand v3 "Smiley sum", build/DESIGN.md).
   Phone first: one column, big tap targets. No inline styles anywhere (the site's Content-Security-Policy allows
   style-src 'self' only), so every look lives here. The only styles set from JavaScript go through the CSSOM (the jar
   level and progress bar widths), which the policy allows. */

@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/fredoka.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/assets/fonts/nunito.ttf") format("truetype");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --sun: #FFC845;
  --sun-deep: #F5B417;
  --navy: #1E2A4A;
  --navy-soft: #2D3C63;
  --tomato: #F2603F;
  --tomato-text: #B5381B;   /* tomato dark enough for small text on white (5.6:1) */
  --candy: #F9C4CF;
  --mint: #BFE6D3;
  --paper: #FFFCF4;
  --butter: #FFF1C9;
  --white: #FFFFFF;
  --mute: #5B6478;
  --line: #E8E2D3;
  --line-strong: #CFC6B0;
  --radius: 18px;
  --display: "Fredoka", "Nunito", "Segoe UI", system-ui, sans-serif;
  --body: "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--navy);
  font-family: var(--body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.45;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.2; margin: 0; }
p { margin: 0 0 10px; }
a { color: var(--navy); text-decoration-thickness: 2px; text-underline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--tomato-text); outline-offset: 2px; }
h1:focus, h2:focus { outline: none; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.file-btn { cursor: pointer; }
#import-file:focus-visible + .file-btn { outline: 3px solid var(--tomato-text); outline-offset: 2px; }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; }

/* ------------------------------------------------------------------ top bar */
.topbar {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
}
.topbar-mark { width: 40px; height: 40px; flex: none; }
.topbar-text p { margin: 0; }
.topbar-title { font-family: var(--display); font-size: 1.15rem; line-height: 1.15; }
.topbar-by { font-family: var(--display); font-size: 0.95rem; line-height: 1.1; }
.w-honest { color: var(--navy); }
.w-sums { color: var(--tomato); }

/* ------------------------------------------------------------------ layout */
.main { padding: 16px 16px calc(28px + env(safe-area-inset-bottom)); }
.panel-title { font-size: 1.75rem; margin: 4px 0 4px; }
.panel-sub { color: var(--mute); margin-bottom: 14px; }
.hint { display: block; color: var(--mute); font-size: 0.92rem; margin: 6px 0 0; }
.small { color: var(--mute); font-size: 0.9rem; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 14px;
}
.card-mint { background: #E6F5EE; border-color: var(--mint); }
.card-title { font-size: 1.2rem; margin-bottom: 10px; }
.card p:last-child { margin-bottom: 0; }

.notice { background: var(--candy); border-radius: 14px; padding: 12px 14px; margin: 0 0 14px; font-weight: 700; }

.back {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 44px; padding: 0 12px 0 4px; margin: -6px 0 2px -4px;
  background: none; border: 0; cursor: pointer; color: var(--navy);
  font-weight: 800; font-size: 1rem;
  -webkit-tap-highlight-color: transparent;
}
.back span { font-size: 1.7rem; line-height: 1; margin-top: -3px; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 20px;
  border-radius: 999px; border: 2px solid transparent;
  font-weight: 800; font-size: 1rem; line-height: 1.15; text-align: center;
  cursor: pointer; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--navy); color: var(--sun); }
.btn-primary:hover { background: var(--navy-soft); }
.btn-ghost { background: transparent; border-color: var(--navy); color: var(--navy); }
.btn-ghost:hover { background: rgba(30, 42, 74, 0.06); }
.btn-danger { background: var(--tomato-text); color: var(--white); }
.btn-danger:hover { background: #9C2E14; }
.btn-text-danger { background: transparent; color: var(--tomato-text); padding: 0 10px; margin-left: auto; }
.btn-small { min-height: 44px; padding: 0 16px; font-size: 0.95rem; }
.btn-wide { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.btn-row:first-child { margin-top: 0; }

/* ------------------------------------------------------------------ forms */
.field { margin: 0 0 16px; }
.label { display: block; font-weight: 800; margin-bottom: 6px; }
.input {
  display: block; width: 100%; min-height: 50px;
  padding: 10px 14px;
  font-size: 1.06rem;           /* 17px: stops iPhones zooming in on focus */
  background: var(--white);
  border: 2px solid var(--line-strong);
  border-radius: 12px;
}
.input::placeholder { color: #8A90A0; font-weight: 600; }
.input:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px var(--sun); }
.input[aria-invalid="true"] { border-color: var(--tomato-text); }
.input-code { text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; text-align: center; font-size: 1.3rem; }
.error { color: var(--tomato-text); font-weight: 800; margin: 8px 0 0; }
.confirm { background: #FDE8EC; border: 1px solid var(--candy); border-radius: 14px; padding: 12px 14px; margin-top: 12px; }
fieldset { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
legend { padding: 0; }
.note { background: #E6F5EE; border: 1px solid var(--mint); border-radius: 12px; padding: 10px 12px; font-size: 0.95rem; margin: 0 0 16px; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg-2 { grid-template-columns: 1fr 1fr; }
.seg-opt {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 4px 10px;
  border: 2px solid var(--line-strong); border-radius: 999px; cursor: pointer; font-weight: 800; text-align: center;
  line-height: 1.15;
}
.seg-opt input { width: 20px; height: 20px; margin: 0; accent-color: var(--navy); flex: none; }
.seg-opt:has(input:checked) { border-color: var(--navy); background: var(--butter); }

.plan-list { display: grid; gap: 8px; }
.plan-opt {
  display: flex; align-items: flex-start; gap: 12px; min-height: 52px; padding: 12px 14px;
  border: 2px solid var(--line-strong); border-radius: 14px; cursor: pointer; background: var(--white);
}
.plan-opt input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--navy); flex: none; }
.plan-opt:has(input:checked) { border-color: var(--navy); background: var(--butter); }
.plan-text { display: block; min-width: 0; }
.plan-name { display: block; font-weight: 800; }
.plan-blurb { display: block; color: var(--mute); font-size: 0.88rem; line-height: 1.35; margin-top: 2px; }

.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 16px; }
.chip {
  min-height: 44px; padding: 6px 14px;
  border-radius: 999px; border: 2px solid var(--line-strong);
  background: var(--white); color: var(--navy);
  font-weight: 800; font-size: 0.95rem; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.chip:hover { border-color: var(--navy); }
.fund-row { display: grid; grid-template-columns: 3fr 2fr; gap: 10px; }
.fund-row .field { margin-bottom: 10px; }
.funds-hint { margin: 0 0 12px; }
#more-funds { margin: 0 0 12px; }

/* ------------------------------------------------------------------ unlock screen */
.lock { padding: 24px 16px 40px; }
.lock-card { text-align: center; padding: 28px 20px; }
.lock-mark { width: 72px; height: 72px; margin: 0 auto 14px; display: block; }
.lock-card h1 { font-size: 1.7rem; margin-bottom: 6px; }
.lock-sub { color: var(--mute); margin-bottom: 18px; }
.lock-card form { text-align: left; margin-bottom: 18px; }
.lock-card form .btn { margin-top: 14px; }
.btn-big { min-height: 58px; font-size: 1.15rem; }
.lock-free-note { margin: 8px 0 0; }
.lock-code-part { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px; }
.lock-code-title, .locked-code-title { font-family: var(--body); font-weight: 800; font-size: 1.02rem; line-height: 1.3; margin: 0 0 12px; }
.lock-code-title { text-align: center; }
.locked-code-title { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.label-hint { font-weight: 600; color: var(--mute); }

/* ------------------------------------------------------------------ free mode */
.free-line { text-align: center; color: var(--mute); font-size: 0.92rem; margin: 16px 8px 12px; }
.free-line p { margin: 0 0 2px; }
.free-line a { color: var(--navy); font-weight: 800; }
.link-btn {
  background: none; border: 0; padding: 6px 4px; min-height: 44px; cursor: pointer;
  color: var(--navy); font-weight: 800; font-size: 0.92rem; text-decoration: underline;
  text-decoration-thickness: 2px; text-underline-offset: 2px;
}
.pick-free { background: var(--butter); border-radius: 12px; padding: 10px 12px; font-size: 0.95rem; margin: -4px 0 14px; }
.lock-tag { display: inline-block; vertical-align: -1px; margin-right: 7px; line-height: 0; }
.lock-ico { width: 16px; height: 16px; }
.lock-ico-body { fill: var(--mute); }
.lock-ico-hoop { fill: none; stroke: var(--mute); stroke-width: 2; }
.row.is-locked .row-title { color: var(--navy-soft); }
.badge-free { background: var(--mint); }
.btn-text { background: transparent; color: var(--navy); padding: 0 12px; text-decoration: underline; }

/* ------------------------------------------------------------------ the one-time review ask */
.review {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 40;
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: calc(100% - 32px); max-width: 528px;
  background: var(--white); color: var(--navy);
  border: 1px solid var(--line); border-top: 6px solid var(--sun); border-radius: 16px;
  padding: 14px 16px; box-shadow: 0 10px 30px rgba(30, 42, 74, 0.25);
}
.review p { margin: 0; font-weight: 700; }
.review .btn-row { margin-top: 10px; }

/* ------------------------------------------------------------------ home */
.hero-intro { border-top: 8px solid var(--sun); padding: 20px 18px; }
.hero-title { font-size: 1.6rem; line-height: 1.2; margin-bottom: 10px; }
.hero-intro .btn { margin-top: 6px; }

.list { list-style: none; margin: 0 0 14px; padding: 0; }
.row {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin: 0 0 10px; min-height: 64px;
  -webkit-tap-highlight-color: transparent;
}
.row:hover { border-color: var(--line-strong); }
.row-title { display: block; font-family: var(--display); font-size: 1.15rem; }
.row-meta { display: block; color: var(--mute); font-size: 0.92rem; margin-top: 2px; }
.row.my { border-left: 8px solid var(--sun); }
.row.my.is-complete { border-left-color: var(--mint); background: #F4FBF7; }
.row-figs { display: flex; align-items: baseline; gap: 4px; margin-top: 6px; font-size: 0.95rem; color: var(--mute); }
.row-saved { font-family: var(--display); font-size: 1.25rem; color: var(--navy); }
.row-pct { margin-left: auto; font-weight: 800; color: var(--navy); }

.bar { display: block; height: 12px; margin-top: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; background: var(--sun); border-radius: 999px; }
.is-complete .bar-fill { background: #8FCBAE; }

.badge {
  display: inline-block; font-family: var(--body); font-size: 0.72rem; font-weight: 800; line-height: 1;
  padding: 5px 8px; border-radius: 999px; background: var(--butter); color: var(--navy);
  vertical-align: middle; margin-left: 8px;
}
.group-title { font-size: 1.25rem; margin: 18px 0 10px; }
.group-title:first-child { margin-top: 4px; }

.how summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; margin: 0; min-height: 28px; }
.how summary::-webkit-details-marker { display: none; }
.how summary::after { content: "+"; font-size: 1.5rem; line-height: 1; }
.how[open] summary::after { content: "\2212"; }
.how[open] summary { margin-bottom: 10px; }
.steps { margin: 0; padding-left: 1.3em; }
.steps li { margin-bottom: 8px; }
.steps li:last-child { margin-bottom: 0; }
.privacy-line { text-align: center; color: var(--mute); font-size: 0.9rem; margin-top: 4px; }
.made-by { text-align: center; color: var(--mute); font-size: 0.9rem; margin: 18px 0 6px; }
.a2hs-steps h3 { font-family: var(--body); font-weight: 800; font-size: 1rem; margin: 10px 0 4px; }
.a2hs-steps ol { margin: 0 0 8px; padding-left: 1.3em; }

/* ------------------------------------------------------------------ the pot */
.pot {
  display: grid; grid-template-columns: 104px 1fr; gap: 6px 16px; align-items: center;
  border-top: 8px solid var(--sun);
}
.pot-jar svg { display: block; width: 104px; height: auto; }
.jar-glass { fill: #F7FBFF; }
.jar-line { fill: none; stroke: var(--navy); stroke-width: 3.5; stroke-linejoin: round; }
.jar-lid { fill: var(--navy); }
.jar-level { fill: var(--sun); }
.jar-wave { fill: var(--sun-deep); }
.jar-shine { stroke: #FFFFFF; stroke-width: 4; stroke-linecap: round; opacity: 0.8; }
.jar-fill { transform: translateY(86px); }
.is-full .jar-level { fill: #8FCBAE; }
.is-full .jar-wave { fill: #6FB893; }
.pot-text p { margin: 0; }
.pot-label { color: var(--mute); font-weight: 800; font-size: 0.92rem; }
.pot-big {
  font-family: var(--display); font-size: 2.6rem; line-height: 1.05; margin: 2px 0 4px !important;
  color: var(--tomato);          /* the one tomato pop on this screen (large text) */
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.pot-left { font-weight: 800; font-size: 1.05rem; }
.pot-count { color: var(--mute); font-size: 0.92rem; margin-top: 2px !important; }
.stones { grid-column: 1 / -1; list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stone {
  display: flex; align-items: center; justify-content: center; min-height: 36px;
  border: 2px dashed var(--line-strong); border-radius: 999px; color: var(--mute); font-weight: 800; font-size: 0.92rem;
}
.stone.is-reached { border: 2px solid var(--navy); background: var(--sun); color: var(--navy); }
.stone.is-reached span::before { content: "\2713 "; }

/* ------------------------------------------------------------------ the boxes */
.board-hint { margin: 0 0 12px; text-align: center; }
.boxes-card { padding: 14px 12px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 2px 8px; }
.sec-title { font-size: 1.15rem; }
.sec-fig { color: var(--mute); font-weight: 800; font-size: 0.9rem; white-space: nowrap; }
.sec-fig.is-done { color: #2E7A55; }
.sec-note { color: var(--mute); font-size: 0.88rem; margin: -4px 2px 8px; }

.grid { display: grid; gap: 7px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.grid-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.wd { text-align: center; color: var(--mute); font-weight: 800; font-size: 0.75rem; padding-bottom: 2px; }

.box {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 0; min-height: 56px; padding: 6px 2px;
  background: var(--white); color: var(--navy);
  border: 2px solid #9AA2B6; border-radius: 12px;
  font-weight: 800; line-height: 1.1; text-align: center; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  user-select: none; -webkit-user-select: none;
}
.grid-5 .box { min-height: 54px; }
.grid-3 .box { min-height: 64px; }
.grid-7 .box { min-height: 44px; padding: 3px 1px; border-radius: 10px; border-width: 1.5px; }
.box-a { font-family: var(--display); font-weight: 600; font-size: 1.12rem; font-variant-numeric: tabular-nums; }
.box-long .box-a { font-size: 0.9rem; }
.box-l { font-size: 0.78rem; color: var(--mute); }
.box-s { font-size: 0.7rem; color: var(--mute); font-weight: 700; }
.box-day { font-family: var(--display); font-weight: 600; font-size: 1rem; }
.box-p { font-size: 0.66rem; color: var(--mute); }
.box.is-weekend { background: #FBF8EF; }
.box.is-now { border-color: var(--tomato-text); box-shadow: 0 0 0 2px var(--tomato-text); }

/* coloured in: three pencil colours taking turns, plus a tick so it never relies on colour alone */
.box.is-on { border-color: var(--navy); }
.box.is-on.c0 { background: var(--sun); }
.box.is-on.c1 { background: var(--candy); }
.box.is-on.c2 { background: var(--mint); }
.box.is-on .box-l, .box.is-on .box-s, .box.is-on .box-p { color: var(--navy); }
.box.is-on::after {
  content: "\2713"; position: absolute; top: 2px; right: 4px;
  font-size: 0.72rem; font-weight: 900; color: var(--navy); line-height: 1;
}
.grid-7 .box.is-on::after { top: 1px; right: 2px; font-size: 0.6rem; }

/* ------------------------------------------------------------------ dice games (Roll and Save 2027) */
.dice-card { text-align: center; border-top: 8px solid var(--tomato); padding: 14px 16px 16px; }
.dice-show { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 2px 0 10px; }
.die { display: block; }
.die-face { fill: var(--white); stroke: var(--navy); stroke-width: 5; }
.die-pip { fill: var(--navy); }
.die-big { width: 64px; height: 64px; }
.dice-total { font-family: var(--display); font-weight: 600; font-size: 2.6rem; line-height: 1; color: var(--tomato); min-width: 1.6em; }
.dice-msg { font-weight: 800; font-size: 1.02rem; margin: 0 0 12px; min-height: 2.9em; display: flex; align-items: center; justify-content: center; }
.dice-card.is-any .dice-msg { color: var(--tomato-text); }
.dice-card.is-miss .dice-msg { color: var(--mute); }
#roll:disabled { opacity: 0.45; cursor: default; }

.dice-board { padding: 12px 10px; }
.dice-row { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.dice-row:last-child { margin-bottom: 0; }
.dice-lab {
  flex: none; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--navy); color: var(--sun);
  font-family: var(--display); font-weight: 600; font-size: 1.1rem; line-height: 1;
}
.dice-lab-die { background: none; }
.dice-lab-die .die { width: 34px; height: 34px; }
.dice-boxes { flex: 1; min-width: 0; display: flex; justify-content: center; gap: 5px; }
.dice-boxes .box { flex: 0 0 calc((100% - 25px) / 6); min-height: 46px; padding: 4px 1px; }
.dice-w5 .dice-boxes .box { flex-basis: calc((100% - 20px) / 5); }
.dice-boxes .box-a { font-size: 1.05rem; }

/* lit: the free boxes the last roll allows. The others step back a little until a box is coloured. */
.box.is-lit { border-color: var(--tomato); background: var(--butter); box-shadow: 0 0 0 3px var(--sun); }
.dice-board.has-lit .box:not(.is-lit):not(.is-on) { opacity: 0.5; }

/* ------------------------------------------------------------------ dialogs (bottom sheets on phones) */
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  margin: auto auto 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  border: 0; border-radius: 22px 22px 0 0;
  background: var(--white); color: var(--navy);
}
.sheet[open]:not(:modal) { position: fixed; inset: auto 0 0 0; z-index: 30; box-shadow: 0 -10px 40px rgba(30, 42, 74, 0.3); }
.sheet::backdrop { background: rgba(30, 42, 74, 0.45); }
.sheet-title { font-size: 1.4rem; margin-bottom: 6px; }
.sheet-blurb { color: var(--mute); margin-bottom: 14px; }
.sheet .btn-row {
  position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); z-index: 1;
  margin: 12px -16px calc(-20px - env(safe-area-inset-bottom));
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--white); border-top: 1px solid var(--line);
}
@media (min-width: 600px) {
  .sheet { margin: auto; border-radius: 22px; }
}

/* ------------------------------------------------------------------ the cheer */
.party {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(30, 42, 74, 0.5);
}
.party-card {
  position: relative; z-index: 2; width: 100%; max-width: 360px;
  background: var(--white); border-radius: 24px; padding: 26px 22px 20px; text-align: center;
  border-top: 10px solid var(--sun);
  box-shadow: 0 20px 50px rgba(30, 42, 74, 0.35);
}
.party-mark { width: 64px; height: 64px; display: block; margin: 0 auto 6px; }
.party-pct { font-family: var(--display); font-size: 3rem; line-height: 1; color: var(--tomato); margin: 0 0 6px; }
.party-title { font-size: 1.5rem; margin-bottom: 8px; }
.party-card .btn { margin-top: 8px; }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; background: var(--sun); opacity: 0; }
.confetti i:nth-child(3n) { background: var(--tomato); }
.confetti i:nth-child(3n+1) { background: var(--mint); width: 12px; height: 12px; border-radius: 50%; }
.confetti i:nth-child(4n) { background: var(--candy); }
.confetti i:nth-child(1) { left: 4%; }  .confetti i:nth-child(2) { left: 9%; }  .confetti i:nth-child(3) { left: 15%; }
.confetti i:nth-child(4) { left: 21%; } .confetti i:nth-child(5) { left: 26%; } .confetti i:nth-child(6) { left: 31%; }
.confetti i:nth-child(7) { left: 37%; } .confetti i:nth-child(8) { left: 42%; } .confetti i:nth-child(9) { left: 47%; }
.confetti i:nth-child(10) { left: 52%; } .confetti i:nth-child(11) { left: 57%; } .confetti i:nth-child(12) { left: 62%; }
.confetti i:nth-child(13) { left: 67%; } .confetti i:nth-child(14) { left: 72%; } .confetti i:nth-child(15) { left: 77%; }
.confetti i:nth-child(16) { left: 82%; } .confetti i:nth-child(17) { left: 87%; } .confetti i:nth-child(18) { left: 91%; }
.confetti i:nth-child(19) { left: 95%; } .confetti i:nth-child(20) { left: 98%; }
.party-card { animation: none; }

/* ------------------------------------------------------------------ toast */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 40;
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: calc(100% - 32px); max-width: 528px;
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  background: var(--navy); color: var(--paper);
  border-radius: 14px; padding: 12px 14px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(30, 42, 74, 0.3);
}
.toast-btn { flex: none; background: var(--sun); color: var(--navy); border: 0; border-radius: 999px; min-height: 40px; padding: 0 14px; font-weight: 800; cursor: pointer; }

@media (min-width: 600px) {
  .main { padding-left: 20px; padding-right: 20px; }
  .pot-big { font-size: 3rem; }
  .grid-5 .box { min-height: 62px; }
}

/* ------------------------------------------------------------------ motion (only for people who haven't asked for less) */
@media (prefers-reduced-motion: no-preference) {
  .btn, .chip, .seg-opt, .plan-opt, .box { transition: background-color 0.15s ease, border-color 0.15s ease; }
  .jar-fill { transition: transform 0.6s cubic-bezier(0.3, 1.4, 0.5, 1); }
  .no-anim .jar-fill { transition: none; }
  .bar-fill { transition: width 0.4s ease; }
  .box.pop { animation: pop 0.32s ease; }
  .party-card { animation: rise 0.4s cubic-bezier(0.3, 1.5, 0.5, 1); }
  .confetti i { animation: fall 2.6s ease-in forwards; }
  .confetti i:nth-child(2n) { animation-duration: 3.1s; animation-delay: 0.15s; }
  .confetti i:nth-child(3n) { animation-duration: 2.3s; animation-delay: 0.3s; }
  .confetti i:nth-child(5n) { animation-delay: 0.45s; }
  .confetti i:nth-child(7n) { animation-duration: 3.4s; }
  .is-big .confetti i { animation-iteration-count: 2; }
  .dice-show.is-rolling .die { animation: tumble 0.45s cubic-bezier(0.3, 1.4, 0.5, 1); }
  .dice-show.is-rolling .die:nth-child(2) { animation-duration: 0.55s; }
  .box.is-lit { animation: glow 1.4s ease-in-out 2; }
}
@keyframes tumble {
  0% { transform: rotate(-200deg) scale(0.6); }
  100% { transform: none; }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 3px var(--sun); }
  50% { box-shadow: 0 0 0 6px var(--sun); }
}
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.14) rotate(-3deg); }
  100% { transform: scale(1); }
}
@keyframes rise {
  0% { transform: translateY(30px) scale(0.9); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
@keyframes fall {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(105vh) rotate(540deg); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .confetti { display: none; }
}
@media print {
  .toast, .topbar, .btn, .btn-row, .back, .party, .review { display: none !important; }
  .main { padding: 0; }
}

/* ---------------------------------------------------------------- make your own (CR-040): two- and four-way choices */
.seg-2 { grid-template-columns: repeat(2, 1fr); }
.seg-4 { grid-template-columns: repeat(2, 1fr); }

/* ---------------------------------------------------------------- make your own first (CR-040, round 2) */
.own-card { background: var(--butter); border: 2px solid var(--sun); padding: 18px; }
.own-title { font-size: 1.35rem; margin-bottom: 4px; }
.own-line { color: var(--navy); font-weight: 700; margin-bottom: 12px; }
.own-card .lock-ico-body { fill: var(--sun); }
.own-card .lock-ico-hoop { stroke: var(--sun); }
.row.row-own { background: var(--butter); border: 2px solid var(--sun); }
.list-own { margin-bottom: 8px; }
.print-hint { margin: 8px 0 0; }

/* ---------------------------------------------------------------- print my challenge (CR-040)
   The print view is built by app.js from the board and only shown while printing (body.printing). Sizes are in mm.
   Round 2 (Niall's iPhone, 20 Nov 2026): every sheet is 180 x 250 mm, the area iPhone Safari leaves inside its own
   margins (about 14 mm each side) and its footer, so Safari no longer shrinks the page (it printed a 210 mm-wide page
   at 87%) or spills a sheet onto a blank page; A6 cards come out at a true 105 x 148 mm. Chrome and Edge get the same
   area from the @page margins below; iPhone Safari (the only browser that knows -webkit-touch-callout) gets margin 0,
   as measured on Niall's phone, so its own margins are never added to ours. Nothing on the print view is 100vh or
   wider than the sheet, and the last sheet has no page break after it, so no blank pages.
   Black and white friendly: navy text and outlines, coloured boxes print grey with a tick. */
@page { size: A4; margin: 22mm 15mm; }
@supports (-webkit-touch-callout: none) { @page { size: A4; margin: 0; } }
.print-view { display: none; }
@media print {
  html, body { height: auto !important; min-height: 0 !important; }
  body:not(.printing) .main { padding: 10mm; }
  body.printing { background: #FFFFFF; margin: 0; padding: 0; overflow: visible; }
  body.printing > :not(.print-view) { display: none !important; }
  body.printing .print-view { display: block; width: 180mm; margin: 0; padding: 0; }
}
.pp-sheet {
  position: relative; width: 180mm; height: 250mm; overflow: hidden; background: #FFFFFF; color: var(--navy);
  font-family: var(--body); break-after: page; page-break-after: always; break-inside: avoid; page-break-inside: avoid;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.pp-sheet:last-child { break-after: auto; page-break-after: auto; }
.pp-t { position: absolute; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.pp-right { text-align: right; }
.pp-centre { text-align: center; }
/* the header band, as on the printables: butter, rounded, the logo by a small spaced-out heading */
.pp-band { position: absolute; background: var(--butter); border-radius: 3.5mm; }
.pp-eyebrow, .pp-c-eyebrow { font-weight: 800; font-size: 7.5pt; letter-spacing: 0.16em; text-transform: uppercase; }
.pp-eye-mark { width: 3.4mm; height: 3.4mm; vertical-align: -0.6mm; margin-right: 1.6mm; }
.pp-title { font-family: var(--display); font-weight: 600; font-size: 21pt; line-height: 1.15; }
.pp-goal-label { font-weight: 800; font-size: 7.5pt; letter-spacing: 0.16em; text-transform: uppercase; }
.pp-goal { font-family: var(--display); font-weight: 600; font-size: 21pt; line-height: 1.15; color: var(--tomato); }
.pp-cont { font-family: var(--display); font-weight: 600; font-size: 12pt; }
.pp-sub { font-size: 9.5pt; color: #4E5669; }
.pp-total { color: var(--tomato); font-family: var(--display); font-weight: 600; font-size: 1.25em; }
.pp-sums { font-size: 10pt; font-weight: 700; }
.pp-saved { font-size: 9pt; color: #4E5669; }
/* boxes */
.pp-box, .pp-cbox {
  position: absolute; border: 0.3mm solid #9AA2B6; border-radius: 2mm; background: #FFFFFF; display: flex;
  flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow: hidden;
}
.pp-l { position: absolute; left: 1.2mm; right: 3.6mm; top: 0.7mm; font-size: 6.5pt; line-height: 1.08; color: #4E5669;
  text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-s { position: absolute; left: 1.2mm; top: 3.6mm; font-size: 6pt; color: #4E5669; white-space: nowrap; }
.pp-amt, .pp-camt { font-weight: 800; line-height: 1; white-space: nowrap; }
.pp-run { position: absolute; right: 1.2mm; bottom: 0.6mm; font-size: 5.8pt; color: #4E5669; white-space: nowrap; }
.pp-big .pp-l { font-size: 8pt; left: 2mm; top: 1.4mm; }
.pp-big .pp-s { font-size: 7pt; left: 2mm; top: 5.2mm; }
.pp-big .pp-run { font-size: 7pt; right: 2mm; bottom: 1.4mm; }
.pp-small .pp-l { font-size: 5.6pt; left: 0.8mm; right: 0.8mm; }
.pp-small.is-done .pp-l { right: 3.2mm; }
.pp-small .pp-run { font-size: 5.5pt; right: 0.8mm; }
.pp-box.is-done, .pp-cbox.is-done { background: #E4E4E4; }
.pp-tick { position: absolute; right: 0.8mm; top: 0.2mm; font-size: 8pt; font-weight: 800; line-height: 1.2; }
/* the printables' list (dated plans of up to 26 paydays) */
.pp-cap { font-size: 7.5pt; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #4E5669; }
.pp-shade { position: absolute; background: #FBF8EF; border-radius: 1.5mm; }
.pp-r-l { font-family: var(--display); font-weight: 600; font-size: 11.5pt; }
.pp-r-s { font-size: 7.5pt; color: #4E5669; }
.pp-r-run { font-weight: 800; font-size: 10pt; }
.pp-write { position: absolute; border-top: 0.25mm solid #C3C8D4; }
/* the thermometer */
.pp-th-label { font-weight: 800; font-size: 8.5pt; }
.pp-th-goal { font-family: var(--display); font-weight: 600; font-size: 12pt; }
.pp-tube { position: absolute; border: 0.35mm solid var(--navy); border-radius: 5mm; background: #FFFFFF; }
.pp-band-line { position: absolute; border-left: 0.25mm solid #9AA2B6; }
.pp-th-step { font-size: 7pt; color: #4E5669; }
.pp-bulb { position: absolute; border: 0.35mm solid var(--navy); border-radius: 50%; background: #FFFFFF; display: flex;
  align-items: center; justify-content: center; font-size: 6.5pt; font-weight: 800; }
/* the footer, as on the printables */
.pp-rule { position: absolute; border-top: 0.25mm solid var(--line); }
.pp-word { font-family: var(--display); font-weight: 600; font-size: 9pt; overflow: visible; }
.pp-word-mark { width: 4.2mm; height: 4.2mm; vertical-align: -1.1mm; margin-right: 1.2mm; }
.pp-foot { font-size: 7.5pt; color: #4E5669; }
/* A6 cards, two to a sheet turned on their side */
.pp-cut { position: absolute; left: 0; top: 0; }
.pp-dash { stroke: #9AA2B6; stroke-width: 0.25; stroke-dasharray: 2 1.5; }
.pp-card-edge { fill: none; stroke: #CFC6B0; stroke-width: 0.2; }
.pp-cut-note { font-size: 7.5pt; color: #4E5669; }
.pp-card { position: absolute; }
.pp-rot { transform-origin: 0 0; }               /* app.js sets the transform: down to its slot, a quarter turn left */
.pp-c-eyebrow { font-size: 6pt; letter-spacing: 0.12em; }
.pp-c-eyebrow .pp-eye-mark { width: 2.8mm; height: 2.8mm; }
.pp-c-no { font-size: 6.5pt; color: #4E5669; }
.pp-c-title { font-family: var(--display); font-weight: 600; font-size: 15pt; line-height: 1.15; }
.pp-c-goal { font-family: var(--display); font-weight: 600; font-size: 13pt; color: var(--tomato); }
.pp-c-sub { font-size: 7pt; color: #4E5669; }
.pp-cbox { border-radius: 1.6mm; }
.pp-cbox .pp-l { font-size: 5.5pt; left: 0.9mm; right: 0.9mm; top: 0.5mm; }
.pp-cbox.is-done .pp-l { right: 3.4mm; }
.pp-c-total { font-size: 8.5pt; font-weight: 700; }
.pp-c-prog { font-size: 6.5pt; font-weight: 800; }
.pp-prog { position: absolute; border: 0.25mm solid #9AA2B6; border-radius: 1mm; display: flex; align-items: center;
  justify-content: center; font-size: 6pt; color: #4E5669; }
.pp-c-word { font-size: 7.5pt; }
.pp-c-word .pp-word-mark { width: 3.4mm; height: 3.4mm; vertical-align: -0.9mm; }
.pp-c-site { font-size: 6.5pt; color: #4E5669; }
