/* Version: 1.0.0 | Updated: 2026-11-23 */
/* Pocket Bank. Light only on purpose: the two evidence screens are screenshotted, so they must always look the same. */

@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("../fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("../fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("../fonts/poppins-700.woff2") format("woff2"); }

:root {
  --navy: #002885;
  --navy-hover: #0B3AA8;
  --sky: #8BB8E8;
  --sand: #EDE6DF;
  --mist: #DDEBEE;
  --ink: #0B1636;
  --muted: #3A4666;
  --page: #F3F6F9;
  --card: #FFFFFF;
  --line: #C3D1E3;
  --error: #B3261E;
  --error-bg: #FCE8E6;
  --good: #1D6B3A;
  --title-font: "Copperplate Gothic Light", "Poppins", system-ui, sans-serif;
  --target: 48px;
  color-scheme: light;
}

html { font-size: 112.5%; }               /* 18px body text on tablets and laptops */
@media (max-width: 480px) { html { font-size: 100%; } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-block-size: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size-adjust: from-font;
  color: var(--ink);
  background: var(--page);
  line-height: 1.5;
  overflow-wrap: break-word;
}

h1, h2, h3, p { margin: 0; }
h1, h2 { text-wrap: balance; line-height: 1.25; }
p, li { text-wrap: pretty; }

.sprite { position: absolute; inline-size: 0; block-size: 0; overflow: hidden; }
.icon { inline-size: 1.25em; block-size: 1.25em; flex: none; vertical-align: -0.2em; }

.sr-only {
  position: absolute; inline-size: 1px; block-size: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.topbar :focus-visible { outline-color: #fff; }
[tabindex="-1"]:focus { outline: none; }

/* ---- Buttons ---- */

.btn {
  font: inherit; font-weight: 600; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-block-size: var(--target); min-inline-size: var(--target); padding: 0.4rem 1.1rem;
  border: 2px solid var(--navy); border-radius: 0.7rem;
  background: var(--card); color: var(--navy); cursor: pointer;
}
.btn:hover { background: var(--mist); }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-hover); }
.btn.big { font-size: 1.05rem; min-block-size: 56px; padding: 0.55rem 1.4rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.on-dark { background: transparent; color: #fff; border-color: #fff; }
.btn.on-dark:hover { background: rgba(255, 255, 255, 0.15); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.chip {
  font: inherit; font-size: 0.9rem; font-weight: 600;
  min-block-size: var(--target); padding: 0.35rem 0.95rem;
  border: 2px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink); cursor: pointer; text-align: start;
}
.chip:hover:not(:disabled) { border-color: var(--navy); }
.chip[aria-pressed="true"] { background: var(--sky); border-color: var(--navy); }
.chip[aria-pressed="true"]::before { content: "\2713\00a0"; }
.chip:disabled { cursor: default; color: var(--muted); }
.chip:disabled[aria-pressed="true"] { color: var(--ink); }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---- Frame ---- */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--navy); color: #fff; padding: 0.4rem 16px; min-block-size: 3.2rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: #fff; text-decoration: none; font-family: var(--title-font); font-weight: 700; font-size: 1.2rem; min-block-size: var(--target); }
.crest { inline-size: 32px; block-size: auto; }

main { flex: 1; inline-size: 100%; max-inline-size: 72rem; margin: 0 auto; padding: 1rem 16px; }
.site-foot { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 0.4rem 16px 0.8rem; }

.notice { padding-block: 3rem; text-align: center; }
.notice h1 { font-size: 1.3rem; }

/* ---- Home ---- */

.home { max-inline-size: 48rem; margin: 0 auto; display: grid; gap: 0.8rem; padding-block: 1rem; }
.home h1 { font-family: var(--title-font); font-size: 2.2rem; color: var(--navy); }
.strand { color: var(--muted); }
.lesson-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin-block-start: 0.6rem; }
.lesson-card {
  display: grid; gap: 0.4rem; padding: 1.2rem; border-radius: 1rem;
  background: var(--card); border: 2px solid var(--line); color: var(--ink); text-decoration: none;
}
.lesson-card strong { color: var(--navy); font-size: 1.2rem; }
.lesson-card:hover { border-color: var(--navy); background: var(--mist); }
.build { color: var(--muted); font-size: 0.75rem; margin-block-start: 1.5rem; }

/* ---- Account cards ---- */

.accounts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.account {
  display: grid; gap: 0.1rem; padding: 0.8rem 1rem; border-radius: 1rem;
  background: var(--navy); color: #fff;
}
.account.savings { background: var(--mist); color: var(--ink); border: 2px solid var(--sky); }
.account-name { font-size: 0.9rem; font-weight: 600; }
.account-balance { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; border-radius: 0.4rem; }
.account-balance.bump {
  @media (prefers-reduced-motion: no-preference) { animation: bump 0.9s ease-out; }
}
@keyframes bump { from { background: rgba(139, 184, 232, 0.55); } to { background: transparent; } }

/* ---- Lesson 1 ---- */

.month-grid { display: grid; gap: 1rem; }
.month-side { display: grid; gap: 1rem; align-content: start; }
.step-panel { background: var(--card); border: 2px solid var(--line); border-radius: 1rem; padding: 1rem; display: grid; gap: 0.6rem; }
.progress { color: var(--muted); font-size: 0.85rem; min-block-size: 1.3em; }
.what { font-size: 1rem; color: var(--navy); }
.note { font-size: 1.05rem; min-block-size: 3em; }
.decision { display: grid; gap: 0.7rem; }
.prompt { font-weight: 600; }
.choice-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.choice-row.money .btn { min-inline-size: 4.5rem; }

.statement-wrap {
  background: var(--card); border: 2px solid var(--line); border-radius: 1rem;
  overflow: auto; max-block-size: min(26rem, 60dvh);
}
.statement { inline-size: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9rem; }
.statement caption { text-align: start; font-weight: 700; color: var(--navy); padding: 0.6rem 0.8rem 0.3rem; caption-side: top; }
.statement thead th { position: sticky; inset-block-start: 0; background: var(--sand); z-index: 1; }
.statement th, .statement td { padding: 0.4rem 0.7rem; text-align: start; border-block-end: 1px solid var(--line); vertical-align: top; }
.statement tbody th { font-weight: 400; }
.statement .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.statement .bal { font-weight: 600; }
.statement tr.transfer { background: #F1F7F9; }
.statement tr.declined th { font-weight: 700; color: var(--error); }
.statement tr.declined { background: var(--error-bg); }
.statement tr.empty td { color: var(--muted); }

@media (min-width: 900px) {
  .month-grid { grid-template-columns: minmax(18rem, 22rem) 1fr; align-items: start; }
  .month .statement-wrap { max-block-size: calc(100dvh - 8.5rem); }
}

/* Small phones: the statement drops the Day column's padding and shrinks a little. */
@media (max-width: 480px) {
  .accounts { gap: 0.5rem; }
  .account-balance { font-size: 1.5rem; }
  .statement { font-size: 0.8rem; }
  .statement th, .statement td { padding: 0.35rem 0.4rem; }
}

/* ---- Evidence cards (Month complete, Scam Spotter) ---- */

.evidence { display: grid; gap: 0.8rem; justify-items: center; }
.card {
  inline-size: 100%; background: var(--card); border: 2px solid var(--line); border-radius: 1.2rem;
  padding: 1.2rem 1.4rem; box-shadow: 0 4px 18px rgba(0, 40, 133, 0.08);
}
.card-foot {
  display: flex; flex-wrap: wrap; gap: 0.2rem 1.2rem; justify-content: space-between;
  border-block-start: 2px solid var(--mist); margin-block-start: 0.8rem; padding-block-start: 0.5rem;
  color: var(--muted); font-size: 0.75rem;
}
.card-date { font-weight: 700; color: var(--ink); }
.outside { color: var(--muted); text-align: center; max-inline-size: 44rem; display: grid; gap: 0.6rem; justify-items: center; }

.complete-card { max-inline-size: 68rem; }
.complete-card h1 { font-family: var(--title-font); color: var(--navy); font-size: 1.5rem; margin-block-end: 0.7rem; }
.complete-grid { display: grid; gap: 0.9rem; }
.summary { margin: 0.8rem 0 0; padding-inline-start: 1.2rem; display: grid; gap: 0.3rem; }
.statement-wrap.compact { max-block-size: none; }
/* Grid items default to their content's width; let them shrink so a wide table scrolls inside its box. */
.month-grid > *, .complete-grid > *, .inbox-grid > * { min-inline-size: 0; }
.compact .statement { font-size: 0.78rem; }
.compact .statement th, .compact .statement td { padding: 0.18rem 0.55rem; line-height: 1.3; }
.compact .statement caption { padding-block: 0.3rem 0.2rem; }
@media (min-width: 900px) {
  .complete-grid { grid-template-columns: minmax(14rem, 18rem) 1fr; align-items: start; }
  .final { grid-template-columns: 1fr; }
}
/* If a long path doesn't fit a short screen, only the statement scrolls. */
@media (max-height: 820px) and (min-width: 900px) {
  .statement-wrap.compact { max-block-size: calc(100dvh - 13rem); overflow: auto; }
}

/* ---- Lesson 2: Scam Inbox ---- */

.inbox-grid { display: grid; gap: 1rem; }
@media (min-width: 900px) {
  .inbox-grid { grid-template-columns: 20rem 1fr; align-items: start; }
}
.inbox-list-wrap { background: var(--card); border: 2px solid var(--line); border-radius: 1.2rem; overflow: hidden; }
.inbox-list-wrap summary {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  min-block-size: var(--target); padding: 0.5rem 1rem; background: var(--navy); color: #fff; font-weight: 600; cursor: pointer;
}
.pill { background: var(--sky); color: var(--ink); border-radius: 999px; padding: 0.05rem 0.7rem; font-size: 0.85rem; }
.inbox-list { list-style: none; margin: 0; padding: 0.3rem; display: grid; gap: 0.2rem; }
.inbox-item {
  font: inherit; inline-size: 100%; display: flex; align-items: center; gap: 0.7rem; text-align: start;
  min-block-size: 56px; padding: 0.45rem 0.6rem; border: 2px solid transparent; border-radius: 0.8rem;
  background: none; color: var(--ink); cursor: pointer;
}
.inbox-item:hover:not(:disabled) { background: var(--mist); }
.inbox-item[aria-current="true"] { border-color: var(--navy); background: var(--mist); }
.inbox-item:disabled { cursor: default; color: var(--muted); }
.inbox-item .channel { color: var(--navy); }
.item-text { display: grid; min-inline-size: 0; flex: 1; }
.item-from { font-weight: 600; font-size: 0.9rem; }
.item-preview { font-size: 0.8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item .status { color: var(--good); }
.inbox-item:disabled .status { color: var(--muted); }

.reader { display: grid; gap: 1rem; }
#message-view { display: grid; gap: 0.4rem; }
.msg-count { color: var(--muted); font-size: 0.85rem; }
.msg { background: var(--card); border: 2px solid var(--line); border-radius: 1.2rem; padding: 1rem 1.2rem; display: grid; gap: 0.6rem; max-inline-size: 40rem; }
.msg-head { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.msg-head .channel { color: var(--navy); }
.msg-from { font-weight: 700; }
.msg-body { font-size: 1.1rem; }
.bubble { background: #E9EDF2; border-radius: 1.2rem 1.2rem 1.2rem 0.3rem; padding: 0.7rem 1rem; max-inline-size: 32rem; }
.msg-chat .bubble { background: var(--mist); }
.msg-app { border-radius: 1.4rem; box-shadow: 0 4px 14px rgba(11, 22, 54, 0.12); }
.msg-voicemail { background: var(--sand); }
.msg-voicemail .msg-body { font-style: italic; }
.msg-meta { display: grid; grid-template-columns: auto 1fr; gap: 0.1rem 0.8rem; margin: 0; padding-block-end: 0.5rem; border-block-end: 1px solid var(--line); font-size: 0.95rem; }
.msg-meta dt { color: var(--muted); }
.msg-meta dd { margin: 0; font-weight: 600; }
.inert-link { text-decoration: underline; text-decoration-thickness: 2px; color: var(--navy); overflow-wrap: anywhere; cursor: help; }

.answer { display: grid; gap: 1rem; justify-items: start; max-inline-size: 40rem; }
fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
legend { font-weight: 700; color: var(--navy); padding: 0; margin-block-end: 0.5rem; font-size: 1.05rem; }
.verdicts, .clues { inline-size: 100%; }
.verdict-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.verdict { flex-direction: column; gap: 0.2rem; min-block-size: 76px; }
.verdict .icon { inline-size: 1.6em; block-size: 1.6em; }
.verdict[aria-pressed="true"] { background: var(--navy); color: #fff; box-shadow: 0 0 0 3px var(--sky); }
.verdict:disabled { opacity: 1; cursor: default; }
.verdict:disabled:not([aria-pressed="true"]) { opacity: 0.5; }
.chip.match { border-color: var(--navy); border-style: dashed; }
.hint { color: var(--muted); font-size: 0.9rem; }

.reveal { inline-size: 100%; background: var(--mist); border-radius: 1rem; padding: 1rem 1.2rem; display: grid; gap: 0.5rem; }
.reveal-lead { font-weight: 700; font-size: 1.1rem; }
.reveal-clues-head { font-weight: 600; font-size: 0.9rem; }

.trick-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.trick-chips li { background: var(--card); border: 2px solid var(--sky); border-radius: 999px; padding: 0.1rem 0.8rem; font-size: 0.9rem; font-weight: 600; }

/* ---- Lesson 2: rules ---- */

.rules-card { max-inline-size: 46rem; margin: 0 auto; display: grid; gap: 1rem; }
.rules-card h1 { font-size: 1.4rem; color: var(--navy); }
.privacy { background: var(--sand); border-radius: 0.8rem; padding: 0.5rem 0.9rem; font-weight: 600; }
#rule-fields { display: grid; gap: 0.9rem; }
.field { display: grid; gap: 0.25rem; }
.field label { font-weight: 700; }
.field input {
  font: inherit; font-size: 1.05rem; min-block-size: 52px; padding: 0.4rem 0.8rem;
  border: 2px solid var(--line); border-radius: 0.7rem; background: var(--card); color: var(--ink); inline-size: 100%;
}
.field input:focus-visible { border-color: var(--navy); }
.field input[aria-invalid="true"] { border-color: var(--error); background: var(--error-bg); }
.counter { color: var(--muted); font-size: 0.8rem; }
.field-error { color: var(--error); font-weight: 600; font-size: 0.9rem; }
.field-error::before { content: "\26A0\FE0E\00a0"; }
.starters { display: grid; gap: 0.5rem; }
.starters-head { font-weight: 600; }
.who-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.who-option {
  display: inline-flex; align-items: center; gap: 0.5rem; min-block-size: var(--target);
  padding: 0.35rem 1rem; border: 2px solid var(--line); border-radius: 999px; background: var(--card); cursor: pointer; font-weight: 600;
}
.who-option:has(input:checked) { background: var(--sky); border-color: var(--navy); }
.who-option input { accent-color: var(--navy); inline-size: 1.2rem; block-size: 1.2rem; margin: 0; }

/* ---- Lesson 2 evidence: Scam Spotter ---- */

.done-card { max-inline-size: 46rem; display: grid; gap: 0.7rem; }
.badge { display: flex; align-items: center; gap: 0.8rem; }
.badge-icon { inline-size: 3rem; block-size: 3rem; color: var(--navy); flex: none; }
.badge h1 { font-family: var(--title-font); font-size: 2rem; color: var(--navy); }
.congrats { font-size: 1.2rem; font-weight: 700; }
.congrats-2 { color: var(--muted); }
.done-tricks h2, .done-rules h2 { font-size: 0.95rem; color: var(--navy); margin-block-end: 0.3rem; }
.done-rules { background: var(--mist); border-radius: 1rem; padding: 0.8rem 1.1rem; }
.done-rules ol { margin: 0; padding-inline-start: 1.6rem; display: grid; gap: 0.35rem; font-size: 1.2rem; font-weight: 600; line-height: 1.35; }
.done-tell { font-size: 1rem; }
.howto { text-align: start; background: var(--card); border: 2px solid var(--line); border-radius: 0.8rem; padding: 0.3rem 1rem; }
.howto summary { cursor: pointer; font-weight: 600; min-block-size: var(--target); display: flex; align-items: center; }
.howto ul { margin: 0 0 0.6rem; padding-inline-start: 1.2rem; }

/* ---- Teacher key ---- */

.key { display: grid; gap: 0.8rem; }
.key h1 { color: var(--navy); }
.key h2 { color: var(--navy); font-size: 1.1rem; margin-block-start: 0.6rem; }
.key ul { margin: 0; }
.key .statement-wrap { max-block-size: none; }
.key-table td, .key-table th { font-size: 0.85rem; }

/* ---- Reset dialog ---- */

dialog {
  border: 0; border-radius: 1.2rem; padding: 1.4rem; max-inline-size: min(28rem, calc(100vw - 32px));
  box-shadow: 0 12px 40px rgba(11, 22, 54, 0.3); color: var(--ink);
}
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { background: rgba(11, 22, 54, 0.45); overflow: hidden; overscroll-behavior: contain; }
dialog h2 { color: var(--navy); margin-block-end: 0.4rem; }
dialog .btn-row { margin-block-start: 1rem; justify-content: flex-end; }

/* ---- Print: the evidence card only ---- */

@media print {
  .topbar, .site-foot, .outside { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .card { box-shadow: none; border-color: #999; }
}
