/* The stories, tools and guides: the same look as the home page (app/home.html). */
:root {
  --ink: #1b2559;
  --ink-2: #444f80;
  --muted: #6b759c;
  --line: #e3e8f6;
  --bg: #f6f9ff;
  --card: #fff;
  --blue: #3d5bf5;
  --blue-d: #2a43c9;
  --blue-soft: #e8edff;
  --gold: #ffc22e;
  --gold-d: #e39300;
  --gold-soft: #fff4d6;
  --orange: #ff8a1f;
  --green: #22c38e;
  --green-d: #129468;
  --green-soft: #ddf7ec;
  --pink: #ff7aa8;
  --purple: #8a6bff;
  --shadow: 0 1px 0 rgba(27, 37, 89, 0.04), 0 14px 34px -18px rgba(27, 37, 89, 0.35);
  --shadow-lg: 0 30px 70px -28px rgba(27, 37, 89, 0.5);
  --display: 'Fredoka', 'Nunito', ui-rounded, system-ui, sans-serif;
  --body: 'Nunito', ui-rounded, system-ui, sans-serif;
  color-scheme: light;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 90px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 600 17px/1.6 var(--body);
  overflow-x: hidden;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: var(--blue-d);
}
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
p {
  margin: 0;
  text-wrap: pretty;
}
.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 720px) {
  .wrap {
    padding: 0 24px;
  }
}
.narrow {
  max-width: 760px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

/* Buttons */
.btn {
  --b: var(--blue);
  --bd: var(--blue-d);
  --fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 16px;
  border: 0;
  background: var(--b);
  color: var(--fg);
  font: 600 17px/1.1 var(--display);
  text-decoration: none;
  box-shadow: 0 5px 0 var(--bd), 0 16px 26px -14px rgba(27, 37, 89, 0.55);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.2s;
  cursor: pointer;
}
.btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--bd), 0 6px 12px -8px rgba(27, 37, 89, 0.5);
}
.btn[disabled] {
  opacity: 0.55;
  cursor: default;
  transform: none;
}
.btn-gold {
  --b: linear-gradient(180deg, #ffd45a, #ffb21e);
  --bd: var(--gold-d);
  --fg: #5a3500;
}
.btn-white {
  --b: #fff;
  --bd: #c9d6f5;
  --fg: var(--ink);
}
.btn-green {
  --b: var(--green);
  --bd: var(--green-d);
}
.btn-sm {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 15px;
  border-radius: 13px;
  box-shadow: 0 4px 0 var(--bd), 0 10px 18px -12px rgba(27, 37, 89, 0.5);
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 249, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 rgba(27, 37, 89, 0.08);
}
.top .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 20px;
  row-gap: 2px;
  padding-top: 10px;
  padding-bottom: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-inline-end: auto;
  text-decoration: none;
  color: var(--ink);
  font: 700 21px/1 var(--display);
}
.brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.brand b {
  color: var(--orange);
  font-weight: 700;
}
.nav {
  display: flex;
  gap: 18px;
}
.nav a {
  padding: 6px 0;
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
}
.nav a:hover,
.nav a[aria-current] {
  color: var(--blue);
}
@media (max-width: 720px) {
  .nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }
}

/* Page heading */
.hero {
  padding: clamp(32px, 6vw, 64px) 0 clamp(24px, 4vw, 40px);
  background: linear-gradient(180deg, #d5e6ff 0%, #e8f1ff 55%, var(--bg) 100%);
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.3rem);
}
.hero .lede {
  margin-top: 14px;
  max-width: 40em;
  font-size: clamp(1.05rem, 1.7vw, 1.2rem);
  color: var(--ink-2);
}
.crumb {
  display: inline-block;
  margin-bottom: 12px;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 8px 12px 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font-weight: 800;
  font-size: 14px;
  box-shadow: var(--shadow);
}
.tag.fiction {
  background: #fff1f6;
  color: #a4264f;
}

section.block {
  padding: clamp(24px, 5vw, 48px) 0;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s;
}
a.card:hover {
  transform: translateY(-4px);
}
.card .pic {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--blue-soft);
}
.card .body {
  display: grid;
  gap: 6px;
  padding: 18px 20px 22px;
}
.card .icon {
  width: 60px;
  height: 60px;
}
.card h2,
.card h3 {
  font-size: 1.28rem;
}
.card p {
  font-size: 15.5px;
  color: var(--ink-2);
}
.card .meta {
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
}

/* Reading */
.prose {
  font-size: 18px;
  line-height: 1.68;
}
.prose > * + * {
  margin-top: 1em;
}
.prose h2 {
  margin-top: 1.7em;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
}
.prose h3 {
  margin-top: 1.4em;
  font-size: 1.25rem;
}
.prose ul,
.prose ol {
  padding-inline-start: 1.3em;
}
.prose li + li {
  margin-top: 0.35em;
}
.prose figure {
  margin: 1.4em 0;
}
.table-scroll {
  overflow-x: auto;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}
.prose th,
.prose td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
}
.prose tr:last-child td {
  border-bottom: 0;
}
.prose th {
  font-family: var(--display);
  font-weight: 600;
  background: var(--blue-soft);
}
.prose .note {
  font-size: 15px;
  color: var(--muted);
}
.story {
  font-size: 20px;
  line-height: 1.72;
}
.story p + p {
  margin-top: 0.85em;
}
.cover {
  margin: 0 0 28px;
  overflow: hidden;
  border-radius: 28px;
  border: 6px solid #fff;
  box-shadow: var(--shadow-lg);
}
.cover img {
  width: 100%;
}
.panel {
  padding: 22px 24px;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}
.panel.gold {
  background: var(--gold-soft);
}
.panel.green {
  background: var(--green-soft);
}
.panel h2,
.panel h3 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}
.panel ul {
  margin: 0;
  padding-inline-start: 1.2em;
}
.panel + .panel {
  margin-top: 16px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

/* The call to action at the foot of a page */
.band {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(16px, 4vw, 36px);
  align-items: center;
  padding: clamp(24px, 4vw, 44px);
  border-radius: 32px;
  background: linear-gradient(135deg, #4d86ff 0%, var(--blue) 55%, #5b3df5 100%);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.band > img {
  width: clamp(96px, 15vw, 170px);
}
.band h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
}
.band p {
  margin-top: 8px;
  color: #e3e9ff;
}
.band .btn-row {
  margin-top: 18px;
}
.band small {
  display: block;
  margin-top: 16px;
  color: #d3dcff;
  font-size: 14px;
}
@media (max-width: 640px) {
  .band {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }
  .band .btn-row {
    justify-content: center;
  }
}

/* Footer */
footer {
  padding: 44px 0 40px;
  color: var(--muted);
  font-size: 15px;
}
footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  justify-content: space-between;
}
footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
footer a {
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 800;
}
footer a:hover {
  color: var(--blue);
}

/* Forms in the tools */
.field {
  display: grid;
  gap: 5px;
  font-weight: 800;
  font-size: 15px;
}
.field input,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 9px 13px;
  border: 2px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  font: 700 16px/1.2 var(--body);
}
.field input:focus,
.field select:focus {
  outline: 0;
  border-color: var(--blue);
}
.field .hint {
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
}

/* ---- /try/ : the demo ---- */
.demo-step {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--gold-soft);
  font-weight: 800;
}
.demo-step img {
  flex: none;
  width: 44px;
  height: 44px;
}
.demo-tabs {
  display: none;
  gap: 8px;
  margin-bottom: 14px;
}
.demo-tabs button {
  flex: 1;
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--ink-2);
  font: 600 15px/1.1 var(--display);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.demo-tabs button[aria-selected='true'] {
  background: var(--blue);
  color: #fff;
}
.demo-tabs .count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-inline-start: 6px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 13px;
}
.phones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: start;
}
.phone {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  padding: 18px;
  border-radius: 34px;
  border: 7px solid #1b2559;
  background: #f2f6ff;
  box-shadow: var(--shadow-lg);
}
.phone-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font: 600 1.15rem/1.15 var(--display);
}
.phone-title small {
  display: block;
  font: 800 13px/1.2 var(--body);
  color: var(--muted);
}
.balance {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  background: #fff;
  color: #8a5a00;
  font: 700 16px/1 var(--display);
  box-shadow: var(--shadow);
}
.balance img {
  width: 24px;
  height: 24px;
}
.goal-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}
.goal-card img {
  width: 56px;
  height: 56px;
}
.goal-card strong {
  font: 600 1rem/1.1 var(--display);
}
.bar {
  height: 14px;
  margin: 6px 0 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}
.bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), #54dfb1);
  transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.goal-card small {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}
.q-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.q {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}
.q > img {
  width: 42px;
  height: 42px;
}
.q strong {
  display: block;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.25;
}
.q span {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}
.q .note {
  color: #a4264f;
}
.q.done strong {
  color: var(--green-d);
}
.q-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.q-actions .btn {
  padding-inline: 6px;
  font-size: 14px;
}
.empty {
  padding: 34px 16px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}
.empty img {
  width: 76px;
  height: 76px;
  margin: 0 auto 8px;
}
.celebrate {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 16px;
  background: rgba(27, 37, 89, 0.78);
  color: #fff;
  text-align: center;
  font: 600 1.6rem/1.15 var(--display);
  animation: pop-in 0.3s ease;
}
.celebrate img {
  width: 110px;
  height: 110px;
}
.celebrate b {
  color: #ffd45a;
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
}
.finish {
  margin-top: 26px;
}
@media (max-width: 760px) {
  .demo-tabs {
    display: flex;
  }
  .phones {
    grid-template-columns: minmax(0, 1fr);
  }
  .phone {
    min-height: 460px;
  }
  .phone[data-off] {
    display: none;
  }
}

/* ---- /tools/chore-chart/ ---- */
.maker {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.maker-form {
  display: grid;
  gap: 14px;
}
.task-list {
  display: grid;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
  margin: 0;
  padding: 2px;
  list-style: none;
}
.task-list label {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 5px 10px;
  border-radius: 12px;
  background: var(--bg);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.task-list input {
  flex: none;
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}
.task-list img {
  flex: none;
  width: 28px;
  height: 28px;
}
.add-task {
  display: flex;
  gap: 8px;
}
.add-task input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  font: 700 16px/1.2 var(--body);
}
.chart-scroll {
  overflow-x: auto;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
}
.chart {
  --tint: #3d5bf5;
  --tint-soft: #e8edff;
  min-width: 640px;
  padding: 22px 24px 16px;
  background: #fff;
  color: var(--ink);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.chart-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.chart-head img {
  width: 58px;
  height: 58px;
}
.chart h2 {
  font-size: 2rem;
  color: var(--tint);
}
.chart-head p {
  font-weight: 800;
  font-size: 14px;
  color: var(--muted);
}
.chart table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 5px;
}
.chart th {
  padding: 6px 2px;
  font: 600 14px/1 var(--display);
  background: var(--tint);
  color: #fff;
}
.chart th:first-child {
  padding-inline-start: 12px;
  border-radius: 10px 0 0 10px;
  text-align: start;
}
.chart th:last-child {
  border-radius: 0 10px 10px 0;
}
.chart td {
  padding: 4px 2px;
  background: var(--tint-soft);
  text-align: center;
}
.chart td:first-child {
  width: 36%;
  padding-inline-start: 10px;
  border-radius: 10px 0 0 10px;
  text-align: start;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.15;
}
.chart td:last-child {
  border-radius: 0 10px 10px 0;
}
.chart td:first-child > span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chart td img {
  flex: none;
  width: 30px;
  height: 30px;
}
.tick {
  display: inline-block;
  width: 26px;
  height: 26px;
  border: 2.5px solid var(--tint);
  border-radius: 50%;
  background: #fff;
  vertical-align: middle;
}
.chart-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}
.chart-reward {
  flex: 1;
  padding: 10px 14px;
  border: 2.5px dashed var(--gold-d);
  border-radius: 14px;
  background: var(--gold-soft);
  font: 600 16px/1.25 var(--display);
}
.chart-credit {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 210px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--muted);
}
.chart-credit img {
  flex: none;
  width: 58px;
  height: 58px;
}
@media (max-width: 880px) {
  .maker {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---- /tools/savings-goal-calculator/ ---- */
.calc {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.calc-form {
  display: grid;
  gap: 14px;
}
.result-big {
  font: 700 clamp(1.9rem, 5vw, 3rem) / 1.08 var(--display);
  color: var(--blue-d);
}
.panel .result-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.result-list li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--bg);
}
.result-list img {
  width: 44px;
  height: 44px;
}
@media (max-width: 800px) {
  .calc {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---- /tools/advent-quest-calendar/ ---- */
.advent {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #1d2a78, #141c4d);
  list-style: none;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.advent li {
  position: relative;
  display: grid;
  gap: 2px;
  align-content: start;
  min-height: 132px;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.22;
}
.advent b {
  font: 700 22px/1 var(--display);
  color: var(--blue);
}
.advent img {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  width: 34px;
  height: 34px;
}
.advent-title {
  display: none;
}
.advent-credit {
  display: none;
}
@media (max-width: 720px) {
  .advent {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
  }
}

/* ---- printing ---- */
@media print {
  @page {
    margin: 10mm;
  }
  body {
    background: #fff;
    font-size: 13px;
  }
  .top,
  footer,
  .band,
  .no-print,
  .hero .lede,
  .crumb,
  .actions,
  .panel.prompt {
    display: none !important;
  }
  .hero {
    padding: 0 0 8px;
    background: none;
  }
  .wrap {
    max-width: none;
    padding: 0;
  }
  section.block {
    padding: 0;
  }
  .cover {
    box-shadow: none;
    border: 0;
    max-height: 70mm;
  }
  .cover img {
    max-height: 70mm;
    object-fit: cover;
  }
  .story {
    font-size: 13.5pt;
    line-height: 1.5;
  }
  body.printing-chart .hero {
    display: none;
  }
  body.printing-chart .maker {
    display: block;
  }
  body.printing-chart .chart-scroll {
    overflow: visible;
    box-shadow: none;
    border-radius: 0;
  }
  body.printing-chart .chart {
    min-width: 0;
    padding: 0;
  }
  /* Bigger rows and tick circles, to fill the page and be easy for small hands. */
  body.printing-chart .chart td {
    padding-top: 9px;
    padding-bottom: 9px;
  }
  body.printing-chart .chart td:first-child {
    font-size: 16px;
  }
  body.printing-chart .tick {
    width: 32px;
    height: 32px;
  }
  body.printing-advent .hero {
    display: none;
  }
  body.printing-advent .advent-title {
    display: block;
    margin: 0 0 6px;
    font-size: 22pt;
    text-align: center;
  }
  body.printing-advent .advent {
    gap: 6px;
    padding: 8px;
    border-radius: 12px;
  }
  body.printing-advent .advent li {
    min-height: 0;
    height: 39mm;
    padding: 6px;
    font-size: 10.5pt;
    break-inside: avoid;
  }
  body.printing-advent .advent img {
    width: 26px;
    height: 26px;
  }
  body.printing-advent .advent-credit {
    display: block;
    margin-top: 4px;
    font-size: 9pt;
    text-align: center;
    color: #6b759c;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
